HwmonTempMain: fix sensor index of Name1

For pressure and humidity sensors are using Name1 as sensor name, and it
needs manually assign the index to 2 for the thresholds config works correctly

Tested EM conifg:
{
    "Address": "0x40",
    "Bus": 10,
    "Name": "FRONT_PANEL_TEMP",
    "Name1": "FRONT_PANEL_HUMIDTY",
    "Thresholds": [
        {
            "Direction": "greater than",
            "Index": 1,
            "Name": "upper critical",
            "Severity": 1,
            "Value": 40
        },
        {
            "Direction": "less than",
            "Index": 1,
            "Name": "lower critical",
            "Severity": 1,
            "Value": 0
        },
        {
            "Direction": "greater than",
            "Index": 2,
            "Name": "upper critical",
            "Severity": 1,
            "Value": 80
        },
        {
            "Direction": "less than",
            "Index": 2,
            "Name": "lower critical",
            "Severity": 1,
            "Value": 10
        }
    ],
    "Type": "HDC1080"
}

Tested Results:
root@bletchley:~# busctl introspect xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/FRONT_PANEL_TEMP xyz.openbmc_project.Sensor.Threshold.Critical
NAME                                          TYPE      SIGNATURE RESULT/VALUE FLAGS
.CriticalAlarmHigh                            property  b         false        emits-change
.CriticalAlarmLow                             property  b         false        emits-change
.CriticalHigh                                 property  d         40           emits-change writable
.CriticalLow                                  property  d         0            emits-change writable
root@bletchley:~# busctl introspect xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/humidity/FRONT_PANEL_HUMIDTY xyz.openbmc_project.Sensor.Threshold.Critical
NAME                                          TYPE      SIGNATURE RESULT/VALUE FLAGS
.CriticalAlarmHigh                            property  b         false        emits-change
.CriticalAlarmLow                             property  b         false        emits-change
.CriticalHigh                                 property  d         80           emits-change writable
.CriticalLow                                  property  d         10           emits-change writable

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I6ae1c007729b884acde56ecc83b6c8b88ea1bc81
1 file changed
tree: acd2e9c07c0bf29ba0d5d9336b04c15f83920438
  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. OWNERS
  16. 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