summaryrefslogtreecommitdiffstats
path: root/control
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2019-01-29 14:20:19 -0600
committerMatthew Barth <msbarth@us.ibm.com>2019-02-13 14:31:44 -0600
commitbaea6c3fde9866a06b219b7c852833a32b23786e (patch)
tree6b35674b0954fbe40fe5434badbaf70ff77c9118 /control
parent766f8545fd3eb5010f5a262aa398f3a11dcc07d7 (diff)
downloadphosphor-fan-presence-baea6c3fde9866a06b219b7c852833a32b23786e.tar.gz
phosphor-fan-presence-baea6c3fde9866a06b219b7c852833a32b23786e.zip
Trigger current mode property change events
Each time the current mode property changes, handle the event similarly to other event signal triggers substituting with a null message. When the handler receives a null message, the property's value that triggered the event is retrieved whether from the zone object or from dbus. Tested: Triggered the use of alternative events based on thermal control mode property state Change-Id: Ibc663c3721c331393250bd32bda0d45cf0214f12 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control')
-rw-r--r--control/zone.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index 60d2947..7a5f926 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -642,7 +642,17 @@ std::string Zone::current(std::string value)
{
current = ThermalObject::current(value);
saveCurrentMode();
- // TODO Trigger event(s) for mode property change
+ // Trigger event(s) for custom mode property change
+ fs::path path{CONTROL_OBJPATH};
+ path /= std::to_string(_zoneNum);
+ auto eData = _objects[path.string()]
+ ["xyz.openbmc_project.Control.ThermalMode"]
+ ["Current"];
+ if (eData != nullptr)
+ {
+ sdbusplus::message::message nullMsg{nullptr};
+ handleEvent(nullMsg, eData);
+ }
}
return current;
}
OpenPOWER on IntegriCloud