control: Add all fan functionality to JSON fan object
In transitioning to JSON based configuration support, the objects
created based on the JSON will eventually replace the similar objects
used for YAML based configurations. This adds all the functionality from
the current fan class used for YAML configs to the fan class used for
JSON configs.
Change-Id: I50bdd218fc964a4b75126643727f1c3f4d27966b
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/config_base.hpp b/control/json/config_base.hpp
index 6b060c1..2f282f8 100644
--- a/control/json/config_base.hpp
+++ b/control/json/config_base.hpp
@@ -20,6 +20,8 @@
#include <nlohmann/json.hpp>
#include <phosphor-logging/log.hpp>
+#include <vector>
+
namespace phosphor::fan::control::json
{
@@ -112,6 +114,9 @@
"Unsupported data type for JSON object's value");
}
+ /* Name of the configuration object */
+ std::string _name;
+
/**
* Profiles this configuration object belongs to (OPTIONAL).
* Otherwise always include this object in the configuration
@@ -120,9 +125,6 @@
std::vector<std::string> _profiles;
private:
- /* Name of the configuration object */
- std::string _name;
-
/**
* @brief Sets the configuration object's name from the given JSON
*