Send high/low alarm signal when sensor reading exceeds threshold

The change to the xyz.openbmc_project.Sensor.Threshold.Warning and
xyz.openbmc_project.Sensor.Threshold.Critical interface that add
the new signals WarningHighAlarmAsserted, WarningHighAlarmDeasserted,
WarningLowAlarmAsserted, WarningLowAlarmDeasserted,
CriticalHighAlarmAsserted, CriticalHighAlarmDeasserted,
CriticalLowAlarmAsserted and CriticalLowAlarmDeasserted.

When sensor reading exceeds the threshold, hwmon would send the signal
with the sensor reading value at that time.

Tested:
Use dbus-monitor command to check the signal is captured, when hwmon
send signals.

Signed-off-by: Duke Du <Duke.Du@quantatw.com>
Change-Id: Ibf050b8bcff128cf77fd103c6d2bd1f30700b27b
2 files changed
tree: 2fc10457a1a13c09633514741894d9d5ea791a04
  1. msl/
  2. test/
  3. tools/
  4. .clang-format
  5. .gitignore
  6. .lcovrc
  7. .shellcheck
  8. average.cpp
  9. average.hpp
  10. bootstrap.sh
  11. configure.ac
  12. env.cpp
  13. env.hpp
  14. fan_pwm.cpp
  15. fan_pwm.hpp
  16. fan_speed.cpp
  17. fan_speed.hpp
  18. gpio_handle.cpp
  19. gpio_handle.hpp
  20. hwmon.cpp
  21. hwmon.hpp
  22. hwmonio.cpp
  23. hwmonio.hpp
  24. interface.hpp
  25. LICENSE
  26. mainloop.cpp
  27. mainloop.hpp
  28. MAINTAINERS
  29. Makefile.am
  30. meson.build
  31. meson_options.txt
  32. readd.cpp
  33. README.iio.md
  34. README.md
  35. sensor.cpp
  36. sensor.hpp
  37. sensorset.cpp
  38. sensorset.hpp
  39. sysfs.cpp
  40. sysfs.hpp
  41. targets.hpp
  42. thresholds.hpp
  43. types.hpp
  44. util.hpp
README.md

Exposes generic hwmon entries as DBus objects. More information can be found at Sensor Architecture

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To clean the repository run `./bootstrap.sh clean`.

D-Bus bus names

To enable the use of Linux features like cgroups prioritization and
udev/systemd control, one instance of phosphor-hwmon is intended to
be run per hwmon sysfs class instance.

This requires an algorithm for selecting a stable, well-known D-Bus busname.

The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf
configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default),
ID is a std::hash of the /sys/devices path backing the hwmon class
instance, and N is the implemented phosphor-hwmon D-Bus API version.