blob: 5a5b2a750a2acda5051fe71dc9f9399929ff8799 [file] [log] [blame]
Kamalkumar Patel3c50c822024-01-30 07:14:40 -06001#pragma once
2#include "common/utils.hpp"
3#include "pldmd/handler.hpp"
4
5#include <phosphor-logging/lg2.hpp>
6
7PHOSPHOR_LOG2_USING;
8
9namespace pldm
10{
11namespace responder
12{
13
14namespace platform_config
15{
16using namespace pldm::utils;
17
18static constexpr auto compatibleInterface =
19 "xyz.openbmc_project.Inventory.Decorator.Compatible";
20static constexpr auto namesProperty = "Names";
21
22class Handler : public CmdHandler
23{
24 public:
25 Handler()
26 {
27 systemCompatibleMatchCallBack =
28 std::make_unique<sdbusplus::bus::match::match>(
29 pldm::utils::DBusHandler::getBus(),
30 sdbusplus::bus::match::rules::interfacesAdded() +
31 sdbusplus::bus::match::rules::sender(
32 "xyz.openbmc_project.EntityManager"),
33 std::bind(&Handler::systemCompatibleCallback, this,
34 std::placeholders::_1));
35 }
36
37 /** @brief Interface to get the system type information
38 *
39 * @return - the system type information
40 */
41 virtual std::optional<std::filesystem::path> getPlatformName();
42
43 /** @brief D-Bus Interface added signal match for Entity Manager */
44 void systemCompatibleCallback(sdbusplus::message_t& msg);
45
46 private:
47 /** @brief system type/model */
48 std::string systemType;
49
50 /** @brief D-Bus Interface added signal match for Entity Manager */
51 std::unique_ptr<sdbusplus::bus::match_t> systemCompatibleMatchCallBack;
52};
53
54} // namespace platform_config
55
56} // namespace responder
57
58} // namespace pldm