From bf7b7b1d252dd976fb9ea288652603d354b934c1 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Tue, 7 Mar 2017 15:46:59 -0600 Subject: 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 --- mainloop.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mainloop.cpp') 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::setLo) Thresholds::setLo = @@ -53,6 +54,12 @@ decltype(Thresholds::alarmLo) Thresholds::alarmL decltype(Thresholds::alarmHi) Thresholds::alarmHi = &CriticalObject::criticalAlarmHigh; +// Initialization for Target objects +decltype(Targets::setTarget) + Targets::setTarget = &FanSpeedObject::target; +decltype(Targets::getTarget) + Targets::getTarget = &FanSpeedObject::target; + using namespace std::literals::chrono_literals; @@ -238,6 +245,9 @@ void MainLoop::run() auto sensorValue = valueInterface->value(); addThreshold(i.first, sensorValue, info); addThreshold(i.first, sensorValue, info); + //TODO openbmc/openbmc#1347 + // Handle application restarts to set/refresh fan speed values + addTarget(i.first, _hwmonRoot, _instance, info); // All the interfaces have been created. Go ahead // and emit InterfacesAdded. -- cgit v1.2.3