Embedded Wireless Framework
ewf_adapter_seeed_lora_e5.h
Go to the documentation of this file.
1 /************************************************************************/
9 #ifndef __ewf_adapter_seeed_seeed_lora_e5__config__h__included__
10 #define __ewf_adapter_seeed_seeed_lora_e5__config__h__included__
11 
12 #include "ewf_adapter.h"
13 #include "ewf_allocator.h"
14 #include "ewf_interface.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 /************************************************************************/
28 /************************************************************************/
32 /************************************************************************/
44 extern ewf_adapter_api_control ewf_adapter_seeed_lora_e5_api_control;
45 
46 ewf_result ewf_adapter_seeed_lora_e5_start(ewf_adapter* adapter_ptr);
47 ewf_result ewf_adapter_seeed_lora_e5_stop(ewf_adapter* adapter_ptr);
48 
57 ewf_result ewf_adapter_seeed_lora_e5_urc_callback(ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
58 
67 extern ewf_adapter_api_info ewf_adapter_seeed_lora_e5_api_info;
68 
69 ewf_result ewf_adapter_seeed_lora_e5_info(ewf_adapter* adapter_ptr);
70 
73 /******************************************************************************
74  *
75  * Internal data
76  *
77  ******************************************************************************/
78 
87 {
88  int dummy;
89 
91 
100 #ifdef EWF_PARAMETER_CHECKING
101 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_HEADER(adapter_ptr) \
102 do { \
103 (adapter_ptr)->struct_magic = EWF_ADAPTER_STRUCT_MAGIC; \
104 (adapter_ptr)->struct_size = EWF_ADAPTER_STRUCT_SIZE; \
105 (adapter_ptr)->struct_version = EWF_ADAPTER_VERSION; \
106 (adapter_ptr)->struct_type = EWF_ADAPTER_TYPE_SEEED_LORA_E5; \
107 } while(0)
108 #else
109 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_HEADER(adapter_ptr)
110 #endif /* EWF_PARAMETER_CHECKING */
111 
112 #if EWF_ADAPTER_SEEED_LORA_E5_TCP_ENABLED
113 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_TCP_API(adapter_ptr) \
114 do { \
115 adapter_ptr->tcp_api_ptr = &ewf_adapter_seeed_lora_e5_api_tcp; \
116 } while(0)
117 #else
118 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_TCP_API(adapter_ptr)
119 #endif /* EWF_ADAPTER_SEEED_LORA_E5_TCP_ENABLED */
120 
121 #if EWF_ADAPTER_SEEED_LORA_E5_UDP_ENABLED
122 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_UDP_API(adapter_ptr) \
123 do { \
124 adapter_ptr->udp_api_ptr = &ewf_adapter_seeed_lora_e5_api_udp; \
125 } while(0)
126 #else
127 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_UDP_API(adapter_ptr)
128 #endif /* EWF_ADAPTER_SEEED_LORA_E5_UDP_ENABLED */
129 
130 #if EWF_ADAPTER_SEEED_LORA_E5_TLS_BASIC_ENABLED
131 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_TLS_BASIC_API(adapter_ptr) \
132 do { \
133 adapter_ptr->tls_basic_api_ptr = &ewf_adapter_seeed_lora_e5_api_tls_basic; \
134 } while(0)
135 #else
136 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_TLS_BASIC_API(adapter_ptr)
137 #endif /* EWF_ADAPTER_SEEED_LORA_E5_TLS_BASIC_ENABLED */
138 
139 #if EWF_ADAPTER_SEEED_LORA_E5_MQTT_BASIC_ENABLED
140 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_MQTT_BASIC_API(adapter_ptr) \
141 do { \
142 adapter_ptr->mqtt_basic_api_ptr = &ewf_adapter_seeed_lora_e5_api_mqtt_basic; \
143 } while(0)
144 #else
145 #define EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_MQTT_BASIC_API(adapter_ptr)
146 #endif /* EWF_ADAPTER_SEEED_LORA_E5_MQTT_BASIC_ENABLED */
147 
156 #define EWF_ADAPTER_SEEED_LORA_E5_STATIC_DECLARE(adapter_ptr, adapter_name_symb, message_allocator_ptr_param, data_allocator_ptr_param, interface_ptr_param) \
157 do { \
158 static ewf_adapter_seeed_lora_e5 ewf_adapter_seeed_lora_e5__implementation__##adapter_name_symb = {0}; \
159 static ewf_adapter ewf_adapter_seeed_lora_e5__##adapter_name_symb = {0}; \
160 interface_ptr_param->message_allocator_ptr = message_allocator_ptr_param; \
161 interface_ptr_param->data_allocator_ptr = data_allocator_ptr_param; \
162 interface_ptr_param->urc_callback = ewf_adapter_seeed_lora_e5_urc_callback; \
163 ewf_adapter_seeed_lora_e5__##adapter_name_symb.interface_ptr = interface_ptr_param; \
164 ewf_adapter_seeed_lora_e5__##adapter_name_symb.implementation_ptr = &(ewf_adapter_seeed_lora_e5__implementation__##adapter_name_symb); \
165 adapter_ptr = &(ewf_adapter_seeed_lora_e5__##adapter_name_symb); \
166 interface_ptr_param->adapter_ptr = adapter_ptr; \
167 EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_HEADER(adapter_ptr); \
168 ewf_adapter_seeed_lora_e5__##adapter_name_symb.control_api_ptr = &ewf_adapter_seeed_lora_e5_api_control; \
169 ewf_adapter_seeed_lora_e5__##adapter_name_symb.info_api_ptr = &ewf_adapter_seeed_lora_e5_api_info; \
170 EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_TCP_API(adapter_ptr); \
171 EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_UDP_API(adapter_ptr); \
172 EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_TLS_BASIC_API(adapter_ptr); \
173 EWF_ADAPTER_SEEED_LORA_E5_INITIALIZE_MQTT_BASIC_API(adapter_ptr); \
174 } while(0)
175 
178 /************************************************************************/
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif /* __ewf_adapter_seeed_seeed_lora_e5__config__h__included__ */
The Embedded Wireless Framework adapter API implementation.
The Embedded Wireless Framework host interface API.
struct _ewf_adapter_seeed_lora_e5 ewf_adapter_seeed_lora_e5
The Seeed LoRa-E5 adapter driver data structure.
enum _ewf_result ewf_result
Success and error result codes specific to the EWF API.
The adapter control API type.
Definition: ewf_adapter_api_control.h:28
Definition: ewf_adapter_api_info.h:26
The Seeed LoRa-E5 adapter driver data structure.
Definition: ewf_adapter_seeed_lora_e5.h:87
The EWF network adapter control structure definition.
Definition: ewf_adapter.h:50
The interface structure definition.
Definition: ewf_interface.h:66