14 #include <pico/binary_info.h>
15 #include <pico/stdlib.h>
16 #include <pico/stdio_usb.h>
17 #include <comms/common.h>
24 #define MAX_RADIX_TOPICS 16
26 typedef int (*Deserialize)(uint8_t* src,
void* dest);
27 typedef int (*Serialize)(
void* src, uint8_t* dest);
28 typedef void (*MsgCb)(
void* data);
32 int32_t topic_data_len;
33 Deserialize deserialize_fn;
34 Serialize serialize_fn;
46 int comms_init_protocol(
void);
47 int comms_register_topic(uint16_t topic_id,
48 uint32_t topic_data_len,
49 Deserialize deserialize_fn,
50 Serialize serialize_fn,
53 int comms_generate_packet(uint16_t topic_id,
void* topic_struct, uint8_t** packet_out, uint32_t* packet_len_out);
54 int comms_send_serial(uint8_t* packet_out, uint32_t packet_len);
55 int comms_write_topic_test(uint16_t topic_id,
void* topic_struct);
56 int comms_write_topic(uint16_t topic_id,
void* topic_struct);
Definition: protocol.h:38
Definition: protocol.h:30