|
libcoap
4.2.0
|
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload marker (0xff), then the payload if stored inline. More...
#include <pdu.h>
Data Fields | |
| uint8_t | type |
| message type More... | |
| uint8_t | code |
| request method (value 1–10) or response code (value 40-255) More... | |
| uint8_t | max_hdr_size |
| space reserved for protocol-specific header More... | |
| uint8_t | hdr_size |
| actaul size used for protocol-specific header More... | |
| uint8_t | token_length |
| length of Token More... | |
| uint16_t | tid |
| transaction id, if any, in regular host byte order More... | |
| uint16_t | max_delta |
| highest option number More... | |
| size_t | alloc_size |
| allocated storage for token, options and payload More... | |
| size_t | used_size |
| used bytes of storage for token, options and payload More... | |
| size_t | max_size |
| maximum size for token, options and payload, or zero for variable size pdu More... | |
| uint8_t * | token |
| first byte of token, if any, or options More... | |
| uint8_t * | data |
| first byte of payload, if any More... | |
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload marker (0xff), then the payload if stored inline.
Memory layout is: <—header—>|<—token—><—options—>0xff<—payload—> header is addressed with a negative offset to token, its maximum size is max_hdr_size. options starts at token + token_length payload starts at data, its length is used_size - (data - token)
| size_t coap_pdu_t::alloc_size |
| uint8_t coap_pdu_t::code |
| uint8_t coap_pdu_t::hdr_size |
| uint8_t coap_pdu_t::max_hdr_size |
| size_t coap_pdu_t::max_size |
| uint16_t coap_pdu_t::tid |
| uint8_t* coap_pdu_t::token |
| size_t coap_pdu_t::used_size |