Modify enet_tasklet.h Change enet_tasklet_network_init() and enet_tasklet_disconnect() declarations to match code. Also add document enet_tasklet.h functions

pull/9208/head
Kari Haapalehto 2018-12-10 15:29:33 +02:00 committed by Cruz Monrreal II
parent 4d2f6621c4
commit 35ce1e5ff3
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 that can be used to communication with this interface
*/
int8_t enet_tasklet_network_init(int8_t device_id);
/*
* \brief Connect to ethernet network
*
* \param callback to be called 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 in case of errors
*/
int8_t enet_tasklet_disconnect(bool send_cb);
/*
* \brief callback to be called when the link state changes.
*
* \param up tells if the link is up or down
*/
void enet_tasklet_link_state_changed(bool up);
#ifdef __cplusplus