monitor: Subscribe to tach target and feedback services
Subscribes to nameOwnerChanged signals for the services of the sensor
and target interfaces for each configured fan. If those services go
offline, the fan tach sensors should get marked nonfunctional due to no
longer receiving updated target or feedback values. In this design, we
use the existing method of determining when a fan tach sensor should be
marked nonfunctional to allow a recovery window, wherein a brief
offline/online transition (such as during a restart) will not trigger a
nonfunctional state change.
Change-Id: I0a935ccad5a864dc952d023185356a1ef1226830
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
diff --git a/monitor/fan.cpp b/monitor/fan.cpp
index c5322b1..0e2d835 100644
--- a/monitor/fan.cpp
+++ b/monitor/fan.cpp
@@ -356,15 +356,15 @@
bool Fan::outOfRange(const TachSensor& sensor)
{
- auto actual = static_cast<uint64_t>(sensor.getInput());
- auto range = sensor.getRange(_deviation);
-
- if ((actual < range.first) || (actual > range.second))
+ if (!sensor.hasOwner())
{
return true;
}
- return false;
+ auto actual = static_cast<uint64_t>(sensor.getInput());
+ auto range = sensor.getRange(_deviation);
+
+ return ((actual < range.first) || (actual > range.second));
}
void Fan::updateState(TachSensor& sensor)