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/fru.hpp b/libpldmresponder/fru.hpp
index b986836..78a1a3e 100644
--- a/libpldmresponder/fru.hpp
+++ b/libpldmresponder/fru.hpp
@@ -232,17 +232,19 @@
pldm_entity_association_tree* bmcEntityTree) :
impl(configPath, fruMasterJsonPath, pdrRepo, entityTree, bmcEntityTree)
{
- handlers.emplace(PLDM_GET_FRU_RECORD_TABLE_METADATA,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_FRU_RECORD_TABLE_METADATA,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getFRURecordTableMetadata(request, payloadLength);
});
-
- handlers.emplace(PLDM_GET_FRU_RECORD_TABLE,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_FRU_RECORD_TABLE,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getFRURecordTable(request, payloadLength);
});
- handlers.emplace(PLDM_GET_FRU_RECORD_BY_OPTION,
- [this](const pldm_msg* request, size_t payloadLength) {
+ handlers.emplace(
+ PLDM_GET_FRU_RECORD_BY_OPTION,
+ [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
return this->getFRURecordByOption(request, payloadLength);
});
}