control: Remove references to "speed" in JSON objects

Fan control can be configured to control any type of fan where "speed"
implies a fan control by setting RPMs. However, fans that are PWM
driven, can also be configured to be controlled so the preference would
be to not specific refer to setting "speeds".

Change-Id: Ia8920832ea29b519bf408c850febb3fed04ad3f9
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/actions/default_floor.hpp b/control/json/actions/default_floor.hpp
index 3eeb13d..25d30bb 100644
--- a/control/json/actions/default_floor.hpp
+++ b/control/json/actions/default_floor.hpp
@@ -27,12 +27,11 @@
 using json = nlohmann::json;
 
 /**
- * @class DefaultFloor - Action to default the fan floor speed
+ * @class DefaultFloor - Action to default the fan floor
  *
- * Sets the fan floor to the defined default fan floor speed when a
- * service associated to a given group has terminated. Once all services
- * are functional and providing the sensors, the fan floor is allowed
- * to be set normally again.
+ * Sets the fan floor to the defined default fan floor when a service associated
+ * to a given group has terminated. Once all services are functional and
+ * providing the sensors, the fan floor is allowed to be set normally again.
  */
 class DefaultFloor : public ActionBase, public ActionRegister<DefaultFloor>
 {
@@ -48,7 +47,7 @@
     ~DefaultFloor() = default;
 
     /**
-     * @brief Default the fan floor speed
+     * @brief Default the fan floor
      *
      * No JSON configuration parameters required
      */
diff --git a/control/json/fan.cpp b/control/json/fan.cpp
index 008bca5..16da07e 100644
--- a/control/json/fan.cpp
+++ b/control/json/fan.cpp
@@ -74,7 +74,7 @@
         auto service = util::SDBusPlus::getService(_bus, path, _interface);
         _sensors[path] = service;
     }
-    // All sensors associated with this fan are set to the same target speed,
+    // All sensors associated with this fan are set to the same target,
     // so only need to read target property from one of them
     if (!path.empty())
     {
diff --git a/control/json/fan.hpp b/control/json/fan.hpp
index 90bb13a..b718585 100644
--- a/control/json/fan.hpp
+++ b/control/json/fan.hpp
@@ -34,7 +34,7 @@
  * that will be controlled by the fan control application. These configuration
  * attributes include, but are not limited to, the cooling zone in which the
  * fan is included, what sensors make up the fan, the target interface to be
- * used in setting a speed, and any profiles(OPTIONAL) the fan should be
+ * used in setting a target, and any profiles(OPTIONAL) the fan should be
  * included in.
  *
  * (When no profile for a fan is given, the fan defaults to always be included)
@@ -115,7 +115,7 @@
 
     /**
      * Interface containing the `Target` property
-     * to use in controlling the fan's speed
+     * to use in controlling the fan's target
      */
     std::string _interface;
 
diff --git a/control/json/group.hpp b/control/json/group.hpp
index e99687f..6b30b9f 100644
--- a/control/json/group.hpp
+++ b/control/json/group.hpp
@@ -30,7 +30,7 @@
  * A group contains a list of dbus objects that are logically grouped together
  * to be used within one-or-more configured fan control events. An event object
  * is configured to apply a set of actions against a list of groups that could
- * result in a fan control speed change. A group may also be configured against
+ * result in a fan control target change. A group may also be configured against
  * a list of profiles(OPTIONAL) and or denote a specific service(OPTIONAL) that
  * serves the list of dbus objects in the group.
  *
diff --git a/control/json/zone.cpp b/control/json/zone.cpp
index f5f8606..6054721 100644
--- a/control/json/zone.cpp
+++ b/control/json/zone.cpp
@@ -60,12 +60,12 @@
             _profiles.emplace_back(profile.get<std::string>());
         }
     }
-    // Speed increase delay is optional, defaults to 0
+    // Increase delay is optional, defaults to 0
     if (jsonObj.contains("increase_delay"))
     {
         _incDelay = jsonObj["increase_delay"].get<uint64_t>();
     }
