Skip to content

Add support of NSAPI_ICMP sockets in Nanostack #15366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Nanostack : public OnboardNetworkStack, private mbed::NonCopyable<Nanostac
* NSAPI_ERROR_NO_SOCKET is returned if no socket is available.
*
* @param handle Destination for the handle to a newly created socket
* @param proto Protocol of socket to open, NSAPI_TCP or NSAPI_UDP
* @param proto Protocol of socket to open, NSAPI_TCP, NSAPI_UDP or NSAPI_ICMP
* @return 0 on success, negative error code on failure
*/
nsapi_error_t socket_open(void **handle, nsapi_protocol_t proto) override;
Expand Down
2 changes: 2 additions & 0 deletions connectivity/nanostack/source/Nanostack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@ nsapi_error_t Nanostack::socket_open(void **handle, nsapi_protocol_t protocol)
ns_proto = SOCKET_UDP;
} else if (NSAPI_TCP == protocol) {
ns_proto = SOCKET_TCP;
} else if (NSAPI_ICMP == protocol) {
ns_proto = SOCKET_ICMP;
} else {
MBED_ASSERT(false);
return NSAPI_ERROR_UNSUPPORTED;
Expand Down