Make Terminus ID & Terminus Handle configurable
The current pldm code hardcoded the terminus id and the
terminus handles, making it configurable so that the
oem vendors can set them as per thier need in the
bitbake meta data.
Also,in the current state the FRU record set PDR's and
the Sensor/Effecter PDR's are generated with terminus
handle 0, but the terminus locator PDR is hardcoded with
handle 1. This commit also fixes that behaviour.
Tested :
1. Terminus locator PDR
{
"nextRecordHandle": 89,
"responseCount": 19,
"recordHandle": 88,
"PDRHeaderVersion": 1,
"PDRType": "Terminus Locator PDR",
"recordChangeNumber": 0,
"dataLength": 9,
"PLDMTerminusHandle": 1,
"validity": "valid",
"TID": 1,
"containerID": 0,
"terminusLocatorType": "MCTP_EID",
"terminusLocatorValueSize": 1,
"EID": 8
}
2. FRU record set PDR
{
"nextRecordHandle": 77,
"responseCount": 20,
"recordHandle": 76,
"PDRHeaderVersion": 1,
"PDRType": "FRU Record Set PDR",
"recordChangeNumber": 0,
"dataLength": 10,
"PLDMTerminusHandle": 1,
"FRURecordSetIdentifier": 76,
"entityType": "[Physical] Slot",
"entityInstanceNumber": 12,
"containerID": 3
}
3. Sensor PDR
{
"nextRecordHandle": 208,
"responseCount": 28,
"recordHandle": 207,
"PDRHeaderVersion": 1,
"PDRType": "State Sensor PDR",
"recordChangeNumber": 0,
"dataLength": 18,
"PLDMTerminusHandle": 1,
"sensorID": 2,
"entityType": "[Physical] External Environment",
"entityInstanceNumber": 0,
"containerID": 1,
"sensorInit": "noInit",
"sensorAuxiliaryNamesPDR": false,
"compositeSensorCount": 1,
"stateSetID[0]": "Health State(1)",
"possibleStatesSize[0]": 2,
"possibleStates[0]": [
"Normal(1)",
"Upper Fatal(9)"
]
}
4. Effecter PDR
{
"nextRecordHandle": 142,
"responseCount": 29,
"recordHandle": 141,
"PDRHeaderVersion": 1,
"PDRType": "State Effecter PDR",
"recordChangeNumber": 0,
"dataLength": 19,
"PLDMTerminusHandle": 1,
"effecterID": 53,
"entityType": "[Physical] Fan",
"entityInstanceNumber": 1,
"containerID": 3,
"effecterSemanticID": 0,
"effecterInit": "noInit",
"effecterDescriptionPDR": false,
"compositeEffecterCount": 1,
"stateSetID[0]": "Identify State(17)",
"possibleStatesSize[0]": 1,
"possibleStates[0]": [
"Identify State Unasserted(1)",
"Identify State Asserted(2)"
]
}
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I68d1c5c121b9389cc9b89dde9f1a8d8679b068f1
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index a7842df..c80f533 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -71,7 +71,7 @@
HTOLE16(pdr->hdr.record_change_num);
HTOLE16(pdr->hdr.length);
- pdr->terminus_handle = 0;
+ pdr->terminus_handle = TERMINUS_HANDLE;
pdr->sensor_id = handler.getNextSensorId();
try