-    setFullSpeed(jsonObj);
+    setDefaultCeiling(jsonObj);
     setDefaultFloor(jsonObj);
     setDecInterval(jsonObj);
     // Setting properties on interfaces to be served are optional
@@ -143,7 +143,7 @@
     return current;
 }
 
-void Zone::setFullSpeed(const json& jsonObj)
+void Zone::setDefaultCeiling(const json& jsonObj)
 {
     if (!jsonObj.contains("full_speed"))
     {
@@ -151,18 +151,18 @@
                         entry("JSON=%s", jsonObj.dump().c_str()));
         throw std::runtime_error("Missing required zone's full speed");
     }
-    _fullSpeed = jsonObj["full_speed"].get<uint64_t>();
+    _defaultCeiling = jsonObj["full_speed"].get<uint64_t>();
     // Start with the current target set as the default
-    _target = _fullSpeed;
+    _target = _defaultCeiling;
 }
 
 void Zone::setDefaultFloor(const json& jsonObj)
 {
     if (!jsonObj.contains("default_floor"))
     {
-        log<level::ERR>("Missing required zone's default floor speed",
+        log<level::ERR>("Missing required zone's default floor",
                         entry("JSON=%s", jsonObj.dump().c_str()));
-        throw std::runtime_error("Missing required zone's default floor speed");
+        throw std::runtime_error("Missing required zone's default floor");
     }
     _defaultFloor = jsonObj["default_floor"].get<uint64_t>();
     // Start with the current floor set as the default
diff --git a/control/json/zone.hpp b/control/json/zone.hpp
index 291a5c5..e9e51ae 100644
--- a/control/json/zone.hpp
+++ b/control/json/zone.hpp
@@ -43,11 +43,10 @@
  * @class Zone - Represents a configured fan control zone
  *
  * A zone object contains the configured attributes for a zone that groups
- * a number of fans together to be under the same speed control. These
- * configuration attributes include, but are not limited to, the full speed
- * of the fans within the zone, a default floor speed, the delay between speed
- * increases, a decrease interval, and any profiles(OPTIONAL) the zone should
- * be included in.
+ * a number of fans together to be under the same target control. These
+ * configuration attributes include, but are not limited to, the default ceiling
+ * of the fans within the zone, a default floor, the delay between increases, a
+ * decrease interval, and any profiles(OPTIONAL) the zone should be included in.
  *
  * (When no profile for a zone is given, the zone defaults to always exist)
  *
@@ -79,26 +78,27 @@
     Zone(sdbusplus::bus::bus& bus, const json& jsonObj);
 
     /**
-     * @brief Get the full speed
+     * @brief Get the default ceiling
      *
-     * Full speed is the speed set to the fans within this zone unless there
-     * are events configured that alter the fan speeds.
+     * Default ceiling is the highest target the fans within this zone is
+     * allowed to increase to. The zone's ceiling defaults to this unless
+     * changed by some configured event.
      *
-     * @return Full speed of this zone
+     * @return Default ceiling of this zone
      */
-    inline const auto& getFullSpeed() const
+    inline const auto& getDefaultCeiling() const
     {
-        return _fullSpeed;
+        return _defaultCeiling;
     }
 
     /**
-     * @brief Get the default floor speed
+     * @brief Get the default floor
      *
-     * The default floor speed is the lowest speed the fans within this zone
-     * are allowed to decrease to. The zone's floor speed defaults to this
+     * The default floor is the lowest target the fans within this zone
+     * are allowed to decrease to. The zone's floor defaults to this
      * unless changed by some configured event.
      *
-     * @return Default floor speed
+     * @return Default floor
      */
     inline const auto& getDefaultFloor() const
     {
@@ -106,17 +106,17 @@
     }
 
     /**
-     * @brief Get the speed increase delay(OPTIONAL)
+     * @brief Get the increase delay(OPTIONAL)
      *
-     * The speed increase delay is the amount of time(in seconds) increases
-     * to a target speed are delayed before being made. The default is 0, which
-     * results in immediate speed increase requests when any events result in
-     * a change to the target speed.
+     * The increase delay is the amount of time(in seconds) increases
+     * to a target are delayed before being made. The default is 0, which
+     * results in immediate increase requests when any events result in
+     * a change to the target.
      *
      * It is recommend a value other than 0 is configured, but that inherently
-     * depends on the fan controller and configured speed increases.
+     * depends on the fan controller and configured increases.
      *
-     * @return Speed increase delay(in seconds)
+     * @return Increase delay(in seconds)
      */
     inline const auto& getIncDelay() const
     {
@@ -124,14 +124,14 @@
     }
 
     /**
-     * @brief Get the speed decrease interval
+     * @brief Get the decrease interval
      *
-     * Speed decreases happen on a set interval when no requests for an increase
-     * in fan speeds exists. This is the interval(in seconds) at which the fans
+     * Decreases happen on a set interval when no requests for an increase
+     * in fan targets exists. This is the interval(in seconds) at which the fans
      * within the zone are decreased if events exist that result in a target
-     * speed decrease.
+     * decrease.
      *
-     * @return Speed decrease interval(in seconds)
+     * @return Decrease interval(in seconds)
      */
     inline const auto& getDecInterval() const
     {
@@ -209,16 +209,16 @@
     std::string current(std::string value) override;
 
   private:
-    /* The zone's full speed value for fans */
-    uint64_t _fullSpeed;
+    /* The zone's default ceiling value for fans */
+    uint64_t _defaultCeiling;
 
-    /* The zone's default floor speed value for fans */
+    /* The zone's default floor value for fans */
     uint64_t _defaultFloor;
 
-    /* Zone's speed increase delay(in seconds) (OPTIONAL) */
+    /* Zone's increase delay(in seconds) (OPTIONAL) */
     uint64_t _incDelay;
 
-    /* Zone's speed decrease interval(in seconds) */
+    /* Zone's decrease interval(in seconds) */
     uint64_t _decInterval;
 
     /* The floor target to not go below */
@@ -247,21 +247,22 @@
     std::vector<std::unique_ptr<Fan>> _fans;
 
     /**
-     * @brief Parse and set the zone's full speed value
+     * @brief Parse and set the zone's default ceiling value
      *
      * @param[in] jsonObj - JSON object for the zone
      *
-     * Sets the full speed value for the zone from the JSON configuration object
+     * Sets the default ceiling value for the zone from the JSON configuration
+     * object
      */
-    void setFullSpeed(const json& jsonObj);
+    void setDefaultCeiling(const json& jsonObj);
 
     /**
-     * @brief Parse and set the zone's default floor speed value
+     * @brief Parse and set the zone's default floor value
      *
      * @param[in] jsonObj - JSON object for the zone
      *
-     * Sets the default floor speed value for the zone from the JSON
-     * configuration object
+     * Sets the default floor value for the zone from the JSON configuration
+     * object
      */
     void setDefaultFloor(const json& jsonObj);
 
@@ -270,7 +271,7 @@
      *
      * @param[in] jsonObj - JSON object for the zone
      *
-     * Sets the speed decrease interval(in seconds) for the zone from the JSON
+     * Sets the decrease interval(in seconds) for the zone from the JSON
      * configuration object
      */
     void setDecInterval(const json& jsonObj);
diff --git a/control/json_parser.cpp b/control/json_parser.cpp
index 9e70459..29af22d 100644
--- a/control/json_parser.cpp
+++ b/control/json_parser.cpp
@@ -133,7 +133,7 @@
             }
 
             zoneDefs.emplace_back(std::make_tuple(
-                zoneNum, zone.second->getFullSpeed(),
+                zoneNum, zone.second->getDefaultCeiling(),
                 zone.second->getDefaultFloor(), zone.second->getIncDelay(),
                 zone.second->getDecInterval(), zone.second->getZoneHandlers(),
                 std::move(fanDefs), std::move(speedEvents)));