Embedded Wireless Framework
Data Structures | Macros | Typedefs | Functions
ewf_adapter_api_tcp.h File Reference

The Embedded Wireless Framework adapter TCP API. More...

#include "ewf.h"

Go to the source code of this file.

Data Structures

struct  _ewf_socket_tcp
 The TCP socket structure definition. More...
 
struct  _ewf_adapter_api_tcp
 The TCP API structure. More...
 

Macros

#define EWF_VALIDATE_TCP_SOCKET_POINTER(socket_ptr)
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_SET_CONTEXT_ID   ("!SetContextId")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_SET_CONNECTION_TIMEOUT   ("!SetConnectionTimeout")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_IS_CONNECTED   ("!IsConnected")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_IS_BOUND   ("!IsBound")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_USES_TLS   ("!UsesTLS")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_PEER_ADDRESSS   ("!PeerAddress")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_LOCAL_ADDRESSS   ("!LocalAddress")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_SENT_BYTES   ("!SentBytes")
 
#define EWF_ADAPTER_TCP_SOCKET_CONTROL_RECEIVED_BYTES   ("!ReceivedBytes")
 

Typedefs

typedef struct _ewf_socket_tcp ewf_socket_tcp
 The TCP socket type.
 
typedef ewf_result(* ewf_adapter_tcp_receive_callback) (ewf_socket_tcp *socket_ptr, const uint8_t *buffer_ptr, uint32_t buffer_length)
 A function pointer type for TCP receive callbacks. More...
 
typedef ewf_result(* ewf_adapter_tcp_disconnect_callback) (ewf_socket_tcp *socket_ptr)
 A function pointer type for TCP disconnect callbacks. More...
 
typedef struct _ewf_adapter_api_tcp ewf_adapter_api_tcp
 The TCP API structure.
 

Functions

ewf_result ewf_adapter_tcp_open (ewf_adapter *adapter_ptr, ewf_socket_tcp *socket_ptr)
 Open a TCP socket. More...
 
ewf_result ewf_adapter_tcp_close (ewf_socket_tcp *socket_ptr)
 Close a TCP socket. More...
 
ewf_result ewf_adapter_tcp_control (ewf_socket_tcp *socket_ptr, const char *control_str, const uint8_t *buffer_ptr, uint32_t *buffer_length_ptr)
 Control a TCP socket This is mainly used to funnel implementation specific functionality. More...
 
ewf_result ewf_adapter_tcp_set_tls_configuration (ewf_socket_tcp *socket_ptr, uint32_t tls_configuration_id)
 Set the TLS context for the socket. More...
 
ewf_result ewf_adapter_tcp_bind (ewf_socket_tcp *socket_ptr, uint32_t port)
 Binds a TCP socket to a port. More...
 
ewf_result ewf_adapter_tcp_listen (ewf_socket_tcp *socket_ptr)
 Listens to incomming connections on a socket. More...
 
ewf_result ewf_adapter_tcp_accept (ewf_socket_tcp *socket_ptr, ewf_socket_tcp *socket_new_ptr)
 Accept a new connection on a listening TCP socket. More...
 
ewf_result ewf_adapter_tcp_connect (ewf_socket_tcp *socket_ptr, const char *server_str, uint32_t port)
 Connect a TCP socket to a server. More...
 
ewf_result ewf_adapter_tcp_shutdown (ewf_socket_tcp *socket_ptr)
 Shutdown a TCP socket. More...
 
ewf_result ewf_adapter_tcp_send (ewf_socket_tcp *socket_ptr, const uint8_t *buffer_ptr, uint32_t buffer_length)
 Send data over a TCP socket. More...
 
ewf_result ewf_adapter_tcp_receive (ewf_socket_tcp *socket_ptr, uint8_t *buffer_ptr, uint32_t *buffer_length, bool wait)
 Receive data over a TCP socket. More...
 
ewf_result ewf_adapter_tcp_receive_callback_set (ewf_socket_tcp *socket_ptr, ewf_adapter_tcp_receive_callback callback)
 Register a user TCP receive callback function. More...
 
ewf_result ewf_adapter_tcp_disconnect_callback_set (ewf_socket_tcp *socket_ptr, ewf_adapter_tcp_disconnect_callback callback)
 Register a user TCP disconnect callback function. More...
 

Detailed Description

The Embedded Wireless Framework adapter TCP API.

Version
Preview