diff --git a/features/nanostack/mbed-mesh-api/source/NanostackEthernetInterface.cpp b/features/nanostack/mbed-mesh-api/source/NanostackEthernetInterface.cpp index 15757ff8af..04bca1b9a6 100644 --- a/features/nanostack/mbed-mesh-api/source/NanostackEthernetInterface.cpp +++ b/features/nanostack/mbed-mesh-api/source/NanostackEthernetInterface.cpp @@ -97,5 +97,8 @@ nsapi_error_t NanostackEthernetInterface::do_initialize() nsapi_error_t Nanostack::EthernetInterface::bringdown() { - return enet_tasklet_disconnect(true); + if (enet_tasklet_disconnect(true)) { + return NSAPI_ERROR_DEVICE_ERROR; + } + return NSAPI_ERROR_OK; } diff --git a/features/nanostack/mbed-mesh-api/source/ethernet_tasklet.c b/features/nanostack/mbed-mesh-api/source/ethernet_tasklet.c index 39ba1068ed..e66afd0335 100644 --- a/features/nanostack/mbed-mesh-api/source/ethernet_tasklet.c +++ b/features/nanostack/mbed-mesh-api/source/ethernet_tasklet.c @@ -294,7 +294,7 @@ int8_t enet_tasklet_disconnect(bool send_cb) if (tasklet_data_ptr->network_interface_id != INVALID_INTERFACE_ID) { status = arm_nwk_interface_down(tasklet_data_ptr->network_interface_id); tasklet_data_ptr->network_interface_id = INVALID_INTERFACE_ID; - if (send_cb == true) { + if (send_cb) { enet_tasklet_network_state_changed(MESH_DISCONNECTED); } } diff --git a/features/nanostack/mbed-mesh-api/source/include/enet_tasklet.h b/features/nanostack/mbed-mesh-api/source/include/enet_tasklet.h index 88c42f9dc8..4aba04cbab 100644 --- a/features/nanostack/mbed-mesh-api/source/include/enet_tasklet.h +++ b/features/nanostack/mbed-mesh-api/source/include/enet_tasklet.h @@ -17,6 +17,7 @@ #ifndef ENET_TASKLET_H #define ENET_TASKLET_H +#include "mesh_interface_types.h" #ifdef __cplusplus extern "C" {