Skip to content

Commit

Permalink
applications: serial_lte_modem: Fix socket options.
Browse files Browse the repository at this point in the history
Numbering has changed for: TLS_DTLS_CID, TLS_DTLS_CID_STATUS and
TLS_DTLS_HANDSHAKE_TIMEO.

SO_BINDTODEVICE has been replaced with SO_BINDTOPDN.

Signed-off-by: Markus Lassila <[email protected]>
  • Loading branch information
MarkusLassila authored and nordicjm committed Oct 10, 2023
1 parent d879602 commit f42e7b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
22 changes: 11 additions & 11 deletions applications/serial_lte_modem/doc/SOCKET_AT_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,6 @@ Syntax

* ``<value>`` is an integer that indicates the send timeout in seconds.

* ``25`` - :c:macro:`SO_BINDTODEVICE` (set-only).

* ``<value>`` is an integer that indicates the PDP context ID to bind to.

* ``30`` - :c:macro:`SO_SILENCE_ALL`.

* ``<value>`` is an integer that indicates whether ICMP echo replies for IPv4 and IPv6 are disabled.
Expand All @@ -539,6 +535,10 @@ Syntax
* ``<value>`` is an integer that indicates whether ICMP echo replies for IPv6 are enabled.
It is ``0`` for disabled or ``1`` for enabled.

* ``40`` - :c:macro:`SO_BINDTOPDN` (set-only).

* ``<value>`` is an integer that indicates the packet data network ID to bind to.

* ``50`` - :c:macro:`SO_RAI_NO_DATA` (set-only).
Immediately release the RRC.

Expand Down Expand Up @@ -663,12 +663,7 @@ Syntax

* ``<value>`` can be any integer value.

* ``14`` - :c:macro:`TLS_DTLS_HANDSHAKE_TIMEO`.

* ``<value>`` is an integer that indicates the DTLS handshake timeout in seconds.
It can be one of the following values: ``1``, ``3``, ``7``, ``15``, ``31``, ``63``, ``123``.

* ``17`` - :c:macro:`TLS_DTLS_CID`.
* ``14`` - :c:macro:`TLS_DTLS_CID` (set-only).

* ``<value>`` is an integer that indicates the DTLS connection identifier setting.
It can be one of the following values:
Expand All @@ -680,12 +675,17 @@ Syntax
This option is only supported with modem firmware 1.3.5 and newer.
See :ref:`nrfxlib:dtls_cid_setting` for more details regarding the allowed values.

* ``18`` - :c:macro:`TLS_DTLS_CID_STATUS` (get-only).
* ``15`` - :c:macro:`TLS_DTLS_CID_STATUS` (get-only).
It is the DTLS connection identifier status.
It can be retrieved after the DTLS handshake.
This option is only supported with modem firmware 1.3.5 and newer.
See :ref:`nrfxlib:dtls_cid_status` for more details regarding the returned values.

* ``18`` - :c:macro:`TLS_DTLS_HANDSHAKE_TIMEO`.

* ``<value>`` is an integer that indicates the DTLS handshake timeout in seconds.
It can be one of the following values: ``1``, ``3``, ``7``, ``15``, ``31``, ``63``, ``123``.

See `nRF socket options`_ for explanation of the supported options.


Expand Down
6 changes: 3 additions & 3 deletions applications/serial_lte_modem/src/slm_at_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int find_avail_socket(void)
return -ENOENT;
}

static int bind_to_device(uint16_t cid)
static int bind_to_pdn(uint16_t cid)
{
int ret = 0;

Expand Down Expand Up @@ -143,7 +143,7 @@ static int do_socket_open(void)

sock.fd = ret;
/* Explicitly bind to secondary PDP context if required */
ret = bind_to_device(sock.cid);
ret = bind_to_pdn(sock.cid);
if (ret) {
close(sock.fd);
return ret;
Expand Down Expand Up @@ -180,7 +180,7 @@ static int do_secure_socket_open(int peer_verify)
}
sock.fd = ret;
/* Explicitly bind to secondary PDP context if required */
ret = bind_to_device(sock.cid);
ret = bind_to_pdn(sock.cid);
if (ret) {
close(sock.fd);
return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ Serial LTE modem
* Modem FOTA to only need a modem reset to apply the firmware update.
The full chip reset (using the ``#XRESET`` AT command) remains supported.
* ``#XGPSDEL`` AT command to disallow deleting local clock (TCXO) frequency offset data because it is an internal value that should not be deleted when simulating a cold start.
* Socket option ``TLS_DTLS_HANDSHAKE_TIMEO`` to a new name value.

* Removed:

Expand Down

0 comments on commit f42e7b4

Please sign in to comment.