packetbuf: Made packetbuf_hdrlen applicable to inbound packets, too
This commit is contained in:
parent
7943751b16
commit
a5a9b42457
|
@ -244,7 +244,16 @@ packetbuf_datalen(void)
|
|||
uint8_t
|
||||
packetbuf_hdrlen(void)
|
||||
{
|
||||
return PACKETBUF_HDR_SIZE - hdrptr;
|
||||
uint8_t hdrlen;
|
||||
|
||||
hdrlen = PACKETBUF_HDR_SIZE - hdrptr;
|
||||
if(hdrlen) {
|
||||
/* outbound packet */
|
||||
return hdrlen;
|
||||
} else {
|
||||
/* inbound packet */
|
||||
return bufptr;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
uint16_t
|
||||
|
|
|
@ -132,7 +132,7 @@ void *packetbuf_dataptr(void);
|
|||
void *packetbuf_hdrptr(void);
|
||||
|
||||
/**
|
||||
* \brief Get the length of the header in the packetbuf, for outbound packets
|
||||
* \brief Get the length of the header in the packetbuf
|
||||
* \return Length of the header in the packetbuf
|
||||
*
|
||||
* For outbound packets, the packetbuf consists of two
|
||||
|
|
Loading…
Reference in a new issue