commit | 0362738df78e3bb511105f9fe28637ec2d7b0ffa | [log] [tgz] |
---|---|---|
author | Josh Lehan <krellan@google.com> | Wed Mar 17 13:35:43 2021 -0700 |
committer | Ed Tanous <ed@tanous.net> | Tue Apr 06 21:21:56 2021 +0000 |
tree | efccc21d342563f6a745bb4fb953ac5eab99f362 | |
parent | 7ea918f22b7df400dd11f909342ac4d256536000 [diff] |
ExternalSensor: Further refinements Further refinements, learned after more testing. Moved the writeHook lambda out of the ExternalSensor constructor, and into separate initWriteHook() function, to reduce the bloat of an already extremely large argument list to the constructor, and solve a nasty gotcha regarding enable_shared_from_this usage: https://stackoverflow.com/a/63579750/3063879 Adding a few more useful debugging messages, to be printed when debugging is enabled (set the "debug" constants to true). Tested: Interrupted external source of data, values changed to NaN as expected. Resumed external source, values changed from NaN to the correctly updated values. Timer durations appear correct. Also sent many configuration change messages, forcing sensor objects to be reconstructed. No errors noted during processing, even when messages sent quickly, and also with random delays, and left to run a while. To check sensor data value: busctl --no-pager introspect xyz.openbmc_project.ExternalSensor \ /xyz/openbmc_project/sensors/temperature/mysensor \ xyz.openbmc_project.Sensor.Value To send a configuration change message: dbus-send --system \ /xyz/openbmc_project/inventory/system/board/myboard/mysensor \ x.x.x.PropertiesChanged \ string:xyz.openbmc_project.Configuration.ExternalSensor Change-Id: I7bd515fed8ddf391df3fabadab61321a446c1b9f Signed-off-by: Josh Lehan <krellan@google.com>
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.
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