summaryrefslogtreecommitdiffstats
path: root/mainloop.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-03-07 15:46:59 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-03-30 02:47:06 +0000
commitbf7b7b1d252dd976fb9ea288652603d354b934c1 (patch)
tree80ab54b0d52f1ac6372299956811b1d1d5c9dcb4 /mainloop.cpp
parent5ec68abbcbac6e3475cff13cf151e6569fc07337 (diff)
downloadphosphor-hwmon-bf7b7b1d252dd976fb9ea288652603d354b934c1.tar.gz
phosphor-hwmon-bf7b7b1d252dd976fb9ea288652603d354b934c1.zip
Create a FanSpeedObject interface
Create the FanSpeedObject target interface when the fanx_target sysfs file exists. The "xyz.openbmc_project.Control.Target" interface is on the /xyz/openbmc_project/sensors/fan_tac/fan[#] object paths. Change-Id: Ib4a099cff17cacea501b474969f292516db212b5 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'mainloop.cpp')
-rw-r--r--mainloop.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/mainloop.cpp b/mainloop.cpp
index 399b17e..7af3096 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -24,6 +24,7 @@
#include "mainloop.hpp"
#include "env.hpp"
#include "thresholds.hpp"
+#include "targets.hpp"
// Initialization for Warning Objects
decltype(Thresholds<WarningObject>::setLo) Thresholds<WarningObject>::setLo =
@@ -53,6 +54,12 @@ decltype(Thresholds<CriticalObject>::alarmLo) Thresholds<CriticalObject>::alarmL
decltype(Thresholds<CriticalObject>::alarmHi) Thresholds<CriticalObject>::alarmHi =
&CriticalObject::criticalAlarmHigh;
+// Initialization for Target objects
+decltype(Targets<FanSpeedObject>::setTarget)
+ Targets<FanSpeedObject>::setTarget = &FanSpeedObject::target;
+decltype(Targets<FanSpeedObject>::getTarget)
+ Targets<FanSpeedObject>::getTarget = &FanSpeedObject::target;
+
using namespace std::literals::chrono_literals;
@@ -238,6 +245,9 @@ void MainLoop::run()
auto sensorValue = valueInterface->value();
addThreshold<WarningObject>(i.first, sensorValue, info);
addThreshold<CriticalObject>(i.first, sensorValue, info);
+ //TODO openbmc/openbmc#1347
+ // Handle application restarts to set/refresh fan speed values
+ addTarget<FanSpeedObject>(i.first, _hwmonRoot, _instance, info);
// All the interfaces have been created. Go ahead
// and emit InterfacesAdded.
OpenPOWER on IntegriCloud