Skip to content

Commit d53553e

Browse files
author
Cruz Monrreal
authored
Merge pull request #9034 from KariHaapalehto/enet_tasklet_definitions
Change enet_tasklet declarations to match code
2 parents 34007bb + 8de7a36 commit d53553e

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 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 Call 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 if error.
53+
*/
54+
int8_t enet_tasklet_disconnect(bool send_cb);
55+
56+
/*
57+
* \brief Callback to call when the link state changes.
58+
*
59+
* \param up Tells if link is up or down.
60+
*/
2961
void enet_tasklet_link_state_changed(bool up);
3062

3163
#ifdef __cplusplus

0 commit comments

Comments
 (0)