mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #15366 from YannCharbon/icmp_sockets
Add support of NSAPI_ICMP sockets in Nanostackpull/15369/head
commit
06566fc569
|
@ -122,7 +122,7 @@ protected:
|
||||||
* NSAPI_ERROR_NO_SOCKET is returned if no socket is available.
|
* NSAPI_ERROR_NO_SOCKET is returned if no socket is available.
|
||||||
*
|
*
|
||||||
* @param handle Destination for the handle to a newly created socket
|
* @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
|
* @return 0 on success, negative error code on failure
|
||||||
*/
|
*/
|
||||||
nsapi_error_t socket_open(void **handle, nsapi_protocol_t proto) override;
|
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;
|
ns_proto = SOCKET_UDP;
|
||||||
} else if (NSAPI_TCP == protocol) {
|
} else if (NSAPI_TCP == protocol) {
|
||||||
ns_proto = SOCKET_TCP;
|
ns_proto = SOCKET_TCP;
|
||||||
|
} else if (NSAPI_ICMP == protocol) {
|
||||||
|
ns_proto = SOCKET_ICMP;
|
||||||
} else {
|
} else {
|
||||||
MBED_ASSERT(false);
|
MBED_ASSERT(false);
|
||||||
return NSAPI_ERROR_UNSUPPORTED;
|
return NSAPI_ERROR_UNSUPPORTED;
|
||||||
|
|
Loading…
Reference in New Issue