host-bmc: Implement Chassis interface
Adding support to host Chassis dbus interface. Based on the PDRs
received from remote PLDM terminus, PLDM hosts the dbus interface based
on the entity type. The Chassis interface is defined at [1].
Tested: Functional test passed
[1]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory/Item/Chassis.interface.yaml
Change-Id: Ia07c5974ae78314e0812cb09fbc6c738b4853cb9
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/host-bmc/dbus/chassis.hpp b/host-bmc/dbus/chassis.hpp
new file mode 100644
index 0000000..55997df
--- /dev/null
+++ b/host-bmc/dbus/chassis.hpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server.hpp>
+#include <sdbusplus/server/object.hpp>
+#include <xyz/openbmc_project/Inventory/Item/Chassis/server.hpp>
+
+#include <string>
+
+namespace pldm
+{
+namespace dbus
+{
+using ItemChassisIntf = sdbusplus::server::object_t<
+ sdbusplus::xyz::openbmc_project::Inventory::Item::server::Chassis>;
+
+class ItemChassis : public ItemChassisIntf
+{
+ public:
+ ItemChassis() = delete;
+ ~ItemChassis() = default;
+ ItemChassis(const ItemChassis&) = delete;
+ ItemChassis& operator=(const ItemChassis&) = delete;
+ ItemChassis(ItemChassis&&) = delete;
+ ItemChassis& operator=(ItemChassis&&) = delete;
+
+ ItemChassis(sdbusplus::bus_t& bus, const std::string& objPath) :
+ ItemChassisIntf(bus, objPath.c_str())
+ {}
+
+ /** Get value of Type */
+ ChassisType type() const override;
+
+ /** Set value of Type */
+ ChassisType type(ChassisType value) override;
+};
+
+} // namespace dbus
+} // namespace pldm