Emit the Event.StateSensorEvent signal
When the PLDM daemon receives a state sensor EventMessages, it emits the
StateSensorEvent signal (with TID, sensorID, sensorOffset, eventState,
previousEventState as the signal data).
This commit implements a DBus interface defined at
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/33552
to provide StateSensorEvent signal.
Tested: Tested ok in fp5280g2 system.
1、Using pldmtool to send a sensor event message:
pldmtool raw -d 0x80 0x02 0x0A 0x01 0x01 0x00 0x2 0x00 0x01 0x03 0x04 0x05
2、Using dbus-monitor tool we can see the signal being emitted:
signal time=6467.863313 sender=:1.107 -> destination=(null destination)
serial=37 path=/xyz/openbmc_project/pldm;
interface=xyz.openbmc_project.PLDM.Event; member=StateSensorEvent
byte 1
uint16 2
byte 3
byte 4
byte 5
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: Ica22e2b16e334a748b60145c527cd70564751d60
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 17b5095..af89a94 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -328,6 +328,10 @@
return PLDM_ERROR;
}
+ // Emitting state sensor event signal
+ emitStateSensorEventSignal(tid, sensorId, sensorOffset, eventState,
+ previousEventState);
+
// Handle PLDM events for which PDR is not available, setSensorEventData
// will return PLDM_ERROR_INVALID_DATA if the sensorID is not found in
// the hardcoded sensor list.