Skip to content

app: Add automatic data reception for sockets#102

Merged
MarkusLassila merged 1 commit into
nrfconnect:mainfrom
MarkusLassila:add-socket-immediate
Dec 8, 2025
Merged

app: Add automatic data reception for sockets#102
MarkusLassila merged 1 commit into
nrfconnect:mainfrom
MarkusLassila:add-socket-immediate

Conversation

@MarkusLassila

@MarkusLassila MarkusLassila commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

A new AT-command #XRECVCFG can be used to set the automatic data reception for the sockets. When the automatic
data reception is activated, the data received for the socket is immediately sent to host as URC.

Jira: SM-110
Jira: SM-195

@MarkusLassila MarkusLassila force-pushed the add-socket-immediate branch 3 times, most recently from f4cea89 to c03e01b Compare December 1, 2025 09:25
@MarkusLassila MarkusLassila marked this pull request as ready for review December 1, 2025 09:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds automatic receive functionality for socket data through a new AT command #XSOCKETMODE. The feature enables sockets to automatically receive and report incoming data as URC notifications, eliminating the need for manual receive commands.

Key Changes

  • Introduces #XSOCKETMODE AT command to configure automatic data reception for sockets in both AT-command mode and data mode
  • Refactors socket mode enumerations to unify send and receive mode handling
  • Enhances poll event management to track and process delayed events across mode transitions

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
doc/app/SOCKET_AT_commands.rst Adds documentation for the new #XSOCKETMODE command with examples and response format references
app/src/sm_uart_handler.c Updates URC sending logic to use in_at_mode() check instead of negated in_datamode()
app/src/sm_cmux.c Updates URC sending logic to use in_at_mode() check instead of negated in_datamode()
app/src/sm_at_socket.h Declares new function to notify socket module when data mode exits
app/src/sm_at_socket.c Core implementation of automatic receive feature including mode tracking, event management, and the #XSOCKETMODE command handler
app/src/sm_at_host.h Declares new in_at_mode() helper function
app/src/sm_at_host.c Implements in_at_mode() function and adds notification call on data mode exit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/sm_at_socket.c Outdated
Comment thread app/src/sm_at_socket.c
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
@MarkusLassila MarkusLassila changed the title app: Add automatic receive for socket data app: Add automatic data reception for sockets Dec 1, 2025
@MarkusLassila MarkusLassila force-pushed the add-socket-immediate branch 6 times, most recently from 3d4f261 to b829cd3 Compare December 3, 2025 09:58
@MarkusLassila

Copy link
Copy Markdown
Contributor Author

Items from SM status meeting have been addressed. Feel free to review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/sm_at_socket.c Outdated
Comment thread app/src/sm_at_socket.c Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread app/src/sm_at_socket.c
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread doc/app/SOCKET_AT_commands.rst Outdated
Comment thread app/src/sm_at_socket.c
@MarkusLassila MarkusLassila force-pushed the add-socket-immediate branch 2 times, most recently from 908160c to cd7656f Compare December 5, 2025 14:10
Comment thread doc/app/SOCKET_AT_commands.rst
@MarkusLassila

Copy link
Copy Markdown
Contributor Author

Ping @trantanen, @divipillai

Comment thread doc/app/SOCKET_AT_commands.rst Outdated
A new AT-command #XRECVCFG can be used to set the
automatic data reception for the sockets. When the automatic
data reception is activated, the data received for the socket
is immediately sent to host as URC.

Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
@MarkusLassila MarkusLassila merged commit 91398a9 into nrfconnect:main Dec 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants