RUI3 (RAK Unified Interface 3) - RAK4631
atcmd_queue.h
Go to the documentation of this file.
1 #ifndef ATCMD_QUEUE_H__
2 #define ATCMD_QUEUE_H__
3 
4 #include <stdint.h>
5 #include <stdint.h>
6 #include <string.h>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 typedef struct
13 {
14  char * atcmd_id;
15  size_t permission;
17 
18 #define CONCAT_2(p1, p2) CONCAT(p1, p2)
19 #define CONCAT(p1, p2) p1##p2
20 
21 #define str_(s) #s
22 #define strq(s) str_(s)
23 
24 #if defined(__CC_ARM)
25 #define ATCMD_ITEM(section_name, section_var) \
26  section_var __attribute__ ((section(strq(section_name)))) __attribute__((used))
27 
28 #elif defined(__GNUC__)
29 #define ATCMD_ITEM(section_name, section_var) \
30  section_var __attribute__ ((section("." strq(section_name)))) __attribute__((used))
31 
32 #elif defined(__ICCARM__)
33 #define ATCMD_ITEM(section_name, section_var) \
34  __root section_var @ strq(section_name)
35 #endif
36 
37 #if defined(__CC_ARM)
38 #define ATCMD_SECTION_DEF(section_name, data_type) \
39  extern data_type * CONCAT_2(section_name, $$Base); \
40  extern data_type * CONCAT_2(section_name, $$Limit)
41 #define ATCMD_SECTION_LENGTH(section_name) \
42  CONCAT_2(section_name, $$Limit) - CONCAT_2(section_name, $$Base)
43 
44 #elif defined(__GNUC__)
45 #define ATCMD_SECTION_DEF(section_name, data_type) \
46  extern data_type * CONCAT_2(__start_, section_name); \
47  extern data_type * CONCAT_2(__stop_, section_name)
48 #define ATCMD_SECTION_LENGTH(section_name) \
49  CONCAT_2(__stop_, section_name) - CONCAT_2(__start_, section_name)
50 
51 #elif defined(__ICCARM__)
52 #define ATCMD_SECTION_DEF(section_name, data_type) \
53  _Pragma(strq(section = strq(section_name)));
54 
55 #endif
56 
57 #define ATCMD_QUEUE_SUCCESS 0
58 #define ATCMD_QUEUE_ERROR 1
59 
60 
61 #define UNIQUE_NAME(base) CONCAT_2(base,__COUNTER__)
62 
63 uint32_t atcmd_queue_pop(atcmd_permission_item * p_element,uint32_t offset);
64 
66 
68 
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif // ATCMD_QUEUE_H__
75 
uint32_t atcmd_queue_pop(atcmd_permission_item *p_element, uint32_t offset)
int atcmd_queue_utilization_get()
bool atcmd_queue_is_empty()
size_t permission
Definition: atcmd_queue.h:15
char * atcmd_id
Definition: atcmd_queue.h:14
Definition: atcmd_queue.h:12