Refactor: Handler expands TID parameter
Adding tid as a parameter to each handler so that the handler
can know the message sent from which device
Tested:
- Unit Tests passed.
Change-Id: Ida37bf61146d2f59ea11ebc7bf009f7837ed496d
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/libpldmresponder/platform.hpp b/libpldmresponder/platform.hpp
index 8df9625..eb01e5f 100644
--- a/libpldmresponder/platform.hpp
+++ b/libpldmresponder/platform.hpp
@@ -69,28 +69,34 @@
pdrCreated = true;
}
- handlers.emplace(PLDM_GET_PDR,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_PDR,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getPDR(request, payloadLength);
});
- handlers.emplace(PLDM_SET_NUMERIC_EFFECTER_VALUE,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_SET_NUMERIC_EFFECTER_VALUE,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->setNumericEffecterValue(request, payloadLength);
});
- handlers.emplace(PLDM_GET_NUMERIC_EFFECTER_VALUE,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_NUMERIC_EFFECTER_VALUE,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getNumericEffecterValue(request, payloadLength);
});
- handlers.emplace(PLDM_SET_STATE_EFFECTER_STATES,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_SET_STATE_EFFECTER_STATES,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->setStateEffecterStates(request, payloadLength);
});
- handlers.emplace(PLDM_PLATFORM_EVENT_MESSAGE,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_PLATFORM_EVENT_MESSAGE,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->platformEventMessage(request, payloadLength);
});
- handlers.emplace(PLDM_GET_STATE_SENSOR_READINGS,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_STATE_SENSOR_READINGS,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getStateSensorReadings(request, payloadLength);
});