Skip to content

Commit b758b34

Browse files
committed
app: Add SO_KEEPOPEN
Add nRF91x1 specific SO_KEEPOPEN. If set, socket is kept open when entering flight mode (+CFUN=4). Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
1 parent dde7101 commit b758b34

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

app/src/sm_at_socket.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,10 @@ static int at_sockopt_to_sockopt(enum at_sockopt at_option, int *level, int *opt
743743
*level = IPPROTO_IPV6;
744744
*option = SO_IPV6_ECHO_REPLY;
745745
break;
746+
case AT_SO_KEEPOPEN:
747+
*level = SOL_SOCKET;
748+
*option = SO_KEEPOPEN;
749+
break;
746750
case AT_SO_IPV6_DELAYED_ADDR_REFRESH:
747751
*level = IPPROTO_IPV6;
748752
*option = SO_IPV6_DELAYED_ADDR_REFRESH;

app/src/sm_sockopt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ enum at_sockopt {
2323
AT_SO_SILENCE_ALL = 30,
2424
AT_SO_IP_ECHO_REPLY = 31,
2525
AT_SO_IPV6_ECHO_REPLY = 32,
26+
AT_SO_KEEPOPEN = 34,
2627
AT_SO_BINDTOPDN = 40,
2728
AT_SO_TCP_SRV_SESSTIMEO = 55,
2829
AT_SO_RAI = 61,

doc/app/at_socket.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,11 @@ Syntax
477477
* ``<value>`` is an integer that indicates whether ICMP echo replies for IPv6 are enabled.
478478
It is ``0`` for disabled or ``1`` for enabled.
479479

480+
* ``34`` - ``AT_SO_KEEPOPEN``.
481+
482+
* ``<value>`` is an integer that indicates whether socket is kept open when the modem enters the flight mode (``+CFUN=4``).
483+
It is ``0`` for disabled or ``1`` for enabled.
484+
480485
* ``40`` - ``AT_SO_BINDTOPDN`` (set-only).
481486

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

0 commit comments

Comments
 (0)