mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
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
|
uint8_t
|
||||||
packetbuf_hdrlen(void)
|
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
|
uint16_t
|
||||||
|
@ -132,7 +132,7 @@ void *packetbuf_dataptr(void);
|
|||||||
void *packetbuf_hdrptr(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
|
* \return Length of the header in the packetbuf
|
||||||
*
|
*
|
||||||
* For outbound packets, the packetbuf consists of two
|
* For outbound packets, the packetbuf consists of two
|
||||||
|
Loading…
Reference in New Issue
Block a user