psusensor: Use configurable read interval

The intervals to read the psusensor value and event were hard-coded to
1000 ms.

For some sensors user may need to use a different interval to poll, e.g.
it should not poll the voltage of RTC battery because it drains the
battery.
The ADC sensor already has the similar change.

Make them configurable parameters from entity-manager's json, so that
the user could use customized poll rate to poll the specific sensors.
If the "PollRate" is not set in the json config, the behavior is the
same as before that uses the default 1s poll rate.

The config parameters are the same as HwmonTemp and ADC sensor.

E.g. the below json config changes the poll rate to 2.0s for pmbus sensor
at i2c 5-0076.

    {
        "Address": "0x76",
        "Bus": 5,
        "Name": "CPU0_VR_0",
        "Labels": [
            "pin",
            "temp1",
            "vout1"
        ],
        "PollRate": 2.0,
        "Thresholds": [...],
        "Type": "pmbus"
    }

Tested: Add `PollRate` in pmbus's sensor and verify the related sensors'
        poll rate is changed accordingly.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I94109e65455dd5c27509ce89a62ef92738714298
5 files changed
tree: 9cc1fc56abe7916056fac390b680de8fef51c1ae
  1. include/
  2. service_files/
  3. src/
  4. subprojects/
  5. tests/
  6. .clang-format
  7. .clang-ignore
  8. .clang-tidy
  9. .gitignore
  10. Jenkinsfile
  11. LICENSE
  12. MAINTAINERS
  13. meson.build
  14. meson_options.txt
  15. 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

sensor documentation