summaryrefslogtreecommitdiffstats
path: root/control
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2019-02-14 15:18:27 -0600
committerMatthew Barth <msbarth@us.ibm.com>2019-02-18 09:46:13 -0600
commitb390df1ec2d6551419a392cf08e09afdc1d1eae6 (patch)
treef61fdfc13e5cd298877910f969e9f7d5f3a538db /control
parent64099cdbe82a2aa429f0861e49ec675801b77ae0 (diff)
downloadphosphor-fan-presence-b390df1ec2d6551419a392cf08e09afdc1d1eae6.tar.gz
phosphor-fan-presence-b390df1ec2d6551419a392cf08e09afdc1d1eae6.zip
Current mode set as uppercase
Always set the current thermal control mode in uppercase to handle case insensitive modes given since it would be something possibly set by the end-user. Tested: Current mode always set in uppercase Change-Id: Ie159de24f5f9b4dd5651a9411f7b176501c4846a Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control')
-rw-r--r--control/zone.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index b844793..d4c7a3c 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -640,12 +640,14 @@ const std::string& Zone::addServices(const std::string& path,
std::string Zone::current(std::string value)
{
- auto current = value;
- if (current != ThermalObject::current())
+ auto current = ThermalObject::current();
+ std::transform(value.begin(), value.end(), value.begin(), toupper);
+
+ if (value != current)
{
current = ThermalObject::current(value);
saveCurrentMode();
- // Trigger event(s) for custom mode property change
+ // Trigger event(s) for current mode property change
auto eData = _objects[_path]
["xyz.openbmc_project.Control.ThermalMode"]
["Current"];
@@ -655,6 +657,7 @@ std::string Zone::current(std::string value)
handleEvent(nullMsg, eData);
}
}
+
return current;
}
OpenPOWER on IntegriCloud