9 #ifndef __ewf_adapter_espressif_common__h__included__
10 #define __ewf_adapter_espressif_common__h__included__
31 #define EWF_ADAPTER_ESPRESSIF_COMMON_TLS_BASIC_ENABLED (0)
32 #define EWF_ADAPTER_ESPRESSIF_COMMON_MQTT_BASIC_ENABLED (0)
34 #if !defined(EWF_ADAPTER_ESPRESSIF_COMMON_TLS_ENABLED) && !defined(EWF_ADAPTER_ESPRESSIF_COMMON_TLS_BASIC_ENABLED)
36 #define EWF_ADAPTER_ESPRESSIF_COMMON_TLS_BASIC_ENABLED (1)
37 #define EWF_ADAPTER_ESPRESSIF_COMMON_TLS_ENABLED (0)
39 #define EWF_ADAPTER_ESPRESSIF_COMMON_TLS_BASIC_ENABLED (0)
40 #define EWF_ADAPTER_ESPRESSIF_COMMON_TLS_ENABLED (1)
44 #ifndef EWF_ADAPTER_ESPRESSIF_COMMON_TCP_ENABLED
45 #define EWF_ADAPTER_ESPRESSIF_COMMON_TCP_ENABLED (1)
48 #ifndef EWF_ADAPTER_ESPRESSIF_COMMON_UDP_ENABLED
49 #define EWF_ADAPTER_ESPRESSIF_COMMON_UDP_ENABLED (1)
52 #ifndef EWF_ADAPTER_ESPRESSIF_COMMON_INTERNET_SOCKET_POOL_SIZE
54 #define EWF_ADAPTER_ESPRESSIF_COMMON_INTERNET_SOCKET_POOL_SIZE (5)
57 #ifndef EWF_ADAPTER_ESPRESSIF_COMMON_INTERNET_SOCKET_RECV_BUFFER_SIZE
59 #define EWF_ADAPTER_ESPRESSIF_COMMON_INTERNET_SOCKET_RECV_BUFFER_SIZE (1500)
62 #ifndef EWF_ADAPTER_ESPRESSIF_COMMON_INTERNET_SOCKET_INVALID
64 #define EWF_ADAPTER_ESPRESSIF_COMMON_INTERNET_SOCKET_INVALID (-1)
80 ewf_adapter_espressif_common_internet_socket_service_type_not_initialized,
81 ewf_adapter_espressif_common_internet_socket_service_type_tcp,
82 ewf_adapter_espressif_common_internet_socket_service_type_udp,
83 ewf_adapter_espressif_common_internet_socket_service_type_tcp_listener,
84 ewf_adapter_espressif_common_internet_socket_service_type_udp_listener,
96 volatile bool open_error;
98 volatile bool conn_error;
109 #if EWF_ADAPTER_ESPRESSIF_COMMON_TCP_ENABLED || EWF_ADAPTER_ESPRESSIF_COMMON_UDP_ENABLED
144 ewf_result ewf_adapter_espressif_common_get_ipv4_address(
ewf_adapter* adapter_ptr, uint32_t* address_ptr);
145 ewf_result ewf_adapter_espressif_common_get_ipv4_netmask(
ewf_adapter* adapter_ptr, uint32_t* netmask_ptr);
146 ewf_result ewf_adapter_espressif_common_get_ipv4_gateway(
ewf_adapter* adapter_ptr, uint32_t* gateway_ptr);
157 ewf_result ewf_adapter_espressif_common_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
169 ewf_result ewf_adapter_espressif_common_wifi_station_connect(
ewf_adapter* adapter_ptr,
const char* ssid_str,
const char* password_str);
180 #if EWF_ADAPTER_ESPRESSIF_COMMON_TCP_ENABLED || EWF_ADAPTER_ESPRESSIF_COMMON_UDP_ENABLED
185 ewf_result ewf_adapter_espressif_common_internet_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
197 #if EWF_ADAPTER_ESPRESSIF_COMMON_TCP_ENABLED
203 ewf_result ewf_adapter_espressif_common_tcp_control(
ewf_socket_tcp* socket_ptr,
const char* control_str,
const uint8_t* buffer_ptr, uint32_t* buffer_length_ptr);
204 ewf_result ewf_adapter_espressif_common_tcp_set_tls_configuration(
ewf_socket_tcp* socket_ptr, uint32_t tls_configuration_id);
208 ewf_result ewf_adapter_espressif_common_tcp_connect(
ewf_socket_tcp* socket_ptr,
const char*
const server, uint32_t port);
210 ewf_result ewf_adapter_espressif_common_tcp_send(
ewf_socket_tcp* socket_ptr,
const uint8_t* buffer_ptr, uint32_t buffer_length);
211 ewf_result ewf_adapter_espressif_common_tcp_receive(
ewf_socket_tcp* socket_ptr, uint8_t* buffer_ptr, uint32_t* buffer_length,
bool wait);
223 #if EWF_ADAPTER_ESPRESSIF_COMMON_UDP_ENABLED
229 ewf_result ewf_adapter_espressif_common_udp_control(
ewf_socket_udp* socket_ptr,
const char* control_str,
const uint8_t* buffer_ptr, uint32_t* buffer_length_ptr);
230 ewf_result ewf_adapter_espressif_common_udp_set_dtls_configuration(
ewf_socket_udp* socket_ptr, uint32_t dtls_configuration_id);
233 ewf_result ewf_adapter_espressif_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);
234 ewf_result ewf_adapter_espressif_common_udp_receive_from(
ewf_socket_udp* socket_ptr,
char* remote_address, uint32_t* remote_address_length_ptr, uint32_t* remote_port_ptr, uint8_t* buffer_ptr, uint32_t* buffer_length_ptr,
bool wait);
The Embedded Wireless Framework adapter API implementation.
struct _ewf_adapter_espressif_common_internet_socket ewf_adapter_espressif_common_internet_socket
Internal structure for internet socket status
_ewf_adapter_common_internet_socket_service_type
The socket service type
Definition: ewf_adapter_espressif_common.h:79
enum _ewf_adapter_common_internet_socket_service_type ewf_adapter_espressif_common_internet_socket_service_type
The socket service type
struct _ewf_adapter_espressif_common ewf_adapter_espressif_common
The ESPRESSIF common adapter data structure.
#define EWF_ADAPTER_ESPRESSIF_COMMON_INTERNET_SOCKET_POOL_SIZE
The total number of supported internet sockets in the adapter.
Definition: ewf_adapter_espressif_common.h:54
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 TCP API structure.
Definition: ewf_adapter_api_tcp.h:76
The UDP API type.
Definition: ewf_adapter_api_udp.h:63
Definition: ewf_adapter_api_wifi_station.h:29
Internal structure for internet socket status
Definition: ewf_adapter_espressif_common.h:90
The ESPRESSIF common adapter data structure.
Definition: ewf_adapter_espressif_common.h:106
bool passive_mode
Definition: ewf_adapter_espressif_common.h:111
int dummy
Definition: ewf_adapter_espressif_common.h:107
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