Skip to content

Commit 06566fc

Browse files
authored
Merge pull request #15366 from YannCharbon/icmp_sockets
Add support of NSAPI_ICMP sockets in Nanostack
2 parents 751fe9d + aa7bf3e commit 06566fc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

connectivity/nanostack/include/nanostack-interface/Nanostack.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class Nanostack : public OnboardNetworkStack, private mbed::NonCopyable<Nanostac
122122
* NSAPI_ERROR_NO_SOCKET is returned if no socket is available.
123123
*
124124
* @param handle Destination for the handle to a newly created socket
125-
* @param proto Protocol of socket to open, NSAPI_TCP or NSAPI_UDP
125+
* @param proto Protocol of socket to open, NSAPI_TCP, NSAPI_UDP or NSAPI_ICMP
126126
* @return 0 on success, negative error code on failure
127127
*/
128128
nsapi_error_t socket_open(void **handle, nsapi_protocol_t proto) override;

connectivity/nanostack/source/Nanostack.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,8 @@ nsapi_error_t Nanostack::socket_open(void **handle, nsapi_protocol_t protocol)
678678
ns_proto = SOCKET_UDP;
679679
} else if (NSAPI_TCP == protocol) {
680680
ns_proto = SOCKET_TCP;
681+
} else if (NSAPI_ICMP == protocol) {
682+
ns_proto = SOCKET_ICMP;
681683
} else {
682684
MBED_ASSERT(false);
683685
return NSAPI_ERROR_UNSUPPORTED;

0 commit comments

Comments
 (0)