IRPyro messaging application
Communications program between IRPyro and IRPyro evaluation tool
|
Go to the documentation of this file.
42 #ifndef MESSAGE_UNPACK
129 #ifdef USE_TEST_BUFFER
131 static uint8_t byte_stream_index = 0;
132 static const uint8_t byte_stream[] =
140 #define CMD_BUFFER_SIZE 20
141 #define PAYLOAD_SIZE 7
161 #ifndef USE_TEST_BUFFER
164 #ifdef USE_TEST_BUFFER
165 static uint8_t byte_stream_index;
167 *output_byte = byte_stream[byte_stream_index];
168 if (byte_stream_index <
sizeof(byte_stream))
220 Micro_controller_delay_ms(10);
367 static void (*
const pf[5])(void) =
static void payload_get(uint8_t *payload, uint8_t const *cmd_buffer, uint8_t cmd_tab_idx)
gets the payload from a command buffer array coming from the GUI
static void fn_decode_complete(void)
sets the completion flag and the next state
static void fn_decode_payload_get(void)
fills the payload buffer if the command requires it
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)
uint8_t continue_process_stream
uint8_t cmd_buffer[CMD_BUFFER_SIZE]
decode_result_type message_unpack_decode(void)
FSM to decode a received command If the command is valid, the command code and the payload (if any) a...
static void assign_cmd_code(void)
on valid crc assigns cmd_code
uint8_t cmd_search_result
uint8_t sensor_destination
static void fn_decode_initialize(void)
On success returns a buffer with command and payload (if any)
decode_state_type next_state
static void fn_decode_error_report(void)
sets the error flag
static void search_for_command(void)
looks for a command in the byte stream
uint8_t payload_array[PAYLOAD_SIZE]
decode_result_type op_result
Decodes a byte stream from the GUI into a data structure applicable to the sensor.
static void process_stream(void)
process stream until crc checks or fails
static uint8_t byte_get(uint8_t *output_byte)
gets a byte from the UART or the byte array
static const struct command_table IRPyro_cmd[CMD_LIST_SIZE]
uint8_t message_getchar(uint8_t *c)
Gets a character from the receive queue.
static void process_next_byte(void)
gets the next byte to process
static void decode_result_assign(void)
evaluates the result