AppaRao Puli | e63eeda | 2019-07-05 16:25:38 +0530 | [diff] [blame] | 1 | /* |
| 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 | |
| 24 | namespace intel |
| 25 | { |
| 26 | namespace pfr |
| 27 | { |
| 28 | |
| 29 | class 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 | |
| 47 | class 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 |