Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 1 | #ifndef PLATFORM_H |
| 2 | #define PLATFORM_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #include <stddef.h> |
| 9 | #include <stdint.h> |
| 10 | |
| 11 | #include "base.h" |
| 12 | |
| 13 | /* Maximum size for request */ |
| 14 | #define PLDM_SET_STATE_EFFECTER_STATES_REQ_BYTES 19 |
| 15 | /* Response lengths are inclusive of completion code */ |
| 16 | #define PLDM_SET_STATE_EFFECTER_STATES_RESP_BYTES 1 |
| 17 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 18 | #define PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES 1 |
| 19 | #define PLDM_SET_NUMERIC_EFFECTER_VALUE_MIN_REQ_BYTES 4 |
| 20 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 21 | #define PLDM_GET_PDR_REQ_BYTES 13 |
| 22 | /* Minimum response length */ |
| 23 | #define PLDM_GET_PDR_MIN_RESP_BYTES 12 |
| 24 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 25 | enum pldm_effecter_data_size { |
| 26 | PLDM_EFFECTER_DATA_SIZE_UINT8, |
| 27 | PLDM_EFFECTER_DATA_SIZE_SINT8, |
| 28 | PLDM_EFFECTER_DATA_SIZE_UINT16, |
| 29 | PLDM_EFFECTER_DATA_SIZE_SINT16, |
| 30 | PLDM_EFFECTER_DATA_SIZE_UINT32, |
| 31 | PLDM_EFFECTER_DATA_SIZE_SINT32 |
| 32 | }; |
| 33 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 34 | enum set_request { PLDM_NO_CHANGE = 0x00, PLDM_REQUEST_SET = 0x01 }; |
| 35 | |
| 36 | enum effecter_state { PLDM_INVALID_VALUE = 0xFF }; |
| 37 | |
| 38 | enum pldm_platform_commands { |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 39 | PLDM_SET_NUMERIC_EFFECTER_VALUE = 0x31, |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 40 | PLDM_SET_STATE_EFFECTER_STATES = 0x39, |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 41 | PLDM_GET_PDR = 0x51, |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 42 | }; |
| 43 | |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 44 | /** @brief PLDM PDR types |
| 45 | */ |
| 46 | enum pldm_pdr_types { |
| 47 | PLDM_STATE_EFFECTER_PDR = 11, |
| 48 | }; |
| 49 | |
| 50 | /** @brief PLDM effecter initialization schemes |
| 51 | */ |
| 52 | enum pldm_effecter_init { |
| 53 | PLDM_NO_INIT, |
| 54 | PLDM_USE_INIT_PDR, |
| 55 | PLDM_ENABLE_EFFECTER, |
| 56 | PLDM_DISABLE_EFECTER |
| 57 | }; |
| 58 | |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 59 | /** @brief PLDM Platform M&C completion codes |
| 60 | */ |
| 61 | enum pldm_platform_completion_codes { |
Sampa Misra | a2fa070 | 2019-05-31 01:28:55 -0500 | [diff] [blame] | 62 | PLDM_PLATFORM_INVALID_EFFECTER_ID = 0x80, |
| 63 | PLDM_PLATFORM_INVALID_STATE_VALUE = 0x81, |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 64 | PLDM_PLATFORM_INVALID_RECORD_HANDLE = 0x82, |
Sampa Misra | a2fa070 | 2019-05-31 01:28:55 -0500 | [diff] [blame] | 65 | PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE = 0x82, |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 66 | }; |
| 67 | |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 68 | /** @struct pldm_pdr_hdr |
| 69 | * |
| 70 | * Structure representing PLDM common PDR header |
| 71 | */ |
| 72 | struct pldm_pdr_hdr { |
| 73 | uint32_t record_handle; |
| 74 | uint8_t version; |
| 75 | uint8_t type; |
| 76 | uint16_t record_change_num; |
| 77 | uint16_t length; |
| 78 | } __attribute__((packed)); |
| 79 | |
| 80 | /** @struct pldm_state_effecter_pdr |
| 81 | * |
| 82 | * Structure representing PLDM state effecter PDR |
| 83 | */ |
| 84 | struct pldm_state_effecter_pdr { |
| 85 | struct pldm_pdr_hdr hdr; |
| 86 | uint16_t terminus_handle; |
| 87 | uint16_t effecter_id; |
| 88 | uint16_t entity_type; |
| 89 | uint16_t entity_instance; |
| 90 | uint16_t container_id; |
| 91 | uint16_t effecter_semantic_id; |
| 92 | uint8_t effecter_init; |
| 93 | bool8_t has_description_pdr; |
| 94 | uint8_t composite_effecter_count; |
| 95 | uint8_t possible_states[1]; |
| 96 | } __attribute__((packed)); |
| 97 | |
| 98 | /** @struct state_effecter_possible_states |
| 99 | * |
| 100 | * Structure representing state enums for state effecter |
| 101 | */ |
| 102 | struct state_effecter_possible_states { |
| 103 | uint16_t state_set_id; |
| 104 | uint8_t possible_states_size; |
| 105 | bitfield8_t states[1]; |
| 106 | } __attribute__((packed)); |
| 107 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 108 | /** @struct set_effecter_state_field |
| 109 | * |
| 110 | * Structure representing a stateField in SetStateEffecterStates command */ |
| 111 | |
| 112 | typedef struct state_field_for_state_effecter_set { |
| 113 | uint8_t set_request; //!< Whether to change the state |
| 114 | uint8_t effecter_state; //!< Expected state of the effecter |
| 115 | } __attribute__((packed)) set_effecter_state_field; |
| 116 | |
Priyanga | 7257fdf | 2019-06-10 01:59:45 -0500 | [diff] [blame] | 117 | /** @struct PLDM_SetStateEffecterStates_Request |
| 118 | * |
| 119 | * Structure representing PLDM set state effecter states request. |
| 120 | */ |
| 121 | struct pldm_set_state_effecter_states_req { |
| 122 | uint16_t effecter_id; |
| 123 | uint8_t comp_effecter_count; |
| 124 | set_effecter_state_field field[8]; |
| 125 | } __attribute__((packed)); |
| 126 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 127 | /** @struct pldm_get_pdr_resp |
| 128 | * |
| 129 | * structure representing GetPDR response packet |
| 130 | * transfer CRC is not part of the structure and will be |
| 131 | * added at the end of last packet in multipart transfer |
| 132 | */ |
| 133 | struct pldm_get_pdr_resp { |
| 134 | uint8_t completion_code; |
| 135 | uint32_t next_record_handle; |
| 136 | uint32_t next_data_transfer_handle; |
| 137 | uint8_t transfer_flag; |
| 138 | uint16_t response_count; |
| 139 | uint8_t record_data[1]; |
| 140 | } __attribute__((packed)); |
| 141 | |
| 142 | /** @struct pldm_get_pdr_req |
| 143 | * |
| 144 | * structure representing GetPDR request packet |
| 145 | */ |
| 146 | struct pldm_get_pdr_req { |
| 147 | uint32_t record_handle; |
| 148 | uint32_t data_transfer_handle; |
| 149 | uint8_t transfer_op_flag; |
| 150 | uint16_t request_count; |
| 151 | uint16_t record_change_number; |
| 152 | } __attribute__((packed)); |
| 153 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 154 | /** @struct pldm_set_numeric_effecter_value_req |
| 155 | * |
| 156 | * structure representing SetNumericEffecterValue request packet |
| 157 | */ |
| 158 | struct pldm_set_numeric_effecter_value_req { |
| 159 | uint16_t effecter_id; |
| 160 | uint8_t effecter_data_size; |
| 161 | uint8_t effecter_value[1]; |
| 162 | } __attribute__((packed)); |
| 163 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 164 | /* Responder */ |
| 165 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 166 | /* SetNumericEffecterValue */ |
| 167 | |
| 168 | /** @brief Decode SetNumericEffecterValue request data |
| 169 | * |
| 170 | * @param[in] msg - Request message |
| 171 | * @param[in] payload_length - Length of request message payload |
| 172 | * @param[out] effecter_id - used to identify and access the effecter |
| 173 | * @param[out] effecter_data_size - The bit width and format of the setting |
| 174 | * value for the effecter. |
| 175 | * value:{uint8,sint8,uint16,sint16,uint32,sint32} |
| 176 | * @param[out] effecter_value - The setting value of numeric effecter being |
| 177 | * requested. |
| 178 | * @return pldm_completion_codes |
| 179 | */ |
| 180 | int decode_set_numeric_effecter_value_req(const struct pldm_msg *msg, |
| 181 | size_t payload_length, |
| 182 | uint16_t *effecter_id, |
| 183 | uint8_t *effecter_data_size, |
| 184 | uint8_t *effecter_value); |
| 185 | |
| 186 | /** @brief Create a PLDM response message for SetNumericEffecterValue |
| 187 | * |
| 188 | * @param[in] instance_id - Message's instance id |
| 189 | * @param[in] completion_code - PLDM completion code |
| 190 | * @param[out] msg - Message will be written to this |
| 191 | * @param[in] payload_length - Length of request message payload |
| 192 | * @return pldm_completion_codes |
| 193 | * @note Caller is responsible for memory alloc and dealloc of param |
| 194 | * 'msg.body.payload' |
| 195 | */ |
| 196 | int encode_set_numeric_effecter_value_resp(uint8_t instance_id, |
| 197 | uint8_t completion_code, |
| 198 | struct pldm_msg *msg, |
| 199 | size_t payload_length); |
| 200 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 201 | /* SetStateEffecterStates */ |
| 202 | |
| 203 | /** @brief Create a PLDM response message for SetStateEffecterStates |
| 204 | * |
| 205 | * @param[in] instance_id - Message's instance id |
| 206 | * @param[in] completion_code - PLDM completion code |
| 207 | * @param[out] msg - Message will be written to this |
| 208 | * @return pldm_completion_codes |
| 209 | * @note Caller is responsible for memory alloc and dealloc of param |
| 210 | * 'msg.body.payload' |
| 211 | */ |
| 212 | |
| 213 | int encode_set_state_effecter_states_resp(uint8_t instance_id, |
| 214 | uint8_t completion_code, |
| 215 | struct pldm_msg *msg); |
| 216 | |
| 217 | /** @brief Decode SetStateEffecterStates request data |
| 218 | * |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 219 | * @param[in] msg - Request message |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 220 | * @param[in] payload_length - Length of request message payload |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 221 | * @param[out] effecter_id - used to identify and access the effecter |
| 222 | * @param[out] comp_effecter_count - number of individual sets of effecter |
| 223 | * information. Upto eight sets of state effecter info can be accessed |
| 224 | * for a given effecter. |
| 225 | * @param[out] field - each unit is an instance of the stateFileld structure |
| 226 | * that is used to set the requested state for a particular effecter |
| 227 | * within the state effecter. This field holds the starting address of |
| 228 | * the stateField values. The user is responsible to allocate the |
| 229 | * memory prior to calling this command. Since the state field count is |
| 230 | * not known in advance, the user should allocate the maximum size |
| 231 | * always, which is 8 in number. |
| 232 | * @return pldm_completion_codes |
| 233 | */ |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 234 | |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 235 | int decode_set_state_effecter_states_req(const struct pldm_msg *msg, |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 236 | size_t payload_length, |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 237 | uint16_t *effecter_id, |
| 238 | uint8_t *comp_effecter_count, |
| 239 | set_effecter_state_field *field); |
| 240 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 241 | /* GetPDR */ |
| 242 | |
| 243 | /** @brief Create a PLDM response message for GetPDR |
| 244 | * |
| 245 | * @param[in] instance_id - Message's instance id |
| 246 | * @param[in] completion_code - PLDM completion code |
| 247 | * @param[in] next_record_hndl - The recordHandle for the PDR that is next in |
| 248 | * the PDR Repository |
| 249 | * @param[in] next_data_transfer_hndl - A handle that identifies the next |
| 250 | * portion of the PDR data to be transferred, if any |
| 251 | * @param[in] transfer_flag - Indicates the portion of PDR data being |
| 252 | * transferred |
| 253 | * @param[in] resp_cnt - The number of recordData bytes returned in this |
| 254 | * response |
| 255 | * @param[in] record_data - PDR data bytes of length resp_cnt |
| 256 | * @param[in] transfer_crc - A CRC-8 for the overall PDR. This is present only |
| 257 | * in the last part of a PDR being transferred |
| 258 | * @param[out] msg - Message will be written to this |
| 259 | * @return pldm_completion_codes |
| 260 | * @note Caller is responsible for memory alloc and dealloc of param |
| 261 | * 'msg.payload' |
| 262 | */ |
| 263 | int encode_get_pdr_resp(uint8_t instance_id, uint8_t completion_code, |
| 264 | uint32_t next_record_hndl, |
| 265 | uint32_t next_data_transfer_hndl, uint8_t transfer_flag, |
| 266 | uint16_t resp_cnt, const uint8_t *record_data, |
| 267 | uint8_t transfer_crc, struct pldm_msg *msg); |
| 268 | |
| 269 | /** @brief Decode GetPDR request data |
| 270 | * |
| 271 | * @param[in] msg - Request message |
| 272 | * @param[in] payload_length - Length of request message payload |
| 273 | * @param[out] record_hndl - The recordHandle value for the PDR to be retrieved |
| 274 | * @param[out] data_transfer_hndl - Handle used to identify a particular |
| 275 | * multipart PDR data transfer operation |
| 276 | * @param[out] transfer_op_flag - Flag to indicate the first or subsequent |
| 277 | * portion of transfer |
| 278 | * @param[out] request_cnt - The maximum number of record bytes requested |
| 279 | * @param[out] record_chg_num - Used to determine whether the PDR has changed |
| 280 | * while PDR transfer is going on |
| 281 | * @return pldm_completion_codes |
| 282 | */ |
| 283 | |
| 284 | int decode_get_pdr_req(const struct pldm_msg *msg, size_t payload_length, |
| 285 | uint32_t *record_hndl, uint32_t *data_transfer_hndl, |
| 286 | uint8_t *transfer_op_flag, uint16_t *request_cnt, |
| 287 | uint16_t *record_chg_num); |
| 288 | |
| 289 | /* Requester */ |
| 290 | |
George Liu | 820a9a5 | 2019-11-26 14:43:59 +0800 | [diff] [blame] | 291 | /* GetPDR */ |
| 292 | |
| 293 | /** @brief Create a PLDM request message for GetPDR |
| 294 | * |
| 295 | * @param[in] instance_id - Message's instance id |
| 296 | * @param[in] record_hndl - The recordHandle value for the PDR to be retrieved |
| 297 | * @param[in] data_transfer_hndl - Handle used to identify a particular |
| 298 | * multipart PDR data transfer operation |
| 299 | * @param[in] transfer_op_flag - Flag to indicate the first or subsequent |
| 300 | * portion of transfer |
| 301 | * @param[in] request_cnt - The maximum number of record bytes requested |
| 302 | * @param[in] record_chg_num - Used to determine whether the PDR has changed |
| 303 | * while PDR transfer is going on |
| 304 | * @param[out] msg - Message will be written to this |
| 305 | * @param[in] payload_length - Length of request message payload |
| 306 | * @return pldm_completion_codes |
| 307 | * @note Caller is responsible for memory alloc and dealloc of param |
| 308 | * 'msg.payload' |
| 309 | */ |
| 310 | int encode_get_pdr_req(uint8_t instance_id, uint32_t record_hndl, |
| 311 | uint32_t data_transfer_hndl, uint8_t transfer_op_flag, |
| 312 | uint16_t request_cnt, uint16_t record_chg_num, |
| 313 | struct pldm_msg *msg, size_t payload_length); |
| 314 | |
| 315 | /** @brief Decode GetPDR response data |
| 316 | * |
George Liu | 684a716 | 2019-12-06 15:10:52 +0800 | [diff] [blame] | 317 | * Note: |
| 318 | * * If the return value is not PLDM_SUCCESS, it represents a |
| 319 | * transport layer error. |
| 320 | * * If the completion_code value is not PLDM_SUCCESS, it represents a |
| 321 | * protocol layer error and all the out-parameters are invalid. |
| 322 | * |
George Liu | 820a9a5 | 2019-11-26 14:43:59 +0800 | [diff] [blame] | 323 | * @param[in] msg - Request message |
| 324 | * @param[in] payload_length - Length of request message payload |
| 325 | * @param[out] completion_code - PLDM completion code |
| 326 | * @param[out] next_record_hndl - The recordHandle for the PDR that is next in |
| 327 | * the PDR Repository |
| 328 | * @param[out] next_data_transfer_hndl - A handle that identifies the next |
| 329 | * portion of the PDR data to be transferred, if any |
| 330 | * @param[out] transfer_flag - Indicates the portion of PDR data being |
| 331 | * transferred |
| 332 | * @param[out] resp_cnt - The number of recordData bytes returned in this |
| 333 | * response |
| 334 | * @param[out] record_data - PDR data bytes of length resp_cnt |
| 335 | * @param[in] record_data_length - Length of record_data |
| 336 | * @param[out] transfer_crc - A CRC-8 for the overall PDR. This is present only |
| 337 | * in the last part of a PDR being transferred |
| 338 | * @return pldm_completion_codes |
| 339 | */ |
| 340 | int decode_get_pdr_resp(const struct pldm_msg *msg, size_t payload_length, |
| 341 | uint8_t *completion_code, uint32_t *next_record_hndl, |
| 342 | uint32_t *next_data_transfer_hndl, |
| 343 | uint8_t *transfer_flag, uint16_t *resp_cnt, |
| 344 | uint8_t *record_data, size_t record_data_length, |
| 345 | uint8_t *transfer_crc); |
| 346 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 347 | /* SetStateEffecterStates */ |
| 348 | |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 349 | /** @brief Create a PLDM request message for SetStateEffecterStates |
| 350 | * |
| 351 | * @param[in] instance_id - Message's instance id |
| 352 | * @param[in] effecter_id - used to identify and access the effecter |
| 353 | * @param[in] comp_effecter_count - number of individual sets of effecter |
| 354 | * information. Upto eight sets of state effecter info can be accessed |
| 355 | * for a given effecter. |
| 356 | * @param[in] field - each unit is an instance of the stateField structure |
| 357 | * that is used to set the requested state for a particular effecter |
| 358 | * within the state effecter. This field holds the starting address of |
| 359 | * the stateField values. The user is responsible to allocate the |
| 360 | * memory prior to calling this command. The user has to allocate the |
| 361 | * field parameter as sizeof(set_effecter_state_field) * |
| 362 | * comp_effecter_count |
| 363 | * @param[out] msg - Message will be written to this |
| 364 | * @return pldm_completion_codes |
| 365 | * @note Caller is responsible for memory alloc and dealloc of param |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 366 | * 'msg.payload' |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 367 | */ |
| 368 | |
| 369 | int encode_set_state_effecter_states_req(uint8_t instance_id, |
| 370 | uint16_t effecter_id, |
| 371 | uint8_t comp_effecter_count, |
| 372 | set_effecter_state_field *field, |
| 373 | struct pldm_msg *msg); |
| 374 | |
| 375 | /** @brief Decode SetStateEffecterStates response data |
George Liu | 684a716 | 2019-12-06 15:10:52 +0800 | [diff] [blame] | 376 | * |
| 377 | * Note: |
| 378 | * * If the return value is not PLDM_SUCCESS, it represents a |
| 379 | * transport layer error. |
| 380 | * * If the completion_code value is not PLDM_SUCCESS, it represents a |
| 381 | * protocol layer error and all the out-parameters are invalid. |
| 382 | * |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 383 | * @param[in] msg - Request message |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 384 | * @param[in] payload_length - Length of response message payload |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 385 | * @param[out] completion_code - PLDM completion code |
| 386 | * @return pldm_completion_codes |
| 387 | */ |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 388 | int decode_set_state_effecter_states_resp(const struct pldm_msg *msg, |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 389 | size_t payload_length, |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 390 | uint8_t *completion_code); |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 391 | |
| 392 | /* SetNumericEffecterValue */ |
| 393 | |
| 394 | /** @brief Create a PLDM request message for SetNumericEffecterValue |
| 395 | * |
| 396 | * @param[in] instance_id - Message's instance id |
| 397 | * @param[in] effecter_id - used to identify and access the effecter |
| 398 | * @param[in] effecter_data_size - The bit width and format of the setting |
| 399 | * value for the effecter. |
| 400 | * value:{uint8,sint8,uint16,sint16,uint32,sint32} |
| 401 | * @param[in] effecter_value - The setting value of numeric effecter being |
| 402 | * requested. |
| 403 | * @param[in] payload_length - Length of request message payload |
| 404 | * @param[out] msg - Message will be written to this |
| 405 | * @return pldm_completion_codes |
| 406 | * @note Caller is responsible for memory alloc and dealloc of param |
| 407 | * 'msg.payload' |
| 408 | */ |
| 409 | int encode_set_numeric_effecter_value_req( |
| 410 | uint8_t instance_id, uint16_t effecter_id, uint8_t effecter_data_size, |
| 411 | uint8_t *effecter_value, struct pldm_msg *msg, size_t payload_length); |
| 412 | |
| 413 | /** @brief Decode SetNumericEffecterValue response data |
| 414 | * @param[in] msg - Request message |
| 415 | * @param[in] payload_length - Length of response message payload |
| 416 | * @param[out] completion_code - PLDM completion code |
| 417 | * @return pldm_completion_codes |
| 418 | */ |
| 419 | int decode_set_numeric_effecter_value_resp(const struct pldm_msg *msg, |
| 420 | size_t payload_length, |
| 421 | uint8_t *completion_code); |
| 422 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 423 | #ifdef __cplusplus |
| 424 | } |
| 425 | #endif |
| 426 | |
| 427 | #endif /* PLATFORM_H */ |