Implementing Motherboard interface
This commit adds support to host motherboard interface which can be
used to generate Dbus Object paths. The Dbus object paths will be
represents the hardware components within the system architecture and
help to understand the architecture better way. The motherboard will
represent the system board and other entity are connected to it.
The interface is implemented at:[1]
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory/Item/Board/Motherboard.interface.yaml
Change-Id: Ie7987ea0fb03d2d6ffd9e485924cfea7446d97d9
Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>
diff --git a/host-bmc/dbus/motherboard.hpp b/host-bmc/dbus/motherboard.hpp
new file mode 100644
index 0000000..abf061c
--- /dev/null
+++ b/host-bmc/dbus/motherboard.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server.hpp>
+#include <sdbusplus/server/object.hpp>
+#include <xyz/openbmc_project/Inventory/Item/Board/Motherboard/server.hpp>
+
+#include <string>
+
+namespace pldm
+{
+namespace dbus
+{
+using ItemMotherboard =
+ sdbusplus::server::object_t<sdbusplus::xyz::openbmc_project::Inventory::
+ Item::Board::server::Motherboard>;
+
+/** @class Motherboard
+ * @brief This class is mapped to Inventory.Item.Board.Motherboard properties
+ * in D-Bus interface path.
+ */
+class Motherboard : public ItemMotherboard
+{
+ public:
+ Motherboard() = delete;
+ ~Motherboard() = default;
+ Motherboard(const Motherboard&) = delete;
+ Motherboard& operator=(const Motherboard&) = delete;
+ Motherboard(Motherboard&&) = default;
+ Motherboard& operator=(Motherboard&&) = default;
+
+ Motherboard(sdbusplus::bus_t& bus, const std::string& objPath) :
+ ItemMotherboard(bus, objPath.c_str())
+ {}
+};
+
+} // namespace dbus
+} // namespace pldm