mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Add mesh_ready() to mesh
mesh_ready checkes whether a packet is queued. This allows to avoid packet loss at application level.
This commit is contained in:
parent
4e40cb8a8d
commit
b1dbc2047e
@ -201,4 +201,11 @@ mesh_send(struct mesh_conn *c, const rimeaddr_t *to)
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
mesh_ready(struct mesh_conn *c)
|
||||
{
|
||||
return (c->queued_data == NULL);
|
||||
}
|
||||
|
||||
|
||||
/** @} */
|
||||
|
@ -133,6 +133,14 @@ void mesh_close(struct mesh_conn *c);
|
||||
*/
|
||||
int mesh_send(struct mesh_conn *c, const rimeaddr_t *dest);
|
||||
|
||||
/**
|
||||
* \brief Test if mesh is ready to send a packet (or packet is queued)
|
||||
* \param c The mesh connection on which is to be tested
|
||||
* \retval 0 Packet queued
|
||||
* \retval !0 Ready
|
||||
*/
|
||||
int mesh_ready(struct mesh_conn *c);
|
||||
|
||||
#endif /* __MESH_H__ */
|
||||
/** @} */
|
||||
/** @} */
|
||||
|
Loading…
Reference in New Issue
Block a user