Decode APIs now accept const struct pldm_msg *msg
All the decode_xxx APIs were changed to accept the complete pldm_msg
instead of working with just a specific member (payload) making it
consistent with the encode_xxx APIs.
Following changes were made through out the code,
- decode_xxx now requires to send the const struct pldm_msg *msg
instead of a const uint8_t *msg.
- Within the decode_xxx function the payload is extracted and used
accordingly.
- All the calls made to decode_xxx APIs have been modified to now
pass the pointer to pldm_msg_hdr (struct pldm_msg *msg).
- The test code was modified to now pass the appropriate data
to all the encode_xxx APIs.
Change-Id: I16a3f6e554ea2c9fa44d55dc8f21f65022bd983a
Signed-off-by: Zahed Hossain <zahzahed@in.ibm.com>
diff --git a/libpldm/platform.h b/libpldm/platform.h
index 7d25eb3..d29dc8a 100644
--- a/libpldm/platform.h
+++ b/libpldm/platform.h
@@ -117,7 +117,7 @@
/** @brief Decode SetStateEffecterStates request data
*
- * @param[in] msg - Request message payload
+ * @param[in] msg - Request message
* @param[in] payload_length - Length of request message payload
* @param[out] effecter_id - used to identify and access the effecter
* @param[out] comp_effecter_count - number of individual sets of effecter
@@ -133,7 +133,7 @@
* @return pldm_completion_codes
*/
-int decode_set_state_effecter_states_req(const uint8_t *msg,
+int decode_set_state_effecter_states_req(const struct pldm_msg *msg,
size_t payload_length,
uint16_t *effecter_id,
uint8_t *comp_effecter_count,
@@ -166,12 +166,12 @@
struct pldm_msg *msg);
/** @brief Decode SetStateEffecterStates response data
- * @param[in] msg - Request message payload
+ * @param[in] msg - Request message
* @param[in] payload_length - Length of response message payload
* @param[out] completion_code - PLDM completion code
* @return pldm_completion_codes
*/
-int decode_set_state_effecter_states_resp(const uint8_t *msg,
+int decode_set_state_effecter_states_resp(const struct pldm_msg *msg,
size_t payload_length,
uint8_t *completion_code);
#ifdef __cplusplus