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/tach_sensor.cpp b/monitor/tach_sensor.cpp
index daeb1f0..91aecdd 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -35,7 +35,6 @@
namespace monitor
{
-constexpr auto FAN_SENSOR_VALUE_INTF = "xyz.openbmc_project.Sensor.Value";
constexpr auto FAN_TARGET_PROPERTY = "Target";
constexpr auto FAN_VALUE_PROPERTY = "Value";
@@ -131,7 +130,7 @@
// object can be functional with a missing D-bus sensor.
}
- auto match = getMatchString(FAN_SENSOR_VALUE_INTF);
+ auto match = getMatchString(util::FAN_SENSOR_VALUE_INTF);
tachSignal = std::make_unique<sdbusplus::server::match::match>(
_bus, match.c_str(),
@@ -169,7 +168,7 @@
void TachSensor::updateTachAndTarget()
{
_tachInput = util::SDBusPlus::getProperty<decltype(_tachInput)>(
- _bus, _name, FAN_SENSOR_VALUE_INTF, FAN_VALUE_PROPERTY);
+ _bus, _name, util::FAN_SENSOR_VALUE_INTF, FAN_VALUE_PROPERTY);
if (_hasTarget)
{
@@ -272,8 +271,8 @@
void TachSensor::handleTachChange(sdbusplus::message::message& msg)
{
- readPropertyFromMessage(msg, FAN_SENSOR_VALUE_INTF, FAN_VALUE_PROPERTY,
- _tachInput);
+ readPropertyFromMessage(msg, util::FAN_SENSOR_VALUE_INTF,
+ FAN_VALUE_PROPERTY, _tachInput);
// Check just this sensor against the target
_fan.tachChanged(*this);