Skip to content

Commit 7e7af77

Browse files
Modify enet_tasklet.h
Change enet_tasklet_network_init() and enet_tasklet_disconnect() declarations to match code. Also add document enet_tasklet.h functions
1 parent 40e13cf commit 7e7af77

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

features/nanostack/mbed-mesh-api/source/NanostackEthernetInterface.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,5 @@ nsapi_error_t NanostackEthernetInterface::do_initialize()
9797

9898
nsapi_error_t Nanostack::EthernetInterface::bringdown()
9999
{
100-
enet_tasklet_disconnect();
101-
return 0;
100+
return enet_tasklet_disconnect(true);
102101
}

features/nanostack/mbed-mesh-api/source/ethernet_tasklet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "ns_event_loop.h"
2525
#include "mesh_interface_types.h"
2626
#include "eventOS_event.h"
27+
#include "enet_tasklet.h"
2728

2829
// For tracing we need to define flag, have include and define group
2930
#include "ns_trace.h"

features/nanostack/mbed-mesh-api/source/include/enet_tasklet.h

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,42 @@
2222
extern "C" {
2323
#endif
2424

25+
/*
26+
* \brief Initialize system.
27+
*/
2528
void enet_tasklet_init(void);
26-
uint8_t enet_tasklet_network_init(int8_t);
29+
30+
/*
31+
* \brief Create network interface.
32+
*
33+
* \param device_id registered physical device
34+
* \return interface ID that can be used to communication with this interface
35+
*/
36+
int8_t enet_tasklet_network_init(int8_t device_id);
37+
38+
/*
39+
* \brief Connect to ethernet network
40+
*
41+
* \param callback to be called when network state changes
42+
* \param nwk_interface_id to use for networking
43+
*
44+
*/
2745
int8_t enet_tasklet_connect(void (*)(mesh_connection_status_t mesh_status), int8_t nwk_interface_id);
28-
void enet_tasklet_disconnect();
46+
47+
/*
48+
* \brief Disconnect network interface.
49+
*
50+
* \param send_cb send possible network status change event if set to true.
51+
* \return >= 0 if disconnected successfully.
52+
* \return < 0 in case of errors
53+
*/
54+
int8_t enet_tasklet_disconnect(bool send_cb);
55+
56+
/*
57+
* \brief callback to be called when the link state changes.
58+
*
59+
* \param up tells if the link is up or down
60+
*/
2961
void enet_tasklet_link_state_changed(bool up);
3062

3163
#ifdef __cplusplus

0 commit comments

Comments
 (0)