CoAP PDU parsing context structure. More...
CoAP PDU parsing context structure.
When this struct is used to assemble the header, coap_pkt_t::payload is used as the write pointer and coap_pkt_t::payload_len contains the number of free bytes left in then packet buffer pointed to by coap_pkt_t::buf
When the header was written, payload must not be changed, it must remain pointing to the end of the header. payload_len must then be set to the size of the payload that was further copied into the packet buffer, after the header.
coap_pkt_t::snips can be used to attach further payload buffers without copying them into the CoAP packet buffer. If there are any, they will be attached in order after the last payload byte (or header byte) in the original CoAP packet buffer.
Definition at line 229 of file nanocoap.h.
#include <nanocoap.h>
Public Member Functions | |
| BITFIELD (opt_crit, CONFIG_NANOCOAP_NOPTS_MAX) | |
| unhandled critical option | |
Data Fields | ||
| union { | ||
| uint8_t * buf | ||
| pointer to the beginning of the buffer holding the pkt More... | ||
| coap_udp_hdr_t * hdr | ||
| Deprecated alias for coap_pkt_t::buf. More... | ||
| }; | ||
| uint8_t * | payload | |
| pointer to end of the header | ||
| iolist_t * | snips | |
| payload snips (optional) | ||
| uint16_t | payload_len | |
| length of payload | ||
| uint16_t | options_len | |
| length of options array | ||
| coap_optpos_t | options [CONFIG_NANOCOAP_NOPTS_MAX] | |
| option offset array | ||
| uint8_t* coap_pkt_t::buf |
pointer to the beginning of the buffer holding the pkt
In other words: Pointer to the first byte of the header.
Definition at line 236 of file nanocoap.h.
| coap_udp_hdr_t* coap_pkt_t::hdr |
Deprecated alias for coap_pkt_t::buf.
Definition at line 248 of file nanocoap.h.
| coap_optpos_t coap_pkt_t::options[CONFIG_NANOCOAP_NOPTS_MAX] |
option offset array
Definition at line 254 of file nanocoap.h.
| uint16_t coap_pkt_t::options_len |
length of options array
Definition at line 253 of file nanocoap.h.
| uint8_t* coap_pkt_t::payload |
pointer to end of the header
Definition at line 250 of file nanocoap.h.
| uint16_t coap_pkt_t::payload_len |
length of payload
Definition at line 252 of file nanocoap.h.
| iolist_t* coap_pkt_t::snips |
payload snips (optional)
Definition at line 251 of file nanocoap.h.