From d527585394dce14ba1989d58935e559cddd280cf Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Fri, 14 Dec 2018 14:04:50 +1100 Subject: [PATCH] Align prototype & implementation of enet_tasklet_disconnect & friends Rework of #8698 Signed-off-by: Alastair D'Silva --- .../mbed-mesh-api/source/NanostackEthernetInterface.cpp | 5 ++++- features/nanostack/mbed-mesh-api/source/ethernet_tasklet.c | 2 +- .../nanostack/mbed-mesh-api/source/include/enet_tasklet.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) 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" {