Skip to content

Change enet_tasklet declarations to match code #9034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions features/nanostack/mbed-mesh-api/source/ethernet_tasklet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
36 changes: 34 additions & 2 deletions features/nanostack/mbed-mesh-api/source/include/enet_tasklet.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,42 @@
extern "C" {
#endif

/*
* \brief Initialize system.
*/
void enet_tasklet_init(void);
uint8_t enet_tasklet_network_init(int8_t);

/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't have the correct /** Doxygen markers - but if you do add them, do also add \internal commands, as I nothing here is public API .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Actually, you can probably put some sort of big group marker that says the whole thing is internal. Not sure of exact syntax)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the other tasklet header files(thread_tasklet.h, nd_tasklet.h etc) are documented same way than enet_tasklet now

Copy link
Contributor

@0xc0170 0xc0170 Dec 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a new tracking issue to use doxygen but having it internal (we can keep it here as it is if its used in this module for now).

* \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
Expand Down