Options header. More...
Options header.
Definition in file options.h.
#include <stdint.h>#include <stdbool.h>#include <string.h>#include <assert.h>#include <errno.h>#include <sys/types.h>#include "byteorder.h"#include "net/unicoap/constants.h"#include "net/unicoap/util_macros.h"
Include dependency graph for options.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | unicoap_option_entry_t |
| Helper struct for options parser. More... | |
| struct | unicoap_options_t |
| CoAP options container. More... | |
| struct | unicoap_options_iterator_t |
| The iterator you use to retrieve option values in-order. More... | |
Allocating option buffers | |
| #define | UNICOAP_OPTIONS_ALLOC(name, capacity) |
| Allocates options with buffer capacity. | |
| #define | UNICOAP_OPTIONS_ALLOC_STATIC(name, capacity) |
| Statically allocates options with buffer capacity. | |
| #define | UNICOAP_OPTIONS_ALLOC_DEFAULT(name) |
| Allocates options with default capacity. | |
| #define | UNICOAP_OPTIONS_ALLOC_STATIC_DEFAULT(name) |
| Statically allocates options with default capacity. | |
Auxiliary constants | |
| #define | EBADOPT 151 |
| Bad option. | |
| #define | EPAYLD 152 |
| Cannot read option, encountered payload marker. | |
| #define | UNICOAP_UINT24_MAX (0xffffff) |
| Largest number representable with 24 bits (3 bytes) | |
| #define | UNICOAP_UINT24_SIZE (3) |
| Size in bytes of number representable with 24 bits (3 bytes) | |
| #define | UNICOAP_UINT_MAX (14 + 255 + 0xffff) |
| Unsigned integer large enough to accommodate the maximum integer representable by CoAP option delta fields and extended length fields. | |
Observe | |
| #define | UNICOAP_OBSERVE_OPTION_REGISTER (0) |
| Observe value for registering for notifications. | |
| #define | UNICOAP_OBSERVE_OPTION_DEREGISTER (1) |
| Observe value for cancelling a registration for notifications. | |
Block-wise Transfers | |
| #define | UNICOAP_BLOCK_OPTION_NONE (0x0f000000) |
| Sentinel value for unicoap_block_option_t indicating an uninitialized value. | |
| typedef uint32_t | unicoap_block_option_t |
Block1 and Block2 option value | |
Option characteristics | |
| static bool | unicoap_option_is_critical (unicoap_option_number_t option_number) |
| Determines whether the given option is considered critical. | |
| static bool | unicoap_option_is_safe_to_forward (unicoap_option_number_t option_number) |
| Determines whether the given option is safe to forward. | |
| static bool | unicoap_option_is_no_cache_key (unicoap_option_number_t option_number) |
| Determines whether the given option is not intended to be part of the cache key. | |
| static bool | unicoap_option_is_cache_key (unicoap_option_number_t option_number) |
| Determines whether the given option is intended to be part of the cache key. | |
Tools | |
| const char * | unicoap_string_from_option_number (unicoap_option_number_t number) |
| Returns label of option corresponding to the given number. | |