Process a stream of bytes to find a valid GUI command.
More...
Process a stream of bytes to find a valid GUI command.
*
*
- Note
◆ CMD_BUFFER_SIZE
#define CMD_BUFFER_SIZE 20 |
◆ PAYLOAD_SIZE
◆ decode_state_type
Enumerator |
---|
initialize | |
get_payload | |
error_report | |
complete | |
Definition at line 66 of file message_unpack.c.
◆ assign_cmd_code()
static void assign_cmd_code |
( |
void |
| ) |
|
|
static |
◆ byte_get()
static uint8_t byte_get |
( |
uint8_t * |
output_byte | ) |
|
|
static |
◆ decode_result_assign()
static void decode_result_assign |
( |
void |
| ) |
|
|
static |
◆ fn_decode_complete()
static void fn_decode_complete |
( |
void |
| ) |
|
|
static |
sets the completion flag and the next state
- Returns
- cmd_completed state machine end flag
-
next_state index for the state machine
Definition at line 326 of file message_unpack.c.
◆ fn_decode_error_report()
static void fn_decode_error_report |
( |
void |
| ) |
|
|
static |
sets the error flag
- Returns
- cmd_error error flag
-
next_state index for the state machine
Definition at line 316 of file message_unpack.c.
◆ fn_decode_initialize()
static void fn_decode_initialize |
( |
void |
| ) |
|
|
static |
On success returns a buffer with command and payload (if any)
- Returns
- cmd_search_result code for the command currently in process
-
cmd_buffer segment of the current byte stream with command and payload
-
next_state index for the state machine
Definition at line 255 of file message_unpack.c.
◆ fn_decode_payload_get()
static void fn_decode_payload_get |
( |
void |
| ) |
|
|
static |
fills the payload buffer if the command requires it
- Returns
- payload payload buffer
-
next_state index for the state machine
Definition at line 303 of file message_unpack.c.
◆ message_unpack_decode()
FSM to decode a received command If the command is valid, the command code and the payload (if any) are made available for the caller function.
Definition at line 365 of file message_unpack.c.
◆ message_unpack_result()
void message_unpack_result |
( |
uint8_t * |
cmd_code_result, |
|
|
uint8_t * |
sensor_destination, |
|
|
uint8_t * |
cmd_payload |
|
) |
| |
gives access to the command code and the corresponding payload (if any)
- Returns
- cmd_code_result command processed successfully
-
cmd_payload corresponding payload (if any)
Definition at line 336 of file message_unpack.c.
◆ payload_get()
static void payload_get |
( |
uint8_t * |
payload, |
|
|
uint8_t const * |
cmd_buffer, |
|
|
uint8_t |
cmd_tab_idx |
|
) |
| |
|
static |
gets the payload from a command buffer array coming from the GUI
- Parameters
-
[out] | payload | destination of cmd_buffer payload |
[in] | cmd_buffer | source byte array being decoded |
[in] | cmd_tab_idx | recovers the payload size from the look |
Definition at line 284 of file message_unpack.c.
◆ process_next_byte()
static void process_next_byte |
( |
void |
| ) |
|
|
static |
◆ process_stream()
static void process_stream |
( |
void |
| ) |
|
|
static |
◆ search_for_command()
static void search_for_command |
( |
void |
| ) |
|
|
static |
◆ cmd_buffer
◆ cmd_completed
◆ cmd_empty
◆ cmd_error
◆ cmd_input
◆ cmd_search_result
uint8_t cmd_search_result |
◆ continue_process_stream
uint8_t continue_process_stream |
◆ crc_calc
◆ get_char_result
◆ idx_buffer
◆ IRPyro_cmd
◆ max_reads
◆ next_state
◆ op_result
◆ payload_array