Sagar Srinivas | 11ce8d2 | 2022-07-28 11:32:34 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | #include "common/utils.hpp" |
| 3 | #include "libpldmresponder/bios.hpp" |
| 4 | #include "libpldmresponder/oem_handler.hpp" |
| 5 | |
| 6 | #include <filesystem> |
| 7 | |
| 8 | namespace pldm |
| 9 | { |
| 10 | namespace responder |
| 11 | { |
| 12 | namespace oem::ibm::bios |
| 13 | { |
| 14 | static constexpr auto compatibleInterface = |
| 15 | "xyz.openbmc_project.Configuration.IBMCompatibleSystem"; |
| 16 | static constexpr auto namesProperty = "Names"; |
| 17 | namespace fs = std::filesystem; |
| 18 | class Handler : public oem_bios::Handler |
| 19 | { |
| 20 | public: |
| 21 | Handler(const pldm::utils::DBusHandler* dBusIntf) : |
| 22 | oem_bios::Handler(dBusIntf) |
| 23 | { |
| 24 | ibmCompatibleMatchConfig = std::make_unique<sdbusplus::bus::match_t>( |
| 25 | dBusIntf->getBus(), |
| 26 | sdbusplus::bus::match::rules::interfacesAdded() + |
| 27 | sdbusplus::bus::match::rules::sender( |
| 28 | "xyz.openbmc_project.EntityManager"), |
| 29 | std::bind_front(&Handler::ibmCompatibleAddedCallback, this)); |
| 30 | } |
| 31 | |
| 32 | /** @brief Method to get the system type information |
| 33 | * |
| 34 | * @return - the system type information |
| 35 | */ |
| 36 | std::optional<std::string> getPlatformName(); |
| 37 | |
| 38 | private: |
| 39 | /** @brief system type/model */ |
| 40 | std::string systemType; |
| 41 | |
| 42 | pldm::responder::bios::Handler* biosHandler; |
| 43 | |
| 44 | /** @brief D-Bus Interface added signal match for Entity Manager */ |
Patrick Williams | 98e703f | 2023-08-15 02:34:38 -0500 | [diff] [blame] | 45 | std::unique_ptr<sdbusplus::bus::match_t> ibmCompatibleMatchConfig; |
Sagar Srinivas | 11ce8d2 | 2022-07-28 11:32:34 -0500 | [diff] [blame] | 46 | |
| 47 | /** @brief D-Bus Interface object*/ |
| 48 | const pldm::utils::DBusHandler* dBusIntf; |
| 49 | |
| 50 | /** @brief callback function invoked when interfaces get added from |
| 51 | * Entity manager |
| 52 | * |
| 53 | * @param[in] msg - Data associated with subscribed signal |
| 54 | */ |
Patrick Williams | 98e703f | 2023-08-15 02:34:38 -0500 | [diff] [blame] | 55 | void ibmCompatibleAddedCallback(sdbusplus::message_t& msg); |
Sagar Srinivas | 11ce8d2 | 2022-07-28 11:32:34 -0500 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | } // namespace oem::ibm::bios |
| 59 | } // namespace responder |
| 60 | } // namespace pldm |