Merge pull request #9034 from KariHaapalehto/enet_tasklet_definitions

Change enet_tasklet declarations to match code
pull/9109/head
Cruz Monrreal 2018-12-12 17:03:43 -06:00 committed by GitHub
commit d53553e10d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 4 deletions

View File

@ -97,6 +97,5 @@ nsapi_error_t NanostackEthernetInterface::do_initialize()
nsapi_error_t Nanostack::EthernetInterface::bringdown()
{
enet_tasklet_disconnect();
return 0;
return enet_tasklet_disconnect(true);
}

View File

@ -24,6 +24,7 @@
#include "ns_event_loop.h"
#include "mesh_interface_types.h"
#include "eventOS_event.h"
#include "enet_tasklet.h"
// For tracing we need to define flag, have include and define group
#include "ns_trace.h"

View File

@ -22,10 +22,42 @@
extern "C" {
#endif
/*
* \brief Initialize system.
*/
void enet_tasklet_init(void);
uint8_t enet_tasklet_network_init(int8_t);
/*
* \brief Create network interface.
*
* \param device_id Registered physical device.
* \return interface ID used to communication with this interface.
*/
int8_t enet_tasklet_network_init(int8_t device_id);
/*
* \brief Connect to Ethernet network.
*
* \param callback Call when network state changes.
* \param nwk_interface_id To use for networking.
*
*/
int8_t enet_tasklet_connect(void (*)(mesh_connection_status_t mesh_status), int8_t nwk_interface_id);
void enet_tasklet_disconnect();
/*
* \brief Disconnect network interface.
*
* \param send_cb Send possible network status change event if set to `true`.
* \return >= 0 if disconnected successfully.
* \return < 0 if error.
*/
int8_t enet_tasklet_disconnect(bool send_cb);
/*
* \brief Callback to call when the link state changes.
*
* \param up Tells if link is up or down.
*/
void enet_tasklet_link_state_changed(bool up);
#ifdef __cplusplus