dbus-sdr: Add hybrid sensors stack option
Because the dynamic sensor stack doesn't support non-threshold sensors,
this patch gives way for retrieving non-threshold sensors by walking
through the sensor.yaml. However, this patch filters out any threshold
sensors written in the sensor yaml file because the current dbus-sdr
already supports them.
The sensor stack has both dynamic and static in this patch, so this new
feature is named hybrid sensor stack.
Tested: Try the SDR get command
0xF9:
entityID: 0x21
entityInstance: 0
interfaces:
xyz.openbmc_project.State.Watchdog:
ExpireAction:
Offsets:
0x00:
assert: xyz.openbmc_project.State.Watchdog.Action.None
type: string
0x01:
assert: xyz.openbmc_project.State.Watchdog.Action.HardReset
type: string
0x02:
assert: xyz.openbmc_project.State.Watchdog.Action.PowerOff
type: string
0x03:
assert: xyz.openbmc_project.State.Watchdog.Action.PowerCycle
type: string
mutability: Mutability::Read
path: /xyz/openbmc_project/watchdog/host0
readingType: assertion
sensorNamePattern: nameLeaf
sensorReadingType: 0x6F
sensorType: 0x23
serviceInterface: org.freedesktop.DBus.Properties
$ ipmitool sdr get host0
Sensor ID : host0 (0xcd)
Entity ID : 33.0 (System Management Software)
Sensor Type (Discrete): Watchdog2 (0x23)
Sensor Reading : 0h
Event Message Control : Per-threshold
States Asserted : Watchdog2
[Hard reset]
Event Status : Event Messages Disabled
Assertion Events : Watchdog2
[Hard reset]
Event Enable : Event Messages Disabled
Assertions Enabled : Watchdog2
[Timer expired]
[Hard reset]
[Power down]
[Power cycle]
OEM : 0
Signed-off-by: Scron Chang <Scron.Chang@quantatw.com>
Change-Id: I1ac16f483f2f725077de9c15595195b848a224ab
diff --git a/configure.ac b/configure.ac
index dcf5e79..a7586b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,6 +296,24 @@
)
AM_CONDITIONAL([FEATURE_DYNAMIC_SENSORS], [test x$dynamic_sensors = xtrue])
+# hybrid sensors stack is disabled by default; offer a way to enable it
+AC_ARG_ENABLE([hybrid-sensors],
+ [ --enable-hybrid-sensors Enable/disable Hybrid Sensors stack],
+ [case "${enableval}" in
+ yes) hybrid_sensors=true ;;
+ no) hybrid_sensors=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-hybrid-sensors]) ;;
+ esac],[hybrid-sensors=false]
+ )
+AM_CONDITIONAL([FEATURE_HYBRID_SENSORS], [test x$hybrid_sensors = xtrue])
+
+AS_IF([test x$hybrid_sensors = xtrue],
+ AC_MSG_NOTICE([Enabling hybrid sensors stack])
+ [cpp_flags="$cpp_flags -DFEATURE_HYBRID_SENSORS"]
+ AC_SUBST([CPPFLAGS], [$cpp_flags]),
+ AC_MSG_WARN([Disabling hybrid sensors feature])
+)
+
# Create configured output
AC_CONFIG_FILES([
Makefile