packetbuf: Made packetbuf_hdrlen applicable to inbound packets, too
This commit is contained in:
parent
7943751b16
commit
a5a9b42457
2 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue