Add timer expiration feature to ExternalSensor

ExternalSensor now functions as intended, wholly within dbus-sensors,
without requiring any modification to the IPMI or Redfish servers,
to provide the feature of timeout expiration of external data, so that
stale/lost external connections can be properly indicated as such.

A "Timeout" parameter is added, in decimal seconds, providing a
watchdog for the arrival of external data. The expectation is that the
external source will provide D-Bus updates, to the sensor Value
property, at regular intervals, repeating indefinitely.
If this external source stops doing this, the watchdog barks, and
the Value of this Sensor will become set to "NaN". This provides
an indication to consumers of this Sensor, to realize that the Value
of this sensor has became stale/disconnected.

A practical application of this is fan control. Upon loss of external
temperature notification, the fans could be thrown into failsafe
mode, instead of risking the system overheating by wrongly continuing
to believe an old temperature value that has become stale.

Tested: Works for me. I started an external data source, data arrived
into the Value of the sensor. I stopped that external data source,
after the Timeout period, the Value became "NaN". I started the
external source again, the Value became correct again, as soon as
external data started to arrive again. I repeated this stop and start
procedure a few times, verifying that it operated as intended.

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: I53b9ff4c0aa771aff4aaf3449fcab23c07afa296
3 files changed
tree: 7049e25050a24a06b106d00ae329297a92f875a2
  1. include/
  2. service_files/
  3. src/
  4. tests/
  5. .clang-format
  6. .clang-ignore
  7. .clang-tidy
  8. .gitignore
  9. Jenkinsfile
  10. LICENSE
  11. MAINTAINERS
  12. meson.build
  13. meson_options.txt
  14. README.md
README.md

dbus-sensors

dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.

key features

  • runtime re-configurable from d-bus (entity-manager or the like)

  • isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible

  • async single-threaded: uses sdbusplus/asio bindings

  • multiple data inputs: hwmon, d-bus, direct driver access