pldmtool: Map completion codes to readable strings
Add helper utility to map numeric PLDM completion codes
to human-readable strings. This enhances readability
and debugging when interpreting PLDM responses.
Change-Id: I6dfe98741fe51203c26562ae988d74d8fd093f09
Signed-off-by: Rajeev Ranjan <ranjan.rajeev1609@gmail.com>
diff --git a/pldmtool/pldm_cmd_helper.hpp b/pldmtool/pldm_cmd_helper.hpp
index e668974..de33d53 100644
--- a/pldmtool/pldm_cmd_helper.hpp
+++ b/pldmtool/pldm_cmd_helper.hpp
@@ -60,6 +60,16 @@
std::cout << data.dump(4) << std::endl;
}
+/**
+ * @brief Maps numeric PLDM completion codes to human-readable strings
+ *
+ * @param[in] completionCode - Numeric PLDM completion code returned in response
+ * @param[in] data - The JSON data to which the completion code is added.
+ * @param[in] pldmType - PLDM type
+ */
+void fillCompletionCode(uint8_t completionCode, ordered_json& data,
+ uint8_t pldmType);
+
/** @brief MCTP socket read/receive
*
* @param[in] requestMsg - Request message to compare against loopback