presence: Add fan utility
Add utility wrappers for reading/writing
xyz.openbmc_project.Inventory.Item.Present.
Change-Id: I9d6bb776e56b67b9cac1f991790886ec8105d4b1
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/presence/fan.hpp b/presence/fan.hpp
new file mode 100644
index 0000000..c743e3e
--- /dev/null
+++ b/presence/fan.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <string>
+#include <tuple>
+
+namespace phosphor
+{
+namespace fan
+{
+namespace presence
+{
+
+/** @brief PrettyName and inventory path. */
+using Fan = std::tuple<std::string, std::string>;
+
+/**
+ * @brief Update the presence state.
+ *
+ * Update the Present property of the
+ * xyz.openbmc_project.Inventory.Item interface.
+ *
+ * @param[in] fan - The fan to update.
+ * @param[in] newState - The new state of the fan.
+ */
+void setPresence(const Fan& fan, bool newState);
+
+/**
+ * @brief Read the presence state.
+ *
+ * Read the Present property of the
+ * xyz.openbmc_project.Inventory.Item
+ *
+ * @param[in] fan - The fan to read.
+ */
+bool getPresence(const Fan& fan);
+} // namespace presence
+} // namespace fan
+} // namespace phosphor