blob: b3b8eaccba06afe8f43fe15c2b1602972b504bb1 [file] [log] [blame]
Sampa Misra0db1dfa2019-03-19 00:15:31 -05001#ifndef PLATFORM_H
2#define PLATFORM_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stddef.h>
9#include <stdint.h>
10
11#include "base.h"
Deepak Kodihalli5544ccd2020-03-15 23:36:16 -050012#include "pdr.h"
Sampa Misra0db1dfa2019-03-19 00:15:31 -050013
14/* Maximum size for request */
15#define PLDM_SET_STATE_EFFECTER_STATES_REQ_BYTES 19
Jolie Ku3557bad2020-03-02 16:22:57 +080016#define PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES 4
Jolie Ku6787f172020-03-19 11:15:53 +080017#define PLDM_GET_NUMERIC_EFFECTER_VALUE_REQ_BYTES 2
Sampa Misra0db1dfa2019-03-19 00:15:31 -050018/* Response lengths are inclusive of completion code */
19#define PLDM_SET_STATE_EFFECTER_STATES_RESP_BYTES 1
Jolie Ku3557bad2020-03-02 16:22:57 +080020#define PLDM_GET_STATE_SENSOR_READINGS_RESP_BYTES 34
Sampa Misra0db1dfa2019-03-19 00:15:31 -050021
George Liu30b859f2020-01-07 15:03:22 +080022#define PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES 1
23#define PLDM_SET_NUMERIC_EFFECTER_VALUE_MIN_REQ_BYTES 4
24
Sampa Misra7fcfb662019-05-08 13:13:53 -050025#define PLDM_GET_PDR_REQ_BYTES 13
26/* Minimum response length */
27#define PLDM_GET_PDR_MIN_RESP_BYTES 12
Jolie Ku6787f172020-03-19 11:15:53 +080028#define PLDM_GET_NUMERIC_EFFECTER_VALUE_MIN_RESP_BYTES 5
Sampa Misra7fcfb662019-05-08 13:13:53 -050029
Zahed Hossaind4abab12020-02-06 03:36:43 -060030/* Minimum length for PLDM PlatformEventMessage request */
31#define PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES 3
32#define PLDM_PLATFORM_EVENT_MESSAGE_STATE_SENSOR_STATE_REQ_BYTES 6
Tom Joseph56e45c52020-03-16 10:01:45 +053033#define PLDM_PLATFORM_EVENT_MESSAGE_RESP_BYTES 2
Zahed Hossaind4abab12020-02-06 03:36:43 -060034
Zahed Hossain1c861712020-03-04 08:55:19 -060035/* Minumum length of senson event data */
36#define PLDM_SENSOR_EVENT_DATA_MIN_LENGTH 5
37#define PLDM_SENSOR_EVENT_SENSOR_OP_STATE_DATA_LENGTH 2
38#define PLDM_SENSOR_EVENT_STATE_SENSOR_STATE_DATA_LENGTH 3
39#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MIN_DATA_LENGTH 4
40#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MAX_DATA_LENGTH 7
41#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_8BIT_DATA_LENGTH 4
42#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_16BIT_DATA_LENGTH 5
43#define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_32BIT_DATA_LENGTH 7
44
Zahed Hossain9be087c2020-04-02 02:26:41 -050045/* Minimum length of data for pldmPDRRepositoryChgEvent */
46#define PLDM_PDR_REPOSITORY_CHG_EVENT_MIN_LENGTH 2
47#define PLDM_PDR_REPOSITORY_CHANGE_RECORD_MIN_LENGTH 2
48
George Liu30b859f2020-01-07 15:03:22 +080049enum pldm_effecter_data_size {
50 PLDM_EFFECTER_DATA_SIZE_UINT8,
51 PLDM_EFFECTER_DATA_SIZE_SINT8,
52 PLDM_EFFECTER_DATA_SIZE_UINT16,
53 PLDM_EFFECTER_DATA_SIZE_SINT16,
54 PLDM_EFFECTER_DATA_SIZE_UINT32,
55 PLDM_EFFECTER_DATA_SIZE_SINT32
56};
57
Sampa Misra0db1dfa2019-03-19 00:15:31 -050058enum set_request { PLDM_NO_CHANGE = 0x00, PLDM_REQUEST_SET = 0x01 };
59
60enum effecter_state { PLDM_INVALID_VALUE = 0xFF };
61
Jolie Ku3557bad2020-03-02 16:22:57 +080062enum sensor_operational_state {
63 ENABLED = 0x00,
64 DISABLED = 0x01,
65 UNAVAILABLE = 0x02,
66 STATUSUNKNOWN = 0x03,
67 FAILED = 0x04,
68 INITIALIZING = 0x05,
69 SHUTTINGDOWN = 0x06,
70 INTEST = 0x07
71};
72
73enum present_state {
74 UNKNOWN = 0x0,
75 NORMAL = 0x01,
76 WARNING = 0x02,
77 CRITICAL = 0x03,
78 FATAL = 0x04,
79 LOWERWARNING = 0x05,
80 LOWERCRITICAL = 0x06,
81 LOWERFATAL = 0x07,
82 UPPERWARNING = 0x08,
83 UPPERCRITICAL = 0x09,
84 UPPERFATAL = 0x0a
85};
86
Jolie Ku6787f172020-03-19 11:15:53 +080087enum pldm_effecter_oper_state {
88 EFFECTER_OPER_STATE_ENABLED_UPDATEPENDING,
89 EFFECTER_OPER_STATE_ENABLED_NOUPDATEPENDING,
90 EFFECTER_OPER_STATE_DISABLED,
91 EFFECTER_OPER_STATE_UNAVAILABLE,
92 EFFECTER_OPER_STATE_STATUSUNKNOWN,
93 EFFECTER_OPER_STATE_FAILED,
94 EFFECTER_OPER_STATE_INITIALIZING,
95 EFFECTER_OPER_STATE_SHUTTINGDOWN,
96 EFFECTER_OPER_STATE_INTEST
97};
98
Sampa Misra0db1dfa2019-03-19 00:15:31 -050099enum pldm_platform_commands {
Jolie Ku3557bad2020-03-02 16:22:57 +0800100 PLDM_GET_STATE_SENSOR_READINGS = 0x21,
George Liu30b859f2020-01-07 15:03:22 +0800101 PLDM_SET_NUMERIC_EFFECTER_VALUE = 0x31,
Jolie Ku6787f172020-03-19 11:15:53 +0800102 PLDM_GET_NUMERIC_EFFECTER_VALUE = 0x32,
Sampa Misra0db1dfa2019-03-19 00:15:31 -0500103 PLDM_SET_STATE_EFFECTER_STATES = 0x39,
Sampa Misra7fcfb662019-05-08 13:13:53 -0500104 PLDM_GET_PDR = 0x51,
Zahed Hossaind4abab12020-02-06 03:36:43 -0600105 PLDM_PLATFORM_EVENT_MESSAGE = 0x0A
Sampa Misra0db1dfa2019-03-19 00:15:31 -0500106};
107
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -0500108/** @brief PLDM PDR types
109 */
110enum pldm_pdr_types {
111 PLDM_STATE_EFFECTER_PDR = 11,
Deepak Kodihalli0a738f02020-03-10 01:56:21 -0500112 PLDM_PDR_ENTITY_ASSOCIATION = 15,
Deepak Kodihallidb914672020-02-07 02:47:45 -0600113 PLDM_PDR_FRU_RECORD_SET = 20,
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -0500114};
115
116/** @brief PLDM effecter initialization schemes
117 */
118enum pldm_effecter_init {
119 PLDM_NO_INIT,
120 PLDM_USE_INIT_PDR,
121 PLDM_ENABLE_EFFECTER,
122 PLDM_DISABLE_EFECTER
123};
124
Deepak Kodihalli557dfb02019-05-12 13:11:17 +0530125/** @brief PLDM Platform M&C completion codes
126 */
127enum pldm_platform_completion_codes {
Sampa Misraa2fa0702019-05-31 01:28:55 -0500128 PLDM_PLATFORM_INVALID_EFFECTER_ID = 0x80,
129 PLDM_PLATFORM_INVALID_STATE_VALUE = 0x81,
Zach Clark76728752020-03-31 10:44:09 -0500130
131 PLDM_PLATFORM_INVALID_DATA_TRANSFER_HANDLE = 0x80,
132 PLDM_PLATFORM_INVALID_TRANSFER_OPERATION_FLAG = 0x81,
Deepak Kodihalli557dfb02019-05-12 13:11:17 +0530133 PLDM_PLATFORM_INVALID_RECORD_HANDLE = 0x82,
Zach Clark76728752020-03-31 10:44:09 -0500134 PLDM_PLATFORM_INVALID_RECORD_CHANGE_NUMBER = 0x83,
135 PLDM_PLATFORM_TRANSFER_TIMEOUT = 0x84,
136
Sampa Misraa2fa0702019-05-31 01:28:55 -0500137 PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE = 0x82,
Deepak Kodihalli557dfb02019-05-12 13:11:17 +0530138};
139
Zahed Hossaind4abab12020-02-06 03:36:43 -0600140/** @brief PLDM Event types
141 */
142enum pldm_event_types {
143 PLDM_SENSOR_EVENT = 0x00,
144 PLDM_EFFECTER_EVENT = 0x01,
145 PLDM_REDFISH_TASK_EXECUTED_EVENT = 0x02,
146 PLDM_REDFISH_MESSAGE_EVENT = 0x03,
147 PLDM_PDR_REPOSITORY_CHG_EVENT = 0x04,
148 PLDM_MESSAGE_POLL_EVENT = 0x05,
149 PLDM_HEARTBEAT_TIMER_ELAPSED_EVENT = 0x06
150};
151
152/** @brief PLDM sensorEventClass states
153 */
154enum sensor_event_class_states {
155 PLDM_SENSOR_OP_STATE,
156 PLDM_STATE_SENSOR_STATE,
157 PLDM_NUMERIC_SENSOR_STATE
158};
159
160/** @brief PLDM sensor supported states
161 */
162enum pldm_sensor_operational_state {
163 PLDM_SENSOR_ENABLED,
164 PLDM_SENSOR_DISABLED,
165 PLDM_SENSOR_UNAVAILABLE,
166 PLDM_SENSOR_STATUSUNKOWN,
167 PLDM_SENSOR_FAILED,
168 PLDM_SENSOR_INITIALIZING,
169 PLDM_SENSOR_SHUTTINGDOWN,
170 PLDM_SENSOR_INTEST
171};
172
173/** @brief PLDM pldmPDRRepositoryChgEvent class eventData format
174 */
175enum pldm_pdr_repository_chg_event_data_format {
176 REFRESH_ENTIRE_REPOSITORY,
177 FORMAT_IS_PDR_TYPES,
178 FORMAT_IS_PDR_HANDLES
179};
180
Zahed Hossain9be087c2020-04-02 02:26:41 -0500181/** @brief PLDM pldmPDRRepositoryChgEvent class changeRecord format
182 * eventDataOperation
183 */
184enum pldm_pdr_repository_chg_event_change_record_event_data_operation {
185 PLDM_REFRESH_ALL_RECORDS,
186 PLDM_RECORDS_DELETED,
187 PLDM_RECORDS_ADDED,
188 PLDM_RECORDS_MODIFIED
189};
190
Zahed Hossain1c861712020-03-04 08:55:19 -0600191/** @brief PLDM NumericSensorStatePresentReading data type
192 */
193enum pldm_sensor_readings_data_type {
194 PLDM_SENSOR_DATA_SIZE_UINT8,
195 PLDM_SENSOR_DATA_SIZE_SINT8,
196 PLDM_SENSOR_DATA_SIZE_UINT16,
197 PLDM_SENSOR_DATA_SIZE_SINT16,
198 PLDM_SENSOR_DATA_SIZE_UINT32,
199 PLDM_SENSOR_DATA_SIZE_SINT32
200};
201
Tom Joseph56e45c52020-03-16 10:01:45 +0530202/** @brief PLDM PlatformEventMessage response status
203 */
204enum pldm_platform_event_status {
205 PLDM_EVENT_NO_LOGGING = 0x00,
206 PLDM_EVENT_LOGGING_DISABLED = 0x01,
207 PLDM_EVENT_LOG_FULL = 0x02,
208 PLDM_EVENT_ACCEPTED_FOR_LOGGING = 0x03,
209 PLDM_EVENT_LOGGED = 0x04,
210 PLDM_EVENT_LOGGING_REJECTED = 0x05
211};
212
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -0500213/** @struct pldm_pdr_hdr
214 *
215 * Structure representing PLDM common PDR header
216 */
217struct pldm_pdr_hdr {
218 uint32_t record_handle;
219 uint8_t version;
220 uint8_t type;
221 uint16_t record_change_num;
222 uint16_t length;
223} __attribute__((packed));
224
Deepak Kodihalli5544ccd2020-03-15 23:36:16 -0500225/** @struct pldm_pdr_entity_association
226 *
227 * Structure representing PLDM Entity Association PDR
228 */
229struct pldm_pdr_entity_association {
230 uint16_t container_id;
231 uint8_t association_type;
232 pldm_entity container;
233 uint8_t num_children;
234 pldm_entity children[1];
235} __attribute__((packed));
236
Deepak Kodihallidb914672020-02-07 02:47:45 -0600237/** @struct pldm_pdr_fru_record_set
238 *
239 * Structure representing PLDM FRU record set PDR
240 */
241struct pldm_pdr_fru_record_set {
242 uint16_t terminus_handle;
243 uint16_t fru_rsi;
244 uint16_t entity_type;
245 uint16_t entity_instance_num;
246 uint16_t container_id;
247} __attribute__((packed));
248
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -0500249/** @struct pldm_state_effecter_pdr
250 *
251 * Structure representing PLDM state effecter PDR
252 */
253struct pldm_state_effecter_pdr {
254 struct pldm_pdr_hdr hdr;
255 uint16_t terminus_handle;
256 uint16_t effecter_id;
257 uint16_t entity_type;
258 uint16_t entity_instance;
259 uint16_t container_id;
260 uint16_t effecter_semantic_id;
261 uint8_t effecter_init;
262 bool8_t has_description_pdr;
263 uint8_t composite_effecter_count;
264 uint8_t possible_states[1];
265} __attribute__((packed));
266
267/** @struct state_effecter_possible_states
268 *
269 * Structure representing state enums for state effecter
270 */
271struct state_effecter_possible_states {
272 uint16_t state_set_id;
273 uint8_t possible_states_size;
274 bitfield8_t states[1];
275} __attribute__((packed));
276
Sampa Misra0db1dfa2019-03-19 00:15:31 -0500277/** @struct set_effecter_state_field
278 *
279 * Structure representing a stateField in SetStateEffecterStates command */
280
281typedef struct state_field_for_state_effecter_set {
282 uint8_t set_request; //!< Whether to change the state
283 uint8_t effecter_state; //!< Expected state of the effecter
284} __attribute__((packed)) set_effecter_state_field;
285
Jolie Ku3557bad2020-03-02 16:22:57 +0800286/** @struct get_sensor_readings_field
287 *
288 * Structure representing a stateField in GetStateSensorReadings command */
289
290typedef struct state_field_for_get_state_sensor_readings {
291 uint8_t sensor_op_state; //!< The state of the sensor itself
292 uint8_t present_state; //!< Return a state value
293 uint8_t previous_state; //!< The state that the presentState was entered
294 //! from. This must be different from the
295 //! present state
296 uint8_t event_state; //!< Return a state value from a PLDM State Set
297 //! that is associated with the sensor
298} __attribute__((packed)) get_sensor_state_field;
299
Priyanga7257fdf2019-06-10 01:59:45 -0500300/** @struct PLDM_SetStateEffecterStates_Request
301 *
302 * Structure representing PLDM set state effecter states request.
303 */
304struct pldm_set_state_effecter_states_req {
305 uint16_t effecter_id;
306 uint8_t comp_effecter_count;
307 set_effecter_state_field field[8];
308} __attribute__((packed));
309
Sampa Misra7fcfb662019-05-08 13:13:53 -0500310/** @struct pldm_get_pdr_resp
311 *
312 * structure representing GetPDR response packet
313 * transfer CRC is not part of the structure and will be
314 * added at the end of last packet in multipart transfer
315 */
316struct pldm_get_pdr_resp {
317 uint8_t completion_code;
318 uint32_t next_record_handle;
319 uint32_t next_data_transfer_handle;
320 uint8_t transfer_flag;
321 uint16_t response_count;
322 uint8_t record_data[1];
323} __attribute__((packed));
324
325/** @struct pldm_get_pdr_req
326 *
327 * structure representing GetPDR request packet
328 */
329struct pldm_get_pdr_req {
330 uint32_t record_handle;
331 uint32_t data_transfer_handle;
332 uint8_t transfer_op_flag;
333 uint16_t request_count;
334 uint16_t record_change_number;
335} __attribute__((packed));
336
George Liu30b859f2020-01-07 15:03:22 +0800337/** @struct pldm_set_numeric_effecter_value_req
338 *
339 * structure representing SetNumericEffecterValue request packet
340 */
341struct pldm_set_numeric_effecter_value_req {
342 uint16_t effecter_id;
343 uint8_t effecter_data_size;
344 uint8_t effecter_value[1];
345} __attribute__((packed));
346
Jolie Ku3557bad2020-03-02 16:22:57 +0800347/** @struct pldm_get_state_sensor_readings_req
348 *
349 * Structure representing PLDM get state sensor readings request.
350 */
351struct pldm_get_state_sensor_readings_req {
352 uint16_t sensor_id;
353 bitfield8_t sensor_rearm;
354 uint8_t reserved;
355} __attribute__((packed));
356
357/** @struct pldm_get_state_sensor_readings_resp
358 *
359 * Structure representing PLDM get state sensor readings response.
360 */
361struct pldm_get_state_sensor_readings_resp {
362 uint8_t completion_code;
363 uint8_t comp_sensor_count;
364 get_sensor_state_field field[1];
365} __attribute__((packed));
366
Zahed Hossaind4abab12020-02-06 03:36:43 -0600367/** @struct pldm_sensor_event
368 *
369 * structure representing sensorEventClass
370 */
371struct pldm_sensor_event_data {
372 uint16_t sensor_id;
373 uint8_t sensor_event_class_type;
374 uint8_t event_class[1];
375} __attribute__((packed));
376
377/** @struct pldm_state_sensor_state
378 *
379 * structure representing sensorEventClass for stateSensorState
380 */
381struct pldm_sensor_event_state_sensor_state {
382 uint8_t sensor_offset;
383 uint8_t event_state;
384 uint8_t previous_event_state;
385} __attribute__((packed));
386
387/** @struct pldm_sensor_event_numeric_sensor_state
388 *
389 * structure representing sensorEventClass for stateSensorState
390 */
391struct pldm_sensor_event_numeric_sensor_state {
392 uint8_t event_state;
393 uint8_t previous_event_state;
394 uint8_t sensor_data_size;
395 uint8_t present_reading[1];
396} __attribute__((packed));
397
398/** @struct pldm_sensor_event_sensor_op_state
399 *
400 * structure representing sensorEventClass for SensorOpState
401 */
402struct pldm_sensor_event_sensor_op_state {
403 uint8_t present_op_state;
404 uint8_t previous_op_state;
405} __attribute__((packed));
406
407/** @struct pldm_platform_event_message_req
408 *
409 * structure representing PlatformEventMessage command request data
410 */
411struct pldm_platform_event_message_req {
412 uint8_t format_version;
413 uint8_t tid;
414 uint8_t event_class;
415 uint8_t event_data[1];
416} __attribute__((packed));
417
418/** @struct pldm_platform_event_message_response
419 *
420 * structure representing PlatformEventMessage command response data
421 */
422struct pldm_platform_event_message_resp {
423 uint8_t completion_code;
Pavithra Barithaya2ea1f072020-04-03 09:30:23 -0500424 uint8_t platform_event_status;
Zahed Hossaind4abab12020-02-06 03:36:43 -0600425} __attribute__((packed));
426
427/** @struct pldm_pdr_repository_chg_event_data
428 *
429 * structure representing pldmPDRRepositoryChgEvent class eventData
430 */
431struct pldm_pdr_repository_chg_event_data {
432 uint8_t event_data_format;
433 uint8_t number_of_change_records;
434 uint8_t change_records[1];
435} __attribute__((packed));
436
437/** @struct pldm_pdr_repository_chg_event_change_record_data
438 *
439 * structure representing pldmPDRRepositoryChgEvent class eventData's change
440 * record data
441 */
442struct pldm_pdr_repository_change_record_data {
443 uint8_t event_data_operation;
444 uint8_t number_of_change_entries;
445 uint32_t change_entry[1];
446} __attribute__((packed));
447
Jolie Ku6787f172020-03-19 11:15:53 +0800448/** @struct pldm_get_numeric_effecter_value_req
449 *
450 * structure representing GetNumericEffecterValue request packet
451 */
452struct pldm_get_numeric_effecter_value_req {
453 uint16_t effecter_id;
454} __attribute__((packed));
455
456/** @struct pldm_get_numeric_effecter_value_resp
457 *
458 * structure representing GetNumericEffecterValue response packet
459 */
460struct pldm_get_numeric_effecter_value_resp {
461 uint8_t completion_code;
462 uint8_t effecter_data_size;
463 uint8_t effecter_oper_state;
464 uint8_t pending_and_present_values[1];
465} __attribute__((packed));
466
Sampa Misra0db1dfa2019-03-19 00:15:31 -0500467/* Responder */
468
George Liu30b859f2020-01-07 15:03:22 +0800469/* SetNumericEffecterValue */
470
471/** @brief Decode SetNumericEffecterValue request data
472 *
473 * @param[in] msg - Request message
474 * @param[in] payload_length - Length of request message payload
475 * @param[out] effecter_id - used to identify and access the effecter
476 * @param[out] effecter_data_size - The bit width and format of the setting
477 * value for the effecter.
478 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
479 * @param[out] effecter_value - The setting value of numeric effecter being
480 * requested.
481 * @return pldm_completion_codes
482 */
483int decode_set_numeric_effecter_value_req(const struct pldm_msg *msg,
484 size_t payload_length,
485 uint16_t *effecter_id,
486 uint8_t *effecter_data_size,
487 uint8_t *effecter_value);
488
489/** @brief Create a PLDM response message for SetNumericEffecterValue
490 *
491 * @param[in] instance_id - Message's instance id
492 * @param[in] completion_code - PLDM completion code
493 * @param[out] msg - Message will be written to this
494 * @param[in] payload_length - Length of request message payload
495 * @return pldm_completion_codes
496 * @note Caller is responsible for memory alloc and dealloc of param
497 * 'msg.body.payload'
498 */
499int encode_set_numeric_effecter_value_resp(uint8_t instance_id,
500 uint8_t completion_code,
501 struct pldm_msg *msg,
502 size_t payload_length);
503
Sampa Misra0db1dfa2019-03-19 00:15:31 -0500504/* SetStateEffecterStates */
505
506/** @brief Create a PLDM response message for SetStateEffecterStates
507 *
508 * @param[in] instance_id - Message's instance id
509 * @param[in] completion_code - PLDM completion code
510 * @param[out] msg - Message will be written to this
511 * @return pldm_completion_codes
512 * @note Caller is responsible for memory alloc and dealloc of param
513 * 'msg.body.payload'
514 */
515
516int encode_set_state_effecter_states_resp(uint8_t instance_id,
517 uint8_t completion_code,
518 struct pldm_msg *msg);
519
520/** @brief Decode SetStateEffecterStates request data
521 *
Zahed Hossain223a73d2019-07-04 12:46:18 -0500522 * @param[in] msg - Request message
vkaverapa6575b82019-04-03 05:33:52 -0500523 * @param[in] payload_length - Length of request message payload
Sampa Misra0db1dfa2019-03-19 00:15:31 -0500524 * @param[out] effecter_id - used to identify and access the effecter
525 * @param[out] comp_effecter_count - number of individual sets of effecter
526 * information. Upto eight sets of state effecter info can be accessed
527 * for a given effecter.
528 * @param[out] field - each unit is an instance of the stateFileld structure
529 * that is used to set the requested state for a particular effecter
530 * within the state effecter. This field holds the starting address of
531 * the stateField values. The user is responsible to allocate the
532 * memory prior to calling this command. Since the state field count is
533 * not known in advance, the user should allocate the maximum size
534 * always, which is 8 in number.
535 * @return pldm_completion_codes
536 */
vkaverapa6575b82019-04-03 05:33:52 -0500537
Zahed Hossain223a73d2019-07-04 12:46:18 -0500538int decode_set_state_effecter_states_req(const struct pldm_msg *msg,
vkaverapa6575b82019-04-03 05:33:52 -0500539 size_t payload_length,
Sampa Misra0db1dfa2019-03-19 00:15:31 -0500540 uint16_t *effecter_id,
541 uint8_t *comp_effecter_count,
542 set_effecter_state_field *field);
543
Sampa Misra7fcfb662019-05-08 13:13:53 -0500544/* GetPDR */
545
546/** @brief Create a PLDM response message for GetPDR
547 *
548 * @param[in] instance_id - Message's instance id
549 * @param[in] completion_code - PLDM completion code
550 * @param[in] next_record_hndl - The recordHandle for the PDR that is next in
551 * the PDR Repository
552 * @param[in] next_data_transfer_hndl - A handle that identifies the next
553 * portion of the PDR data to be transferred, if any
554 * @param[in] transfer_flag - Indicates the portion of PDR data being
555 * transferred
556 * @param[in] resp_cnt - The number of recordData bytes returned in this
557 * response
558 * @param[in] record_data - PDR data bytes of length resp_cnt
559 * @param[in] transfer_crc - A CRC-8 for the overall PDR. This is present only
560 * in the last part of a PDR being transferred
561 * @param[out] msg - Message will be written to this
562 * @return pldm_completion_codes
563 * @note Caller is responsible for memory alloc and dealloc of param
564 * 'msg.payload'
565 */
566int encode_get_pdr_resp(uint8_t instance_id, uint8_t completion_code,
567 uint32_t next_record_hndl,
568 uint32_t next_data_transfer_hndl, uint8_t transfer_flag,
569 uint16_t resp_cnt, const uint8_t *record_data,
570 uint8_t transfer_crc, struct pldm_msg *msg);
571
572/** @brief Decode GetPDR request data
573 *
574 * @param[in] msg - Request message
575 * @param[in] payload_length - Length of request message payload
576 * @param[out] record_hndl - The recordHandle value for the PDR to be retrieved
577 * @param[out] data_transfer_hndl - Handle used to identify a particular
578 * multipart PDR data transfer operation
579 * @param[out] transfer_op_flag - Flag to indicate the first or subsequent
580 * portion of transfer
581 * @param[out] request_cnt - The maximum number of record bytes requested
582 * @param[out] record_chg_num - Used to determine whether the PDR has changed
583 * while PDR transfer is going on
584 * @return pldm_completion_codes
585 */
586
587int decode_get_pdr_req(const struct pldm_msg *msg, size_t payload_length,
588 uint32_t *record_hndl, uint32_t *data_transfer_hndl,
589 uint8_t *transfer_op_flag, uint16_t *request_cnt,
590 uint16_t *record_chg_num);
591
Jolie Ku3557bad2020-03-02 16:22:57 +0800592/* GetStateSensorReadings */
593
594/** @brief Decode GetStateSensorReadings request data
595 *
596 * @param[in] msg - Request message
597 * @param[in] payload_length - Length of request message payload
598 * @param[out] sensor_id - used to identify and access the simple or composite
599 * sensor
600 * @param[out] sensor_rearm - Each bit location in this field corresponds to a
601 * particular sensor within the state sensor, where bit [0] corresponds
602 * to the first state sensor (sensor offset 0) and bit [7] corresponds
603 * to the eighth sensor (sensor offset 7), sequentially.
604 * @param[out] reserved - value: 0x00
605 * @return pldm_completion_codes
606 */
607
608int decode_get_state_sensor_readings_req(const struct pldm_msg *msg,
609 size_t payload_length,
610 uint16_t *sensor_id,
611 bitfield8_t *sensor_rearm,
612 uint8_t *reserved);
613
614/** @brief Encode GetStateSensorReadings response data
615 *
616 * @param[in] instance_id - Message's instance id
617 * @param[in] completion_code - PLDM completion code
618 * @param[out] comp_sensor_count - The number of individual sets of sensor
619 * information that this command accesses
620 * @param[out] field - Each stateField is an instance of a stateField structure
621 * that is used to return the present operational state setting and the
622 * present state and event state for a particular set of sensor
623 * information contained within the state sensor
624 * @param[out] msg - Message will be written to this
625 * @return pldm_completion_codes
626 */
627
628int encode_get_state_sensor_readings_resp(uint8_t instance_id,
629 uint8_t completion_code,
630 uint8_t comp_sensor_count,
631 get_sensor_state_field *field,
632 struct pldm_msg *msg);
633
Jolie Ku6787f172020-03-19 11:15:53 +0800634/* GetNumericEffecterValue */
635
636/** @brief Decode GetNumericEffecterValue request data
637 *
638 * @param[in] msg - Request message
639 * @param[in] payload_length - Length of request message payload
640 * @param[out] effecter_id - used to identify and access the effecter
641 * @return pldm_completion_codes
642 */
643int decode_get_numeric_effecter_value_req(const struct pldm_msg *msg,
644 size_t payload_length,
645 uint16_t *effecter_id);
646
647/** @brief Create a PLDM response message for GetNumericEffecterValue
648 *
649 * @param[in] instance_id - Message's instance id
650 * @param[in] completion_code - PLDM completion code
651 * @param[in] effecter_data_size - The bit width and format of the setting
652 * value for the effecter.
653 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
654 * @param[in] effecter_oper_state - The state of the effecter itself
655 * @param[in] pending_value - The pending numeric value setting of the
656 * effecter. The effecterDataSize field indicates the number of
657 * bits used for this field
658 * @param[in] present_value - The present numeric value setting of the
659 * effecter. The effecterDataSize indicates the number of bits
660 * used for this field
661 * @param[out] msg - Message will be written to this
662 * @param[in] payload_length - Length of request message payload
663 * @return pldm_completion_codes
664 * @note Caller is responsible for memory alloc and dealloc of param
665 * 'msg.payload'
666 */
667int encode_get_numeric_effecter_value_resp(
668 uint8_t instance_id, uint8_t completion_code, uint8_t effecter_data_size,
669 uint8_t effecter_oper_state, uint8_t *pending_value, uint8_t *present_value,
670 struct pldm_msg *msg, size_t payload_length);
671
Sampa Misra7fcfb662019-05-08 13:13:53 -0500672/* Requester */
673
George Liu820a9a52019-11-26 14:43:59 +0800674/* GetPDR */
675
676/** @brief Create a PLDM request message for GetPDR
677 *
678 * @param[in] instance_id - Message's instance id
679 * @param[in] record_hndl - The recordHandle value for the PDR to be retrieved
680 * @param[in] data_transfer_hndl - Handle used to identify a particular
681 * multipart PDR data transfer operation
682 * @param[in] transfer_op_flag - Flag to indicate the first or subsequent
683 * portion of transfer
684 * @param[in] request_cnt - The maximum number of record bytes requested
685 * @param[in] record_chg_num - Used to determine whether the PDR has changed
686 * while PDR transfer is going on
687 * @param[out] msg - Message will be written to this
688 * @param[in] payload_length - Length of request message payload
689 * @return pldm_completion_codes
690 * @note Caller is responsible for memory alloc and dealloc of param
691 * 'msg.payload'
692 */
693int encode_get_pdr_req(uint8_t instance_id, uint32_t record_hndl,
694 uint32_t data_transfer_hndl, uint8_t transfer_op_flag,
695 uint16_t request_cnt, uint16_t record_chg_num,
696 struct pldm_msg *msg, size_t payload_length);
697
698/** @brief Decode GetPDR response data
699 *
George Liu684a7162019-12-06 15:10:52 +0800700 * Note:
701 * * If the return value is not PLDM_SUCCESS, it represents a
702 * transport layer error.
703 * * If the completion_code value is not PLDM_SUCCESS, it represents a
704 * protocol layer error and all the out-parameters are invalid.
705 *
George Liu820a9a52019-11-26 14:43:59 +0800706 * @param[in] msg - Request message
707 * @param[in] payload_length - Length of request message payload
708 * @param[out] completion_code - PLDM completion code
709 * @param[out] next_record_hndl - The recordHandle for the PDR that is next in
710 * the PDR Repository
711 * @param[out] next_data_transfer_hndl - A handle that identifies the next
712 * portion of the PDR data to be transferred, if any
713 * @param[out] transfer_flag - Indicates the portion of PDR data being
714 * transferred
715 * @param[out] resp_cnt - The number of recordData bytes returned in this
716 * response
Zach Clark3dba2bf2020-03-31 10:58:03 -0500717 * @param[out] record_data - PDR data bytes of length resp_cnt, or NULL to
718 * skip the copy and place the actual length in resp_cnt.
George Liu820a9a52019-11-26 14:43:59 +0800719 * @param[in] record_data_length - Length of record_data
720 * @param[out] transfer_crc - A CRC-8 for the overall PDR. This is present only
721 * in the last part of a PDR being transferred
722 * @return pldm_completion_codes
723 */
724int decode_get_pdr_resp(const struct pldm_msg *msg, size_t payload_length,
725 uint8_t *completion_code, uint32_t *next_record_hndl,
726 uint32_t *next_data_transfer_hndl,
727 uint8_t *transfer_flag, uint16_t *resp_cnt,
728 uint8_t *record_data, size_t record_data_length,
729 uint8_t *transfer_crc);
730
Sampa Misra7fcfb662019-05-08 13:13:53 -0500731/* SetStateEffecterStates */
732
vkaverap98a2c192019-04-03 05:33:52 -0500733/** @brief Create a PLDM request message for SetStateEffecterStates
734 *
735 * @param[in] instance_id - Message's instance id
736 * @param[in] effecter_id - used to identify and access the effecter
737 * @param[in] comp_effecter_count - number of individual sets of effecter
738 * information. Upto eight sets of state effecter info can be accessed
739 * for a given effecter.
740 * @param[in] field - each unit is an instance of the stateField structure
741 * that is used to set the requested state for a particular effecter
742 * within the state effecter. This field holds the starting address of
743 * the stateField values. The user is responsible to allocate the
744 * memory prior to calling this command. The user has to allocate the
745 * field parameter as sizeof(set_effecter_state_field) *
746 * comp_effecter_count
747 * @param[out] msg - Message will be written to this
748 * @return pldm_completion_codes
749 * @note Caller is responsible for memory alloc and dealloc of param
vkaverapa6575b82019-04-03 05:33:52 -0500750 * 'msg.payload'
vkaverap98a2c192019-04-03 05:33:52 -0500751 */
752
753int encode_set_state_effecter_states_req(uint8_t instance_id,
754 uint16_t effecter_id,
755 uint8_t comp_effecter_count,
756 set_effecter_state_field *field,
757 struct pldm_msg *msg);
758
759/** @brief Decode SetStateEffecterStates response data
George Liu684a7162019-12-06 15:10:52 +0800760 *
761 * Note:
762 * * If the return value is not PLDM_SUCCESS, it represents a
763 * transport layer error.
764 * * If the completion_code value is not PLDM_SUCCESS, it represents a
765 * protocol layer error and all the out-parameters are invalid.
766 *
Zahed Hossain223a73d2019-07-04 12:46:18 -0500767 * @param[in] msg - Request message
vkaverapa6575b82019-04-03 05:33:52 -0500768 * @param[in] payload_length - Length of response message payload
vkaverap98a2c192019-04-03 05:33:52 -0500769 * @param[out] completion_code - PLDM completion code
770 * @return pldm_completion_codes
771 */
Zahed Hossain223a73d2019-07-04 12:46:18 -0500772int decode_set_state_effecter_states_resp(const struct pldm_msg *msg,
vkaverapa6575b82019-04-03 05:33:52 -0500773 size_t payload_length,
vkaverap98a2c192019-04-03 05:33:52 -0500774 uint8_t *completion_code);
George Liu30b859f2020-01-07 15:03:22 +0800775
776/* SetNumericEffecterValue */
777
778/** @brief Create a PLDM request message for SetNumericEffecterValue
779 *
780 * @param[in] instance_id - Message's instance id
781 * @param[in] effecter_id - used to identify and access the effecter
782 * @param[in] effecter_data_size - The bit width and format of the setting
783 * value for the effecter.
784 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
785 * @param[in] effecter_value - The setting value of numeric effecter being
786 * requested.
787 * @param[in] payload_length - Length of request message payload
788 * @param[out] msg - Message will be written to this
789 * @return pldm_completion_codes
790 * @note Caller is responsible for memory alloc and dealloc of param
791 * 'msg.payload'
792 */
793int encode_set_numeric_effecter_value_req(
794 uint8_t instance_id, uint16_t effecter_id, uint8_t effecter_data_size,
795 uint8_t *effecter_value, struct pldm_msg *msg, size_t payload_length);
796
797/** @brief Decode SetNumericEffecterValue response data
798 * @param[in] msg - Request message
799 * @param[in] payload_length - Length of response message payload
800 * @param[out] completion_code - PLDM completion code
801 * @return pldm_completion_codes
802 */
803int decode_set_numeric_effecter_value_resp(const struct pldm_msg *msg,
804 size_t payload_length,
805 uint8_t *completion_code);
806
Jolie Ku3557bad2020-03-02 16:22:57 +0800807/** @brief Create a PLDM request message for GetStateSensorReadings
808 *
809 * @param[in] instance_id - Message's instance id
810 * @param[in] sensor_id - used to identify and access the simple or composite
811 * sensor
812 * @param[in] sensorRearm - Each bit location in this field corresponds to a
813 * particular sensor within the state sensor, where bit [0] corresponds
814 * to the first state sensor (sensor offset 0) and bit [7] corresponds
815 * to the eighth sensor (sensor offset 7), sequentially
816 * @param[in] reserved - value: 0x00
817 * @param[out] msg - Message will be written to this
818 * @return pldm_completion_codes
819 * @note Caller is responsible for memory alloc and dealloc of param
820 * 'msg.payload'
821 */
Jolie Ku3557bad2020-03-02 16:22:57 +0800822int encode_get_state_sensor_readings_req(uint8_t instance_id,
823 uint16_t sensor_id,
824 bitfield8_t sensor_rearm,
825 uint8_t reserved,
826 struct pldm_msg *msg);
827
828/** @brief Decode GetStateSensorReadings response data
829 *
830 * @param[in] msg - Request message
831 * @param[in] payload_length - Length of response message payload
832 * @param[out] completion_code - PLDM completion code
833 * @param[in,out] comp_sensor_count - The number of individual sets of sensor
834 * information that this command accesses
835 * @param[out] field - Each stateField is an instance of a stateField structure
836 * that is used to return the present operational state setting and the
837 * present state and event state for a particular set of sensor
838 * information contained within the state sensor
839 * @return pldm_completion_codes
840 */
841
842int decode_get_state_sensor_readings_resp(const struct pldm_msg *msg,
843 size_t payload_length,
844 uint8_t *completion_code,
845 uint8_t *comp_sensor_count,
846 get_sensor_state_field *field);
847
Zahed Hossaind4abab12020-02-06 03:36:43 -0600848/* PlatformEventMessage */
849
850/** @brief Decode PlatformEventMessage request data
851 * @param[in] msg - Request message
852 * @param[in] payload_length - Length of response message payload
853 * @param[out] format_version - Version of the event format
854 * @param[out] tid - Terminus ID for the terminus that originated the event
855 * message
856 * @param[out] event_class - The class of event being sent
857 * @param[out] event_data_offset - Offset where the event data should be read
858 * from pldm msg
859 * @return pldm_completion_codes
860 */
861int decode_platform_event_message_req(const struct pldm_msg *msg,
862 size_t payload_length,
863 uint8_t *format_version, uint8_t *tid,
864 uint8_t *event_class,
865 size_t *event_data_offset);
866
867/** @brief Encode PlatformEventMessage response data
868 * @param[in] instance_id - Message's instance id
869 * @param[in] completion_code - PLDM completion code
Pavithra Barithaya2ea1f072020-04-03 09:30:23 -0500870 * @param[in] platform_event_status - Response status of the event message
871 * command
Zahed Hossaind4abab12020-02-06 03:36:43 -0600872 * @param[out] msg - Message will be written to this
873 * @return pldm_completion_codes
874 * @note Caller is responsible for memory alloc and dealloc of param
875 * 'msg.payload'
876 */
877int encode_platform_event_message_resp(uint8_t instance_id,
Pavithra Barithaya2ea1f072020-04-03 09:30:23 -0500878 uint8_t completion_code,
879 uint8_t platform_event_status,
Zahed Hossaind4abab12020-02-06 03:36:43 -0600880 struct pldm_msg *msg);
881
Pavithra Barithaya35f2b2c2020-04-08 01:35:56 -0500882/** @brief Encode PlatformEventMessage request data
883 * @param[in] instance_id - Message's instance id
884 * @param[in] format_version - Version of the event format
885 * @param[in] tid - Terminus ID for the terminus that originated the event
886 * message
887 * @param[in] event_class - The class of event being sent
888 * @param[in] event_data - the event data should be read from pldm msg
889 * @param[in] event_data_length - Length of the event data
890 * @param[out] msg - Request message
891 * @return pldm_completion_codes
892 * @note Caller is responsible for memory alloc and dealloc of param
893 * 'msg.payload'
894 */
895int encode_platform_event_message_req(uint8_t instance_id,
896 uint8_t format_version, uint8_t tid,
897 uint8_t event_class,
898 const uint8_t *event_data,
899 size_t event_data_length,
900 struct pldm_msg *msg);
901
902/** @brief Decode PlatformEventMessage response data
903 * @param[in] msg - Request message
904 * @param[in] payload_length - Length of Response message payload
905 * @param[out] completion_code - PLDM completion code
906 * @param[out] platform_event_status - Response status of the event message
907 * command
908 * @return pldm_completion_codes
909 */
910int decode_platform_event_message_resp(const struct pldm_msg *msg,
911 size_t payload_length,
912 uint8_t *completion_code,
913 uint8_t *platform_event_status);
914
Zahed Hossain1c861712020-03-04 08:55:19 -0600915/** @brief Decode sensorEventData response data
916 *
917 * @param[in] event_data - event data from the response message
918 * @param[in] event_data_length - length of the event data
919 * @param[out] sensor_id - sensorID value of the sensor
920 * @param[out] sensor_event_class_type - Type of sensor event class
921 * @param[out] event_class_data_offset - Offset where the event class data
922 * should be read from event data
923 * @return pldm_completion_codes
924 * @note Caller is responsible for memory alloc and dealloc of param
925 * 'event_data'
926 */
927int decode_sensor_event_data(const uint8_t *event_data,
928 size_t event_data_length, uint16_t *sensor_id,
929 uint8_t *sensor_event_class_type,
930 size_t *event_class_data_offset);
931
932/** @brief Decode sensorOpState response data
933 *
934 * @param[in] sensor_data - sensor_data for sensorEventClass = sensorOpState
935 * @param[in] sensor_data_length - Length of sensor_data
936 * @param[out] present_op_state - The sensorOperationalState value from the
937 * state change that triggered the event message
938 * @param[out] previous_op_state - The sensorOperationalState value for the
939 * state from which the present state was entered
940 * @return pldm_completion_codes
941 * @note Caller is responsible for memory alloc and dealloc of param
942 * 'sensor_data'
943 */
944int decode_sensor_op_data(const uint8_t *sensor_data, size_t sensor_data_length,
945 uint8_t *present_op_state,
946 uint8_t *previous_op_state);
947
948/** @brief Decode stateSensorState response data
949 *
950 * @param[in] sensor_data - sensor_data for sensorEventClass = stateSensorState
951 * @param[in] sensor_data_length - Length of sensor_data
952 * @param[out] sensor_offset - Identifies which state sensor within a composite
953 * state sensor the event is being returned for
954 * @param[out] event_state - The event state value from the state change that
955 * triggered the event message
956 * @param[out] previous_event_state - The event state value for the state from
957 * which the present event state was entered
958 * @return pldm_completion_codes
959 * @note Caller is responsible for memory alloc and dealloc of param
960 * 'sensor_data'
961 */
962int decode_state_sensor_data(const uint8_t *sensor_data,
963 size_t sensor_data_length, uint8_t *sensor_offset,
964 uint8_t *event_state,
965 uint8_t *previous_event_state);
966
967/** @brief Decode numericSensorState response data
968 *
969 * @param[in] sensor_data - sensor_data for sensorEventClass =
970 * numericSensorState
971 * @param[in] sensor_data_length - Length of sensor_data
972 * @param[out] event_state - The eventState value from the state change that
973 * triggered the event message
974 * @param[out] previous_event_state - The eventState value for the state from
975 * which the present state was entered
976 * @param[out] sensor_data_size - The bit width and format of reading and
977 * threshold values that the sensor returns
978 * @param[out] present_reading - The present value indicated by the sensor
979 * @return pldm_completion_codes
980 * @note Caller is responsible for memory alloc and dealloc of param
981 * 'sensor_data'
982 */
983int decode_numeric_sensor_data(const uint8_t *sensor_data,
984 size_t sensor_data_length, uint8_t *event_state,
985 uint8_t *previous_event_state,
986 uint8_t *sensor_data_size,
987 uint32_t *present_reading);
988
Jolie Ku6787f172020-03-19 11:15:53 +0800989/* GetNumericEffecterValue */
990
991/** @brief Create a PLDM request message for GetNumericEffecterValue
992 *
993 * @param[in] instance_id - Message's instance id
994 * @param[in] effecter_id - used to identify and access the effecter
995 * @param[out] msg - Message will be written to this
996 * @return pldm_completion_codes
997 * @note Caller is responsible for memory alloc and dealloc of param
998 * 'msg.payload'
999 */
1000int encode_get_numeric_effecter_value_req(uint8_t instance_id,
1001 uint16_t effecter_id,
1002 struct pldm_msg *msg);
1003
1004/** @brief Create a PLDM response message for GetNumericEffecterValue
1005 *
1006 * @param[in] msg - Request message
1007 * @param[in] payload_length - Length of request message payload
1008 * @param[out] completion_code - PLDM completion code
1009 * @param[out] effecter_data_size - The bit width and format of the setting
1010 * value for the effecter.
1011 * value:{uint8,sint8,uint16,sint16,uint32,sint32}
1012 * @param[out] effecter_oper_state - The state of the effecter itself
1013 * @param[out] pending_value - The pending numeric value setting of the
1014 * effecter. The effecterDataSize field indicates the number of
1015 * bits used for this field
1016 * @param[out] present_value - The present numeric value setting of the
1017 * effecter. The effecterDataSize indicates the number of bits
1018 * used for this field
1019 * @return pldm_completion_codes
1020 */
1021int decode_get_numeric_effecter_value_resp(
1022 const struct pldm_msg *msg, size_t payload_length, uint8_t *completion_code,
1023 uint8_t *effecter_data_size, uint8_t *effecter_oper_state,
1024 uint8_t *pending_value, uint8_t *present_value);
1025
Zahed Hossain9be087c2020-04-02 02:26:41 -05001026/** @brief Decode pldmPDRRepositoryChgEvent response data
1027 *
1028 * @param[in] event_data - eventData for pldmPDRRepositoryChgEvent
1029 * @param[in] event_data_size - Length of event_data
1030 * @param[out] event_data_format - This field indicates if the changedRecords
1031 * are of PDR Types or PDR Record Handles
1032 * @param[out] number_of_change_records - The number of changeRecords following
1033 * this field
1034 * @param[out] change_record_data_offset - Identifies where changeRecord data
1035 * is located within event_data
1036 * @return pldm_completion_codes
1037 * @note Caller is responsible for memory alloc and dealloc of param
1038 * 'event_data'
1039 */
1040int decode_pldm_pdr_repository_chg_event_data(
1041 const uint8_t *event_data, size_t event_data_size,
1042 uint8_t *event_data_format, uint8_t *number_of_change_records,
1043 size_t *change_record_data_offset);
1044
1045/** @brief Decode PldmPDRRepositoryChangeRecord response data
1046 *
1047 * @param[in] change_record_data - changeRecordData for
1048 * pldmPDRRepositoryChgEvent
1049 * @param[in] change_record_data_size - Length of change_record_data
1050 * @param[out] event_data_operation - This field indicates the changeEntries
1051 * operation types
1052 * @param[out] number_of_change_entries - The number of changeEntries following
1053 * this field
1054 * @param[out] change_entry_data_offset - Identifies where changeEntries data
1055 * is located within change_record_data
1056 * @return pldm_completion_codes
1057 * @note Caller is responsible for memory alloc and dealloc of param
1058 * 'change_record_data'
1059 */
1060int decode_pldm_pdr_repository_change_record_data(
1061 const uint8_t *change_record_data, size_t change_record_data_size,
1062 uint8_t *event_data_operation, uint8_t *number_of_change_entries,
1063 size_t *change_entry_data_offset);
1064
Sampa Misra0db1dfa2019-03-19 00:15:31 -05001065#ifdef __cplusplus
1066}
1067#endif
1068
1069#endif /* PLATFORM_H */