Supported functions and socket options
The networking sockets support a list of functions and socket options.
The implementation of networking sockets is namespaced (nrf_) to avoid conflicts with functions that might be part of libc or other POSIX compatibility libraries.
Supported functions
Following is a list of supported functions:
The library supports up to eight networking sockets.
Socket options
The following table shows all socket options supported by the Modem library.
Option level |
Option |
Type |
Operations |
Description |
|---|---|---|---|---|
NRF_SOL_SOCKET |
|
get |
Request and clear pending error information on the socket. |
|
NRF_SOL_SOCKET |
|
set |
Enable reuse of server addresses. |
|
NRF_SOL_SOCKET |
|
get/set |
Timeout value for a socket receive and accept operations. |
|
NRF_SOL_SOCKET |
|
get/set |
Timeout value for a socket send operation. |
|
NRF_SOL_SOCKET |
|
set |
Bind a socket to a Packet Data Network (PDN) ID. |
|
NRF_SOL_SOCKET |
|
set |
Set a callback for |
|
NRF_SOL_SOCKET |
|
get/set |
Send data on a socket as part of an exceptional event. |
|
NRF_SOL_SOCKET |
|
get/set |
Keep the socket open when its PDN connection is lost, or the device is set to flight mode. |
|
NRF_SOL_SOCKET |
|
set |
Release Assistance Indication (RAI). |
|
NRF_SOL_SOCKET |
|
set |
Callback to be called when a send request is acknowledged. |
|
NRF_IPPROTO_ALL |
|
get/set |
Disable ICMP echo replies on both IPv4 and IPv6. |
|
NRF_IPPROTO_IP |
|
get/set |
Enable ICMP echo replies on IPv4. |
|
NRF_IPPROTO_IPV6 |
|
get/set |
Enable ICMP echo replies on IPv6. |
|
NRF_IPPROTO_IPV6 |
|
get/set |
Delay IPv6 address refresh during power saving mode. |
|
NRF_IPPROTO_TCP |
|
get/set |
Configure the TCP server session inactivity timeout for a socket. |
|
NRF_SOL_SECURE |
|
get/set |
Select an array of security tags to use for credentials when connecting. |
|
NRF_SOL_SECURE |
|
get/set |
Configure the hostname used for peer verification. |
|
NRF_SOL_SECURE |
|
get/set |
Select which cipher suites are allowed to be used during the TLS handshake. |
|
NRF_SOL_SECURE |
|
get/set |
Configure peer verification level. |
|
NRF_SOL_SECURE |
|
get/set |
Configure the role for the connection. |
|
NRF_SOL_SECURE |
|
get/set |
Enable/disable TLS session caching. |
|
NRF_SOL_SECURE |
|
set |
Purge TLS session cache. |
|
NRF_SOL_SECURE |
|
get/set |
Configure the DTLS handshake timeout value. |
|
NRF_SOL_SECURE |
|
get |
Get the end status of the last completed TLS/DTLS handshake procedure. |
|
NRF_SOL_SECURE |
|
get/set |
Enable/disable the DTLS connection ID. |
|
NRF_SOL_SECURE |
|
get |
Get status of DTLS Connection ID. |
|
NRF_SOL_SECURE |
|
set |
Save DTLS connection. |
|
NRF_SOL_SECURE |
|
set |
Load DTLS connection. |
|
NRF_SOL_SECURE |
|
get |
Retrieve the cipher suite used during the TLS/DTLS handshake. |
|
NRF_SOL_SECURE |
|
get/set |
Enable/disable the DTLS fragmentation extension. |
The details for each socket option are described in the API documentation, notably in the Modem library socket options API and Modem library socket TLS API sections.
Supported flags for socket functions
The following flags are supported for socket functions such as nrf_send(), nrf_recv(), nrf_sendto(), and nrf_recvfrom():
The following table summarizes which send/recv flags are supported by each socket API function.
The flags are further described in the API documentation, notably in the Modem library socket flags API section.