ExternalSensor: New service for external sensors

This code was mostly copied from HwmonTempSensor, and inspired by the
initial proof of concept from https://gerrit.openbmc-project.xyz/35476

External sensors are designed to be placeholders, with no hwmon or
other hardware support locally. Thus, there is no detection or kernel
driver load, so no change is necessary to entity-manager.

The expectation is that these sensors will be updated by something
external to the BMC, such as the host, which can be useful for
including host-based sensors into phosphor-pid-control thermal zones.

* Added systemd service file, similar to the others.
* Added CMakeLists blocks, similar to the others.
* Also cleaned up some nearby formatting in CMakeLists.

Tested: With the addition of the Mutable feature from 36275, and the
installation of the systemd file from 36272, and a change to our IPMI
daemon (still in the process of being upstreamed), the host can write
to a sensor over IPMI. It correctly shows up in the IPMI SDR, and the
written value correctly shows up on the D-Bus ExternalSensor here.

Here is example JSON for use with entity-manager:
{
  "Name": "HostOnlyDevTemp",
  "Measure": "temperature",
  "MinValue": -10.0,
  "MaxValue": 117.5,
  "Type": "ExternalSensor"
},

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: Id499e1cd6c7918179bb1729e5ce8546cf4121dfa
Signed-off-by: Ed Tanous <edtanous@google.com>
6 files changed
tree: 43bd5177c2392eec55cae2e5af32942685a1a42d
  1. cmake/
  2. include/
  3. service_files/
  4. src/
  5. tests/
  6. .clang-format
  7. .clang-ignore
  8. .gitignore
  9. cmake-format.json
  10. CMakeLists.txt
  11. Jenkinsfile
  12. LICENSE
  13. MAINTAINERS
  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