The mesh module sends packets using multi-hop routing to a specified receiver somewhere in the network. More...
Data Structures | |
struct | mesh_callbacks |
Mesh callbacks. More... | |
Files | |
file | mesh.c |
A mesh routing protocol. | |
file | mesh.h |
Header file for the Rime mesh routing protocol. | |
Functions | |
void | mesh_open (struct mesh_conn *c, uint16_t channels, const struct mesh_callbacks *callbacks) |
Open a mesh connection. | |
void | mesh_close (struct mesh_conn *c) |
Close an mesh connection. | |
int | mesh_send (struct mesh_conn *c, const rimeaddr_t *dest) |
Send a mesh packet. |
The mesh module sends packets using multi-hop routing to a specified receiver somewhere in the network.
The mesh module uses 3 channel; one for the multi-hop forwarding (multihop) and two for the route disovery (route-discovery).
void mesh_close | ( | struct mesh_conn * | c | ) |
Close an mesh connection.
c | A pointer to a struct mesh_conn |
This function closes an mesh connection that has previously been opened with mesh_open().
This function typically is called as an exit handler.
void mesh_open | ( | struct mesh_conn * | c, | |
uint16_t | channels, | |||
const struct mesh_callbacks * | callbacks | |||
) |
Open a mesh connection.
c | A pointer to a struct mesh_conn | |
channels | The channels on which the connection will operate; mesh uses 3 channels | |
callbacks | Pointer to callback structure |
This function sets up a mesh connection on the specified channel. The caller must have allocated the memory for the struct mesh_conn, usually by declaring it as a static variable.
The struct mesh_callbacks pointer must point to a structure containing function pointers to functions that will be called when a packet arrives on the channel.
int mesh_send | ( | struct mesh_conn * | c, | |
const rimeaddr_t * | dest | |||
) |
Send a mesh packet.
c | The mesh connection on which the packet should be sent | |
dest | The address of the final destination of the packet |
Non-zero | if the packet could be queued for sending, zero otherwise |
This function sends a mesh packet. The packet must be present in the packetbuf before this function is called.
The parameter c must point to an abc connection that must have previously been set up with mesh_open().