summaryrefslogtreecommitdiffstats
path: root/dcmihandler.hpp
diff options
context:
space:
mode:
authorTom Joseph <tomjoseph@in.ibm.com>2017-07-12 19:54:44 +0530
committerPatrick Williams <patrick@stwcx.xyz>2017-07-18 21:21:28 +0000
commitbe5eaa10b211fd3116762fee5e1b86475bed092f (patch)
tree370341e430cc4843764d9aef8d0078759cef16f3 /dcmihandler.hpp
parent10f4959a020f33d40e7387d93fdab9bba46963d7 (diff)
downloadphosphor-host-ipmid-be5eaa10b211fd3116762fee5e1b86475bed092f.tar.gz
phosphor-host-ipmid-be5eaa10b211fd3116762fee5e1b86475bed092f.zip
dcmi: asset-tag: Add API to read asset tag from dbus
Change-Id: I00958d4bb54896ea7d13aaffd7e0ebf3c20ef3de Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'dcmihandler.hpp')
-rw-r--r--dcmihandler.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/dcmihandler.hpp b/dcmihandler.hpp
new file mode 100644
index 0000000..dfe1d4e
--- /dev/null
+++ b/dcmihandler.hpp
@@ -0,0 +1,51 @@
+#ifndef __HOST_IPMI_DCMI_HANDLER_H__
+#define __HOST_IPMI_DCMI_HANDLER_H__
+
+#include <map>
+#include <string>
+#include <vector>
+
+// IPMI commands for net functions.
+enum ipmi_netfn_sen_cmds
+{
+ // Get capability bits
+ IPMI_CMD_DCMI_GET_POWER = 0x03,
+};
+
+namespace dcmi
+{
+
+static constexpr auto propIntf = "org.freedesktop.DBus.Properties";
+static constexpr auto assetTagIntf =
+ "xyz.openbmc_project.Inventory.Decorator.AssetTag";
+static constexpr auto assetTagProp = "AssetTag";
+
+namespace assettag
+{
+
+ using ObjectPath = std::string;
+ using Service = std::string;
+ using Interfaces = std::vector<std::string>;
+ using ObjectTree = std::map<ObjectPath, std::map<Service, Interfaces>>;
+
+} //namespace assettag
+
+/** @brief Read the object tree to fetch the object path that implemented the
+ * Asset tag interface.
+ *
+ * @param[in,out] objectTree - object tree
+ *
+ * @return On success return the object tree with the object path that
+ * implemented the AssetTag interface.
+ */
+void readAssetTagObjectTree(dcmi::assettag::ObjectTree& objectTree);
+
+/** @brief Read the asset tag of the server
+ *
+ * @return On success return the asset tag.
+ */
+std::string readAssetTag();
+
+} // namespace dcmi
+
+#endif
OpenPOWER on IntegriCloud