libcoap
4.3.0
|
API functions for endoding/decoding CoAP options. More...
Functions | |
unsigned int | coap_decode_var_bytes (const uint8_t *buf, size_t length) |
Decodes multiple-length byte sequences. More... | |
uint64_t | coap_decode_var_bytes8 (const uint8_t *buf, size_t length) |
Decodes multiple-length byte sequences. More... | |
unsigned int | coap_encode_var_safe (uint8_t *buf, size_t length, unsigned int value) |
Encodes multiple-length byte sequences. More... | |
unsigned int | coap_encode_var_safe8 (uint8_t *buf, size_t length, uint64_t value) |
Encodes multiple-length byte sequences. More... | |
API functions for endoding/decoding CoAP options.
unsigned int coap_decode_var_bytes | ( | const uint8_t * | buf, |
size_t | length | ||
) |
Decodes multiple-length byte sequences.
buf
points to an input byte sequence of length length
. Returns the up to 4 byte decoded value.
buf | The input byte sequence to decode from |
length | The length of the input byte sequence |
Definition at line 31 of file encode.c.
uint64_t coap_decode_var_bytes8 | ( | const uint8_t * | buf, |
size_t | length | ||
) |
Decodes multiple-length byte sequences.
buf
points to an input byte sequence of length length
. Returns the up to 8 byte decoded value.
buf | The input byte sequence to decode from |
length | The length of the input byte sequence |
Definition at line 60 of file encode.c.
unsigned int coap_encode_var_safe | ( | uint8_t * | buf, |
size_t | length, | ||
unsigned int | value | ||
) |
Encodes multiple-length byte sequences.
buf
points to an output buffer of sufficient length to store the encoded bytes. value
is the 4 byte value to encode. Returns the number of bytes used to encode value
or 0 on error.
buf | The output buffer to encode into |
length | The output buffer size to encode into (must be sufficient) |
value | The value to encode into the buffer |
value
or 0
on error. Definition at line 40 of file encode.c.
unsigned int coap_encode_var_safe8 | ( | uint8_t * | buf, |
size_t | length, | ||
uint64_t | value | ||
) |
Encodes multiple-length byte sequences.
buf
points to an output buffer of sufficient length to store the encoded bytes. value
is the 8 byte value to encode. Returns the number of bytes used to encode value
or 0 on error.
buf | The output buffer to encode into |
length | The output buffer size to encode into (must be sufficient) |
value | The value to encode into the buffer |
value
or 0
on error. Definition at line 70 of file encode.c.