Align prototype & implementation of enet_tasklet_disconnect & friends

Rework of #8698

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
pull/9208/head
Alastair D'Silva 2018-12-14 14:04:50 +11:00 committed by Cruz Monrreal II
parent 45e7296e05
commit d77f2c4b3a
3 changed files with 6 additions and 2 deletions

View File

@ -97,5 +97,8 @@ nsapi_error_t NanostackEthernetInterface::do_initialize()
nsapi_error_t Nanostack::EthernetInterface::bringdown() 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;
} }

View File

@ -294,7 +294,7 @@ int8_t enet_tasklet_disconnect(bool send_cb)
if (tasklet_data_ptr->network_interface_id != INVALID_INTERFACE_ID) { if (tasklet_data_ptr->network_interface_id != INVALID_INTERFACE_ID) {
status = arm_nwk_interface_down(tasklet_data_ptr->network_interface_id); status = arm_nwk_interface_down(tasklet_data_ptr->network_interface_id);
tasklet_data_ptr->network_interface_id = INVALID_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); enet_tasklet_network_state_changed(MESH_DISCONNECTED);
} }
} }

View File

@ -17,6 +17,7 @@
#ifndef ENET_TASKLET_H #ifndef ENET_TASKLET_H
#define ENET_TASKLET_H #define ENET_TASKLET_H
#include "mesh_interface_types.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {