app: Update socket AT commands to use handle-based API#26
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates socket AT commands to use a handle-based API instead of socket selection, providing more flexible socket management by directly referencing socket handles in all operations.
- Removes
AT#XSOCKETSELECTcommand and socket ranking system - Adds
AT#XCLOSEcommand for individual or bulk socket closure - Updates all socket operations to require handle parameters
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| doc/app/sm_migration.rst | Adds migration guide documenting the transition from socket selection to handle-based API |
| doc/app/SOCKET_AT_commands.rst | Updates command documentation to reflect handle-based parameters and new #XCLOSE command |
| app/src/sm_at_socket.c | Implements handle-based socket operations, removes socket selection logic, and adds close command handler |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
8e79319 to
cad2c1f
Compare
24b8903 to
f575160
Compare
MarkusLassila
left a comment
There was a problem hiding this comment.
Moving into good direction!
I'll review the documentation after the sm_at_socket.c is in order.
894825a to
17e88a2
Compare
|
@MarkusLassila @trantanen I addressed the findings. Please re-review. |
MarkusLassila
left a comment
There was a problem hiding this comment.
Some nits, but LGTM!
0e4271b to
1c6e9ff
Compare
|
|
||
| util_get_peer_addr(&remote, peer_addr, &peer_port); | ||
| rsp_send("\r\n#XRECVFROM: %d,\"%s\",%d\r\n", ret, peer_addr, peer_port); | ||
| rsp_send("\r\n#XRECVFROM: %d,%d,\"%s\",%d\r\n", sock->fd, ret, peer_addr, peer_port); |
There was a problem hiding this comment.
@juhaylinen: Handle these github actions complaints.
There was a problem hiding this comment.
Indeed, compliance has several warnings about long lines but the check is showing green in github. Compliance log has these long lines as warnings, not errors so it doesn't fail. I will need to look at this but meanwhile, please fix the failures.
1c6e9ff to
2819cd7
Compare
All socket operations now require a handle obtained from #XSOCKET or #XSSOCKET command. This allows more flexible way to manage sockets. Remove AT command #XSOCKETSELECT. Add AT command #XCLOSE to close individual socket or all sockets at once. Update documentation. SLM-50 Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2819cd7 to
86fd8df
Compare
MarkusLassila
left a comment
There was a problem hiding this comment.
Merge away.
@moksanen && @jvaliharju, prepare for breaking socket tests.
All socket operations now require a handle obtained from #XSOCKET or #XSSOCKET command. This allows more flexible way to manage sockets.
Remove AT command #XSOCKETSELECT.
Add AT command #XCLOSE to close individual socket or all sockets at once.
Update documentation.
SLM-50