Merge pull request #75 from cmorty/mesh_ready

Add mesh_ready() to mesh
This commit is contained in:
Adam Dunkels 2013-03-18 04:42:43 -07:00
commit ad28f1b396
2 changed files with 15 additions and 0 deletions

View File

@ -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);
}
/** @} */

View File

@ -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__ */
/** @} */
/** @} */