blob: 265a419b18940c6a25a685cc4f5cd15dbbe0ec64 [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 =
Patrick Williams157f5d02024-02-13 02:36:55 -060028 std::make_unique<sdbusplus::bus::match_t>(
Kamalkumar Patel3c50c822024-01-30 07:14:40 -060029 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