1
0
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:
Lasse Lueder 2018-10-25 09:50:26 +02:00
parent 2260cd7f45
commit 2ddd8ce1a9

View File

@ -951,6 +951,18 @@ static inline unsigned coap_get_id(coap_pkt_t *pkt)
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)
*