MBot Software Library  v1.0
An API documentation to mbot_firmware repository
topic_data.h
1 
10 #include <stdio.h>
11 #include <stdint.h>
12 #include <stdlib.h>
13 #include <pico/stdlib.h>
14 #include <pico/mutex.h>
15 #include <comms/common.h>
16 #include <comms/protocol.h>
17 #include <string.h>
18 #include <search.h>
19 #include <pico/binary_info.h>
20 
21 #ifndef TOPIC_DATA_H
22 #define TOPIC_DATA_H
23 
24 #define MAX_RADIX_DATA 16
25 
26 typedef struct topic_data_val{
27  uint16_t topic_id;
28  void* topic_data;
29  uint16_t topic_len;
30  mutex_t topic_mutex;
32 
33 typedef struct topic_data_entry{
34  struct topic_data_entry* left;
35  struct topic_data_entry* right;
36  struct topic_data_val* value;
38 
39 extern topic_data_entry_t* topic_data_root_node;
40 
41 int comms_init_topic_data(void);
42 int comms_get_topic_data(uint16_t topic_id, void* msg_struct);
43 void comms_set_topic_data(uint16_t topic_id, void* msg_struct, uint16_t message_len);
44 
45 #endif
Definition: topic_data.h:33
Definition: topic_data.h:26