packetbuf: add packetbuf_remaininglen()
packetbuf_freelen() returns the length of free space in packetbuf.
This commit is contained in:
parent
c48cfb6b9d
commit
aa1f408825
|
@ -184,6 +184,12 @@ packetbuf_totlen(void)
|
||||||
return packetbuf_hdrlen() + packetbuf_datalen();
|
return packetbuf_hdrlen() + packetbuf_datalen();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
uint16_t
|
||||||
|
packetbuf_remaininglen(void)
|
||||||
|
{
|
||||||
|
return PACKETBUF_SIZE - packetbuf_totlen();
|
||||||
|
}
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
packetbuf_attr_clear(void)
|
packetbuf_attr_clear(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -123,6 +123,13 @@ uint16_t packetbuf_datalen(void);
|
||||||
*/
|
*/
|
||||||
uint16_t packetbuf_totlen(void);
|
uint16_t packetbuf_totlen(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get the total length of the remaining space in the packetbuf
|
||||||
|
* \return Length of the remaining space in the packetbuf
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
uint16_t packetbuf_remaininglen(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the length of the data in the packetbuf
|
* \brief Set the length of the data in the packetbuf
|
||||||
* \param len The length of the data
|
* \param len The length of the data
|
||||||
|
|
Loading…
Reference in a new issue