blob: ba76a9570302eada697fb57bc44e4030dbe57a40 [file] [log] [blame]
Sagar Srinivas11ce8d22022-07-28 11:32:34 -05001#pragma once
2#include "common/utils.hpp"
3#include "libpldmresponder/bios.hpp"
4#include "libpldmresponder/oem_handler.hpp"
5
6#include <filesystem>
7
8namespace pldm
9{
10namespace responder
11{
12namespace oem::ibm::bios
13{
14static constexpr auto compatibleInterface =
15 "xyz.openbmc_project.Configuration.IBMCompatibleSystem";
16static constexpr auto namesProperty = "Names";
17namespace fs = std::filesystem;
18class 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 Williams98e703f2023-08-15 02:34:38 -050045 std::unique_ptr<sdbusplus::bus::match_t> ibmCompatibleMatchConfig;
Sagar Srinivas11ce8d22022-07-28 11:32:34 -050046
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 Williams98e703f2023-08-15 02:34:38 -050055 void ibmCompatibleAddedCallback(sdbusplus::message_t& msg);
Sagar Srinivas11ce8d22022-07-28 11:32:34 -050056};
57
58} // namespace oem::ibm::bios
59} // namespace responder
60} // namespace pldm