ipmi: split dbus get property into separate file
This is a step towards handling getting/setting dbus properties as an
implementation of an interface, de-coupling from dbus.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I81a2c5100833235811d4b7e59152d70585c7abaf
diff --git a/ipmi/dbus_mode.hpp b/ipmi/dbus_mode.hpp
new file mode 100644
index 0000000..05e9734
--- /dev/null
+++ b/ipmi/dbus_mode.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <cstdint>
+#include <string>
+
+namespace pid_control
+{
+namespace ipmi
+{
+
+/*
+ * busctl call xyz.openbmc_project.State.FanCtrl \
+ * /xyz/openbmc_project/settings/fanctrl/zone1 \
+ * org.freedesktop.DBus.Properties \
+ * GetAll \
+ * s \
+ * xyz.openbmc_project.Control.Mode
+ * a{sv} 2 "Manual" b false "FailSafe" b false
+ *
+ * This returns an IPMI code as a uint8_t (which will always be sufficient to
+ * hold the result). NOTE: This does not return the typedef value to avoid
+ * including a header with conflicting types.
+ */
+uint8_t getFanCtrlProperty(uint8_t zoneId, bool* value,
+ const std::string& property);
+
+} // namespace ipmi
+} // namespace pid_control