Embedded Wireless Framework
ewf_adapter_thales_exs82_w.h
Go to the documentation of this file.
1 /************************************************************************/
9 #ifndef __ewf_adapter_thales_exs82_w__h__included__
10 #define __ewf_adapter_thales_exs82_w__h__included__
11 
12 #include "ewf_adapter.h"
13 #include "ewf_allocator.h"
14 #include "ewf_interface.h"
15 #include "ewf_adapter_api_modem.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /************************************************************************/
29 #ifndef EWF_ADAPTER_THALES_EXS82_W_FFS_ENABLED
30 #define EWF_ADAPTER_THALES_EXS82_W_FFS_ENABLED (0)
31 #define EWF_ADAPTER_THALES_COMMON_FFS_ENABLED (0)
32 #endif
33 
34 #if 1
35 #define EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED (0)
36 #define EWF_ADAPTER_THALES_COMMON_TLS_BASIC_ENABLED (0)
37 #define EWF_ADAPTER_THALES_EXS82_W_TLS_ENABLED (0)
38 #define EWF_ADAPTER_THALES_COMMON_TLS_ENABLED (0)
39 #else
40 #if !defined(EWF_ADAPTER_THALES_EXS82_W_TLS_ENABLED) && !defined(EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED)
41 #if 1
42 #define EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED (1)
43 #define EWF_ADAPTER_THALES_COMMON_TLS_BASIC_ENABLED (1)
44 #define EWF_ADAPTER_THALES_EXS82_W_TLS_ENABLED (0)
45 #define EWF_ADAPTER_THALES_COMMON_TLS_ENABLED (0)
46 #else
47 #define EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED (0)
48 #define EWF_ADAPTER_THALES_COMMON_TLS_BASIC_ENABLED (0)
49 #define EWF_ADAPTER_THALES_EXS82_W_TLS_ENABLED (1)
50 #define EWF_ADAPTER_THALES_COMMON_TLS_ENABLED (1)
51 #endif
52 #endif
53 #endif
54 
55 #ifndef EWF_ADAPTER_THALES_EXS82_W_TCP_ENABLED
56 #define EWF_ADAPTER_THALES_EXS82_W_TCP_ENABLED (1)
57 #define EWF_ADAPTER_THALES_COMMON_TCP_ENABLED (1)
58 #endif
59 
60 #ifndef EWF_ADAPTER_THALES_EXS82_W_UDP_ENABLED
61 #define EWF_ADAPTER_THALES_EXS82_W_UDP_ENABLED (1)
62 #define EWF_ADAPTER_THALES_COMMON_UDP_ENABLED (1)
63 #endif
64 
65 #if 1
66 #define EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED (0)
67 #define EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED (0)
68 #define EWF_ADAPTER_THALES_EXS82_W_MQTT_ENABLED (0)
69 #define EWF_ADAPTER_THALES_COMMON_MQTT_ENABLED (0)
70 #else
71 #if !defined(EWF_ADAPTER_THALES_EXS82_W_MQTT_ENABLED) && !defined(EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED)
72 #if 1
73 #define EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED (1)
74 #define EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED (1)
75 #define EWF_ADAPTER_THALES_EXS82_W_MQTT_ENABLED (0)
76 #define EWF_ADAPTER_THALES_COMMON_MQTT_ENABLED (0)
77 #else
78 #define EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED (0)
79 #define EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED (0)
80 #define EWF_ADAPTER_THALES_EXS82_W_MQTT_ENABLED (1)
81 #define EWF_ADAPTER_THALES_COMMON_MQTT_ENABLED (1)
82 #endif
83 #endif
84 #endif
85 
86 /************************************************************************/
90 /* Include the Thales Cinterion common header here, to take the above configuration macros into account */
92 
93 /************************************************************************/
105 extern ewf_adapter_api_control ewf_adapter_thales_exs82_w_api_control;
106 
107 ewf_result ewf_adapter_thales_exs82_w_start(ewf_adapter* adapter_ptr);
108 ewf_result ewf_adapter_thales_exs82_w_stop(ewf_adapter* adapter_ptr);
109 
118 ewf_result ewf_adapter_thales_exs82_w_urc_callback(ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
119 
128 #define ewf_adapter_thales_exs82_w_info ewf_adapter_thales_common_info
129 #define ewf_adapter_thales_exs82_w_get_ipv4_address ewf_adapter_thales_common_get_ipv4_address
130 #define ewf_adapter_thales_exs82_w_get_ipv4_netmask ewf_adapter_thales_common_get_ipv4_netmask
131 #define ewf_adapter_thales_exs82_w_get_ipv4_gateway ewf_adapter_thales_common_get_ipv4_gateway
132 #define ewf_adapter_thales_exs82_w_get_ipv4_dns ewf_adapter_thales_common_get_ipv4_dns
133 
142 #define ewf_adapter_thales_exs82_w_context_start ewf_adapter_thales_common_context_start
143 #define ewf_adapter_thales_exs82_w_context_stop ewf_adapter_thales_common_context_stop
144 
145 #define ewf_adapter_thales_exs82_w_context_urc_callback ewf_adapter_thales_common_context_urc_callback
146 
147 #define ewf_adapter_thales_exs82_w_context_activate ewf_adapter_thales_common_context_activate
148 #define ewf_adapter_thales_exs82_w_context_deactivate ewf_adapter_thales_common_context_deactivate
149 #define ewf_adapter_thales_exs82_w_context_configure ewf_adapter_thales_common_context_configure
150 #define ewf_adapter_thales_exs82_w_context_configure_dns ewf_adapter_thales_common_context_configure_dns
151 
160 #if EWF_ADAPTER_THALES_EXS82_W_FFS_ENABLED
161 
162 #define ewf_adapter_thales_exs82_w_ufs_start ewf_adapter_thales_common_ufs_start
163 #define ewf_adapter_thales_exs82_w_ufs_stop ewf_adapter_thales_common_ufs_stop
164 
165 #define ewf_adapter_thales_exs82_w_ufs_urc_callback ewf_adapter_thales_common_ufs_urc_callback
166 
167 #define ewf_adapter_thales_exs82_w_ufs_list ewf_adapter_thales_common_ufs_list
168 #define ewf_adapter_thales_exs82_w_ufs_delete ewf_adapter_thales_common_ufs_delete
169 #define ewf_adapter_thales_exs82_w_ufs_upload ewf_adapter_thales_common_ufs_upload
170 
171 #endif /* EWF_ADAPTER_THALES_EXS82_W_FFS_ENABLED */
172 
181 #if EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED
182 
183 #define ewf_adapter_thales_exs82_w_tls_basic_start ewf_adapter_thales_common_tls_basic_start
184 #define ewf_adapter_thales_exs82_w_tls_basic_stop ewf_adapter_thales_common_tls_basic_stop
185 
186 #define ewf_adapter_thales_exs82_w_tls_basic_urc_callback ewf_adapter_thales_common_tls_basic_urc_callback
187 
188 #define ewf_adapter_thales_exs82_w_tls_basic_init ewf_adapter_thales_common_tls_basic_init
189 #define ewf_adapter_thales_exs82_w_tls_basic_clean ewf_adapter_thales_common_tls_basic_clean
190 
191 #endif /* EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED */
192 
201 #define ewf_adapter_thales_exs82_w_internet_start ewf_adapter_thales_common_internet_start
202 #define ewf_adapter_thales_exs82_w_internet_stop ewf_adapter_thales_common_internet_stop
203 
204 #define ewf_adapter_thales_exs82_w_internet_urc_callback ewf_adapter_thales_common_internet_urc_callback
205 
214 #if EWF_ADAPTER_THALES_EXS82_W_TCP_ENABLED
215 
216 #define ewf_adapter_thales_exs82_w_tcp_open ewf_adapter_thales_common_tcp_open
217 #define ewf_adapter_thales_exs82_w_tcp_close ewf_adapter_thales_common_tcp_close
218 #define ewf_adapter_thales_exs82_w_tcp_control ewf_adapter_thales_common_tcp_control
219 #define ewf_adapter_thales_exs82_w_tcp_set_tls_configuration ewf_adapter_thales_common_tcp_set_tls_configuration
220 #define ewf_adapter_thales_exs82_w_tcp_bind ewf_adapter_thales_common_tcp_bind
221 #define ewf_adapter_thales_exs82_w_tcp_listen ewf_adapter_thales_common_tcp_listen
222 #define ewf_adapter_thales_exs82_w_tcp_accept ewf_adapter_thales_common_tcp_accept
223 #define ewf_adapter_thales_exs82_w_tcp_connect ewf_adapter_thales_common_tcp_connect
224 #define ewf_adapter_thales_exs82_w_tcp_shutdown ewf_adapter_thales_common_tcp_shutdown
225 #define ewf_adapter_thales_exs82_w_tcp_send ewf_adapter_thales_common_tcp_send
226 #define ewf_adapter_thales_exs82_w_tcp_receive ewf_adapter_thales_common_tcp_receive
227 
228 #endif /* EWF_ADAPTER_THALES_EXS82_W_TCP_ENABLED */
229 
238 #if EWF_ADAPTER_THALES_EXS82_W_UDP_ENABLED
239 
240 #define ewf_adapter_thales_exs82_w_udp_open ewf_adapter_thales_common_udp_open
241 #define ewf_adapter_thales_exs82_w_udp_close ewf_adapter_thales_common_udp_close
242 #define ewf_adapter_thales_exs82_w_udp_control ewf_adapter_thales_common_udp_control
243 #define ewf_adapter_thales_exs82_w_udp_set_dtls_configuration ewf_adapter_thales_common_udp_set_dtls_configuration
244 #define ewf_adapter_thales_exs82_w_udp_bind ewf_adapter_thales_common_udp_bind
245 #define ewf_adapter_thales_exs82_w_udp_send_to ewf_adapter_thales_common_udp_send_to
246 #define ewf_adapter_thales_exs82_w_udp_receive_from ewf_adapter_thales_common_udp_receive_from
247 
248 #endif /* EWF_ADAPTER_THALES_EXS82_W_UDP_ENABLED */
249 
258 #if EWF_ADAPTER_THALES_EXS82_W_MQTT_ENABLED
259 
260 ewf_result ewf_adapter_thales_exs82_w_mqtt_start(ewf_adapter* adapter_ptr);
261 ewf_result ewf_adapter_thales_exs82_w_mqtt_stop(ewf_adapter* adapter_ptr);
262 
263 ewf_result ewf_adapter_thales_exs82_w_mqtt_urc_callback(ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
264 
265 #endif /* EWF_ADAPTER_THALES_EXS82_W_MQTT_ENABLED */
266 
275 #if EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED
276 
277 #define ewf_adapter_thales_exs82_w_mqtt_basic_start ewf_adapter_thales_common_mqtt_basic_start
278 #define ewf_adapter_thales_exs82_w_mqtt_basic_stop ewf_adapter_thales_common_mqtt_basic_stop
279 
280 #define ewf_adapter_thales_exs82_w_mqtt_basic_urc_callback ewf_adapter_thales_common_mqtt_basic_urc_callback
281 
282 #define ewf_adapter_thales_exs82_w_mqtt_basic_default_state_callback ewf_adapter_thales_common_mqtt_basic_default_state_callback
283 #define ewf_adapter_thales_exs82_w_mqtt_basic_default_message_callback ewf_adapter_thales_common_mqtt_basic_default_message_callback
284 
285 #define ewf_adapter_thales_exs82_w_mqtt_basic_connect ewf_adapter_thales_common_mqtt_basic_connect
286 #define ewf_adapter_thales_exs82_w_mqtt_basic_disconnect ewf_adapter_thales_common_mqtt_basic_disconnect
287 #define ewf_adapter_thales_exs82_w_mqtt_basic_subscribe ewf_adapter_thales_common_mqtt_basic_subscribe
288 #define ewf_adapter_thales_exs82_w_mqtt_basic_unsubscribe ewf_adapter_thales_common_mqtt_basic_unsubscribe
289 #define ewf_adapter_thales_exs82_w_mqtt_basic_publish ewf_adapter_thales_common_mqtt_basic_publish
290 
291 #endif /* EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED */
292 
295 /******************************************************************************
296  *
297  * Internal data
298  *
299  ******************************************************************************/
300 
309 {
312 
314 
323 #ifdef EWF_PARAMETER_CHECKING
324 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_HEADER(adapter_ptr) \
325 do { \
326 (adapter_ptr)->struct_magic = EWF_ADAPTER_STRUCT_MAGIC; \
327 (adapter_ptr)->struct_size = EWF_ADAPTER_STRUCT_SIZE; \
328 (adapter_ptr)->struct_version = EWF_ADAPTER_VERSION; \
329 (adapter_ptr)->struct_type = EWF_ADAPTER_TYPE_THALES_EXS82_W; \
330 } while(0)
331 #else
332 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_HEADER(adapter_ptr)
333 #endif /* EWF_PARAMETER_CHECKING */
334 
335 #if EWF_ADAPTER_THALES_EXS82_W_TCP_ENABLED
336 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_TCP_API(adapter_ptr) \
337 do { \
338 adapter_ptr->tcp_api_ptr = &ewf_adapter_thales_common_api_tcp; \
339 } while(0)
340 #else
341 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_TCP_API(adapter_ptr)
342 #endif /* EWF_ADAPTER_THALES_EXS82_W_TCP_ENABLED */
343 
344 #if EWF_ADAPTER_THALES_EXS82_W_UDP_ENABLED
345 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_UDP_API(adapter_ptr) \
346 do { \
347 adapter_ptr->udp_api_ptr = &ewf_adapter_thales_common_api_udp; \
348 } while(0)
349 #else
350 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_UDP_API(adapter_ptr)
351 #endif /* EWF_ADAPTER_THALES_EXS82_W_UDP_ENABLED */
352 
353 #if EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED
354 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_TLS_BASIC_API(adapter_ptr) \
355 do { \
356 adapter_ptr->tls_basic_api_ptr = &ewf_adapter_thales_common_api_tls_basic; \
357 } while(0)
358 #else
359 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_TLS_BASIC_API(adapter_ptr)
360 #endif /* EWF_ADAPTER_THALES_EXS82_W_TLS_BASIC_ENABLED */
361 
362 #if EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED
363 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_MQTT_BASIC_API(adapter_ptr) \
364 do { \
365 adapter_ptr->mqtt_basic_api_ptr = &ewf_adapter_thales_common_api_mqtt_basic; \
366 } while(0)
367 #else
368 #define EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_MQTT_BASIC_API(adapter_ptr)
369 #endif /* EWF_ADAPTER_THALES_EXS82_W_MQTT_BASIC_ENABLED */
370 
379 #define EWF_ADAPTER_THALES_EXS82_W_STATIC_DECLARE(adapter_ptr, adapter_name_symb, message_allocator_ptr_param, data_allocator_ptr_param, interface_ptr_param) \
380 do { \
381 static ewf_adapter_thales_exs82_w ewf_adapter_thales_exs82_w__implementation__##adapter_name_symb = {0}; \
382 static ewf_adapter ewf_adapter_thales_exs82_w__##adapter_name_symb = {0}; \
383 interface_ptr_param->message_allocator_ptr = message_allocator_ptr_param; \
384 interface_ptr_param->data_allocator_ptr = data_allocator_ptr_param; \
385 interface_ptr_param->urc_callback = ewf_adapter_thales_exs82_w_urc_callback; \
386 ewf_adapter_thales_exs82_w__##adapter_name_symb.interface_ptr = interface_ptr_param; \
387 ewf_adapter_thales_exs82_w__##adapter_name_symb.implementation_ptr = &(ewf_adapter_thales_exs82_w__implementation__##adapter_name_symb); \
388 adapter_ptr = &(ewf_adapter_thales_exs82_w__##adapter_name_symb); \
389 interface_ptr_param->adapter_ptr = adapter_ptr; \
390 EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_HEADER(adapter_ptr); \
391 ewf_adapter_thales_exs82_w__##adapter_name_symb.control_api_ptr = &ewf_adapter_thales_exs82_w_api_control; \
392 ewf_adapter_thales_exs82_w__##adapter_name_symb.info_api_ptr = &ewf_adapter_thales_common_api_info; \
393 EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_TCP_API(adapter_ptr); \
394 EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_UDP_API(adapter_ptr); \
395 EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_TLS_BASIC_API(adapter_ptr); \
396 EWF_ADAPTER_THALES_EXS82_W_INITIALIZE_MQTT_BASIC_API(adapter_ptr); \
397 } while(0)
398 
401 /************************************************************************/
405 #ifdef __cplusplus
406 }
407 #endif
408 
409 #endif /* __ewf_adapter_thales_exs82_w__h__included__ */
The Embedded Wireless Framework adapter API implementation.
The Embedded Wireless Framework modem adapter API.
The Embedded Wireless Framework generic Thales adapter functionality.
The Embedded Wireless Framework host interface API.
struct _ewf_adapter_thales_exs82_w ewf_adapter_thales_exs82_w
The Thales Cinterion EXS82-W adapter 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
The Thales common adapter data structure.
Definition: ewf_adapter_thales_common.h:151
The Thales Cinterion EXS82-W adapter data structure.
Definition: ewf_adapter_thales_exs82_w.h:309
ewf_adapter_thales_common common_implementation_data
Definition: ewf_adapter_thales_exs82_w.h:311
The EWF network adapter control structure definition.
Definition: ewf_adapter.h:50
The interface structure definition.
Definition: ewf_interface.h:66