1 #pragma once
2 #include "common/utils.hpp"
3 #include "pldmd/handler.hpp"
4 
5 #include <phosphor-logging/lg2.hpp>
6 
7 PHOSPHOR_LOG2_USING;
8 
9 namespace pldm
10 {
11 namespace responder
12 {
13 
14 namespace platform_config
15 {
16 using namespace pldm::utils;
17 
18 static constexpr auto compatibleInterface =
19     "xyz.openbmc_project.Inventory.Decorator.Compatible";
20 static constexpr auto namesProperty = "Names";
21 
22 class Handler : public CmdHandler
23 {
24   public:
25     Handler()
26     {
27         systemCompatibleMatchCallBack =
28             std::make_unique<sdbusplus::bus::match_t>(
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
59