requestHandler: Queue the request messages to one endpoint
Section "Requirements for requesters" in DSP0240 details "A PLDM
terminus that issues PLDM requests to another PLDM terminus shall wait
until one of the following occurs before issuing a new PLDM request:
it gets the response to a particular request, it times out waiting for
the response, or it receives an indication that transmission of the
particular request failed." So the registered request messages to one
endpoint have to be queued before sending to meet the requester
requirement.
When a sensor manager is added to pldmd daemon to manage the sensors
of one terminus, the sensor manager will support the sensor polling
timers. The timers will poll the PLDM sensors with different intervals
so there can be many `getSensorReading` requests to one endpoint to
get the sensor values. Moreover, BMC also sends
`PollForPlatformEventMessage` requests to get the event data when it
receives the `pldmMessagePollEvent` event from the terminus. So those
TX request messages have to be queued.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Change-Id: I9756e1029b41a297a8f73e2ab7be47bc143ef710
diff --git a/requester/test/handler_test.cpp b/requester/test/handler_test.cpp
index b656c1a..3b003a0 100644
--- a/requester/test/handler_test.cpp
+++ b/requester/test/handler_test.cpp
@@ -134,7 +134,7 @@
pldm::Response response(sizeof(pldm_msg_hdr) + sizeof(uint8_t));
auto responsePtr = reinterpret_cast<const pldm_msg*>(response.data());
- reqHandler.handleResponse(eid, instanceIdNxt, 0, 0, responsePtr,
+ reqHandler.handleResponse(eid, instanceId, 0, 0, responsePtr,
sizeof(response));
EXPECT_EQ(validResponse, true);
EXPECT_EQ(callbackCount, 1);
@@ -144,7 +144,7 @@
// simulate a delayed response for the first request
waitEventExpiry(milliseconds(500));
- reqHandler.handleResponse(eid, instanceId, 0, 0, responsePtr,
+ reqHandler.handleResponse(eid, instanceIdNxt, 0, 0, responsePtr,
sizeof(response));
EXPECT_EQ(validResponse, true);