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/base.hpp b/libpldmresponder/base.hpp
index 1bd88f8..544e913 100644
--- a/libpldmresponder/base.hpp
+++ b/libpldmresponder/base.hpp
@@ -30,20 +30,24 @@
instanceIdDb(instanceIdDb), event(event),
oemPlatformHandler(oemPlatformHandler), handler(handler)
{
- handlers.emplace(PLDM_GET_PLDM_TYPES,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_PLDM_TYPES,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getPLDMTypes(request, payloadLength);
});
- handlers.emplace(PLDM_GET_PLDM_COMMANDS,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_PLDM_COMMANDS,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getPLDMCommands(request, payloadLength);
});
- handlers.emplace(PLDM_GET_PLDM_VERSION,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_PLDM_VERSION,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getPLDMVersion(request, payloadLength);
});
- handlers.emplace(PLDM_GET_TID,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_TID,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getTID(request, payloadLength);
});
}