control: Complete fan configuration parsing
Fan control's complete configuration includes a configuration of the
fan(s) that will be controlled. These fan(s) are made up of
configuration attributes that determine what zones they are included in
and how to interface with their sensor(s) that control their speeds.
Tested:
Fan object created for each entry within "fans.json"
A "fans.json" configuration is required
Each supported attribute is parsed and stored on each fan object
Change-Id: Ic5db2a685d672a6f5fb642a1dc0ec67cc6ac16a3
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/fan.hpp b/control/json/fan.hpp
index bd95160..63d975c 100644
--- a/control/json/fan.hpp
+++ b/control/json/fan.hpp
@@ -125,6 +125,45 @@
* to use in controlling the fan's speed
*/
std::string _interface;
+
+ /**
+ * @brief Parse and set the fan's profiles
+ *
+ * @param[in] jsonObj - JSON object for the fan
+ *
+ * Sets the list of profiles this fan belongs to if any are configured,
+ * otherwise an empty list of profiles results in the fan always being
+ * included in the zone.
+ */
+ void setProfiles(const json& jsonObj);
+
+ /**
+ * @brief Parse and set the fan's zone
+ *
+ * @param[in] jsonObj - JSON object for the fan
+ *
+ * Sets the zone this fan is included in.
+ */
+ void setZone(const json& jsonObj);
+
+ /**
+ * @brief Parse and set the fan's sensor list
+ *
+ * @param[in] jsonObj - JSON object for the fan
+ *
+ * Sets the list of sensors that contain a `Target` property on dbus
+ * that make up this fan.
+ */
+ void setSensors(const json& jsonObj);
+
+ /**
+ * @brief Parse and set the fan's sensor interface
+ *
+ * @param[in] jsonObj - JSON object for the fan
+ *
+ * Sets the sensor interface to use when setting the `Target` property
+ */
+ void setInterface(const json& jsonObj);
};
} // namespace phosphor::fan::control::json