mirror of https://github.com/ARMmbed/mbed-os.git
Add support of NSAPI_ICMP sockets in Nanostack
parent
149d444825
commit
aa7bf3e435
|
@ -122,7 +122,7 @@ protected:
|
|||
* 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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue