Read, set, and add options predefined by IANA. More...
Read, set, and add options predefined by IANA.
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. | |
static ssize_t | unicoap_options_t::unicoap_options_get_observe (const unicoap_options_t *options, uint32_t *observe) |
Retrieves the Observe option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_observe (unicoap_options_t *options, uint32_t observe) |
Sets the Observe option. More... | |
static int | unicoap_options_t::unicoap_options_remove_observe (unicoap_options_t *options) |
Removes the Observe option, if present. More... | |
int | unicoap_options_t::unicoap_options_set_observe_generated (unicoap_options_t *options) |
Sets the Observe option to a randomly generated value. More... | |
Uri-Host | |
static ssize_t | unicoap_options_t::unicoap_options_get_uri_host (const unicoap_options_t *options, const char **host) |
Retrieves the Uri-Host option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_uri_host (unicoap_options_t *options, char *host, size_t length) |
Sets the Uri-Host option. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_uri_host_string (unicoap_options_t *options, char *host) |
Sets the Uri-Host option from null-terminated string. More... | |
static int | unicoap_options_t::unicoap_options_remove_uri_host (unicoap_options_t *options) |
Removes the Uri-Host option, if present. More... | |
If-None-Match | |
static bool | unicoap_options_t::unicoap_options_get_if_none_match (const unicoap_options_t *options) |
Determines whether the If-None-Match option is present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_if_none_match (unicoap_options_t *options, bool value) |
Sets the If-None-Match option. More... | |
Uri-Port | |
static ssize_t | unicoap_options_t::unicoap_options_get_uri_port (const unicoap_options_t *options, uint16_t *port) |
Retrieves the Uri-Port option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_uri_port (unicoap_options_t *options, uint16_t port) |
Sets the Uri-Port option. More... | |
static int | unicoap_options_t::unicoap_options_remove_uri_port (unicoap_options_t *options) |
Removes the Uri-Port option, if present. More... | |
Content-Format | |
static ssize_t | unicoap_options_t::unicoap_options_get_content_format (const unicoap_options_t *options, unicoap_content_format_t *format) |
Retrieves the Content-Format option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_content_format (unicoap_options_t *options, unicoap_content_format_t format) |
Sets the Content-Format option. More... | |
static int | unicoap_options_t::unicoap_options_remove_content_format (unicoap_options_t *options) |
Removes the Content-Format option, if present. More... | |
Max-Age | |
static ssize_t | unicoap_options_t::unicoap_options_get_max_age (const unicoap_options_t *options, uint32_t *age) |
Retrieves the Max-Age option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_max_age (unicoap_options_t *options, uint32_t age) |
Sets the Max-Age option. More... | |
static int | unicoap_options_t::unicoap_options_remove_max_age (unicoap_options_t *options) |
Removes the Max-Age option, if present. More... | |
Accept | |
static ssize_t | unicoap_options_t::unicoap_options_get_accept (const unicoap_options_t *options, unicoap_content_format_t *format) |
Retrieves the Accept option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_accept (unicoap_options_t *options, unicoap_content_format_t format) |
Sets the Accept option. More... | |
static int | unicoap_options_t::unicoap_options_remove_accept (unicoap_options_t *options) |
Removes the Accept option, if present. More... | |
Proxy-Scheme | |
static ssize_t | unicoap_options_t::unicoap_options_get_proxy_scheme (const unicoap_options_t *options, const char **scheme) |
Retrieves the Proxy-Scheme option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_proxy_scheme (unicoap_options_t *options, char *scheme, size_t length) |
Sets the Proxy-Scheme option. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_proxy_scheme_string (unicoap_options_t *options, char *scheme) |
Sets the Proxy-Scheme option from null-terminated string. More... | |
static int | unicoap_options_t::unicoap_options_remove_proxy_scheme (unicoap_options_t *options) |
Removes the Proxy-Scheme option, if present. More... | |
Proxy-Uri | |
static ssize_t | unicoap_options_t::unicoap_options_get_proxy_uri (const unicoap_options_t *options, const char **uri) |
Retrieves the Proxy-Uri option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_proxy_uri (unicoap_options_t *options, char *uri, size_t length) |
Sets the Proxy-Uri option. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_proxy_uri_string (unicoap_options_t *options, char *uri) |
Sets the Proxy-Uri option from null-terminated string. More... | |
static int | unicoap_options_t::unicoap_options_remove_proxy_uri (unicoap_options_t *options) |
Removes the Proxy-Uri option, if present. More... | |
No-Response | |
static ssize_t | unicoap_options_t::unicoap_options_get_no_response (const unicoap_options_t *options, uint8_t *value) |
Retrieves the No-Response option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_set_no_response (unicoap_options_t *options, uint8_t value) |
Sets the No-Response option. More... | |
static int | unicoap_options_t::unicoap_options_remove_no_response (unicoap_options_t *options) |
Removes the No-Response option, if present. More... | |
If-Match | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_if_match (const unicoap_options_t *options, const uint8_t **value) |
Retrieves the first If-Match option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_if_match (unicoap_options_iterator_t *iterator, const uint8_t **value) |
Gets the next If-Match option provided by the specified iterator. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_if_match (unicoap_options_t *options, uint8_t *value, size_t size) |
Adds If-Match option. More... | |
static int | unicoap_options_t::unicoap_options_remove_all_if_match (unicoap_options_t *options) |
Removes all If-Match options, if any. More... | |
ETag | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_etag (const unicoap_options_t *options, const uint8_t **etag) |
Retrieves the first ETag option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_etag (unicoap_options_iterator_t *iterator, const uint8_t **etag) |
Gets the next ETag option provided by the specified iterator. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_etag (unicoap_options_t *options, uint8_t *etag, size_t size) |
Adds ETag option. More... | |
static int | unicoap_options_t::unicoap_options_remove_etags (unicoap_options_t *options) |
Removes all ETag options, if any. More... | |
Location-Path | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_location_path_component (const unicoap_options_t *options, const char **component) |
Retrieves the first Location-Path option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_location_path_component (unicoap_options_iterator_t *iterator, const char **component) |
Gets the next Location-Path option provided by the specified iterator. More... | |
static ssize_t | unicoap_options_t::unicoap_options_copy_location_path (const unicoap_options_t *options, char *path, size_t capacity) |
Copies absolute location path into the given buffer. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_path_component (unicoap_options_t *options, char *component, size_t length) |
Adds Location-Path option. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_path_component_string (unicoap_options_t *options, char *component) |
Adds Location-Path option from null-terminated string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_path (unicoap_options_t *options, char *path, size_t length) |
Adds multiple Location-Path options from string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_path_string (unicoap_options_t *options, char *path) |
Adds multiple Location-Path options from null-terminated string. More... | |
static int | unicoap_options_t::unicoap_options_remove_location_path (unicoap_options_t *options) |
Removes all Location-Path options, if any. More... | |
Uri-Path | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_uri_path_component (const unicoap_options_t *options, const char **component) |
Retrieves the first Uri-Path option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_uri_path_component (unicoap_options_iterator_t *iterator, const char **component) |
Gets the next Uri-Path option provided by the specified iterator. More... | |
static ssize_t | unicoap_options_t::unicoap_options_copy_uri_path (const unicoap_options_t *options, char *path, size_t capacity) |
Copies absolute URI path into the given buffer. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_path_component (unicoap_options_t *options, char *component, size_t length) |
Adds Uri-Path option. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_path_component_string (unicoap_options_t *options, char *component) |
Adds Uri-Path option from null-terminated string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_path (unicoap_options_t *options, char *path, size_t length) |
Adds multiple Uri-Path options from string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_path_string (unicoap_options_t *options, char *path) |
Adds multiple Uri-Path options from null-terminated string. More... | |
static int | unicoap_options_t::unicoap_options_remove_uri_path (unicoap_options_t *options) |
Removes all Uri-Path options, if any. More... | |
Uri-Query | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_uri_query (const unicoap_options_t *options, const char **query) |
Retrieves the first Uri-Query option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_uri_query (unicoap_options_iterator_t *iterator, const char **query) |
Gets the next Uri-Query option provided by the specified iterator. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_uri_query_by_name (unicoap_options_iterator_t *iterator, const char *name, const char **value) |
Gets the next Uri-Query option matching the given name, potentially skipping any options in between. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_uri_query_by_name (unicoap_options_t *options, const char *name, const char **value) |
Retrieves the first Uri-Query option matching the given name, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_copy_uri_queries (const unicoap_options_t *options, char *queries, size_t capacity) |
Copies URI query string into the given buffer. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_query (unicoap_options_t *options, char *query, size_t length) |
Adds Uri-Query option. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_query_string (unicoap_options_t *options, char *query) |
Adds Uri-Query option from null-terminated string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_queries (unicoap_options_t *options, char *queries, size_t length) |
Adds multiple Uri-Query options from string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_uri_queries_string (unicoap_options_t *options, char *queries) |
Adds multiple Uri-Query options from null-terminated string. More... | |
static int | unicoap_options_t::unicoap_options_remove_uri_queries (unicoap_options_t *options) |
Removes all Uri-Query options, if any. More... | |
Location-Query | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_location_query (const unicoap_options_t *options, const char **query) |
Retrieves the first Location-Query option, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_location_query (unicoap_options_iterator_t *iterator, const char **query) |
Gets the next Location-Query option provided by the specified iterator. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_next_location_query_by_name (unicoap_options_iterator_t *iterator, const char *name, const char **value) |
Gets the next Location-Query option matching the given name, potentially skipping any options in between. More... | |
static ssize_t | unicoap_options_t::unicoap_options_get_first_location_query_by_name (unicoap_options_t *options, const char *name, const char **value) |
Retrieves the first Location-Query option matching the given name, if present. More... | |
static ssize_t | unicoap_options_t::unicoap_options_copy_location_queries (const unicoap_options_t *options, char *queries, size_t capacity) |
Copies location query string into the given buffer. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_query (unicoap_options_t *options, char *query, size_t length) |
Adds Location-Query option. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_query_string (unicoap_options_t *options, char *query) |
Adds Location-Query option from null-terminated string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_queries (unicoap_options_t *options, char *queries, size_t length) |
Adds multiple Location-Query options from string. More... | |
static ssize_t | unicoap_options_t::unicoap_options_add_location_queries_string (unicoap_options_t *options, char *queries) |
Adds multiple Location-Query options from null-terminated string. More... | |
static int | unicoap_options_t::unicoap_options_remove_location_queries (unicoap_options_t *options) |
Removes all Location-Query options, if any. More... | |
#define UNICOAP_BLOCK_OPTION_NONE (0x0f000000) |
Sentinel value for unicoap_block_option_t indicating an uninitialized value.
Block1
or Block2
value. Content-Format
option values
Enumerator | |
---|---|
UNICOAP_FORMAT_TEXT | Content type |
UNICOAP_FORMAT_COSE_ENCRYPT0 | Content type
|
UNICOAP_FORMAT_COSE_MAC0 | Content type
|
UNICOAP_FORMAT_COSE_SIGN1 | Content type
|
UNICOAP_FORMAT_ACE_CBOR | Content type
|
UNICOAP_FORMAT_IMAGE_GIF | Content type |
UNICOAP_FORMAT_IMAGE_JPEG | Content type
|
UNICOAP_FORMAT_IMAGE_PNG | Content type
|
UNICOAP_FORMAT_LINK | Content type
|
UNICOAP_FORMAT_XML | Content type
|
UNICOAP_FORMAT_OCTET_STREAM | Content type |
UNICOAP_FORMAT_EXI | Content type |
UNICOAP_FORMAT_JSON | Content type
|
UNICOAP_FORMAT_JSON_PATCH_JSON | Content type
|
UNICOAP_FORMAT_MERGE_PATCH_JSON | Content type
|
UNICOAP_FORMAT_CBOR | Content type
|
UNICOAP_FORMAT_CWT | Content type
|
UNICOAP_FORMAT_MULTIPART_CORE | Content type
|
UNICOAP_FORMAT_CBOR_SEQ | Content type
|
UNICOAP_FORMAT_EDHOC_CBOR_SEQ | Content type
|
UNICOAP_FORMAT_CID_EDHOC_CBOR_SEQ | Content type
|
UNICOAP_FORMAT_COSE_ENCRYPT | Content type
|
UNICOAP_FORMAT_COSE_MAC | Content type
|
UNICOAP_FORMAT_COSE_SIGN | Content type
|
UNICOAP_FORMAT_COSE_KEY | Content type
|
UNICOAP_FORMAT_COSE_KEY_SET | Content type
|
UNICOAP_FORMAT_SENML_JSON | Content type
|
UNICOAP_FORMAT_SENSML_JSON | Content type
|
UNICOAP_FORMAT_SENML_CBOR | Content type
|
UNICOAP_FORMAT_SENSML_CBOR | Content type
|
UNICOAP_FORMAT_SENML_EXI | Content type
|
UNICOAP_FORMAT_SENSML_EXI | Content type
|
UNICOAP_FORMAT_YANG_DATA_CBOR_SID | Content type
|
UNICOAP_FORMAT_COAP_GROUP_JSON | Content type
|
UNICOAP_FORMAT_CONCISE_PROBLEM_DETAILS_CBOR | Content type
|
UNICOAP_FORMAT_SWID_CBOR | Content type
|
UNICOAP_FORMAT_PKIXCMP | Content type
|
UNICOAP_FORMAT_YANG_SID_JSON | Content type
|
UNICOAP_FORMAT_ACE_GROUPCOMM_CBOR | Content type
|
UNICOAP_FORMAT_ACE_TRL_CBOR | Content type |
UNICOAP_FORMAT_EAT_CWT | Content type
|
UNICOAP_FORMAT_EAT_JWT | Content type
|
UNICOAP_FORMAT_EAT_BUN_CBOR | Content type
|
UNICOAP_FORMAT_EAT_BUN_JSON | Content type
|
UNICOAP_FORMAT_EAT_UCS_CBOR | Content type
|
UNICOAP_FORMAT_EAT_UCS_JSON | Content type
|
UNICOAP_FORMAT_COAP_EAP | Content type
|
UNICOAP_FORMAT_DOTS_CBOR | Content type
|
UNICOAP_FORMAT_MISSING_BLOCKS_CBOR_SEQ | Content type
|
UNICOAP_FORMAT_PKCS7_MIME_SERVER_GENERATED_KEY | Content type |
UNICOAP_FORMAT_PKCS7_MIME_CERTS_ONLY | Content type |
UNICOAP_FORMAT_PKCS8 | Content type |
UNICOAP_FORMAT_CSRATTRS | Content type |
UNICOAP_FORMAT_PKCS10 | Content type |
UNICOAP_FORMAT_PKIX_CERT | Content type |
UNICOAP_FORMAT_AIF_CBOR | Content type
|
UNICOAP_FORMAT_AIF_JSON | Content type
|
UNICOAP_FORMAT_SENML_XML | Content type
|
UNICOAP_FORMAT_SENSML_XML | Content type
|
UNICOAP_FORMAT_SENML_ETCH_JSON | Content type
|
UNICOAP_FORMAT_SENML_ETCH_CBOR | Content type
|
UNICOAP_FORMAT_YANG_DATA_CBOR | Content type
|
UNICOAP_FORMAT_YANG_DATA_CBOR_NAME | Content type
|
UNICOAP_FORMAT_TD_JSON | Content type |
UNICOAP_FORMAT_TM_JSON | Content type |
UNICOAP_FORMAT_SDF_JSON | Content type
|
UNICOAP_FORMAT_UCCS_CBOR | Content type |
UNICOAP_FORMAT_OCF_CBOR | Content type
|
UNICOAP_FORMAT_OSCORE | Content type
|
UNICOAP_FORMAT_JAVASCRIPT | Content type
|
UNICOAP_FORMAT_EAT_CWT_PSA_TFM | Content type
|
UNICOAP_FORMAT_EAT_CWT_PSA_LEGACY | Content type
|
UNICOAP_FORMAT_EAT_CWT_INTEL | Content type |
UNICOAP_FORMAT_TOC_CBOR | Content type
|
UNICOAP_FORMAT_CE_CBOR | Content type
|
UNICOAP_FORMAT_TOC_CBOR_INTEL | Content type |
UNICOAP_FORMAT_CE_CBOR_INTEL | Content type |
UNICOAP_FORMAT_JSON_DEFLATE | Content type
|
UNICOAP_FORMAT_CBOR_DEFLATE | Content type
|
UNICOAP_FORMAT_OMA_LWM2M_TLV | Content type
|
UNICOAP_FORMAT_OMA_LWM2M_JSON | Content type
|
UNICOAP_FORMAT_OMA_LWM2M_CBOR | Content type
|
UNICOAP_FORMAT_TEXT_ZSTD | Content type
|
UNICOAP_FORMAT_XML_ZSTD | Content type
|
UNICOAP_FORMAT_JSON_ZSTD | Content type
|
UNICOAP_FORMAT_TEXT_CSS | Content type
|
UNICOAP_FORMAT_IMAGE_SVG_XML | Content type |
Definition at line 713 of file constants.h.
|
inline |
Adds ETag
option.
[in,out] | options | Options to write to |
[in] | etag | ETag value |
size | Number of bytes in etag in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
etag
must be at least of size 1 bytes etag
size must not exceed 8 bytes
|
inline |
Adds If-Match
option.
[in,out] | options | Options to write to |
[in] | value | If-Match value |
size | Number of bytes in value in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
value
size must not exceed 8 bytes
|
inline |
Adds multiple Location-Path
options from string.
[in,out] | options | Options to write to |
[in] | path | as buffer of UTF-8 code units with values separated by / |
length | Number of UTF-8 code units in path , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function.
|
inline |
Adds Location-Path
option.
[in,out] | options | Options to write to |
[in] | component | Location-Path value as buffer of UTF-8 code units |
length | Number of UTF-8 code units in component , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
|
inline |
Adds Location-Path
option from null-terminated string.
[in,out] | options | Options to write to |
[in] | component | Location-Path value as buffer of UTF-8 code units, must be null-terminated |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
Uses strlen
to calculate the number of code units.
|
inline |
Adds multiple Location-Path
options from null-terminated string.
[in,out] | options | Options to write to |
[in] | path | as null-terminated string of UTF-8 code units with values separated by / |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function. Uses strlen
to calculate the number of code units.
|
inline |
Adds multiple Location-Query
options from string.
[in,out] | options | Options to write to |
[in] | queries | as buffer of UTF-8 code units with values separated by & |
length | Number of UTF-8 code units in queries , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function.
|
inline |
Adds multiple Location-Query
options from null-terminated string.
[in,out] | options | Options to write to |
[in] | queries | as null-terminated string of UTF-8 code units with values separated by & |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function. Uses strlen
to calculate the number of code units.
|
inline |
Adds Location-Query
option.
[in,out] | options | Options to write to |
[in] | query | Location-Query value as buffer of UTF-8 code units |
length | Number of UTF-8 code units in query , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
query
size must not exceed 255 bytes
|
inline |
Adds Location-Query
option from null-terminated string.
[in,out] | options | Options to write to |
[in] | query | Location-Query value as buffer of UTF-8 code units, must be null-terminated |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
query
size must not exceed 255 bytesUses strlen
to calculate the number of code units.
|
inline |
Adds multiple Uri-Path
options from string.
[in,out] | options | Options to write to |
[in] | path | as buffer of UTF-8 code units with values separated by / |
length | Number of UTF-8 code units in path , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function.
|
inline |
Adds Uri-Path
option.
[in,out] | options | Options to write to |
[in] | component | Uri-Path value as buffer of UTF-8 code units |
length | Number of UTF-8 code units in component , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
component
size must not exceed 255 bytes
|
inline |
Adds Uri-Path
option from null-terminated string.
[in,out] | options | Options to write to |
[in] | component | Uri-Path value as buffer of UTF-8 code units, must be null-terminated |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
component
size must not exceed 255 bytesUses strlen
to calculate the number of code units.
|
inline |
Adds multiple Uri-Path
options from null-terminated string.
[in,out] | options | Options to write to |
[in] | path | as null-terminated string of UTF-8 code units with values separated by / |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function. Uses strlen
to calculate the number of code units.
|
inline |
Adds multiple Uri-Query
options from string.
[in,out] | options | Options to write to |
[in] | queries | as buffer of UTF-8 code units with values separated by & |
length | Number of UTF-8 code units in queries , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function.
|
inline |
Adds multiple Uri-Query
options from null-terminated string.
[in,out] | options | Options to write to |
[in] | queries | as null-terminated string of UTF-8 code units with values separated by & |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
If the string with the values you want to add starts with the separator, you can still use this function. Uses strlen
to calculate the number of code units.
|
inline |
Adds Uri-Query
option.
[in,out] | options | Options to write to |
[in] | query | Uri-Query value as buffer of UTF-8 code units |
length | Number of UTF-8 code units in query , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
query
size must not exceed 255 bytes
|
inline |
Adds Uri-Query
option from null-terminated string.
[in,out] | options | Options to write to |
[in] | query | Uri-Query value as buffer of UTF-8 code units, must be null-terminated |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to add options |
query
size must not exceed 255 bytesUses strlen
to calculate the number of code units.
|
inline |
Copies absolute location path into the given buffer.
[in] | options | Options to read from |
[in,out] | path | Buffer of UTF-8 code units |
capacity | Capacity of path |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-ENOBUFS</tt> | path lacks sufficient capacity to copy values |
capacity
must be greater than zeroThis function creates a string from all Location-Path
options by joining them with the /
separator. The string will bear the /
prefix even if there is no Location-Path
option. The string will not be null-terminated. The resulting string uses UTF-8 encoding.
|
inline |
Copies location query string into the given buffer.
[in] | options | Options to read from |
[in,out] | queries | Buffer of UTF-8 code units |
capacity | Capacity of queries |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-ENOBUFS</tt> | queries lacks sufficient capacity to copy values |
This function creates a string from all Location-Query
options by joining them with the &
separator. The string will not be null-terminated. The resulting string uses UTF-8 encoding.
|
inline |
Copies absolute URI path into the given buffer.
[in] | options | Options to read from |
[in,out] | path | Buffer of UTF-8 code units |
capacity | Capacity of path |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-ENOBUFS</tt> | path lacks sufficient capacity to copy values |
capacity
must be greater than zeroThis function creates a string from all Uri-Path
options by joining them with the /
separator. The string will bear the /
prefix even if there is no Uri-Path
option. The string will not be null-terminated. The resulting string uses UTF-8 encoding.
|
inline |
Copies URI query string into the given buffer.
[in] | options | Options to read from |
[in,out] | queries | Buffer of UTF-8 code units |
capacity | Capacity of queries |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-ENOBUFS</tt> | queries lacks sufficient capacity to copy values |
This function creates a string from all Uri-Query
options by joining them with the &
separator. The string will not be null-terminated. The resulting string uses UTF-8 encoding.
|
inline |
Retrieves the Accept
option, if present.
[in] | options | Options to read from |
[out] | format | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves a Block1
or Block2
option.
[in] | options | Options to read from |
number | Option number (UNICOAP_OPTION_BLOCK1 or UNICOAP_OPTION_BLOCK2) | |
[out] | block | Pointer to variable that will store Block1 or Block2 value |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Block1
option, if present.
[in] | options | Options to read from |
[out] | block | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Block2
option, if present.
[in] | options | Options to read from |
[out] | block | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Content-Format
option, if present.
[in] | options | Options to read from |
[out] | format | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the first ETag
option, if present.
[in] | options | Options to read from |
[out] | etag | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the first If-Match
option, if present.
[in] | options | Options to read from |
[out] | value | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the first Location-Path
option, if present.
[in] | options | Options to read from |
[out] | component | Pointer to value variable as buffer of UTF-8 code units |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the first Location-Query
option, if present.
[in] | options | Options to read from |
[out] | query | Pointer to value variable as buffer of UTF-8 code units |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the first Location-Query
option matching the given name, if present.
This method splits Location-Query
options at the =
character.
[in] | options | Options to read from |
[in] | name | Name of query parameter to find |
[out] | value | Pointer to a UTF-8 string variable that will store the entire option, including the name= part |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished and no matching Location-Query option was found |
|
inline |
Retrieves the first Uri-Path
option, if present.
[in] | options | Options to read from |
[out] | component | Pointer to value variable as buffer of UTF-8 code units |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the first Uri-Query
option, if present.
[in] | options | Options to read from |
[out] | query | Pointer to value variable as buffer of UTF-8 code units |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the first Uri-Query
option matching the given name, if present.
This method splits Uri-Query
options at the =
character.
[in] | options | Options to read from |
[in] | name | Name of query parameter to find |
[out] | value | Pointer to a UTF-8 string variable that will store the entire option, including the name= part |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished and no matching Uri-Query option was found |
|
inline |
Determines whether the If-None-Match
option is present.
[in] | options | Options to read from |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Max-Age
option, if present.
[in] | options | Options to read from |
[out] | age | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Gets the next ETag
option provided by the specified iterator.
[in,out] | iterator | Option iterator |
[out] | etag | Pointer to a variable that will store next etag |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Gets the next If-Match
option provided by the specified iterator.
[in,out] | iterator | Option iterator |
[out] | value | Pointer to a variable that will store next value |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Gets the next Location-Path
option provided by the specified iterator.
[in,out] | iterator | Option iterator |
[out] | component | Pointer to a variable that will store next component |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Gets the next Location-Query
option provided by the specified iterator.
[in,out] | iterator | Option iterator |
[out] | query | Pointer to a variable that will store next query |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Gets the next Location-Query
option matching the given name, potentially skipping any options in between.
This method splits Location-Query
options at the =
character.
[in,out] | iterator | Option iterator |
[in] | name | Name of query parameter to find |
[out] | value | Pointer to a UTF-8 string variable that will store the entire option, including the name= part |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Gets the next Uri-Path
option provided by the specified iterator.
[in,out] | iterator | Option iterator |
[out] | component | Pointer to a variable that will store next component |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Gets the next Uri-Query
option provided by the specified iterator.
[in,out] | iterator | Option iterator |
[out] | query | Pointer to a variable that will store next query |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Gets the next Uri-Query
option matching the given name, potentially skipping any options in between.
This method splits Uri-Query
options at the =
character.
[in,out] | iterator | Option iterator |
[in] | name | Name of query parameter to find |
[out] | value | Pointer to a UTF-8 string variable that will store the entire option, including the name= part |
<tt>-EBADOPT</tt> | Option corrupted |
<tt>-1</tt> | if the iterator is finished |
|
inline |
Retrieves the No-Response
option, if present.
[in] | options | Options to read from |
[out] | value | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Observe
option, if present.
[in] | options | Options to read from |
[out] | observe | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Proxy-Scheme
option, if present.
[in] | options | Options to read from |
[out] | scheme | Pointer to value variable as buffer of UTF-8 code units |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Proxy-Uri
option, if present.
[in] | options | Options to read from |
[out] | uri | Pointer to value variable as buffer of UTF-8 code units |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Size1
option, if present.
[in] | options | Options to read from |
[out] | size | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Size2
option, if present.
[in] | options | Options to read from |
[out] | size | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Uri-Host
option, if present.
[in] | options | Options to read from |
[out] | host | Pointer to value variable as buffer of UTF-8 code units |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
Retrieves the Uri-Port
option, if present.
[in] | options | Options to read from |
[out] | port | Pointer to value variable |
<tt>-ENOENT</tt> | Option not found |
<tt>-EBADOPT</tt> | Option corrupted |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sets the Block1
or Block2
option.
[in,out] | options | Options to write to |
number | Option number (UNICOAP_OPTION_BLOCK1 or UNICOAP_OPTION_BLOCK2) | |
block | Block1 or Block2 value |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int unicoap_options_set_observe_generated | ( | unicoap_options_t * | options | ) |
Sets the Observe
option to a randomly generated value.
[in] | options | Options to read from |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
|
inline |
Sets the Proxy-Scheme
option.
[in,out] | options | Options to write to |
[in] | scheme | Proxy-Scheme value as buffer of UTF-8 code units |
length | Number of UTF-8 code units in scheme , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
|
inline |
Sets the Proxy-Scheme
option from null-terminated string.
[in,out] | options | Options to write to |
[in] | scheme | Proxy-Scheme value as buffer of UTF-8 code units, must be null-terminated |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
Uses strlen
to calculate the number of code units.
|
inline |
Sets the Proxy-Uri
option.
[in,out] | options | Options to write to |
[in] | uri | Proxy-Uri value as buffer of UTF-8 code units |
length | Number of UTF-8 code units in uri , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
uri
must be at least of size 1 bytes uri
size must not exceed 1034 bytes
|
inline |
Sets the Proxy-Uri
option from null-terminated string.
[in,out] | options | Options to write to |
[in] | uri | Proxy-Uri value as buffer of UTF-8 code units, must be null-terminated |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
uri
must be at least of size 1 bytes uri
size must not exceed 1034 bytesUses strlen
to calculate the number of code units.
|
inline |
|
inline |
|
inline |
Sets the Uri-Host
option.
[in,out] | options | Options to write to |
[in] | host | Uri-Host value as buffer of UTF-8 code units |
length | Number of UTF-8 code units in host , excluding null-terminator (if present) in bytes |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
host
must be at least of size 1 bytes host
size must not exceed 255 bytes
|
inline |
Sets the Uri-Host
option from null-terminated string.
[in,out] | options | Options to write to |
[in] | host | Uri-Host value as buffer of UTF-8 code units, must be null-terminated |
<tt>-ENOBUFS</tt> | Options buffer lacks sufficient capacity to set option |
host
must be at least of size 1 bytes host
size must not exceed 255 bytesUses strlen
to calculate the number of code units.
|
inline |