app: Move from nrf_ to zsock_ socket operations#316
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the Serial Modem application and its AT-socket test suite from nrf_* socket APIs to offloaded zsock_* socket operations, leveraging SO_POLLCB support to return to offloaded sockets.
Changes:
- Replace
nrf_*socket calls withzsock_*equivalents across the AT socket layer and HTTP client paths. - Update unit tests to mock
zsock_*APIs and enable POSIX socket namespace compatibility for the test build. - Remove direct dependency on
nrf_socket.hfrom shared defines and adjust buffer sizing.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/sm_at_socket.c | Switch core AT socket operations, sockopts, polling and callbacks to zsock_*. |
| app/src/sm_at_httpc.c | Use zsock_send/recv and ZSOCK_POLL* events for HTTP client socket I/O. |
| app/src/sm_at_httpc.h | Update poll-event documentation to reference ZSOCK_POLL*. |
| app/src/sm_ppp.c | Use zsock_inet_pton for PPP DNS fallback address parsing. |
| app/src/sm_defines.h | Drop nrf_socket.h include and hardcode SM_MAX_MESSAGE_SIZE. |
| app/src/sm_at_icmp.c | Remove nrf_socket.h include (keep Zephyr socket usage). |
| app/tests/at_socket/CMakeLists.txt | Enable CONFIG_NET_NAMESPACE_COMPAT_MODE for the test target. |
| app/tests/at_socket/src/test_at_socket.c | Update mocks/expectations from nrf_* to zsock_* across test cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
trantanen
approved these changes
May 22, 2026
Replace nrf_ socket operations with offloaded zsock_ socket operations. Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
23dac8e to
fa23e37
Compare
Change the unit tests to use offloaded sockets. Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
fa23e37 to
a62431f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace nrf_ socket operations with offloaded zsock_ socket operations.
Note: We changed from
zsock_sockettonrf_socketin PR #47 due toSO_POLLCBsupport being only for nrf_sockets.. Now that we haveSO_POLLCB, we can move back to offloaded sockets.Jira: SM-319