MBot Software Library  v1.0
An API documentation to mbot_firmware repository
listener.h
1 
10 #include <stdio.h>
11 #include <stdint.h>
12 #include <stdlib.h>
13 #include <pico/binary_info.h>
14 #include <pico/stdlib.h>
15 #include <pico/stdio_usb.h>
16 #include <pico/mutex.h>
17 #include <comms/common.h>
18 #include <comms/protocol.h>
19 #include <comms/topic_data.h>
20 #include <string.h>
21 #include <search.h>
22 
23 #ifndef LISTENER_H
24 #define LISTENER_H
31 void comms_listener_loop(void);
32 
39 int read_header(uint8_t* header_data);
40 
47 int validate_header(uint8_t* header_data);
48 
58 int read_message(uint8_t* header_data, uint8_t* msg_data_serialized, uint16_t message_len, char* topic_msg_data_checksum);
59 
69 int validate_message(uint8_t* header_data, uint8_t* msg_data_serialized, uint16_t message_len, char topic_msg_data_checksum);
70 
71 
72 #endif
int read_message(uint8_t *header_data, uint8_t *msg_data_serialized, uint16_t message_len, char *topic_msg_data_checksum)
Read a message from the communication interface.
Definition: listener.c:26
int validate_header(uint8_t *header_data)
Validate the integrity of the header data.
Definition: listener.c:17
void comms_listener_loop(void)
Main loop for the communication listener.
Definition: listener.c:51
int validate_message(uint8_t *header_data, uint8_t *msg_data_serialized, uint16_t message_len, char topic_msg_data_checksum)
Validate the integrity of the message data.
Definition: listener.c:39
int read_header(uint8_t *header_data)
Read the header data from the communication interface.
Definition: listener.c:4