Embedded Wireless Framework
ewf_adapter_renesas_ryz014.h
Go to the documentation of this file.
1 /************************************************************************/
9 #ifndef __ewf_adapter_renesas_ryz014__h__included__
10 #define __ewf_adapter_renesas_ryz014__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_RENESAS_RYZ014_NVM_ENABLED
30 #define EWF_ADAPTER_RENESAS_RYZ014_NVM_ENABLED (1)
31 #endif
32 
33 #if !defined(EWF_ADAPTER_RENESAS_RYZ014_TLS_ENABLED) && !defined(EWF_ADAPTER_RENESAS_RYZ014_TLS_BASIC_ENABLED)
34 #if 1
35 #define EWF_ADAPTER_RENESAS_RYZ014_TLS_BASIC_ENABLED (1)
36 #define EWF_ADAPTER_RENESAS_RYZ014_TLS_ENABLED (0)
37 #else
38 #define EWF_ADAPTER_RENESAS_RYZ014_TLS_BASIC_ENABLED (0)
39 #define EWF_ADAPTER_RENESAS_RYZ014_TLS_ENABLED (1)
40 #endif
41 #endif
42 
43 #ifndef EWF_ADAPTER_RENESAS_RYZ014_TCP_ENABLED
44 #define EWF_ADAPTER_RENESAS_RYZ014_TCP_ENABLED (1)
45 #endif
46 
47 #ifndef EWF_ADAPTER_RENESAS_RYZ014_UDP_ENABLED
48 #define EWF_ADAPTER_RENESAS_RYZ014_UDP_ENABLED (1)
49 #endif
50 
51 #if !defined(EWF_ADAPTER_RENESAS_RYZ014_MQTT_ENABLED) && !defined(EWF_ADAPTER_RENESAS_RYZ014_MQTT_BASIC_ENABLED)
52 #if 1
53 #define EWF_ADAPTER_RENESAS_RYZ014_MQTT_BASIC_ENABLED (1)
54 #define EWF_ADAPTER_RENESAS_RYZ014_MQTT_ENABLED (0)
55 #else
56 #define EWF_ADAPTER_RENESAS_RYZ014_MQTT_BASIC_ENABLED (0)
57 #define EWF_ADAPTER_RENESAS_RYZ014_MQTT_ENABLED (1)
58 #endif
59 #endif
60 
66 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_ROOT_CA_CERTIFICATE_ID
67 #undef EWF_CONFIG_ADAPTER_RENESAS_COMMON_ROOT_CA_CERTIFICATE_ID
68 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_ROOT_CA_CERTIFICATE_ID EWF_CONFIG_ADAPTER_RENESAS_RYZ014_ROOT_CA_CERTIFICATE_ID
69 #endif
70 
76 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_USER_CA_CERTIFICATE_ID
77 #undef EWF_CONFIG_ADAPTER_RENESAS_COMMON_USER_CA_CERTIFICATE_ID
78 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_USER_CA_CERTIFICATE_ID EWF_CONFIG_ADAPTER_RENESAS_RYZ014_USER_CA_CERTIFICATE_ID
79 #endif
80 
86 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CA_CERTIFICATE_ID
87 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_CA_CERTIFICATE_ID EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CA_CERTIFICATE_ID
88 #endif
89 
95 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_CERTIFICATE_ID
96 #undef EWF_CONFIG_ADAPTER_RENESAS_COMMON_CLIENT_CERTIFICATE_ID
97 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_CLIENT_CERTIFICATE_ID EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_CERTIFICATE_ID
98 #endif
99 
105 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_PRIVATE_KEY_ID
106 #undef EWF_CONFIG_ADAPTER_RENESAS_COMMON_CLIENT_PRIVATE_KEY_ID
107 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_CLIENT_PRIVATE_KEY_ID EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_PRIVATE_KEY_ID
108 #endif
109 
111 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_ROOT_CA_CERTIFICATE_BUFFER_NAME
112 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_ROOT_CA_CERTIFICATE_BUFFER_NAME EWF_CONFIG_ADAPTER_RENESAS_RYZ014_ROOT_CA_CERTIFICATE_BUFFER_NAME
113 #endif
114 
116 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_USER_CA_CERTIFICATE_BUFFER_NAME
117 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_USER_CA_CERTIFICATE_BUFFER_NAME EWF_CONFIG_ADAPTER_RENESAS_RYZ014_USER_CA_CERTIFICATE_BUFFER_NAME
118 #endif
119 
121 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_CERTIFICATE_BUFFER_NAME
122 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_CLIENT_CERTIFICATE_BUFFER_NAME EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_CERTIFICATE_BUFFER_NAME
123 #endif
124 
126 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_PRIVATE_KEY_BUFFER_NAME
127 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_CLIENT_PRIVATE_KEY_BUFFER_NAME EWF_CONFIG_ADAPTER_RENESAS_RYZ014_CLIENT_PRIVATE_KEY_BUFFER_NAME
128 #endif
129 
135 #ifdef EWF_CONFIG_ADAPTER_RENESAS_RYZ014_SECURITY_PROFILE_ID
136 #undef EWF_CONFIG_ADAPTER_RENESAS_COMMON_SECURITY_PROFILE_ID
137 #define EWF_CONFIG_ADAPTER_RENESAS_COMMON_SECURITY_PROFILE_ID EWF_CONFIG_ADAPTER_RENESAS_RYZ014_SECURITY_PROFILE_ID
138 #endif
139 
140 /************************************************************************/
144 /* Include the Quectel common header here, to take the above configuration macros into account */
146 
147 /************************************************************************/
159 extern ewf_adapter_api_control ewf_adapter_renesas_ryz014_api_control;
160 
161 ewf_result ewf_adapter_renesas_ryz014_start(ewf_adapter* adapter_ptr);
162 ewf_result ewf_adapter_renesas_ryz014_stop(ewf_adapter* adapter_ptr);
163 
172 ewf_result ewf_adapter_renesas_ryz014_urc_callback(ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
173 
182 #define ewf_adapter_renesas_ryz014_info ewf_adapter_renesas_common_info
183 #define ewf_adapter_renesas_ryz014_get_ipv4_address ewf_adapter_renesas_common_get_ipv4_address
184 #define ewf_adapter_renesas_ryz014_get_ipv4_netmask ewf_adapter_renesas_common_get_ipv4_netmask
185 #define ewf_adapter_renesas_ryz014_get_ipv4_gateway ewf_adapter_renesas_common_get_ipv4_gateway
186 #define ewf_adapter_renesas_ryz014_get_ipv4_dns ewf_adapter_renesas_common_get_ipv4_dns
187 
196 #define ewf_adapter_renesas_ryz014_context_start ewf_adapter_renesas_common_context_start
197 #define ewf_adapter_renesas_ryz014_context_stop ewf_adapter_renesas_common_context_stop
198 
199 #define ewf_adapter_renesas_ryz014_context_urc_callback ewf_adapter_renesas_common_context_urc_callback
200 
201 #define ewf_adapter_renesas_ryz014_context_activate ewf_adapter_renesas_common_context_activate
202 #define ewf_adapter_renesas_ryz014_context_deactivate ewf_adapter_renesas_common_context_deactivate
203 #define ewf_adapter_renesas_ryz014_context_configure ewf_adapter_renesas_common_context_configure
204 #define ewf_adapter_renesas_ryz014_context_configure_dns ewf_adapter_renesas_common_context_configure_dns
205 
214 #if EWF_ADAPTER_RENESAS_RYZ014_NVM_ENABLED
215 
216 #define ewf_adapter_renesas_ryz014_nvm_start ewf_adapter_renesas_common_nvm_start
217 #define ewf_adapter_renesas_ryz014_nvm_stop ewf_adapter_renesas_common_nvm_stop
218 
219 #define ewf_adapter_renesas_ryz014_nvm_urc_callback ewf_adapter_renesas_common_nvm_urc_callback
220 
221 #define ewf_adapter_renesas_ryz014_nvm_list ewf_adapter_renesas_common_nvm_list
222 #define ewf_adapter_renesas_ryz014_nvm_delete ewf_adapter_renesas_common_nvm_delete
223 #define ewf_adapter_renesas_ryz014_nvm_upload ewf_adapter_renesas_common_nvm_upload
224 
225 #endif /* EWF_ADAPTER_RENESAS_RYZ014_NVM_ENABLED */
226 
235 #if EWF_ADAPTER_RENESAS_RYZ014_TLS_BASIC_ENABLED
236 
237 #define ewf_adapter_renesas_ryz014_tls_basic_start ewf_adapter_renesas_common_tls_basic_start
238 #define ewf_adapter_renesas_ryz014_tls_basic_stop ewf_adapter_renesas_common_tls_basic_stop
239 
240 #define ewf_adapter_renesas_ryz014_tls_basic_urc_callback ewf_adapter_renesas_common_tls_basic_urc_callback
241 
242 #define ewf_adapter_renesas_ryz014_tls_basic_init ewf_adapter_renesas_common_tls_basic_init
243 #define ewf_adapter_renesas_ryz014_tls_basic_clean ewf_adapter_renesas_common_tls_basic_clean
244 
245 #endif /* EWF_ADAPTER_RENESAS_RYZ014_TLS_BASIC_ENABLED */
246 
255 #define ewf_adapter_renesas_ryz014_internet_start ewf_adapter_renesas_common_internet_start
256 #define ewf_adapter_renesas_ryz014_internet_stop ewf_adapter_renesas_common_internet_stop
257 
258 #define ewf_adapter_renesas_ryz014_internet_urc_callback ewf_adapter_renesas_common_internet_urc_callback
259 
268 #if EWF_ADAPTER_RENESAS_RYZ014_TCP_ENABLED
269 
270 #define ewf_adapter_renesas_ryz014_tcp_open ewf_adapter_renesas_common_tcp_open
271 #define ewf_adapter_renesas_ryz014_tcp_close ewf_adapter_renesas_common_tcp_close
272 #define ewf_adapter_renesas_ryz014_tcp_control ewf_adapter_renesas_common_tcp_control
273 #define ewf_adapter_renesas_ryz014_tcp_set_tls_configuration ewf_adapter_renesas_common_tcp_set_tls_configuration
274 #define ewf_adapter_renesas_ryz014_tcp_bind ewf_adapter_renesas_common_tcp_bind
275 #define ewf_adapter_renesas_ryz014_tcp_listen ewf_adapter_renesas_common_tcp_listen
276 #define ewf_adapter_renesas_ryz014_tcp_accept ewf_adapter_renesas_common_tcp_accept
277 #define ewf_adapter_renesas_ryz014_tcp_connect ewf_adapter_renesas_common_tcp_connect
278 #define ewf_adapter_renesas_ryz014_tcp_shutdown ewf_adapter_renesas_common_tcp_shutdown
279 #define ewf_adapter_renesas_ryz014_tcp_send ewf_adapter_renesas_common_tcp_send
280 #define ewf_adapter_renesas_ryz014_tcp_receive ewf_adapter_renesas_common_tcp_receive
281 
282 #endif /* EWF_ADAPTER_RENESAS_RYZ014_TCP_ENABLED */
283 
292 #if EWF_ADAPTER_RENESAS_RYZ014_UDP_ENABLED
293 
294 #define ewf_adapter_renesas_ryz014_udp_open ewf_adapter_renesas_common_udp_open
295 #define ewf_adapter_renesas_ryz014_udp_close ewf_adapter_renesas_common_udp_close
296 #define ewf_adapter_renesas_ryz014_udp_control ewf_adapter_renesas_common_udp_control
297 #define ewf_adapter_renesas_ryz014_udp_set_dtls_configuration ewf_adapter_renesas_common_udp_set_dtls_configuration
298 #define ewf_adapter_renesas_ryz014_udp_bind ewf_adapter_renesas_common_udp_bind
299 #define ewf_adapter_renesas_ryz014_udp_send_to ewf_adapter_renesas_common_udp_send_to
300 #define ewf_adapter_renesas_ryz014_udp_receive_from ewf_adapter_renesas_common_udp_receive_from
301 
302 #endif /* EWF_ADAPTER_RENESAS_RYZ014_UDP_ENABLED */
303 
312 #if EWF_ADAPTER_RENESAS_RYZ014_MQTT_ENABLED
313 
314 ewf_result ewf_adapter_renesas_ryz014_mqtt_start(ewf_adapter* adapter_ptr);
315 ewf_result ewf_adapter_renesas_ryz014_mqtt_stop(ewf_adapter* adapter_ptr);
316 
317 ewf_result ewf_adapter_renesas_ryz014_mqtt_urc_callback(ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
318 
319 #endif /* EWF_ADAPTER_RENESAS_RYZ014_MQTT_ENABLED */
320 
329 #if EWF_ADAPTER_RENESAS_RYZ014_MQTT_BASIC_ENABLED
330 
331 #define ewf_adapter_renesas_ryz014_mqtt_basic_start ewf_adapter_renesas_common_mqtt_basic_start
332 #define ewf_adapter_renesas_ryz014_mqtt_basic_stop ewf_adapter_renesas_common_mqtt_basic_stop
333 
334 #define ewf_adapter_renesas_ryz014_mqtt_basic_urc_callback ewf_adapter_renesas_common_mqtt_basic_urc_callback
335 
336 #define ewf_adapter_renesas_ryz014_mqtt_basic_default_state_callback ewf_adapter_renesas_common_mqtt_basic_default_state_callback
337 #define ewf_adapter_renesas_ryz014_mqtt_basic_default_message_callback ewf_adapter_renesas_common_mqtt_basic_default_message_callback
338 
339 #define ewf_adapter_renesas_ryz014_mqtt_basic_connect ewf_adapter_renesas_common_mqtt_basic_connect
340 #define ewf_adapter_renesas_ryz014_mqtt_basic_disconnect ewf_adapter_renesas_common_mqtt_basic_disconnect
341 #define ewf_adapter_renesas_ryz014_mqtt_basic_subscribe ewf_adapter_renesas_common_mqtt_basic_subscribe
342 #define ewf_adapter_renesas_ryz014_mqtt_basic_unsubscribe ewf_adapter_renesas_common_mqtt_basic_unsubscribe
343 #define ewf_adapter_renesas_ryz014_mqtt_basic_publish ewf_adapter_renesas_common_mqtt_basic_publish
344 
345 #endif /* EWF_ADAPTER_RENESAS_RYZ014_MQTT_BASIC_ENABLED */
346 
349 /******************************************************************************
350  *
351  * Internal data
352  *
353  ******************************************************************************/
354 
363 {
366 
368 
377 #ifdef EWF_PARAMETER_CHECKING
378 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_HEADER(adapter_ptr) \
379 do { \
380 (adapter_ptr)->struct_magic = EWF_ADAPTER_STRUCT_MAGIC; \
381 (adapter_ptr)->struct_size = EWF_ADAPTER_STRUCT_SIZE; \
382 (adapter_ptr)->struct_version = EWF_ADAPTER_VERSION; \
383 (adapter_ptr)->struct_type = EWF_ADAPTER_TYPE_RENESAS_RYZ014; \
384 } while(0)
385 #else
386 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_HEADER(adapter_ptr)
387 #endif /* EWF_PARAMETER_CHECKING */
388 
389 #if EWF_ADAPTER_RENESAS_RYZ014_TCP_ENABLED
390 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_TCP_API(adapter_ptr) \
391 do { \
392 adapter_ptr->tcp_api_ptr = &ewf_adapter_renesas_common_api_tcp; \
393 } while(0)
394 #else
395 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_TCP_API(adapter_ptr)
396 #endif /* EWF_ADAPTER_RENESAS_RYZ014_TCP_ENABLED */
397 
398 #if EWF_ADAPTER_RENESAS_RYZ014_UDP_ENABLED
399 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_UDP_API(adapter_ptr) \
400 do { \
401 adapter_ptr->udp_api_ptr = &ewf_adapter_renesas_common_api_udp; \
402 } while(0)
403 #else
404 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_UDP_API(adapter_ptr)
405 #endif /* EWF_ADAPTER_RENESAS_RYZ014_UDP_ENABLED */
406 
407 #if EWF_ADAPTER_RENESAS_RYZ014_TLS_BASIC_ENABLED
408 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_TLS_BASIC_API(adapter_ptr) \
409 do { \
410 adapter_ptr->tls_basic_api_ptr = &ewf_adapter_renesas_common_api_tls_basic; \
411 } while(0)
412 #else
413 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_TLS_BASIC_API(adapter_ptr)
414 #endif /* EWF_ADAPTER_RENESAS_RYZ014_TLS_BASIC_ENABLED */
415 
416 #if EWF_ADAPTER_RENESAS_RYZ014_MQTT_BASIC_ENABLED
417 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_MQTT_BASIC_API(adapter_ptr) \
418 do { \
419 adapter_ptr->mqtt_basic_api_ptr = &ewf_adapter_renesas_common_api_mqtt_basic; \
420 } while(0)
421 #else
422 #define EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_MQTT_BASIC_API(adapter_ptr)
423 #endif /* EWF_ADAPTER_RENESAS_RYZ014_MQTT_BASIC_ENABLED */
424 
433 #define EWF_ADAPTER_RENESAS_RYZ014_STATIC_DECLARE(adapter_ptr, adapter_name_symb, message_allocator_ptr_param, data_allocator_ptr_param, interface_ptr_param) \
434 do { \
435 static ewf_adapter_renesas_ryz014 ewf_adapter_renesas_ryz014__implementation__##adapter_name_symb = {0}; \
436 static ewf_adapter ewf_adapter_renesas_ryz014__##adapter_name_symb = {0}; \
437 static ewf_adapter_api_modem_data ewf_adapter_renesas_ryz014__modem_data__##adapter_name_symb = {0}; \
438 interface_ptr_param->message_allocator_ptr = message_allocator_ptr_param; \
439 interface_ptr_param->data_allocator_ptr = data_allocator_ptr_param; \
440 interface_ptr_param->urc_callback = ewf_adapter_renesas_ryz014_urc_callback; \
441 ewf_adapter_renesas_ryz014__##adapter_name_symb.interface_ptr = interface_ptr_param; \
442 ewf_adapter_renesas_ryz014__##adapter_name_symb.implementation_ptr = &(ewf_adapter_renesas_ryz014__implementation__##adapter_name_symb); \
443 adapter_ptr = &(ewf_adapter_renesas_ryz014__##adapter_name_symb); \
444 interface_ptr_param->adapter_ptr = adapter_ptr; \
445 EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_HEADER(adapter_ptr); \
446 ewf_adapter_renesas_ryz014__##adapter_name_symb.modem_api_data_ptr = &ewf_adapter_renesas_ryz014__modem_data__##adapter_name_symb; \
447 ewf_adapter_renesas_ryz014__##adapter_name_symb.control_api_ptr = &ewf_adapter_renesas_ryz014_api_control; \
448 ewf_adapter_renesas_ryz014__##adapter_name_symb.info_api_ptr = &ewf_adapter_renesas_common_api_info; \
449 EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_TCP_API(adapter_ptr); \
450 EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_UDP_API(adapter_ptr); \
451 EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_TLS_BASIC_API(adapter_ptr); \
452 EWF_ADAPTER_RENESAS_RYZ014_INITIALIZE_MQTT_BASIC_API(adapter_ptr); \
453 } while(0)
454 
457 /************************************************************************/
461 #ifdef __cplusplus
462 }
463 #endif
464 
465 #endif /* __ewf_adapter_renesas_ryz014__h__included__ */
The Embedded Wireless Framework adapter API implementation.
The Embedded Wireless Framework modem adapter API.
The Embedded Wireless Framework generic Renesas adapter functionality. Renesas adapter common definit...
The Embedded Wireless Framework host interface API.
struct _ewf_adapter_renesas_ryz014 ewf_adapter_renesas_ryz014
The Renesas RYZ014A 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 Renesas adapter data structure.
Definition: ewf_adapter_renesas_common.h:220
The Renesas RYZ014A adapter data structure.
Definition: ewf_adapter_renesas_ryz014.h:363
ewf_adapter_renesas_common common_implementation_data
Definition: ewf_adapter_renesas_ryz014.h:365
The EWF network adapter control structure definition.
Definition: ewf_adapter.h:50
The interface structure definition.
Definition: ewf_interface.h:66