9 #ifndef __ewf_adapter_mxchip_common__h__included__
10 #define __ewf_adapter_mxchip_common__h__included__
25 #define EWF_ADAPTER_MXCHIP_COMMON_TLS_BASIC_ENABLED (0)
26 #define EWF_ADAPTER_MXCHIP_COMMON_MQTT_BASIC_ENABLED (0)
28 #if !defined(EWF_ADAPTER_MXCHIP_COMMON_TLS_ENABLED) && !defined(EWF_ADAPTER_MXCHIP_COMMON_TLS_BASIC_ENABLED)
30 #define EWF_ADAPTER_MXCHIP_COMMON_TLS_BASIC_ENABLED (1)
31 #define EWF_ADAPTER_MXCHIP_COMMON_TLS_ENABLED (0)
33 #define EWF_ADAPTER_MXCHIP_COMMON_TLS_BASIC_ENABLED (0)
34 #define EWF_ADAPTER_MXCHIP_COMMON_TLS_ENABLED (1)
38 #ifndef EWF_ADAPTER_MXCHIP_COMMON_TCP_ENABLED
39 #define EWF_ADAPTER_MXCHIP_COMMON_TCP_ENABLED (1)
42 #ifndef EWF_ADAPTER_MXCHIP_COMMON_UDP_ENABLED
43 #define EWF_ADAPTER_MXCHIP_COMMON_UDP_ENABLED (1)
46 #ifndef EWF_ADAPTER_MXCHIP_COMMON_INTERNET_SOCKET_POOL_SIZE
48 #define EWF_ADAPTER_MXCHIP_COMMON_INTERNET_SOCKET_POOL_SIZE (5)
51 #ifndef EWF_ADAPTER_MXCHIP_COMMON_INTERNET_SOCKET_RECV_BUFFER_SIZE
53 #define EWF_ADAPTER_MXCHIP_COMMON_INTERNET_SOCKET_RECV_BUFFER_SIZE (1500)
56 #ifndef EWF_ADAPTER_MXCHIP_COMMON_INTERNET_SOCKET_INVALID
58 #define EWF_ADAPTER_MXCHIP_COMMON_INTERNET_SOCKET_INVALID (-1)
95 ewf_adapter_mxchip_common_internet_socket_service_type_not_initialized,
96 ewf_adapter_mxchip_common_internet_socket_service_type_tcp,
97 ewf_adapter_mxchip_common_internet_socket_service_type_udp,
98 ewf_adapter_mxchip_common_internet_socket_service_type_tcp_listener,
99 ewf_adapter_mxchip_common_internet_socket_service_type_udp_listener,
111 volatile bool open_error;
113 volatile bool conn_error;
122 volatile bool status_ap;
123 volatile bool status_station;
125 uint32_t ipv4_address;
126 uint32_t ipv4_netmask;
127 uint32_t ipv4_gateway;
130 #if EWF_ADAPTER_MXCHIP_COMMON_TCP_ENABLED || EWF_ADAPTER_MXCHIP_COMMON_UDP_ENABLED
165 ewf_result ewf_adapter_mxchip_common_get_ipv4_address(
ewf_adapter* adapter_ptr, uint32_t* address_ptr);
166 ewf_result ewf_adapter_mxchip_common_get_ipv4_netmask(
ewf_adapter* adapter_ptr, uint32_t* netmask_ptr);
167 ewf_result ewf_adapter_mxchip_common_get_ipv4_gateway(
ewf_adapter* adapter_ptr, uint32_t* gateway_ptr);
178 ewf_result ewf_adapter_mxchip_common_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
190 ewf_result ewf_adapter_mxchip_common_wifi_station_connect(
ewf_adapter* adapter_ptr,
const char* ssid_str,
const char* password_str);
201 #if EWF_ADAPTER_MXCHIP_COMMON_TCP_ENABLED || EWF_ADAPTER_MXCHIP_COMMON_UDP_ENABLED
206 ewf_result ewf_adapter_mxchip_common_internet_urc_callback(
ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t buffer_length);
218 #if EWF_ADAPTER_MXCHIP_COMMON_TCP_ENABLED
224 ewf_result ewf_adapter_mxchip_common_tcp_control(
ewf_socket_tcp* socket_ptr,
const char* control_str,
const uint8_t* buffer_ptr, uint32_t* buffer_length_ptr);
225 ewf_result ewf_adapter_mxchip_common_tcp_set_tls_configuration(
ewf_socket_tcp* socket_ptr, uint32_t tls_configuration_id);
229 ewf_result ewf_adapter_mxchip_common_tcp_connect(
ewf_socket_tcp* socket_ptr,
const char*
const server, uint32_t port);
231 ewf_result ewf_adapter_mxchip_common_tcp_send(
ewf_socket_tcp* socket_ptr,
const uint8_t* buffer_ptr, uint32_t buffer_length);
232 ewf_result ewf_adapter_mxchip_common_tcp_receive(
ewf_socket_tcp* socket_ptr, uint8_t* buffer_ptr, uint32_t* buffer_length,
bool wait);
244 #if EWF_ADAPTER_MXCHIP_COMMON_UDP_ENABLED
250 ewf_result ewf_adapter_mxchip_common_udp_control(
ewf_socket_udp* socket_ptr,
const char* control_str,
const uint8_t* buffer_ptr, uint32_t* buffer_length_ptr);
251 ewf_result ewf_adapter_mxchip_common_udp_set_dtls_configuration(
ewf_socket_udp* socket_ptr, uint32_t dtls_configuration_id);
254 ewf_result ewf_adapter_mxchip_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);
255 ewf_result ewf_adapter_mxchip_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.
_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_mxchip_common_internet_socket_service_type
The socket service type
struct _ewf_adapter_mxchip_common ewf_adapter_mxchip_common
The MX-CHIP common adapter data structure.
struct _ewf_adapter_mxchip_common_internet_socket ewf_adapter_mxchip_common_internet_socket
Internal structure for internet socket status
#define EWF_ADAPTER_MXCHIP_COMMON_INTERNET_SOCKET_POOL_SIZE
The total number of supported internet sockets in the adapter.
Definition: ewf_adapter_mxchip_common.h:48
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_mxchip_common.h:105
The MX-CHIP common adapter data structure.
Definition: ewf_adapter_mxchip_common.h:121
uint32_t ipv4_dns
Definition: ewf_adapter_mxchip_common.h:128
bool passive_mode
Definition: ewf_adapter_mxchip_common.h:132
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