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" |
Deepak Kodihalli | 5544ccd | 2020-03-15 23:36:16 -0500 | [diff] [blame] | 12 | #include "pdr.h" |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 13 | |
| 14 | /* Maximum size for request */ |
| 15 | #define PLDM_SET_STATE_EFFECTER_STATES_REQ_BYTES 19 |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 16 | #define PLDM_GET_STATE_SENSOR_READINGS_REQ_BYTES 4 |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 17 | /* Response lengths are inclusive of completion code */ |
| 18 | #define PLDM_SET_STATE_EFFECTER_STATES_RESP_BYTES 1 |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 19 | #define PLDM_GET_STATE_SENSOR_READINGS_RESP_BYTES 34 |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 20 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 21 | #define PLDM_SET_NUMERIC_EFFECTER_VALUE_RESP_BYTES 1 |
| 22 | #define PLDM_SET_NUMERIC_EFFECTER_VALUE_MIN_REQ_BYTES 4 |
| 23 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 24 | #define PLDM_GET_PDR_REQ_BYTES 13 |
| 25 | /* Minimum response length */ |
| 26 | #define PLDM_GET_PDR_MIN_RESP_BYTES 12 |
| 27 | |
Zahed Hossain | d4abab1 | 2020-02-06 03:36:43 -0600 | [diff] [blame] | 28 | /* Minimum length for PLDM PlatformEventMessage request */ |
| 29 | #define PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES 3 |
| 30 | #define PLDM_PLATFORM_EVENT_MESSAGE_STATE_SENSOR_STATE_REQ_BYTES 6 |
| 31 | |
Zahed Hossain | 1c86171 | 2020-03-04 08:55:19 -0600 | [diff] [blame] | 32 | /* Minumum length of senson event data */ |
| 33 | #define PLDM_SENSOR_EVENT_DATA_MIN_LENGTH 5 |
| 34 | #define PLDM_SENSOR_EVENT_SENSOR_OP_STATE_DATA_LENGTH 2 |
| 35 | #define PLDM_SENSOR_EVENT_STATE_SENSOR_STATE_DATA_LENGTH 3 |
| 36 | #define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MIN_DATA_LENGTH 4 |
| 37 | #define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MAX_DATA_LENGTH 7 |
| 38 | #define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_8BIT_DATA_LENGTH 4 |
| 39 | #define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_16BIT_DATA_LENGTH 5 |
| 40 | #define PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_32BIT_DATA_LENGTH 7 |
| 41 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 42 | enum pldm_effecter_data_size { |
| 43 | PLDM_EFFECTER_DATA_SIZE_UINT8, |
| 44 | PLDM_EFFECTER_DATA_SIZE_SINT8, |
| 45 | PLDM_EFFECTER_DATA_SIZE_UINT16, |
| 46 | PLDM_EFFECTER_DATA_SIZE_SINT16, |
| 47 | PLDM_EFFECTER_DATA_SIZE_UINT32, |
| 48 | PLDM_EFFECTER_DATA_SIZE_SINT32 |
| 49 | }; |
| 50 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 51 | enum set_request { PLDM_NO_CHANGE = 0x00, PLDM_REQUEST_SET = 0x01 }; |
| 52 | |
| 53 | enum effecter_state { PLDM_INVALID_VALUE = 0xFF }; |
| 54 | |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 55 | enum sensor_operational_state { |
| 56 | ENABLED = 0x00, |
| 57 | DISABLED = 0x01, |
| 58 | UNAVAILABLE = 0x02, |
| 59 | STATUSUNKNOWN = 0x03, |
| 60 | FAILED = 0x04, |
| 61 | INITIALIZING = 0x05, |
| 62 | SHUTTINGDOWN = 0x06, |
| 63 | INTEST = 0x07 |
| 64 | }; |
| 65 | |
| 66 | enum present_state { |
| 67 | UNKNOWN = 0x0, |
| 68 | NORMAL = 0x01, |
| 69 | WARNING = 0x02, |
| 70 | CRITICAL = 0x03, |
| 71 | FATAL = 0x04, |
| 72 | LOWERWARNING = 0x05, |
| 73 | LOWERCRITICAL = 0x06, |
| 74 | LOWERFATAL = 0x07, |
| 75 | UPPERWARNING = 0x08, |
| 76 | UPPERCRITICAL = 0x09, |
| 77 | UPPERFATAL = 0x0a |
| 78 | }; |
| 79 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 80 | enum pldm_platform_commands { |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 81 | PLDM_GET_STATE_SENSOR_READINGS = 0x21, |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 82 | PLDM_SET_NUMERIC_EFFECTER_VALUE = 0x31, |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 83 | PLDM_SET_STATE_EFFECTER_STATES = 0x39, |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 84 | PLDM_GET_PDR = 0x51, |
Zahed Hossain | d4abab1 | 2020-02-06 03:36:43 -0600 | [diff] [blame] | 85 | PLDM_PLATFORM_EVENT_MESSAGE = 0x0A |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 86 | }; |
| 87 | |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 88 | /** @brief PLDM PDR types |
| 89 | */ |
| 90 | enum pldm_pdr_types { |
| 91 | PLDM_STATE_EFFECTER_PDR = 11, |
Deepak Kodihalli | 0a738f0 | 2020-03-10 01:56:21 -0500 | [diff] [blame] | 92 | PLDM_PDR_ENTITY_ASSOCIATION = 15, |
Deepak Kodihalli | db91467 | 2020-02-07 02:47:45 -0600 | [diff] [blame] | 93 | PLDM_PDR_FRU_RECORD_SET = 20, |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | /** @brief PLDM effecter initialization schemes |
| 97 | */ |
| 98 | enum pldm_effecter_init { |
| 99 | PLDM_NO_INIT, |
| 100 | PLDM_USE_INIT_PDR, |
| 101 | PLDM_ENABLE_EFFECTER, |
| 102 | PLDM_DISABLE_EFECTER |
| 103 | }; |
| 104 | |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 105 | /** @brief PLDM Platform M&C completion codes |
| 106 | */ |
| 107 | enum pldm_platform_completion_codes { |
Sampa Misra | a2fa070 | 2019-05-31 01:28:55 -0500 | [diff] [blame] | 108 | PLDM_PLATFORM_INVALID_EFFECTER_ID = 0x80, |
| 109 | PLDM_PLATFORM_INVALID_STATE_VALUE = 0x81, |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 110 | PLDM_PLATFORM_INVALID_RECORD_HANDLE = 0x82, |
Sampa Misra | a2fa070 | 2019-05-31 01:28:55 -0500 | [diff] [blame] | 111 | PLDM_PLATFORM_SET_EFFECTER_UNSUPPORTED_SENSORSTATE = 0x82, |
Deepak Kodihalli | 557dfb0 | 2019-05-12 13:11:17 +0530 | [diff] [blame] | 112 | }; |
| 113 | |
Zahed Hossain | d4abab1 | 2020-02-06 03:36:43 -0600 | [diff] [blame] | 114 | /** @brief PLDM Event types |
| 115 | */ |
| 116 | enum pldm_event_types { |
| 117 | PLDM_SENSOR_EVENT = 0x00, |
| 118 | PLDM_EFFECTER_EVENT = 0x01, |
| 119 | PLDM_REDFISH_TASK_EXECUTED_EVENT = 0x02, |
| 120 | PLDM_REDFISH_MESSAGE_EVENT = 0x03, |
| 121 | PLDM_PDR_REPOSITORY_CHG_EVENT = 0x04, |
| 122 | PLDM_MESSAGE_POLL_EVENT = 0x05, |
| 123 | PLDM_HEARTBEAT_TIMER_ELAPSED_EVENT = 0x06 |
| 124 | }; |
| 125 | |
| 126 | /** @brief PLDM sensorEventClass states |
| 127 | */ |
| 128 | enum sensor_event_class_states { |
| 129 | PLDM_SENSOR_OP_STATE, |
| 130 | PLDM_STATE_SENSOR_STATE, |
| 131 | PLDM_NUMERIC_SENSOR_STATE |
| 132 | }; |
| 133 | |
| 134 | /** @brief PLDM sensor supported states |
| 135 | */ |
| 136 | enum pldm_sensor_operational_state { |
| 137 | PLDM_SENSOR_ENABLED, |
| 138 | PLDM_SENSOR_DISABLED, |
| 139 | PLDM_SENSOR_UNAVAILABLE, |
| 140 | PLDM_SENSOR_STATUSUNKOWN, |
| 141 | PLDM_SENSOR_FAILED, |
| 142 | PLDM_SENSOR_INITIALIZING, |
| 143 | PLDM_SENSOR_SHUTTINGDOWN, |
| 144 | PLDM_SENSOR_INTEST |
| 145 | }; |
| 146 | |
| 147 | /** @brief PLDM pldmPDRRepositoryChgEvent class eventData format |
| 148 | */ |
| 149 | enum pldm_pdr_repository_chg_event_data_format { |
| 150 | REFRESH_ENTIRE_REPOSITORY, |
| 151 | FORMAT_IS_PDR_TYPES, |
| 152 | FORMAT_IS_PDR_HANDLES |
| 153 | }; |
| 154 | |
Zahed Hossain | 1c86171 | 2020-03-04 08:55:19 -0600 | [diff] [blame] | 155 | /** @brief PLDM NumericSensorStatePresentReading data type |
| 156 | */ |
| 157 | enum pldm_sensor_readings_data_type { |
| 158 | PLDM_SENSOR_DATA_SIZE_UINT8, |
| 159 | PLDM_SENSOR_DATA_SIZE_SINT8, |
| 160 | PLDM_SENSOR_DATA_SIZE_UINT16, |
| 161 | PLDM_SENSOR_DATA_SIZE_SINT16, |
| 162 | PLDM_SENSOR_DATA_SIZE_UINT32, |
| 163 | PLDM_SENSOR_DATA_SIZE_SINT32 |
| 164 | }; |
| 165 | |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 166 | /** @struct pldm_pdr_hdr |
| 167 | * |
| 168 | * Structure representing PLDM common PDR header |
| 169 | */ |
| 170 | struct pldm_pdr_hdr { |
| 171 | uint32_t record_handle; |
| 172 | uint8_t version; |
| 173 | uint8_t type; |
| 174 | uint16_t record_change_num; |
| 175 | uint16_t length; |
| 176 | } __attribute__((packed)); |
| 177 | |
Deepak Kodihalli | 5544ccd | 2020-03-15 23:36:16 -0500 | [diff] [blame] | 178 | /** @struct pldm_pdr_entity_association |
| 179 | * |
| 180 | * Structure representing PLDM Entity Association PDR |
| 181 | */ |
| 182 | struct pldm_pdr_entity_association { |
| 183 | uint16_t container_id; |
| 184 | uint8_t association_type; |
| 185 | pldm_entity container; |
| 186 | uint8_t num_children; |
| 187 | pldm_entity children[1]; |
| 188 | } __attribute__((packed)); |
| 189 | |
Deepak Kodihalli | db91467 | 2020-02-07 02:47:45 -0600 | [diff] [blame] | 190 | /** @struct pldm_pdr_fru_record_set |
| 191 | * |
| 192 | * Structure representing PLDM FRU record set PDR |
| 193 | */ |
| 194 | struct pldm_pdr_fru_record_set { |
| 195 | uint16_t terminus_handle; |
| 196 | uint16_t fru_rsi; |
| 197 | uint16_t entity_type; |
| 198 | uint16_t entity_instance_num; |
| 199 | uint16_t container_id; |
| 200 | } __attribute__((packed)); |
| 201 | |
Deepak Kodihalli | c6e8fb5 | 2019-05-02 08:35:31 -0500 | [diff] [blame] | 202 | /** @struct pldm_state_effecter_pdr |
| 203 | * |
| 204 | * Structure representing PLDM state effecter PDR |
| 205 | */ |
| 206 | struct pldm_state_effecter_pdr { |
| 207 | struct pldm_pdr_hdr hdr; |
| 208 | uint16_t terminus_handle; |
| 209 | uint16_t effecter_id; |
| 210 | uint16_t entity_type; |
| 211 | uint16_t entity_instance; |
| 212 | uint16_t container_id; |
| 213 | uint16_t effecter_semantic_id; |
| 214 | uint8_t effecter_init; |
| 215 | bool8_t has_description_pdr; |
| 216 | uint8_t composite_effecter_count; |
| 217 | uint8_t possible_states[1]; |
| 218 | } __attribute__((packed)); |
| 219 | |
| 220 | /** @struct state_effecter_possible_states |
| 221 | * |
| 222 | * Structure representing state enums for state effecter |
| 223 | */ |
| 224 | struct state_effecter_possible_states { |
| 225 | uint16_t state_set_id; |
| 226 | uint8_t possible_states_size; |
| 227 | bitfield8_t states[1]; |
| 228 | } __attribute__((packed)); |
| 229 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 230 | /** @struct set_effecter_state_field |
| 231 | * |
| 232 | * Structure representing a stateField in SetStateEffecterStates command */ |
| 233 | |
| 234 | typedef struct state_field_for_state_effecter_set { |
| 235 | uint8_t set_request; //!< Whether to change the state |
| 236 | uint8_t effecter_state; //!< Expected state of the effecter |
| 237 | } __attribute__((packed)) set_effecter_state_field; |
| 238 | |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 239 | /** @struct get_sensor_readings_field |
| 240 | * |
| 241 | * Structure representing a stateField in GetStateSensorReadings command */ |
| 242 | |
| 243 | typedef struct state_field_for_get_state_sensor_readings { |
| 244 | uint8_t sensor_op_state; //!< The state of the sensor itself |
| 245 | uint8_t present_state; //!< Return a state value |
| 246 | uint8_t previous_state; //!< The state that the presentState was entered |
| 247 | //! from. This must be different from the |
| 248 | //! present state |
| 249 | uint8_t event_state; //!< Return a state value from a PLDM State Set |
| 250 | //! that is associated with the sensor |
| 251 | } __attribute__((packed)) get_sensor_state_field; |
| 252 | |
Priyanga | 7257fdf | 2019-06-10 01:59:45 -0500 | [diff] [blame] | 253 | /** @struct PLDM_SetStateEffecterStates_Request |
| 254 | * |
| 255 | * Structure representing PLDM set state effecter states request. |
| 256 | */ |
| 257 | struct pldm_set_state_effecter_states_req { |
| 258 | uint16_t effecter_id; |
| 259 | uint8_t comp_effecter_count; |
| 260 | set_effecter_state_field field[8]; |
| 261 | } __attribute__((packed)); |
| 262 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 263 | /** @struct pldm_get_pdr_resp |
| 264 | * |
| 265 | * structure representing GetPDR response packet |
| 266 | * transfer CRC is not part of the structure and will be |
| 267 | * added at the end of last packet in multipart transfer |
| 268 | */ |
| 269 | struct pldm_get_pdr_resp { |
| 270 | uint8_t completion_code; |
| 271 | uint32_t next_record_handle; |
| 272 | uint32_t next_data_transfer_handle; |
| 273 | uint8_t transfer_flag; |
| 274 | uint16_t response_count; |
| 275 | uint8_t record_data[1]; |
| 276 | } __attribute__((packed)); |
| 277 | |
| 278 | /** @struct pldm_get_pdr_req |
| 279 | * |
| 280 | * structure representing GetPDR request packet |
| 281 | */ |
| 282 | struct pldm_get_pdr_req { |
| 283 | uint32_t record_handle; |
| 284 | uint32_t data_transfer_handle; |
| 285 | uint8_t transfer_op_flag; |
| 286 | uint16_t request_count; |
| 287 | uint16_t record_change_number; |
| 288 | } __attribute__((packed)); |
| 289 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 290 | /** @struct pldm_set_numeric_effecter_value_req |
| 291 | * |
| 292 | * structure representing SetNumericEffecterValue request packet |
| 293 | */ |
| 294 | struct pldm_set_numeric_effecter_value_req { |
| 295 | uint16_t effecter_id; |
| 296 | uint8_t effecter_data_size; |
| 297 | uint8_t effecter_value[1]; |
| 298 | } __attribute__((packed)); |
| 299 | |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 300 | /** @struct pldm_get_state_sensor_readings_req |
| 301 | * |
| 302 | * Structure representing PLDM get state sensor readings request. |
| 303 | */ |
| 304 | struct pldm_get_state_sensor_readings_req { |
| 305 | uint16_t sensor_id; |
| 306 | bitfield8_t sensor_rearm; |
| 307 | uint8_t reserved; |
| 308 | } __attribute__((packed)); |
| 309 | |
| 310 | /** @struct pldm_get_state_sensor_readings_resp |
| 311 | * |
| 312 | * Structure representing PLDM get state sensor readings response. |
| 313 | */ |
| 314 | struct pldm_get_state_sensor_readings_resp { |
| 315 | uint8_t completion_code; |
| 316 | uint8_t comp_sensor_count; |
| 317 | get_sensor_state_field field[1]; |
| 318 | } __attribute__((packed)); |
| 319 | |
Zahed Hossain | d4abab1 | 2020-02-06 03:36:43 -0600 | [diff] [blame] | 320 | /** @struct pldm_sensor_event |
| 321 | * |
| 322 | * structure representing sensorEventClass |
| 323 | */ |
| 324 | struct pldm_sensor_event_data { |
| 325 | uint16_t sensor_id; |
| 326 | uint8_t sensor_event_class_type; |
| 327 | uint8_t event_class[1]; |
| 328 | } __attribute__((packed)); |
| 329 | |
| 330 | /** @struct pldm_state_sensor_state |
| 331 | * |
| 332 | * structure representing sensorEventClass for stateSensorState |
| 333 | */ |
| 334 | struct pldm_sensor_event_state_sensor_state { |
| 335 | uint8_t sensor_offset; |
| 336 | uint8_t event_state; |
| 337 | uint8_t previous_event_state; |
| 338 | } __attribute__((packed)); |
| 339 | |
| 340 | /** @struct pldm_sensor_event_numeric_sensor_state |
| 341 | * |
| 342 | * structure representing sensorEventClass for stateSensorState |
| 343 | */ |
| 344 | struct pldm_sensor_event_numeric_sensor_state { |
| 345 | uint8_t event_state; |
| 346 | uint8_t previous_event_state; |
| 347 | uint8_t sensor_data_size; |
| 348 | uint8_t present_reading[1]; |
| 349 | } __attribute__((packed)); |
| 350 | |
| 351 | /** @struct pldm_sensor_event_sensor_op_state |
| 352 | * |
| 353 | * structure representing sensorEventClass for SensorOpState |
| 354 | */ |
| 355 | struct pldm_sensor_event_sensor_op_state { |
| 356 | uint8_t present_op_state; |
| 357 | uint8_t previous_op_state; |
| 358 | } __attribute__((packed)); |
| 359 | |
| 360 | /** @struct pldm_platform_event_message_req |
| 361 | * |
| 362 | * structure representing PlatformEventMessage command request data |
| 363 | */ |
| 364 | struct pldm_platform_event_message_req { |
| 365 | uint8_t format_version; |
| 366 | uint8_t tid; |
| 367 | uint8_t event_class; |
| 368 | uint8_t event_data[1]; |
| 369 | } __attribute__((packed)); |
| 370 | |
| 371 | /** @struct pldm_platform_event_message_response |
| 372 | * |
| 373 | * structure representing PlatformEventMessage command response data |
| 374 | */ |
| 375 | struct pldm_platform_event_message_resp { |
| 376 | uint8_t completion_code; |
| 377 | uint8_t status; |
| 378 | } __attribute__((packed)); |
| 379 | |
| 380 | /** @struct pldm_pdr_repository_chg_event_data |
| 381 | * |
| 382 | * structure representing pldmPDRRepositoryChgEvent class eventData |
| 383 | */ |
| 384 | struct pldm_pdr_repository_chg_event_data { |
| 385 | uint8_t event_data_format; |
| 386 | uint8_t number_of_change_records; |
| 387 | uint8_t change_records[1]; |
| 388 | } __attribute__((packed)); |
| 389 | |
| 390 | /** @struct pldm_pdr_repository_chg_event_change_record_data |
| 391 | * |
| 392 | * structure representing pldmPDRRepositoryChgEvent class eventData's change |
| 393 | * record data |
| 394 | */ |
| 395 | struct pldm_pdr_repository_change_record_data { |
| 396 | uint8_t event_data_operation; |
| 397 | uint8_t number_of_change_entries; |
| 398 | uint32_t change_entry[1]; |
| 399 | } __attribute__((packed)); |
| 400 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 401 | /* Responder */ |
| 402 | |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 403 | /* SetNumericEffecterValue */ |
| 404 | |
| 405 | /** @brief Decode SetNumericEffecterValue request data |
| 406 | * |
| 407 | * @param[in] msg - Request message |
| 408 | * @param[in] payload_length - Length of request message payload |
| 409 | * @param[out] effecter_id - used to identify and access the effecter |
| 410 | * @param[out] effecter_data_size - The bit width and format of the setting |
| 411 | * value for the effecter. |
| 412 | * value:{uint8,sint8,uint16,sint16,uint32,sint32} |
| 413 | * @param[out] effecter_value - The setting value of numeric effecter being |
| 414 | * requested. |
| 415 | * @return pldm_completion_codes |
| 416 | */ |
| 417 | int decode_set_numeric_effecter_value_req(const struct pldm_msg *msg, |
| 418 | size_t payload_length, |
| 419 | uint16_t *effecter_id, |
| 420 | uint8_t *effecter_data_size, |
| 421 | uint8_t *effecter_value); |
| 422 | |
| 423 | /** @brief Create a PLDM response message for SetNumericEffecterValue |
| 424 | * |
| 425 | * @param[in] instance_id - Message's instance id |
| 426 | * @param[in] completion_code - PLDM completion code |
| 427 | * @param[out] msg - Message will be written to this |
| 428 | * @param[in] payload_length - Length of request message payload |
| 429 | * @return pldm_completion_codes |
| 430 | * @note Caller is responsible for memory alloc and dealloc of param |
| 431 | * 'msg.body.payload' |
| 432 | */ |
| 433 | int encode_set_numeric_effecter_value_resp(uint8_t instance_id, |
| 434 | uint8_t completion_code, |
| 435 | struct pldm_msg *msg, |
| 436 | size_t payload_length); |
| 437 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 438 | /* SetStateEffecterStates */ |
| 439 | |
| 440 | /** @brief Create a PLDM response message for SetStateEffecterStates |
| 441 | * |
| 442 | * @param[in] instance_id - Message's instance id |
| 443 | * @param[in] completion_code - PLDM completion code |
| 444 | * @param[out] msg - Message will be written to this |
| 445 | * @return pldm_completion_codes |
| 446 | * @note Caller is responsible for memory alloc and dealloc of param |
| 447 | * 'msg.body.payload' |
| 448 | */ |
| 449 | |
| 450 | int encode_set_state_effecter_states_resp(uint8_t instance_id, |
| 451 | uint8_t completion_code, |
| 452 | struct pldm_msg *msg); |
| 453 | |
| 454 | /** @brief Decode SetStateEffecterStates request data |
| 455 | * |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 456 | * @param[in] msg - Request message |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 457 | * @param[in] payload_length - Length of request message payload |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 458 | * @param[out] effecter_id - used to identify and access the effecter |
| 459 | * @param[out] comp_effecter_count - number of individual sets of effecter |
| 460 | * information. Upto eight sets of state effecter info can be accessed |
| 461 | * for a given effecter. |
| 462 | * @param[out] field - each unit is an instance of the stateFileld structure |
| 463 | * that is used to set the requested state for a particular effecter |
| 464 | * within the state effecter. This field holds the starting address of |
| 465 | * the stateField values. The user is responsible to allocate the |
| 466 | * memory prior to calling this command. Since the state field count is |
| 467 | * not known in advance, the user should allocate the maximum size |
| 468 | * always, which is 8 in number. |
| 469 | * @return pldm_completion_codes |
| 470 | */ |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 471 | |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 472 | int decode_set_state_effecter_states_req(const struct pldm_msg *msg, |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 473 | size_t payload_length, |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 474 | uint16_t *effecter_id, |
| 475 | uint8_t *comp_effecter_count, |
| 476 | set_effecter_state_field *field); |
| 477 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 478 | /* GetPDR */ |
| 479 | |
| 480 | /** @brief Create a PLDM response message for GetPDR |
| 481 | * |
| 482 | * @param[in] instance_id - Message's instance id |
| 483 | * @param[in] completion_code - PLDM completion code |
| 484 | * @param[in] next_record_hndl - The recordHandle for the PDR that is next in |
| 485 | * the PDR Repository |
| 486 | * @param[in] next_data_transfer_hndl - A handle that identifies the next |
| 487 | * portion of the PDR data to be transferred, if any |
| 488 | * @param[in] transfer_flag - Indicates the portion of PDR data being |
| 489 | * transferred |
| 490 | * @param[in] resp_cnt - The number of recordData bytes returned in this |
| 491 | * response |
| 492 | * @param[in] record_data - PDR data bytes of length resp_cnt |
| 493 | * @param[in] transfer_crc - A CRC-8 for the overall PDR. This is present only |
| 494 | * in the last part of a PDR being transferred |
| 495 | * @param[out] msg - Message will be written to this |
| 496 | * @return pldm_completion_codes |
| 497 | * @note Caller is responsible for memory alloc and dealloc of param |
| 498 | * 'msg.payload' |
| 499 | */ |
| 500 | int encode_get_pdr_resp(uint8_t instance_id, uint8_t completion_code, |
| 501 | uint32_t next_record_hndl, |
| 502 | uint32_t next_data_transfer_hndl, uint8_t transfer_flag, |
| 503 | uint16_t resp_cnt, const uint8_t *record_data, |
| 504 | uint8_t transfer_crc, struct pldm_msg *msg); |
| 505 | |
| 506 | /** @brief Decode GetPDR request data |
| 507 | * |
| 508 | * @param[in] msg - Request message |
| 509 | * @param[in] payload_length - Length of request message payload |
| 510 | * @param[out] record_hndl - The recordHandle value for the PDR to be retrieved |
| 511 | * @param[out] data_transfer_hndl - Handle used to identify a particular |
| 512 | * multipart PDR data transfer operation |
| 513 | * @param[out] transfer_op_flag - Flag to indicate the first or subsequent |
| 514 | * portion of transfer |
| 515 | * @param[out] request_cnt - The maximum number of record bytes requested |
| 516 | * @param[out] record_chg_num - Used to determine whether the PDR has changed |
| 517 | * while PDR transfer is going on |
| 518 | * @return pldm_completion_codes |
| 519 | */ |
| 520 | |
| 521 | int decode_get_pdr_req(const struct pldm_msg *msg, size_t payload_length, |
| 522 | uint32_t *record_hndl, uint32_t *data_transfer_hndl, |
| 523 | uint8_t *transfer_op_flag, uint16_t *request_cnt, |
| 524 | uint16_t *record_chg_num); |
| 525 | |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 526 | /* GetStateSensorReadings */ |
| 527 | |
| 528 | /** @brief Decode GetStateSensorReadings request data |
| 529 | * |
| 530 | * @param[in] msg - Request message |
| 531 | * @param[in] payload_length - Length of request message payload |
| 532 | * @param[out] sensor_id - used to identify and access the simple or composite |
| 533 | * sensor |
| 534 | * @param[out] sensor_rearm - Each bit location in this field corresponds to a |
| 535 | * particular sensor within the state sensor, where bit [0] corresponds |
| 536 | * to the first state sensor (sensor offset 0) and bit [7] corresponds |
| 537 | * to the eighth sensor (sensor offset 7), sequentially. |
| 538 | * @param[out] reserved - value: 0x00 |
| 539 | * @return pldm_completion_codes |
| 540 | */ |
| 541 | |
| 542 | int decode_get_state_sensor_readings_req(const struct pldm_msg *msg, |
| 543 | size_t payload_length, |
| 544 | uint16_t *sensor_id, |
| 545 | bitfield8_t *sensor_rearm, |
| 546 | uint8_t *reserved); |
| 547 | |
| 548 | /** @brief Encode GetStateSensorReadings response data |
| 549 | * |
| 550 | * @param[in] instance_id - Message's instance id |
| 551 | * @param[in] completion_code - PLDM completion code |
| 552 | * @param[out] comp_sensor_count - The number of individual sets of sensor |
| 553 | * information that this command accesses |
| 554 | * @param[out] field - Each stateField is an instance of a stateField structure |
| 555 | * that is used to return the present operational state setting and the |
| 556 | * present state and event state for a particular set of sensor |
| 557 | * information contained within the state sensor |
| 558 | * @param[out] msg - Message will be written to this |
| 559 | * @return pldm_completion_codes |
| 560 | */ |
| 561 | |
| 562 | int encode_get_state_sensor_readings_resp(uint8_t instance_id, |
| 563 | uint8_t completion_code, |
| 564 | uint8_t comp_sensor_count, |
| 565 | get_sensor_state_field *field, |
| 566 | struct pldm_msg *msg); |
| 567 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 568 | /* Requester */ |
| 569 | |
George Liu | 820a9a5 | 2019-11-26 14:43:59 +0800 | [diff] [blame] | 570 | /* GetPDR */ |
| 571 | |
| 572 | /** @brief Create a PLDM request message for GetPDR |
| 573 | * |
| 574 | * @param[in] instance_id - Message's instance id |
| 575 | * @param[in] record_hndl - The recordHandle value for the PDR to be retrieved |
| 576 | * @param[in] data_transfer_hndl - Handle used to identify a particular |
| 577 | * multipart PDR data transfer operation |
| 578 | * @param[in] transfer_op_flag - Flag to indicate the first or subsequent |
| 579 | * portion of transfer |
| 580 | * @param[in] request_cnt - The maximum number of record bytes requested |
| 581 | * @param[in] record_chg_num - Used to determine whether the PDR has changed |
| 582 | * while PDR transfer is going on |
| 583 | * @param[out] msg - Message will be written to this |
| 584 | * @param[in] payload_length - Length of request message payload |
| 585 | * @return pldm_completion_codes |
| 586 | * @note Caller is responsible for memory alloc and dealloc of param |
| 587 | * 'msg.payload' |
| 588 | */ |
| 589 | int encode_get_pdr_req(uint8_t instance_id, uint32_t record_hndl, |
| 590 | uint32_t data_transfer_hndl, uint8_t transfer_op_flag, |
| 591 | uint16_t request_cnt, uint16_t record_chg_num, |
| 592 | struct pldm_msg *msg, size_t payload_length); |
| 593 | |
| 594 | /** @brief Decode GetPDR response data |
| 595 | * |
George Liu | 684a716 | 2019-12-06 15:10:52 +0800 | [diff] [blame] | 596 | * Note: |
| 597 | * * If the return value is not PLDM_SUCCESS, it represents a |
| 598 | * transport layer error. |
| 599 | * * If the completion_code value is not PLDM_SUCCESS, it represents a |
| 600 | * protocol layer error and all the out-parameters are invalid. |
| 601 | * |
George Liu | 820a9a5 | 2019-11-26 14:43:59 +0800 | [diff] [blame] | 602 | * @param[in] msg - Request message |
| 603 | * @param[in] payload_length - Length of request message payload |
| 604 | * @param[out] completion_code - PLDM completion code |
| 605 | * @param[out] next_record_hndl - The recordHandle for the PDR that is next in |
| 606 | * the PDR Repository |
| 607 | * @param[out] next_data_transfer_hndl - A handle that identifies the next |
| 608 | * portion of the PDR data to be transferred, if any |
| 609 | * @param[out] transfer_flag - Indicates the portion of PDR data being |
| 610 | * transferred |
| 611 | * @param[out] resp_cnt - The number of recordData bytes returned in this |
| 612 | * response |
| 613 | * @param[out] record_data - PDR data bytes of length resp_cnt |
| 614 | * @param[in] record_data_length - Length of record_data |
| 615 | * @param[out] transfer_crc - A CRC-8 for the overall PDR. This is present only |
| 616 | * in the last part of a PDR being transferred |
| 617 | * @return pldm_completion_codes |
| 618 | */ |
| 619 | int decode_get_pdr_resp(const struct pldm_msg *msg, size_t payload_length, |
| 620 | uint8_t *completion_code, uint32_t *next_record_hndl, |
| 621 | uint32_t *next_data_transfer_hndl, |
| 622 | uint8_t *transfer_flag, uint16_t *resp_cnt, |
| 623 | uint8_t *record_data, size_t record_data_length, |
| 624 | uint8_t *transfer_crc); |
| 625 | |
Sampa Misra | 7fcfb66 | 2019-05-08 13:13:53 -0500 | [diff] [blame] | 626 | /* SetStateEffecterStates */ |
| 627 | |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 628 | /** @brief Create a PLDM request message for SetStateEffecterStates |
| 629 | * |
| 630 | * @param[in] instance_id - Message's instance id |
| 631 | * @param[in] effecter_id - used to identify and access the effecter |
| 632 | * @param[in] comp_effecter_count - number of individual sets of effecter |
| 633 | * information. Upto eight sets of state effecter info can be accessed |
| 634 | * for a given effecter. |
| 635 | * @param[in] field - each unit is an instance of the stateField structure |
| 636 | * that is used to set the requested state for a particular effecter |
| 637 | * within the state effecter. This field holds the starting address of |
| 638 | * the stateField values. The user is responsible to allocate the |
| 639 | * memory prior to calling this command. The user has to allocate the |
| 640 | * field parameter as sizeof(set_effecter_state_field) * |
| 641 | * comp_effecter_count |
| 642 | * @param[out] msg - Message will be written to this |
| 643 | * @return pldm_completion_codes |
| 644 | * @note Caller is responsible for memory alloc and dealloc of param |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 645 | * 'msg.payload' |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 646 | */ |
| 647 | |
| 648 | int encode_set_state_effecter_states_req(uint8_t instance_id, |
| 649 | uint16_t effecter_id, |
| 650 | uint8_t comp_effecter_count, |
| 651 | set_effecter_state_field *field, |
| 652 | struct pldm_msg *msg); |
| 653 | |
| 654 | /** @brief Decode SetStateEffecterStates response data |
George Liu | 684a716 | 2019-12-06 15:10:52 +0800 | [diff] [blame] | 655 | * |
| 656 | * Note: |
| 657 | * * If the return value is not PLDM_SUCCESS, it represents a |
| 658 | * transport layer error. |
| 659 | * * If the completion_code value is not PLDM_SUCCESS, it represents a |
| 660 | * protocol layer error and all the out-parameters are invalid. |
| 661 | * |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 662 | * @param[in] msg - Request message |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 663 | * @param[in] payload_length - Length of response message payload |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 664 | * @param[out] completion_code - PLDM completion code |
| 665 | * @return pldm_completion_codes |
| 666 | */ |
Zahed Hossain | 223a73d | 2019-07-04 12:46:18 -0500 | [diff] [blame] | 667 | int decode_set_state_effecter_states_resp(const struct pldm_msg *msg, |
vkaverap | a6575b8 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 668 | size_t payload_length, |
vkaverap | 98a2c19 | 2019-04-03 05:33:52 -0500 | [diff] [blame] | 669 | uint8_t *completion_code); |
George Liu | 30b859f | 2020-01-07 15:03:22 +0800 | [diff] [blame] | 670 | |
| 671 | /* SetNumericEffecterValue */ |
| 672 | |
| 673 | /** @brief Create a PLDM request message for SetNumericEffecterValue |
| 674 | * |
| 675 | * @param[in] instance_id - Message's instance id |
| 676 | * @param[in] effecter_id - used to identify and access the effecter |
| 677 | * @param[in] effecter_data_size - The bit width and format of the setting |
| 678 | * value for the effecter. |
| 679 | * value:{uint8,sint8,uint16,sint16,uint32,sint32} |
| 680 | * @param[in] effecter_value - The setting value of numeric effecter being |
| 681 | * requested. |
| 682 | * @param[in] payload_length - Length of request message payload |
| 683 | * @param[out] msg - Message will be written to this |
| 684 | * @return pldm_completion_codes |
| 685 | * @note Caller is responsible for memory alloc and dealloc of param |
| 686 | * 'msg.payload' |
| 687 | */ |
| 688 | int encode_set_numeric_effecter_value_req( |
| 689 | uint8_t instance_id, uint16_t effecter_id, uint8_t effecter_data_size, |
| 690 | uint8_t *effecter_value, struct pldm_msg *msg, size_t payload_length); |
| 691 | |
| 692 | /** @brief Decode SetNumericEffecterValue response data |
| 693 | * @param[in] msg - Request message |
| 694 | * @param[in] payload_length - Length of response message payload |
| 695 | * @param[out] completion_code - PLDM completion code |
| 696 | * @return pldm_completion_codes |
| 697 | */ |
| 698 | int decode_set_numeric_effecter_value_resp(const struct pldm_msg *msg, |
| 699 | size_t payload_length, |
| 700 | uint8_t *completion_code); |
| 701 | |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 702 | /** @brief Create a PLDM request message for GetStateSensorReadings |
| 703 | * |
| 704 | * @param[in] instance_id - Message's instance id |
| 705 | * @param[in] sensor_id - used to identify and access the simple or composite |
| 706 | * sensor |
| 707 | * @param[in] sensorRearm - Each bit location in this field corresponds to a |
| 708 | * particular sensor within the state sensor, where bit [0] corresponds |
| 709 | * to the first state sensor (sensor offset 0) and bit [7] corresponds |
| 710 | * to the eighth sensor (sensor offset 7), sequentially |
| 711 | * @param[in] reserved - value: 0x00 |
| 712 | * @param[out] msg - Message will be written to this |
| 713 | * @return pldm_completion_codes |
| 714 | * @note Caller is responsible for memory alloc and dealloc of param |
| 715 | * 'msg.payload' |
| 716 | */ |
Jolie Ku | 3557bad | 2020-03-02 16:22:57 +0800 | [diff] [blame] | 717 | int encode_get_state_sensor_readings_req(uint8_t instance_id, |
| 718 | uint16_t sensor_id, |
| 719 | bitfield8_t sensor_rearm, |
| 720 | uint8_t reserved, |
| 721 | struct pldm_msg *msg); |
| 722 | |
| 723 | /** @brief Decode GetStateSensorReadings response data |
| 724 | * |
| 725 | * @param[in] msg - Request message |
| 726 | * @param[in] payload_length - Length of response message payload |
| 727 | * @param[out] completion_code - PLDM completion code |
| 728 | * @param[in,out] comp_sensor_count - The number of individual sets of sensor |
| 729 | * information that this command accesses |
| 730 | * @param[out] field - Each stateField is an instance of a stateField structure |
| 731 | * that is used to return the present operational state setting and the |
| 732 | * present state and event state for a particular set of sensor |
| 733 | * information contained within the state sensor |
| 734 | * @return pldm_completion_codes |
| 735 | */ |
| 736 | |
| 737 | int decode_get_state_sensor_readings_resp(const struct pldm_msg *msg, |
| 738 | size_t payload_length, |
| 739 | uint8_t *completion_code, |
| 740 | uint8_t *comp_sensor_count, |
| 741 | get_sensor_state_field *field); |
| 742 | |
Zahed Hossain | d4abab1 | 2020-02-06 03:36:43 -0600 | [diff] [blame] | 743 | /* PlatformEventMessage */ |
| 744 | |
| 745 | /** @brief Decode PlatformEventMessage request data |
| 746 | * @param[in] msg - Request message |
| 747 | * @param[in] payload_length - Length of response message payload |
| 748 | * @param[out] format_version - Version of the event format |
| 749 | * @param[out] tid - Terminus ID for the terminus that originated the event |
| 750 | * message |
| 751 | * @param[out] event_class - The class of event being sent |
| 752 | * @param[out] event_data_offset - Offset where the event data should be read |
| 753 | * from pldm msg |
| 754 | * @return pldm_completion_codes |
| 755 | */ |
| 756 | int decode_platform_event_message_req(const struct pldm_msg *msg, |
| 757 | size_t payload_length, |
| 758 | uint8_t *format_version, uint8_t *tid, |
| 759 | uint8_t *event_class, |
| 760 | size_t *event_data_offset); |
| 761 | |
| 762 | /** @brief Encode PlatformEventMessage response data |
| 763 | * @param[in] instance_id - Message's instance id |
| 764 | * @param[in] completion_code - PLDM completion code |
| 765 | * @param[in] status - Response status of the event message command |
| 766 | * @param[out] msg - Message will be written to this |
| 767 | * @return pldm_completion_codes |
| 768 | * @note Caller is responsible for memory alloc and dealloc of param |
| 769 | * 'msg.payload' |
| 770 | */ |
| 771 | int encode_platform_event_message_resp(uint8_t instance_id, |
| 772 | uint8_t completion_code, uint8_t status, |
| 773 | struct pldm_msg *msg); |
| 774 | |
Zahed Hossain | 1c86171 | 2020-03-04 08:55:19 -0600 | [diff] [blame] | 775 | /** @brief Decode sensorEventData response data |
| 776 | * |
| 777 | * @param[in] event_data - event data from the response message |
| 778 | * @param[in] event_data_length - length of the event data |
| 779 | * @param[out] sensor_id - sensorID value of the sensor |
| 780 | * @param[out] sensor_event_class_type - Type of sensor event class |
| 781 | * @param[out] event_class_data_offset - Offset where the event class data |
| 782 | * should be read from event data |
| 783 | * @return pldm_completion_codes |
| 784 | * @note Caller is responsible for memory alloc and dealloc of param |
| 785 | * 'event_data' |
| 786 | */ |
| 787 | int decode_sensor_event_data(const uint8_t *event_data, |
| 788 | size_t event_data_length, uint16_t *sensor_id, |
| 789 | uint8_t *sensor_event_class_type, |
| 790 | size_t *event_class_data_offset); |
| 791 | |
| 792 | /** @brief Decode sensorOpState response data |
| 793 | * |
| 794 | * @param[in] sensor_data - sensor_data for sensorEventClass = sensorOpState |
| 795 | * @param[in] sensor_data_length - Length of sensor_data |
| 796 | * @param[out] present_op_state - The sensorOperationalState value from the |
| 797 | * state change that triggered the event message |
| 798 | * @param[out] previous_op_state - The sensorOperationalState value for the |
| 799 | * state from which the present state was entered |
| 800 | * @return pldm_completion_codes |
| 801 | * @note Caller is responsible for memory alloc and dealloc of param |
| 802 | * 'sensor_data' |
| 803 | */ |
| 804 | int decode_sensor_op_data(const uint8_t *sensor_data, size_t sensor_data_length, |
| 805 | uint8_t *present_op_state, |
| 806 | uint8_t *previous_op_state); |
| 807 | |
| 808 | /** @brief Decode stateSensorState response data |
| 809 | * |
| 810 | * @param[in] sensor_data - sensor_data for sensorEventClass = stateSensorState |
| 811 | * @param[in] sensor_data_length - Length of sensor_data |
| 812 | * @param[out] sensor_offset - Identifies which state sensor within a composite |
| 813 | * state sensor the event is being returned for |
| 814 | * @param[out] event_state - The event state value from the state change that |
| 815 | * triggered the event message |
| 816 | * @param[out] previous_event_state - The event state value for the state from |
| 817 | * which the present event state was entered |
| 818 | * @return pldm_completion_codes |
| 819 | * @note Caller is responsible for memory alloc and dealloc of param |
| 820 | * 'sensor_data' |
| 821 | */ |
| 822 | int decode_state_sensor_data(const uint8_t *sensor_data, |
| 823 | size_t sensor_data_length, uint8_t *sensor_offset, |
| 824 | uint8_t *event_state, |
| 825 | uint8_t *previous_event_state); |
| 826 | |
| 827 | /** @brief Decode numericSensorState response data |
| 828 | * |
| 829 | * @param[in] sensor_data - sensor_data for sensorEventClass = |
| 830 | * numericSensorState |
| 831 | * @param[in] sensor_data_length - Length of sensor_data |
| 832 | * @param[out] event_state - The eventState value from the state change that |
| 833 | * triggered the event message |
| 834 | * @param[out] previous_event_state - The eventState value for the state from |
| 835 | * which the present state was entered |
| 836 | * @param[out] sensor_data_size - The bit width and format of reading and |
| 837 | * threshold values that the sensor returns |
| 838 | * @param[out] present_reading - The present value indicated by the sensor |
| 839 | * @return pldm_completion_codes |
| 840 | * @note Caller is responsible for memory alloc and dealloc of param |
| 841 | * 'sensor_data' |
| 842 | */ |
| 843 | int decode_numeric_sensor_data(const uint8_t *sensor_data, |
| 844 | size_t sensor_data_length, uint8_t *event_state, |
| 845 | uint8_t *previous_event_state, |
| 846 | uint8_t *sensor_data_size, |
| 847 | uint32_t *present_reading); |
| 848 | |
Sampa Misra | 0db1dfa | 2019-03-19 00:15:31 -0500 | [diff] [blame] | 849 | #ifdef __cplusplus |
| 850 | } |
| 851 | #endif |
| 852 | |
| 853 | #endif /* PLATFORM_H */ |