mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
net/nanocoap: define coap_data_ptr
This commit is contained in:
parent
2260cd7f45
commit
2ddd8ce1a9
@ -951,6 +951,18 @@ static inline unsigned coap_get_id(coap_pkt_t *pkt)
|
|||||||
return ntohs(pkt->hdr->id);
|
return ntohs(pkt->hdr->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the start of data after the header
|
||||||
|
*
|
||||||
|
* @param[in] hdr Header of CoAP packet in contiguous memory
|
||||||
|
*
|
||||||
|
* @returns pointer to first byte after the header
|
||||||
|
*/
|
||||||
|
static inline uint8_t *coap_hdr_data_ptr(coap_hdr_t *hdr)
|
||||||
|
{
|
||||||
|
return ((uint8_t *)hdr) + sizeof(coap_hdr_t);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the total header length (4-byte header + token length)
|
* @brief Get the total header length (4-byte header + token length)
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user