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