9 #ifndef __ewf_adapter_thales_common__h__included__
10 #define __ewf_adapter_thales_common__h__included__
25 #ifndef EWF_ADAPTER_THALES_COMMON_DEFAULT_TIMEOUT
26 #define EWF_ADAPTER_THALES_COMMON_DEFAULT_TIMEOUT (EWF_PLATFORM_TICKS_PER_SECOND * 10)
29 #ifndef EWF_ADAPTER_THALES_COMMON_FFS_ENABLED
30 #define EWF_ADAPTER_THALES_COMMON_FFS_ENABLED (1)
33 #if !defined(EWF_ADAPTER_THALES_COMMON_TLS_ENABLED) && !defined(EWF_ADAPTER_THALES_COMMON_TLS_BASIC_ENABLED)
35 #define EWF_ADAPTER_THALES_COMMON_TLS_BASIC_ENABLED (1)
36 #define EWF_ADAPTER_THALES_COMMON_TLS_ENABLED (0)
38 #define EWF_ADAPTER_THALES_COMMON_TLS_BASIC_ENABLED (0)
39 #define EWF_ADAPTER_THALES_COMMON_TLS_ENABLED (1)
43 #ifndef EWF_ADAPTER_THALES_COMMON_TCP_ENABLED
44 #define EWF_ADAPTER_THALES_COMMON_TCP_ENABLED (1)
47 #ifndef EWF_ADAPTER_THALES_COMMON_UDP_ENABLED
48 #define EWF_ADAPTER_THALES_COMMON_UDP_ENABLED (1)
51 #if !defined(EWF_ADAPTER_THALES_COMMON_MQTT_ENABLED) && !defined(EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED)
53 #define EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED (1)
54 #define EWF_ADAPTER_THALES_COMMON_MQTT_ENABLED (0)
56 #define EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED (0)
57 #define EWF_ADAPTER_THALES_COMMON_MQTT_ENABLED (1)
61 #ifndef EWF_ADAPTER_THALES_COMMON_INTERNET_SOCKET_POOL_SIZE
63 #define EWF_ADAPTER_THALES_COMMON_INTERNET_SOCKET_POOL_SIZE (12)
66 #ifndef EWF_ADAPTER_THALES_COMMON_INTERNET_SOCKET_INVALID
68 #define EWF_ADAPTER_THALES_COMMON_INTERNET_SOCKET_INVALID (-1)
71 #ifndef EWF_ADAPTER_THALES_COMMON_MQTT_SOCKET_POOL_SIZE
73 #define EWF_ADAPTER_THALES_COMMON_MQTT_SOCKET_POOL_SIZE (12)
76 #ifndef EWF_ADAPTER_THALES_COMMON_MQTT_SOCKET_INVALID
78 #define EWF_ADAPTER_THALES_COMMON_MQTT_SOCKET_INVALID (-1)
116 ewf_adapter_thales_common_internet_socket_service_type_not_initialized,
117 ewf_adapter_thales_common_internet_socket_service_type_tcp,
118 ewf_adapter_thales_common_internet_socket_service_type_udp,
119 ewf_adapter_thales_common_internet_socket_service_type_tcp_listener,
120 ewf_adapter_thales_common_internet_socket_service_type_udp_listener,
131 volatile bool used : 1;
132 volatile bool open : 1;
133 volatile bool open_error : 1;
134 volatile bool conn : 1;
135 volatile bool conn_error : 1;
142 volatile bool open : 1;
143 volatile bool open_error : 1;
144 volatile bool conn : 1;
145 volatile bool conn_error : 1;
154 #if EWF_ADAPTER_THALES_COMMON_TCP_ENABLED || EWF_ADAPTER_THALES_COMMON_UDP_ENABLED
159 #if EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED
162 volatile bool mqtt_basic_open_error : 1;
163 volatile bool mqtt_basic_conn : 1;
164 volatile bool mqtt_basic_conn_error : 1;
165 volatile bool mqtt_basic_publish : 1;
166 volatile bool mqtt_basic_subscribe : 1;
169 #if EWF_ADAPTER_THALES_COMMON_MQTT_ENABLED
230 ewf_result ewf_adapter_thales_common_ufs_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
278 ewf_result ewf_adapter_thales_common_get_ipv4_address(
ewf_adapter* adapter_ptr, uint32_t* address_ptr);
279 ewf_result ewf_adapter_thales_common_get_ipv4_netmask(
ewf_adapter* adapter_ptr, uint32_t* netmask_ptr);
280 ewf_result ewf_adapter_thales_common_get_ipv4_gateway(
ewf_adapter* adapter_ptr, uint32_t* gateway_ptr);
291 ewf_result ewf_adapter_thales_common_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
301 #if EWF_ADAPTER_THALES_COMMON_TCP_ENABLED || EWF_ADAPTER_THALES_COMMON_UDP_ENABLED
306 ewf_result ewf_adapter_thales_common_internet_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
318 #if EWF_ADAPTER_THALES_COMMON_TCP_ENABLED
324 ewf_result ewf_adapter_thales_common_tcp_control(
ewf_socket_tcp* socket_ptr,
const char* control_str,
const uint8_t* buffer_ptr, uint32_t* buffer_length_ptr);
325 ewf_result ewf_adapter_thales_common_tcp_set_tls_configuration(
ewf_socket_tcp* socket_ptr, uint32_t tls_configuration_id);
329 ewf_result ewf_adapter_thales_common_tcp_connect(
ewf_socket_tcp* socket_ptr,
const char*
const server, uint32_t port);
331 ewf_result ewf_adapter_thales_common_tcp_send(
ewf_socket_tcp* socket_ptr,
const uint8_t* buffer_ptr, uint32_t buffer_length);
332 ewf_result ewf_adapter_thales_common_tcp_receive(
ewf_socket_tcp* socket_ptr, uint8_t* buffer_ptr, uint32_t* buffer_length,
bool wait);
344 #if EWF_ADAPTER_THALES_COMMON_UDP_ENABLED
350 ewf_result ewf_adapter_thales_common_udp_control(
ewf_socket_udp* socket_ptr,
const char* control_str,
const uint8_t* buffer_ptr, uint32_t* buffer_length_ptr);
351 ewf_result ewf_adapter_thales_common_udp_set_dtls_configuration(
ewf_socket_udp* socket_ptr, uint32_t dtls_configuration_id);
354 ewf_result ewf_adapter_thales_common_udp_send_to(
ewf_socket_udp* socket_ptr,
const char* remote_address_str, uint32_t remote_port,
const uint8_t* buffer_ptr, uint32_t buffer_length);
355 ewf_result ewf_adapter_thales_common_udp_receive_from(
ewf_socket_udp* socket_ptr,
char* remote_address, uint32_t* remote_address_length_ptr, uint32_t* remote_port_ptr,
char* buffer_ptr, uint32_t* buffer_length_ptr,
bool wait);
367 #if EWF_ADAPTER_THALES_COMMON_TLS_BASIC_ENABLED
374 ewf_result ewf_adapter_thales_common_tls_basic_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
389 #if EWF_ADAPTER_THALES_COMMON_MQTT_BASIC_ENABLED
396 ewf_result ewf_adapter_thales_common_mqtt_basic_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
398 ewf_result ewf_adapter_thales_common_mqtt_basic_default_state_callback(
ewf_adapter* adapter_ptr,
const char* state_cstr,
const char* param_cstr);
399 ewf_result ewf_adapter_thales_common_mqtt_basic_default_message_callback(
ewf_adapter* adapter_ptr,
const char* topic_cstr,
const char* payload_cstr);
401 ewf_result ewf_adapter_thales_common_mqtt_basic_connect(
ewf_adapter* adapter_ptr,
char const* server_str, uint32_t port,
char const* clientid,
char const* username,
char const* password);
403 ewf_result ewf_adapter_thales_common_mqtt_basic_subscribe(
ewf_adapter* adapter_ptr,
char const* topic);
404 ewf_result ewf_adapter_thales_common_mqtt_basic_unsubscribe(
ewf_adapter* adapter_ptr,
char const* topic);
405 ewf_result ewf_adapter_thales_common_mqtt_basic_publish(
ewf_adapter* adapter_ptr,
const char* topic,
const char* msg_cstr);
The Embedded Wireless Framework adapter API implementation.
_ewf_adapter_common_internet_socket_service_type
The socket service type
Definition: ewf_adapter_espressif_common.h:79
ewf_result(* ewf_adapter_mqtt_message_callback)(ewf_socket_mqtt *socket_ptr, const char *topic_str, ewf_adapter_mqtt_message *message_ptr)
A function pointer type for MQTT message callbacks.
Definition: ewf_adapter_api_mqtt.h:50
ewf_result ewf_adapter_thales_common_context_configure_dns(ewf_adapter *adapter_ptr, uint32_t ctx, const char *primary_dns, const char *secondary_dns)
Configure a context DNS.
Definition: ewf_adapter_thales_common_context.c:140
ewf_result ewf_adapter_thales_common_context_activate(ewf_adapter *adapter_ptr, uint32_t ctx)
Activate a context.
Definition: ewf_adapter_thales_common_context.c:13
ewf_result ewf_adapter_thales_common_context_configure(ewf_adapter *adapter_ptr, uint32_t ctx, uint32_t type, const char *apn, const char *username, const char *password, uint32_t authentication)
Configure a context.
Definition: ewf_adapter_thales_common_context.c:79
ewf_result ewf_adapter_thales_common_context_deactivate(ewf_adapter *adapter_ptr, uint32_t ctx)
Deactivate a context.
Definition: ewf_adapter_thales_common_context.c:46
enum _ewf_adapter_common_internet_socket_service_type ewf_adapter_thales_common_internet_socket_service_type
The socket service type
struct _ewf_adapter_thales_common ewf_adapter_thales_common
The Thales common adapter data structure.
struct _ewf_adapter_thales_common_internet_socket ewf_adapter_thales_common_internet_socket
Internal structure for internet socket status
struct _ewf_adapter_thales_common_mqtt_socket ewf_adapter_thales_common_mqtt_socket
Internal structure for MQTT socket status
ewf_result ewf_adapter_thales_common_ufs_list(ewf_adapter *adapter_ptr)
List the files in the user file system.
ewf_result ewf_adapter_thales_common_ufs_upload(ewf_adapter *adapter_ptr, const char *filename_str, const uint8_t *buffer_ptr, uint32_t buffer_length)
Upload a file to the user file system.
ewf_result ewf_adapter_thales_common_ufs_delete(ewf_adapter *adapter_ptr, const char *filename_str)
Delete a file from the user file system.
#define EWF_ADAPTER_THALES_COMMON_INTERNET_SOCKET_POOL_SIZE
The total number of supported internet sockets in the adapter.
Definition: ewf_adapter_thales_common.h:63
#define EWF_ADAPTER_THALES_COMMON_MQTT_SOCKET_POOL_SIZE
The total number of supported MQTT sockets in the adapter.
Definition: ewf_adapter_thales_common.h:73
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
Definition: ewf_adapter_api_mqtt_basic.h:55
The TCP API structure.
Definition: ewf_adapter_api_tcp.h:76
The TLS basic API structure.
Definition: ewf_adapter_api_tls_basic.h:29
The UDP API type.
Definition: ewf_adapter_api_udp.h:63
Internal structure for internet socket status
Definition: ewf_adapter_thales_common.h:126
Internal structure for MQTT socket status
Definition: ewf_adapter_thales_common.h:141
The Thales common adapter data structure.
Definition: ewf_adapter_thales_common.h:151
volatile bool mqtt_basic_open
Internal MQTT basic API socket 0 status
Definition: ewf_adapter_thales_common.h:161
uint32_t default_timeout
Definition: ewf_adapter_thales_common.h:152
The EWF network adapter control structure definition.
Definition: ewf_adapter.h:50
The interface structure definition.
Definition: ewf_interface.h:66
The TCP socket structure definition.
Definition: ewf_adapter_api_tcp.h:47
The UDP socket structure definition.
Definition: ewf_adapter_api_udp.h:40
The interface tokenizer pattern structure definition.
Definition: ewf_tokenizer.h:27