host-bmc: Implement Availability interface
Adding support to host Availability dbus interface. PLDM hosts this dbus
interface to provide the availability of the FRUs hosted by PLDM. The
Availability interface is defined at [1].
Tested:
Functional test passed
[1]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/State/Decorator/Availability.interface.yaml
Change-Id: Ie5912b3683ce102a249c8b503ea9f455f0fbcabf
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/host-bmc/dbus/custom_dbus.hpp b/host-bmc/dbus/custom_dbus.hpp
index 7988bd9..281f928 100644
--- a/host-bmc/dbus/custom_dbus.hpp
+++ b/host-bmc/dbus/custom_dbus.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "asset.hpp"
+#include "availability.hpp"
#include "cable.hpp"
#include "chassis.hpp"
#include "common/utils.hpp"
@@ -165,8 +166,18 @@
*/
void implementAssetInterface(const std::string& path);
+ /** @brief Set the availability state property
+ *
+ * @param[in] path - The object path
+ *
+ * @param[in] state - Availability state
+ */
+ void setAvailabilityState(const std::string& path, const bool& state);
+
private:
std::unordered_map<ObjectPath, std::unique_ptr<Asset>> asset;
+ std::unordered_map<ObjectPath, std::unique_ptr<Availability>>
+ availabilityState;
std::unordered_map<ObjectPath, std::unique_ptr<LocationIntf>> location;
std::unordered_map<ObjectPath, std::unique_ptr<CPUCore>> cpuCore;
std::unordered_map<ObjectPath, std::unique_ptr<ItemChassis>> chassis;