oem/pldm: Implement GetAlertStatus command
Implement the GetAlertStatus PLDM OEM command on BMC, the command can
just return the hardcoded data:
00 (PLDM_SUCCESS)
FF 00 00 30
00 00 80 30
Tested:
./pldmtool raw -d 0x80 0x3f 0xf0 0x00
Request Message:
08 01 80 3f f0 00
Response Message:
08 01 00 3f f0 00 30 00 00 ff 30 80 00 00
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I9d231fcc5a7bb77e1abdfaa1b46ba044c6e8bbe8
diff --git a/oem/ibm/libpldmresponder/file_io.hpp b/oem/ibm/libpldmresponder/file_io.hpp
index 4e0cad4..f0555d7 100644
--- a/oem/ibm/libpldmresponder/file_io.hpp
+++ b/oem/ibm/libpldmresponder/file_io.hpp
@@ -17,6 +17,7 @@
#include "libpldm/base.h"
#include "oem/ibm/libpldm/file_io.h"
+#include "oem/ibm/libpldm/host.h"
namespace pldm
{
@@ -143,7 +144,6 @@
namespace oem_ibm
{
-
class Handler : public CmdHandler
{
public:
@@ -189,6 +189,11 @@
[this](const pldm_msg* request, size_t payloadLength) {
return this->fileAck(request, payloadLength);
});
+ handlers.emplace(PLDM_HOST_GET_ALERT_STATUS,
+ [this](const pldm_msg* request, size_t payloadLength) {
+ return this->getAlertStatus(request,
+ payloadLength);
+ });
}
/** @brief Handler for readFileIntoMemory command
@@ -267,6 +272,15 @@
Response writeFile(const pldm_msg* request, size_t payloadLength);
Response fileAck(const pldm_msg* request, size_t payloadLength);
+
+ /** @brief Handler for getAlertStatus command
+ *
+ * @param[in] request - PLDM request msg
+ * @param[in] payloadLength - length of the message payload
+ *
+ * @return PLDM response message
+ */
+ Response getAlertStatus(const pldm_msg* request, size_t payloadLength);
};
} // namespace oem_ibm