Socket Option Id#

Silicon Labs vendor extensions#

These option ids are NOT part of the OSF / CMSIS IoT Socket specification. They are defined only for the SiWx91x BSD-backed IoT Socket wrapper and are non-portable. Code that needs to run against any other IoT Socket implementation must guard these option ids with #ifdefIOT_SOCKET_VENDOR_SILABS. The standard CMSIS IoT Socket option ids occupy values 1..5; the 0x1100+ range is reserved for Silicon Labs vendor extensions.

#define
IOT_SOCKET_VENDOR_SILABS 1

Marker that the SiLabs vendor extensions below are available.

#define
IOT_SOCKET_SO_SSL_ENABLE 0x1100

Enable TLS on a stream socket (Silicon Labs vendor extension).

Macros#

#define
IOT_SOCKET_IO_FIONBIO 1

Non-blocking I/O (Set only, default = 0); opt_val = &nbio, opt_len = sizeof(nbio), nbio (integer): 0=blocking, non-blocking otherwise.

#define
IOT_SOCKET_SO_RCVTIMEO 2

Receive timeout in ms (default = 0); opt_val = &timeout, opt_len = sizeof(timeout)

#define
IOT_SOCKET_SO_SNDTIMEO 3

Send timeout in ms (default = 0); opt_val = &timeout, opt_len = sizeof(timeout)

#define
IOT_SOCKET_SO_KEEPALIVE 4

Keep-alive messages (default = 0); opt_val = &keepalive, opt_len = sizeof(keepalive), keepalive (integer): 0=disabled, enabled otherwise.

#define
IOT_SOCKET_SO_TYPE 5

Socket Type (Get only); opt_val = &socket_type, opt_len = sizeof(socket_type), socket_type (integer): IOT_SOCKET_SOCK_xxx.

Silicon Labs vendor extensions Documentation#