blob: d1bd7e55911763c98c92c9ead1865280d6140301 [file] [log] [blame]
AppaRao Pulie63eeda2019-07-05 16:25:38 +05301/*
2// Copyright (c) 2019 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
17#pragma once
18
19#include <string>
20#include <sdbusplus/asio/object_server.hpp>
21#include <phosphor-logging/log.hpp>
22#include <boost/asio.hpp>
23
24namespace intel
25{
26namespace pfr
27{
28
29class PfrVersion
30{
31 public:
32 PfrVersion(sdbusplus::asio::object_server &srv_,
33 std::shared_ptr<sdbusplus::asio::connection> &conn_,
34 const std::string &path_);
35 ~PfrVersion() = default;
36
37 std::shared_ptr<sdbusplus::asio::connection> conn;
38
39 private:
40 sdbusplus::asio::object_server &server;
41
42 std::string path;
43 std::string version;
44 std::string purpose;
45};
46
47class PfrConfig
48{
49 public:
50 PfrConfig(sdbusplus::asio::object_server &srv_,
51 std::shared_ptr<sdbusplus::asio::connection> &conn_);
52 ~PfrConfig() = default;
53
54 std::shared_ptr<sdbusplus::asio::connection> conn;
55
56 private:
57 sdbusplus::asio::object_server &server;
58
59 bool getPFRProvisionedState();
60 std::string getBIOSVersion(uint8_t type);
61 std::string getBMCVersion(uint8_t type);
62};
63
64} // namespace pfr
65} // namespace intel