IoT Socket  Version 1.3.0
Simple IP Socket (BSD like)
IoT Socket Multiplexer API

List of APIs specific to IoT Socket Multiplexer. More...

Data Structures

struct  iotSocketApi_t
 Access structure of the IoT Socket API. More...
 

Functions

int32_t iotSocketRegisterApi (const iotSocketApi_t *api)
 Register socket API. More...
 

Description

List of APIs specific to IoT Socket Multiplexer.

See IoT Socket Multiplexer for concept overview.


Data Structure Documentation

◆ iotSocketApi_t

struct iotSocketApi_t

Access structure of the IoT Socket API.

Specifies the API access structure for the iotSocketRegisterApi function.

Data Fields

int32_t(* SocketCreate )(int32_t af, int32_t type, int32_t protocol)
 Pointer to IoT Socket create function (see iotSocketCreate)
 
int32_t(* SocketBind )(int32_t socket, const uint8_t *ip, uint32_t ip_len, uint16_t port)
 Pointer to IoT Socket bind function (see iotSocketCreate)
 
int32_t(* SocketListen )(int32_t socket, int32_t backlog)
 Pointer to IoT Socket listen function (see iotSocketListen)
 
int32_t(* SocketAccept )(int32_t socket, uint8_t *ip, uint32_t *ip_len, uint16_t *port)
 Pointer to IoT Socket accept function (see iotSocketAccept)
 
int32_t(* SocketConnect )(int32_t socket, const uint8_t *ip, uint32_t ip_len, uint16_t port)
 Pointer to IoT Socket connect function (see iotSocketConnect)
 
int32_t(* SocketRecv )(int32_t socket, void *buf, uint32_t len)
 Pointer to IoT Socket receive function (see iotSocketRecv)
 
int32_t(* SocketRecvFrom )(int32_t socket, void *buf, uint32_t len, uint8_t *ip, uint32_t *ip_len, uint16_t *port)
 Pointer to IoT Socket receive from function (see iotSocketRecvFrom)
 
int32_t(* SocketSend )(int32_t socket, const void *buf, uint32_t len)
 Pointer to IoT Socket send function (see iotSocketSend).
 
int32_t(* SocketSendTo )(int32_t socket, const void *buf, uint32_t len, const uint8_t *ip, uint32_t ip_len, uint16_t port)
 Pointer to IoT Socket send to function (see iotSocketSendTo)
 
int32_t(* SocketGetSockName )(int32_t socket, uint8_t *ip, uint32_t *ip_len, uint16_t *port)
 Pointer to IoT Socket get socket name function (see iotSocketGetSockName)
 
int32_t(* SocketGetPeerName )(int32_t socket, uint8_t *ip, uint32_t *ip_len, uint16_t *port)
 Pointer to IoT Socket get peer name function (see iotSocketGetPeerName)
 
int32_t(* SocketGetOpt )(int32_t socket, int32_t opt_id, void *opt_val, uint32_t *opt_len)
 Pointer to IoT Socket get option function (see iotSocketGetOpt)
 
int32_t(* SocketSetOpt )(int32_t socket, int32_t opt_id, const void *opt_val, uint32_t opt_len)
 Pointer to IoT Socket set option function (see iotSocketSetOpt)
 
int32_t(* SocketClose )(int32_t socket)
 Pointer to IoT Socket close function (see iotSocketClose)
 
int32_t(* SocketGetHostByName )(const char *name, int32_t af, uint8_t *ip, uint32_t *ip_len)
 Pointer to IoT Socket get host by name function (see iotSocketGetHostByName)
 

Function Documentation

◆ iotSocketRegisterApi()

int32_t iotSocketRegisterApi ( const iotSocketApi_t api)

Register socket API.

Parameters
[in]apipointer to API access structure (NULL disables socket API)
Returns
status information:
  • 0 = Operation successful.
  • negative value = error.

The function iotSocketRegisterApi registers the functions that get executed when corresponding IoT Socket API is called. It is available only with IoT Socket Multiplexer (Mux variant).

The argument api is a pointer to a structure of iotSocketApi_t type that provides the mapping for IoT Socket API.