Read, set, and add options predefined by IANA. More...

Detailed Description

Read, set, and add options predefined by IANA.

Content-Format values

enum  unicoap_content_format_t {
  UNICOAP_FORMAT_TEXT = 0 , UNICOAP_FORMAT_COSE_ENCRYPT0 = 16 , UNICOAP_FORMAT_COSE_MAC0 = 17 , UNICOAP_FORMAT_COSE_SIGN1 = 18 ,
  UNICOAP_FORMAT_ACE_CBOR = 19 , UNICOAP_FORMAT_IMAGE_GIF = 21 , UNICOAP_FORMAT_IMAGE_JPEG = 22 , UNICOAP_FORMAT_IMAGE_PNG = 23 ,
  UNICOAP_FORMAT_LINK = 40 , UNICOAP_FORMAT_XML = 41 , UNICOAP_FORMAT_OCTET_STREAM = 42 , UNICOAP_FORMAT_EXI = 47 ,
  UNICOAP_FORMAT_JSON = 50 , UNICOAP_FORMAT_JSON_PATCH_JSON = 51 , UNICOAP_FORMAT_MERGE_PATCH_JSON = 52 , UNICOAP_FORMAT_CBOR = 60 ,
  UNICOAP_FORMAT_CWT = 61 , UNICOAP_FORMAT_MULTIPART_CORE = 62 , UNICOAP_FORMAT_CBOR_SEQ = 63 , UNICOAP_FORMAT_EDHOC_CBOR_SEQ = 64 ,
  UNICOAP_FORMAT_CID_EDHOC_CBOR_SEQ = 65 , UNICOAP_FORMAT_COSE_ENCRYPT = 96 , UNICOAP_FORMAT_COSE_MAC = 97 , UNICOAP_FORMAT_COSE_SIGN = 98 ,
  UNICOAP_FORMAT_COSE_KEY = 101 , UNICOAP_FORMAT_COSE_KEY_SET = 102 , UNICOAP_FORMAT_SENML_JSON = 110 , UNICOAP_FORMAT_SENSML_JSON = 111 ,
  UNICOAP_FORMAT_SENML_CBOR = 112 , UNICOAP_FORMAT_SENSML_CBOR = 113 , UNICOAP_FORMAT_SENML_EXI = 114 , UNICOAP_FORMAT_SENSML_EXI = 115 ,
  UNICOAP_FORMAT_YANG_DATA_CBOR_SID = 140 , UNICOAP_FORMAT_COAP_GROUP_JSON = 256 , UNICOAP_FORMAT_CONCISE_PROBLEM_DETAILS_CBOR = 257 , UNICOAP_FORMAT_SWID_CBOR = 258 ,
  UNICOAP_FORMAT_PKIXCMP = 259 , UNICOAP_FORMAT_YANG_SID_JSON = 260 , UNICOAP_FORMAT_ACE_GROUPCOMM_CBOR = 261 , UNICOAP_FORMAT_ACE_TRL_CBOR = 262 ,
  UNICOAP_FORMAT_EAT_CWT = 263 , UNICOAP_FORMAT_EAT_JWT = 264 , UNICOAP_FORMAT_EAT_BUN_CBOR = 265 , UNICOAP_FORMAT_EAT_BUN_JSON = 266 ,
  UNICOAP_FORMAT_EAT_UCS_CBOR = 267 , UNICOAP_FORMAT_EAT_UCS_JSON = 268 , UNICOAP_FORMAT_COAP_EAP = 269 , UNICOAP_FORMAT_DOTS_CBOR = 271 ,
  UNICOAP_FORMAT_MISSING_BLOCKS_CBOR_SEQ = 272 , UNICOAP_FORMAT_PKCS7_MIME_SERVER_GENERATED_KEY = 280 , UNICOAP_FORMAT_PKCS7_MIME_CERTS_ONLY = 281 , UNICOAP_FORMAT_PKCS8 = 284 ,
  UNICOAP_FORMAT_CSRATTRS = 285 , UNICOAP_FORMAT_PKCS10 = 286 , UNICOAP_FORMAT_PKIX_CERT = 287 , UNICOAP_FORMAT_AIF_CBOR = 290 ,
  UNICOAP_FORMAT_AIF_JSON = 291 , UNICOAP_FORMAT_SENML_XML = 310 , UNICOAP_FORMAT_SENSML_XML = 311 , UNICOAP_FORMAT_SENML_ETCH_JSON = 320 ,
  UNICOAP_FORMAT_SENML_ETCH_CBOR = 322 , UNICOAP_FORMAT_YANG_DATA_CBOR = 340 , UNICOAP_FORMAT_YANG_DATA_CBOR_NAME = 341 , UNICOAP_FORMAT_TD_JSON = 432 ,
  UNICOAP_FORMAT_TM_JSON = 433 , UNICOAP_FORMAT_SDF_JSON = 434 , UNICOAP_FORMAT_UCCS_CBOR = 601 , UNICOAP_FORMAT_OCF_CBOR = 10000 ,
  UNICOAP_FORMAT_OSCORE = 10001 , UNICOAP_FORMAT_JAVASCRIPT = 10002 , UNICOAP_FORMAT_EAT_CWT_PSA_TFM = 10003 , UNICOAP_FORMAT_EAT_CWT_PSA_LEGACY = 10004 ,
  UNICOAP_FORMAT_EAT_CWT_INTEL = 10005 , UNICOAP_FORMAT_TOC_CBOR = 10570 , UNICOAP_FORMAT_CE_CBOR = 10571 , UNICOAP_FORMAT_TOC_CBOR_INTEL = 10572 ,
  UNICOAP_FORMAT_CE_CBOR_INTEL = 10573 , UNICOAP_FORMAT_JSON_DEFLATE = 11050 , UNICOAP_FORMAT_CBOR_DEFLATE = 11060 , UNICOAP_FORMAT_OMA_LWM2M_TLV = 11542 ,
  UNICOAP_FORMAT_OMA_LWM2M_JSON = 11543 , UNICOAP_FORMAT_OMA_LWM2M_CBOR = 11544 , UNICOAP_FORMAT_TEXT_ZSTD = 12000 , UNICOAP_FORMAT_XML_ZSTD = 12041 ,
  UNICOAP_FORMAT_JSON_ZSTD = 12050 , UNICOAP_FORMAT_TEXT_CSS = 20000 , UNICOAP_FORMAT_IMAGE_SVG_XML = 30000
}
 Content-Format option values More...
 

Block-wise Transfers

typedef uint32_t unicoap_block_option_t
 Block1 and Block2 option value
 
#define UNICOAP_BLOCK_OPTION_NONE   (0x0f000000)
 Sentinel value for unicoap_block_option_t indicating an uninitialized value. More...
 
static ssize_t unicoap_options_t::unicoap_options_get_block (const unicoap_options_t *options, unicoap_option_number_t number, unicoap_block_option_t *block)
 Retrieves a Block1 or Block2 option. More...
 
static int unicoap_options_t::unicoap_options_set_block (unicoap_options_t *options, unicoap_option_number_t number, unicoap_block_option_t block)
 Sets the Block1 or Block2 option. More...
 
static ssize_t unicoap_options_t::unicoap_options_get_block1 (const unicoap_options_t *options, unicoap_block_option_t *block)
 Retrieves the Block1 option, if present. More...
 
static ssize_t unicoap_options_t::unicoap_options_set_block1 (unicoap_options_t *options, unicoap_block_option_t block)
 Sets the Block1 option. More...
 
static int unicoap_options_t::unicoap_options_remove_block1 (unicoap_options_t *options)
 Removes the Block1 option, if present. More...
 
static ssize_t unicoap_options_t::unicoap_options_get_block2 (const unicoap_options_t *options, unicoap_block_option_t *block)
 Retrieves the Block2 option, if present. More...
 
static ssize_t unicoap_options_t::unicoap_options_set_block2 (unicoap_options_t *options, unicoap_block_option_t block)
 Sets the Block2 option. More...
 
static int unicoap_options_t::unicoap_options_remove_block2 (unicoap_options_t *options)
 Removes the Block2 option, if present. More...
 
static ssize_t unicoap_options_t::unicoap_options_get_size1 (const unicoap_options_t *options, uint32_t *size)
 Retrieves the Size1 option, if present. More...
 
static ssize_t unicoap_options_t::unicoap_options_set_size1 (unicoap_options_t *options, uint32_t size)
 Sets the Size1 option. More...
 
static int unicoap_options_t::unicoap_options_remove_size1 (unicoap_options_t *options)
 Removes the Size1 option, if present. More...
 
static ssize_t unicoap_options_t::unicoap_options_get_size2 (const unicoap_options_t *options, uint32_t *size)
 Retrieves the Size2 option, if present. More...
 
static ssize_t unicoap_options_t::unicoap_options_set_size2 (unicoap_options_t *options, uint32_t size)
 Sets the Size2 option. More...
 
static int unicoap_options_t::unicoap_options_remove_size2 (unicoap_options_t *options)
 Removes the Size2 option, if present. More...
 

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...
 

Macro Definition Documentation

◆ UNICOAP_BLOCK_OPTION_NONE

#define UNICOAP_BLOCK_OPTION_NONE   (0x0f000000)

Sentinel value for unicoap_block_option_t indicating an uninitialized value.

Note
This constant occupies 4 bytes and does thus not represent a valid Block1 or Block2 value.

Definition at line 2469 of file options.h.

Enumeration Type Documentation

◆ unicoap_content_format_t

Content-Format option values

See also
Content-Format values assigned by IANA
Enumerator
UNICOAP_FORMAT_TEXT 

Content type text/plain; charset=utf-8

See also
RFC2046
RFC3676
RFC5147
UNICOAP_FORMAT_COSE_ENCRYPT0 

Content type application/cose; cose-type=\"cose-encrypt0\\"

See also
RFC9052
UNICOAP_FORMAT_COSE_MAC0 

Content type application/cose; cose-type=\"cose-mac0\\"

See also
RFC9052
UNICOAP_FORMAT_COSE_SIGN1 

Content type application/cose; cose-type=\"cose-sign1\\"

See also
RFC9052
UNICOAP_FORMAT_ACE_CBOR 

Content type application/ace+cbor

See also
RFC9200
UNICOAP_FORMAT_IMAGE_GIF 

Content type image/gif

See also
https://www.w3.org/Graphics/GIF/spec-gif89a.txt
UNICOAP_FORMAT_IMAGE_JPEG 

Content type image/jpeg

See also
ISO/IEC 10918-5
UNICOAP_FORMAT_IMAGE_PNG 

Content type image/png

See also
RFC2083
UNICOAP_FORMAT_LINK 

Content type application/link-format

See also
RFC6690
UNICOAP_FORMAT_XML 

Content type application/xml

See also
RFC3023
UNICOAP_FORMAT_OCTET_STREAM 

Content type application/octet-stream

See also
RFC2045
RFC2046
UNICOAP_FORMAT_EXI 

Content type application/exi

See also
"Efficient XML Interchange (EXI) Format 1.0 (Second Edition)", February 2014
UNICOAP_FORMAT_JSON 

Content type application/json

See also
RFC8259
UNICOAP_FORMAT_JSON_PATCH_JSON 

Content type application/json-patch+json

See also
RFC6902
UNICOAP_FORMAT_MERGE_PATCH_JSON 

Content type application/merge-patch+json

See also
RFC7396
UNICOAP_FORMAT_CBOR 

Content type application/cbor

See also
RFC8949
UNICOAP_FORMAT_CWT 

Content type application/cwt

See also
RFC8392
UNICOAP_FORMAT_MULTIPART_CORE 

Content type application/multipart-core

See also
RFC8710
UNICOAP_FORMAT_CBOR_SEQ 

Content type application/cbor-seq

See also
RFC8742
UNICOAP_FORMAT_EDHOC_CBOR_SEQ 

Content type application/edhoc+cbor-seq

See also
RFC9528
UNICOAP_FORMAT_CID_EDHOC_CBOR_SEQ 

Content type application/cid-edhoc+cbor-seq

See also
RFC9528
UNICOAP_FORMAT_COSE_ENCRYPT 

Content type application/cose; cose-type=\"cose-encrypt\\"

See also
RFC9052
UNICOAP_FORMAT_COSE_MAC 

Content type application/cose; cose-type=\"cose-mac\\"

See also
RFC9052
UNICOAP_FORMAT_COSE_SIGN 

Content type application/cose; cose-type=\"cose-sign\\"

See also
RFC9052
UNICOAP_FORMAT_COSE_KEY 

Content type application/cose-key

See also
RFC9052
UNICOAP_FORMAT_COSE_KEY_SET 

Content type application/cose-key-set

See also
RFC9052
UNICOAP_FORMAT_SENML_JSON 

Content type application/senml+json

See also
RFC8428
UNICOAP_FORMAT_SENSML_JSON 

Content type application/sensml+json

See also
RFC8428
UNICOAP_FORMAT_SENML_CBOR 

Content type application/senml+cbor

See also
RFC8428
UNICOAP_FORMAT_SENSML_CBOR 

Content type application/sensml+cbor

See also
RFC8428
UNICOAP_FORMAT_SENML_EXI 

Content type application/senml-exi

See also
RFC8428
UNICOAP_FORMAT_SENSML_EXI 

Content type application/sensml-exi

See also
RFC8428
UNICOAP_FORMAT_YANG_DATA_CBOR_SID 

Content type application/yang-data+cbor; id=sid

See also
RFC9254
UNICOAP_FORMAT_COAP_GROUP_JSON 

Content type application/coap-group+json

See also
RFC7390
UNICOAP_FORMAT_CONCISE_PROBLEM_DETAILS_CBOR 

Content type application/concise-problem-details+cbor

See also
RFC9290
UNICOAP_FORMAT_SWID_CBOR 

Content type application/swid+cbor

See also
RFC9393
UNICOAP_FORMAT_PKIXCMP 

Content type application/pkixcmp

See also
RFC9482
RFC-ietf-lamps-rfc6712bis-10
UNICOAP_FORMAT_YANG_SID_JSON 

Content type application/yang-sid+json

See also
RFC9595
UNICOAP_FORMAT_ACE_GROUPCOMM_CBOR 

Content type application/ace-groupcomm+cbor

See also
RFC9594
UNICOAP_FORMAT_ACE_TRL_CBOR 

Content type application/ace-trl+cbor

See also
RFC-ietf-ace-revoked-token-notification-09
UNICOAP_FORMAT_EAT_CWT 

Content type application/eat+cwt

See also
RFC-ietf-rats-eat-media-type-12
UNICOAP_FORMAT_EAT_JWT 

Content type application/eat+jwt

See also
RFC-ietf-rats-eat-media-type-12
UNICOAP_FORMAT_EAT_BUN_CBOR 

Content type application/eat-bun+cbor

See also
RFC-ietf-rats-eat-media-type-12
UNICOAP_FORMAT_EAT_BUN_JSON 

Content type application/eat-bun+json

See also
RFC-ietf-rats-eat-media-type-12
UNICOAP_FORMAT_EAT_UCS_CBOR 

Content type application/eat-ucs+cbor

See also
RFC-ietf-rats-eat-media-type-12
UNICOAP_FORMAT_EAT_UCS_JSON 

Content type application/eat-ucs+json

See also
RFC-ietf-rats-eat-media-type-12
UNICOAP_FORMAT_COAP_EAP 

Content type application/coap-eap

See also
RFC-ietf-ace-wg-coap-eap-14
UNICOAP_FORMAT_DOTS_CBOR 

Content type application/dots+cbor

See also
RFC9132
UNICOAP_FORMAT_MISSING_BLOCKS_CBOR_SEQ 

Content type application/missing-blocks+cbor-seq

See also
RFC9177
UNICOAP_FORMAT_PKCS7_MIME_SERVER_GENERATED_KEY 

Content type application/pkcs7-mime; smime-type=server-generated-key

See also
RFC7030
RFC8551
RFC9148
UNICOAP_FORMAT_PKCS7_MIME_CERTS_ONLY 

Content type application/pkcs7-mime; smime-type=certs-only

See also
RFC8551
RFC9148
UNICOAP_FORMAT_PKCS8 

Content type application/pkcs8

See also
RFC5958
RFC8551
RFC9148
UNICOAP_FORMAT_CSRATTRS 

Content type application/csrattrs

See also
RFC7030
RFC9148
UNICOAP_FORMAT_PKCS10 

Content type application/pkcs10

See also
RFC5967
RFC8551
RFC9148
UNICOAP_FORMAT_PKIX_CERT 

Content type application/pkix-cert

See also
RFC2585
RFC9148
UNICOAP_FORMAT_AIF_CBOR 

Content type application/aif+cbor

See also
RFC9237
UNICOAP_FORMAT_AIF_JSON 

Content type application/aif+json

See also
RFC9237
UNICOAP_FORMAT_SENML_XML 

Content type application/senml+xml

See also
RFC8428
UNICOAP_FORMAT_SENSML_XML 

Content type application/sensml+xml

See also
RFC8428
UNICOAP_FORMAT_SENML_ETCH_JSON 

Content type application/senml-etch+json

See also
RFC8790
UNICOAP_FORMAT_SENML_ETCH_CBOR 

Content type application/senml-etch+cbor

See also
RFC8790
UNICOAP_FORMAT_YANG_DATA_CBOR 

Content type application/yang-data+cbor

See also
RFC9254
UNICOAP_FORMAT_YANG_DATA_CBOR_NAME 

Content type application/yang-data+cbor; id=name

See also
RFC9254
UNICOAP_FORMAT_TD_JSON 

Content type application/td+json

See also
"Web of Things (WoT) Thing Description 1.1", April 2022
UNICOAP_FORMAT_TM_JSON 

Content type application/tm+json

See also
"Web of Things (WoT) Thing Description 1.1", April 2022
UNICOAP_FORMAT_SDF_JSON 

Content type application/sdf+json

See also
RFC-ietf-asdf-sdf-23
UNICOAP_FORMAT_UCCS_CBOR 

Content type application/uccs+cbor

See also
RFC-ietf-rats-uccs-12, Section 6.4
UNICOAP_FORMAT_OCF_CBOR 

Content type application/vnd.ocf+cbor

See also
Michael_Koster
UNICOAP_FORMAT_OSCORE 

Content type application/oscore

See also
RFC8613
UNICOAP_FORMAT_JAVASCRIPT 

Content type application/javascript

See also
RFC4329
UNICOAP_FORMAT_EAT_CWT_PSA_TFM 

Content type application/eat+cwt; eat_profile=\"tag:psacertified.org,2023:psa\#tfm\\"

See also
RFC-tschofenig-rats-psa-token-24
UNICOAP_FORMAT_EAT_CWT_PSA_LEGACY 

Content type application/eat+cwt; eat_profile=\"tag:psacertified.org,2019:psa\#legacy\\"

See also
RFC-tschofenig-rats-psa-token-24
UNICOAP_FORMAT_EAT_CWT_INTEL 

Content type application/eat+cwt; eat_profile=2.16.840.1.113741.1.16.1

See also
RFC-ietf-rats-eat-media-type-12
draft-cds-rats-intel-corim-profile-02
UNICOAP_FORMAT_TOC_CBOR 

Content type application/toc+cbor

See also
CE-Binding, Section 6.3.1
UNICOAP_FORMAT_CE_CBOR 

Content type application/ce+cbor

See also
CE-Binding, Section 6.3.2
UNICOAP_FORMAT_TOC_CBOR_INTEL 

Content type application/toc+cbor;profile=2.16.840.1.113741.1.16.1

See also
TCG DICE Concise Evidence Binding for SPDM
draft-cds-rats-intel-corim-profile
UNICOAP_FORMAT_CE_CBOR_INTEL 

Content type application/ce+cbor;profile=2.16.840.1.113741.1.16.1

See also
TCG DICE Concise Evidence Binding for SPDM
draft-cds-rats-intel-corim-profile
UNICOAP_FORMAT_JSON_DEFLATE 

Content type application/json in deflate coding.

See also
RFC8259
RFC9110, Section 8.4.1.2
UNICOAP_FORMAT_CBOR_DEFLATE 

Content type application/cbor in deflate coding.

See also
RFC8949
RFC9110, Section 8.4.1.2
UNICOAP_FORMAT_OMA_LWM2M_TLV 

Content type application/vnd.oma.lwm2m+tlv

See also
OMA-TS-LightweightM2M-V1_0
UNICOAP_FORMAT_OMA_LWM2M_JSON 

Content type application/vnd.oma.lwm2m+json

See also
OMA-TS-LightweightM2M-V1_0
UNICOAP_FORMAT_OMA_LWM2M_CBOR 

Content type application/vnd.oma.lwm2m+cbor

See also
OMA-TS-LightweightM2M-V1_2
UNICOAP_FORMAT_TEXT_ZSTD 

Content type text/plain;charset=utf-8 in zstd coding.

See also
Benjamin_Valentin
UNICOAP_FORMAT_XML_ZSTD 

Content type application/xml in zstd coding.

See also
Benjamin_Valentin
UNICOAP_FORMAT_JSON_ZSTD 

Content type application/json in zstd coding.

See also
Benjamin_Valentin
UNICOAP_FORMAT_TEXT_CSS 

Content type text/css

See also
RFC2318
UNICOAP_FORMAT_IMAGE_SVG_XML 

Content type image/svg+xml

See also
https://www.w3.org/TR/SVG/mimereg.html

Definition at line 713 of file constants.h.

Function Documentation

◆ unicoap_options_add_etag()

static ssize_t unicoap_options_add_etag ( unicoap_options_t options,
uint8_t *  etag,
size_t  size 
)
inline

Adds ETag option.

Parameters
[in,out]optionsOptions to write to
[in]etagETag value
sizeNumber of bytes in etag in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
etag must be at least of size 1 bytes
etag size must not exceed 8 bytes

Definition at line 1580 of file options.h.

◆ unicoap_options_add_if_match()

static ssize_t unicoap_options_add_if_match ( unicoap_options_t options,
uint8_t *  value,
size_t  size 
)
inline

Adds If-Match option.

Parameters
[in,out]optionsOptions to write to
[in]valueIf-Match value
sizeNumber of bytes in value in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
value size must not exceed 8 bytes

Definition at line 1503 of file options.h.

◆ unicoap_options_add_location_path()

static ssize_t unicoap_options_add_location_path ( unicoap_options_t options,
char *  path,
size_t  length 
)
inline

Adds multiple Location-Path options from string.

Parameters
[in,out]optionsOptions to write to
[in]pathas buffer of UTF-8 code units with values separated by /
lengthNumber of UTF-8 code units in path, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<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.

Definition at line 1731 of file options.h.

◆ unicoap_options_add_location_path_component()

static ssize_t unicoap_options_add_location_path_component ( unicoap_options_t options,
char *  component,
size_t  length 
)
inline

Adds Location-Path option.

Parameters
[in,out]optionsOptions to write to
[in]componentLocation-Path value as buffer of UTF-8 code units
lengthNumber of UTF-8 code units in component, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options

Definition at line 1690 of file options.h.

◆ unicoap_options_add_location_path_component_string()

static ssize_t unicoap_options_add_location_path_component_string ( unicoap_options_t options,
char *  component 
)
inline

Adds Location-Path option from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]componentLocation-Path value as buffer of UTF-8 code units, must be null-terminated
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options

Uses strlen to calculate the number of code units.

See also
unicoap_options_add_location_path_component

Definition at line 1710 of file options.h.

◆ unicoap_options_add_location_path_string()

static ssize_t unicoap_options_add_location_path_string ( unicoap_options_t options,
char *  path 
)
inline

Adds multiple Location-Path options from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]pathas null-terminated string of UTF-8 code units with values separated by /
Returns
Zero on success, negative error number otherwise
Return values
<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.

See also
unicoap_options_add_location_path

Definition at line 1754 of file options.h.

◆ unicoap_options_add_location_queries()

static ssize_t unicoap_options_add_location_queries ( unicoap_options_t options,
char *  queries,
size_t  length 
)
inline

Adds multiple Location-Query options from string.

Parameters
[in,out]optionsOptions to write to
[in]queriesas buffer of UTF-8 code units with values separated by &
lengthNumber of UTF-8 code units in queries, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
queries' size must not exceed 255 bytes

If the string with the values you want to add starts with the separator, you can still use this function.

Definition at line 2344 of file options.h.

◆ unicoap_options_add_location_queries_string()

static ssize_t unicoap_options_add_location_queries_string ( unicoap_options_t options,
char *  queries 
)
inline

Adds multiple Location-Query options from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]queriesas null-terminated string of UTF-8 code units with values separated by &
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
queries size must not exceed 255 bytes

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.

See also
unicoap_options_add_location_queries

Definition at line 2368 of file options.h.

◆ unicoap_options_add_location_query()

static ssize_t unicoap_options_add_location_query ( unicoap_options_t options,
char *  query,
size_t  length 
)
inline

Adds Location-Query option.

Parameters
[in,out]optionsOptions to write to
[in]queryLocation-Query value as buffer of UTF-8 code units
lengthNumber of UTF-8 code units in query, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
query size must not exceed 255 bytes

Definition at line 2300 of file options.h.

◆ unicoap_options_add_location_query_string()

static ssize_t unicoap_options_add_location_query_string ( unicoap_options_t options,
char *  query 
)
inline

Adds Location-Query option from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]queryLocation-Query value as buffer of UTF-8 code units, must be null-terminated
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
query size must not exceed 255 bytes

Uses strlen to calculate the number of code units.

See also
unicoap_options_add_location_query

Definition at line 2322 of file options.h.

◆ unicoap_options_add_uri_path()

static ssize_t unicoap_options_add_uri_path ( unicoap_options_t options,
char *  path,
size_t  length 
)
inline

Adds multiple Uri-Path options from string.

Parameters
[in,out]optionsOptions to write to
[in]pathas buffer of UTF-8 code units with values separated by /
lengthNumber of UTF-8 code units in path, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
components' size must not exceed 255 bytes

If the string with the values you want to add starts with the separator, you can still use this function.

Definition at line 1907 of file options.h.

◆ unicoap_options_add_uri_path_component()

static ssize_t unicoap_options_add_uri_path_component ( unicoap_options_t options,
char *  component,
size_t  length 
)
inline

Adds Uri-Path option.

Parameters
[in,out]optionsOptions to write to
[in]componentUri-Path value as buffer of UTF-8 code units
lengthNumber of UTF-8 code units in component, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
component size must not exceed 255 bytes

Definition at line 1863 of file options.h.

◆ unicoap_options_add_uri_path_component_string()

static ssize_t unicoap_options_add_uri_path_component_string ( unicoap_options_t options,
char *  component 
)
inline

Adds Uri-Path option from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]componentUri-Path value as buffer of UTF-8 code units, must be null-terminated
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
component size must not exceed 255 bytes

Uses strlen to calculate the number of code units.

See also
unicoap_options_add_uri_path_component

Definition at line 1885 of file options.h.

◆ unicoap_options_add_uri_path_string()

static ssize_t unicoap_options_add_uri_path_string ( unicoap_options_t options,
char *  path 
)
inline

Adds multiple Uri-Path options from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]pathas null-terminated string of UTF-8 code units with values separated by /
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
components size must not exceed 255 bytes

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.

See also
unicoap_options_add_uri_path

Definition at line 1931 of file options.h.

◆ unicoap_options_add_uri_queries()

static ssize_t unicoap_options_add_uri_queries ( unicoap_options_t options,
char *  queries,
size_t  length 
)
inline

Adds multiple Uri-Query options from string.

Parameters
[in,out]optionsOptions to write to
[in]queriesas buffer of UTF-8 code units with values separated by &
lengthNumber of UTF-8 code units in queries, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
queries' size must not exceed 255 bytes

If the string with the values you want to add starts with the separator, you can still use this function.

Definition at line 2124 of file options.h.

◆ unicoap_options_add_uri_queries_string()

static ssize_t unicoap_options_add_uri_queries_string ( unicoap_options_t options,
char *  queries 
)
inline

Adds multiple Uri-Query options from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]queriesas null-terminated string of UTF-8 code units with values separated by &
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
queries size must not exceed 255 bytes

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.

See also
unicoap_options_add_uri_queries

Definition at line 2148 of file options.h.

◆ unicoap_options_add_uri_query()

static ssize_t unicoap_options_add_uri_query ( unicoap_options_t options,
char *  query,
size_t  length 
)
inline

Adds Uri-Query option.

Parameters
[in,out]optionsOptions to write to
[in]queryUri-Query value as buffer of UTF-8 code units
lengthNumber of UTF-8 code units in query, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
query size must not exceed 255 bytes

Definition at line 2081 of file options.h.

◆ unicoap_options_add_uri_query_string()

static ssize_t unicoap_options_add_uri_query_string ( unicoap_options_t options,
char *  query 
)
inline

Adds Uri-Query option from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]queryUri-Query value as buffer of UTF-8 code units, must be null-terminated
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to add options
Precondition
query size must not exceed 255 bytes

Uses strlen to calculate the number of code units.

See also
unicoap_options_add_uri_query

Definition at line 2103 of file options.h.

◆ unicoap_options_copy_location_path()

static ssize_t unicoap_options_copy_location_path ( const unicoap_options_t options,
char *  path,
size_t  capacity 
)
inline

Copies absolute location path into the given buffer.

Parameters
[in]optionsOptions to read from
[in,out]pathBuffer of UTF-8 code units
capacityCapacity of path
Returns
Length of string value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-ENOBUFS</tt>path lacks sufficient capacity to copy values
Precondition
capacity must be greater than zero

This 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.

Definition at line 1665 of file options.h.

◆ unicoap_options_copy_location_queries()

static ssize_t unicoap_options_copy_location_queries ( const unicoap_options_t options,
char *  queries,
size_t  capacity 
)
inline

Copies location query string into the given buffer.

Parameters
[in]optionsOptions to read from
[in,out]queriesBuffer of UTF-8 code units
capacityCapacity of queries
Returns
Length of string value in bytes on success, negative error number otherwise
Return values
<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.

Definition at line 2279 of file options.h.

◆ unicoap_options_copy_uri_path()

static ssize_t unicoap_options_copy_uri_path ( const unicoap_options_t options,
char *  path,
size_t  capacity 
)
inline

Copies absolute URI path into the given buffer.

Parameters
[in]optionsOptions to read from
[in,out]pathBuffer of UTF-8 code units
capacityCapacity of path
Returns
Length of string value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-ENOBUFS</tt>path lacks sufficient capacity to copy values
Precondition
capacity must be greater than zero

This 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.

Definition at line 1837 of file options.h.

◆ unicoap_options_copy_uri_queries()

static ssize_t unicoap_options_copy_uri_queries ( const unicoap_options_t options,
char *  queries,
size_t  capacity 
)
inline

Copies URI query string into the given buffer.

Parameters
[in]optionsOptions to read from
[in,out]queriesBuffer of UTF-8 code units
capacityCapacity of queries
Returns
Length of string value in bytes on success, negative error number otherwise
Return values
<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.

Definition at line 2060 of file options.h.

◆ unicoap_options_get_accept()

static ssize_t unicoap_options_get_accept ( const unicoap_options_t options,
unicoap_content_format_t format 
)
inline

Retrieves the Accept option, if present.

Parameters
[in]optionsOptions to read from
[out]formatPointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1204 of file options.h.

◆ unicoap_options_get_block()

static ssize_t unicoap_options_get_block ( const unicoap_options_t options,
unicoap_option_number_t  number,
unicoap_block_option_t block 
)
inline

Retrieves a Block1 or Block2 option.

Parameters
[in]optionsOptions to read from
numberOption number (UNICOAP_OPTION_BLOCK1 or UNICOAP_OPTION_BLOCK2)
[out]blockPointer to variable that will store Block1 or Block2 value
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 2488 of file options.h.

◆ unicoap_options_get_block1()

static ssize_t unicoap_options_get_block1 ( const unicoap_options_t options,
unicoap_block_option_t block 
)
inline

Retrieves the Block1 option, if present.

Parameters
[in]optionsOptions to read from
[out]blockPointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 2525 of file options.h.

◆ unicoap_options_get_block2()

static ssize_t unicoap_options_get_block2 ( const unicoap_options_t options,
unicoap_block_option_t block 
)
inline

Retrieves the Block2 option, if present.

Parameters
[in]optionsOptions to read from
[out]blockPointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 2571 of file options.h.

◆ unicoap_options_get_content_format()

static ssize_t unicoap_options_get_content_format ( const unicoap_options_t options,
unicoap_content_format_t format 
)
inline

Retrieves the Content-Format option, if present.

Parameters
[in]optionsOptions to read from
[out]formatPointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1100 of file options.h.

◆ unicoap_options_get_first_etag()

static ssize_t unicoap_options_get_first_etag ( const unicoap_options_t options,
const uint8_t **  etag 
)
inline

Retrieves the first ETag option, if present.

Parameters
[in]optionsOptions to read from
[out]etagPointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1541 of file options.h.

◆ unicoap_options_get_first_if_match()

static ssize_t unicoap_options_get_first_if_match ( const unicoap_options_t options,
const uint8_t **  value 
)
inline

Retrieves the first If-Match option, if present.

Parameters
[in]optionsOptions to read from
[out]valuePointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1465 of file options.h.

◆ unicoap_options_get_first_location_path_component()

static ssize_t unicoap_options_get_first_location_path_component ( const unicoap_options_t options,
const char **  component 
)
inline

Retrieves the first Location-Path option, if present.

Parameters
[in]optionsOptions to read from
[out]componentPointer to value variable as buffer of UTF-8 code units
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1619 of file options.h.

◆ unicoap_options_get_first_location_query()

static ssize_t unicoap_options_get_first_location_query ( const unicoap_options_t options,
const char **  query 
)
inline

Retrieves the first Location-Query option, if present.

Parameters
[in]optionsOptions to read from
[out]queryPointer to value variable as buffer of UTF-8 code units
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 2185 of file options.h.

◆ unicoap_options_get_first_location_query_by_name()

static ssize_t unicoap_options_get_first_location_query_by_name ( unicoap_options_t options,
const char *  name,
const char **  value 
)
inline

Retrieves the first Location-Query option matching the given name, if present.

This method splits Location-Query options at the = character.

Parameters
[in]optionsOptions to read from
[in]nameName of query parameter to find
[out]valuePointer to a UTF-8 string variable that will store the entire option, including the name= part
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished and no matching Location-Query option was found
Note
If you already have an unicoap_options_iterator_t instance allocated somewhere, use it and call unicoap_options_get_next_location_query_by_name instead.

Definition at line 2254 of file options.h.

◆ unicoap_options_get_first_uri_path_component()

static ssize_t unicoap_options_get_first_uri_path_component ( const unicoap_options_t options,
const char **  component 
)
inline

Retrieves the first Uri-Path option, if present.

Parameters
[in]optionsOptions to read from
[out]componentPointer to value variable as buffer of UTF-8 code units
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1791 of file options.h.

◆ unicoap_options_get_first_uri_query()

static ssize_t unicoap_options_get_first_uri_query ( const unicoap_options_t options,
const char **  query 
)
inline

Retrieves the first Uri-Query option, if present.

Parameters
[in]optionsOptions to read from
[out]queryPointer to value variable as buffer of UTF-8 code units
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1967 of file options.h.

◆ unicoap_options_get_first_uri_query_by_name()

static ssize_t unicoap_options_get_first_uri_query_by_name ( unicoap_options_t options,
const char *  name,
const char **  value 
)
inline

Retrieves the first Uri-Query option matching the given name, if present.

This method splits Uri-Query options at the = character.

Parameters
[in]optionsOptions to read from
[in]nameName of query parameter to find
[out]valuePointer to a UTF-8 string variable that will store the entire option, including the name= part
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished and no matching Uri-Query option was found
Note
If you already have an unicoap_options_iterator_t instance allocated somewhere, use it and call unicoap_options_get_next_uri_query_by_name instead.

Definition at line 2035 of file options.h.

◆ unicoap_options_get_if_none_match()

static bool unicoap_options_get_if_none_match ( const unicoap_options_t options)
inline

Determines whether the If-None-Match option is present.

Parameters
[in]optionsOptions to read from
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1006 of file options.h.

◆ unicoap_options_get_max_age()

static ssize_t unicoap_options_get_max_age ( const unicoap_options_t options,
uint32_t *  age 
)
inline

Retrieves the Max-Age option, if present.

Parameters
[in]optionsOptions to read from
[out]agePointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1153 of file options.h.

◆ unicoap_options_get_next_etag()

static ssize_t unicoap_options_get_next_etag ( unicoap_options_iterator_t iterator,
const uint8_t **  etag 
)
inline

Gets the next ETag option provided by the specified iterator.

Parameters
[in,out]iteratorOption iterator
[out]etagPointer to a variable that will store next etag
See also
unicoap_options_iterator_t::unicoap_options_get_next_by_number
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 1560 of file options.h.

◆ unicoap_options_get_next_if_match()

static ssize_t unicoap_options_get_next_if_match ( unicoap_options_iterator_t iterator,
const uint8_t **  value 
)
inline

Gets the next If-Match option provided by the specified iterator.

Parameters
[in,out]iteratorOption iterator
[out]valuePointer to a variable that will store next value
See also
unicoap_options_iterator_t::unicoap_options_get_next_by_number
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 1484 of file options.h.

◆ unicoap_options_get_next_location_path_component()

static ssize_t unicoap_options_get_next_location_path_component ( unicoap_options_iterator_t iterator,
const char **  component 
)
inline

Gets the next Location-Path option provided by the specified iterator.

Parameters
[in,out]iteratorOption iterator
[out]componentPointer to a variable that will store next component
See also
unicoap_options_iterator_t::unicoap_options_get_next_by_number
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 1639 of file options.h.

◆ unicoap_options_get_next_location_query()

static ssize_t unicoap_options_get_next_location_query ( unicoap_options_iterator_t iterator,
const char **  query 
)
inline

Gets the next Location-Query option provided by the specified iterator.

Parameters
[in,out]iteratorOption iterator
[out]queryPointer to a variable that will store next query
See also
unicoap_options_iterator_t::unicoap_options_get_next_by_number
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 2204 of file options.h.

◆ unicoap_options_get_next_location_query_by_name()

static ssize_t unicoap_options_get_next_location_query_by_name ( unicoap_options_iterator_t iterator,
const char *  name,
const char **  value 
)
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.

Parameters
[in,out]iteratorOption iterator
[in]nameName of query parameter to find
[out]valuePointer to a UTF-8 string variable that will store the entire option, including the name= part
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 2229 of file options.h.

◆ unicoap_options_get_next_uri_path_component()

static ssize_t unicoap_options_get_next_uri_path_component ( unicoap_options_iterator_t iterator,
const char **  component 
)
inline

Gets the next Uri-Path option provided by the specified iterator.

Parameters
[in,out]iteratorOption iterator
[out]componentPointer to a variable that will store next component
See also
unicoap_options_iterator_t::unicoap_options_get_next_by_number
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 1811 of file options.h.

◆ unicoap_options_get_next_uri_query()

static ssize_t unicoap_options_get_next_uri_query ( unicoap_options_iterator_t iterator,
const char **  query 
)
inline

Gets the next Uri-Query option provided by the specified iterator.

Parameters
[in,out]iteratorOption iterator
[out]queryPointer to a variable that will store next query
See also
unicoap_options_iterator_t::unicoap_options_get_next_by_number
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 1986 of file options.h.

◆ unicoap_options_get_next_uri_query_by_name()

static ssize_t unicoap_options_get_next_uri_query_by_name ( unicoap_options_iterator_t iterator,
const char *  name,
const char **  value 
)
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.

Parameters
[in,out]iteratorOption iterator
[in]nameName of query parameter to find
[out]valuePointer to a UTF-8 string variable that will store the entire option, including the name= part
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-EBADOPT</tt>Option corrupted
<tt>-1</tt>if the iterator is finished

Definition at line 2011 of file options.h.

◆ unicoap_options_get_no_response()

static ssize_t unicoap_options_get_no_response ( const unicoap_options_t options,
uint8_t *  value 
)
inline

Retrieves the No-Response option, if present.

Parameters
[in]optionsOptions to read from
[out]valuePointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1413 of file options.h.

◆ unicoap_options_get_observe()

static ssize_t unicoap_options_get_observe ( const unicoap_options_t options,
uint32_t *  observe 
)
inline

Retrieves the Observe option, if present.

Parameters
[in]optionsOptions to read from
[out]observePointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 2411 of file options.h.

◆ unicoap_options_get_proxy_scheme()

static ssize_t unicoap_options_get_proxy_scheme ( const unicoap_options_t options,
const char **  scheme 
)
inline

Retrieves the Proxy-Scheme option, if present.

Parameters
[in]optionsOptions to read from
[out]schemePointer to value variable as buffer of UTF-8 code units
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1257 of file options.h.

◆ unicoap_options_get_proxy_uri()

static ssize_t unicoap_options_get_proxy_uri ( const unicoap_options_t options,
const char **  uri 
)
inline

Retrieves the Proxy-Uri option, if present.

Parameters
[in]optionsOptions to read from
[out]uriPointer to value variable as buffer of UTF-8 code units
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1333 of file options.h.

◆ unicoap_options_get_size1()

static ssize_t unicoap_options_get_size1 ( const unicoap_options_t options,
uint32_t *  size 
)
inline

Retrieves the Size1 option, if present.

Parameters
[in]optionsOptions to read from
[out]sizePointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 2617 of file options.h.

◆ unicoap_options_get_size2()

static ssize_t unicoap_options_get_size2 ( const unicoap_options_t options,
uint32_t *  size 
)
inline

Retrieves the Size2 option, if present.

Parameters
[in]optionsOptions to read from
[out]sizePointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 2661 of file options.h.

◆ unicoap_options_get_uri_host()

static ssize_t unicoap_options_get_uri_host ( const unicoap_options_t options,
const char **  host 
)
inline

Retrieves the Uri-Host option, if present.

Parameters
[in]optionsOptions to read from
[out]hostPointer to value variable as buffer of UTF-8 code units
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 927 of file options.h.

◆ unicoap_options_get_uri_port()

static ssize_t unicoap_options_get_uri_port ( const unicoap_options_t options,
uint16_t *  port 
)
inline

Retrieves the Uri-Port option, if present.

Parameters
[in]optionsOptions to read from
[out]portPointer to value variable
Returns
Size of option value in bytes on success, negative error number otherwise
Return values
<tt>-ENOENT</tt>Option not found
<tt>-EBADOPT</tt>Option corrupted

Definition at line 1049 of file options.h.

◆ unicoap_options_remove_accept()

static int unicoap_options_remove_accept ( unicoap_options_t options)
inline

Removes the Accept option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1234 of file options.h.

◆ unicoap_options_remove_all_if_match()

static int unicoap_options_remove_all_if_match ( unicoap_options_t options)
inline

Removes all If-Match options, if any.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1518 of file options.h.

◆ unicoap_options_remove_block1()

static int unicoap_options_remove_block1 ( unicoap_options_t options)
inline

Removes the Block1 option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 2555 of file options.h.

◆ unicoap_options_remove_block2()

static int unicoap_options_remove_block2 ( unicoap_options_t options)
inline

Removes the Block2 option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 2601 of file options.h.

◆ unicoap_options_remove_content_format()

static int unicoap_options_remove_content_format ( unicoap_options_t options)
inline

Removes the Content-Format option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1130 of file options.h.

◆ unicoap_options_remove_etags()

static int unicoap_options_remove_etags ( unicoap_options_t options)
inline

Removes all ETag options, if any.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1595 of file options.h.

◆ unicoap_options_remove_location_path()

static int unicoap_options_remove_location_path ( unicoap_options_t options)
inline

Removes all Location-Path options, if any.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1768 of file options.h.

◆ unicoap_options_remove_location_queries()

static int unicoap_options_remove_location_queries ( unicoap_options_t options)
inline

Removes all Location-Query options, if any.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 2382 of file options.h.

◆ unicoap_options_remove_max_age()

static int unicoap_options_remove_max_age ( unicoap_options_t options)
inline

Removes the Max-Age option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1181 of file options.h.

◆ unicoap_options_remove_no_response()

static int unicoap_options_remove_no_response ( unicoap_options_t options)
inline

Removes the No-Response option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1442 of file options.h.

◆ unicoap_options_remove_observe()

static int unicoap_options_remove_observe ( unicoap_options_t options)
inline

Removes the Observe option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 2440 of file options.h.

◆ unicoap_options_remove_proxy_scheme()

static int unicoap_options_remove_proxy_scheme ( unicoap_options_t options)
inline

Removes the Proxy-Scheme option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1310 of file options.h.

◆ unicoap_options_remove_proxy_uri()

static int unicoap_options_remove_proxy_uri ( unicoap_options_t options)
inline

Removes the Proxy-Uri option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1390 of file options.h.

◆ unicoap_options_remove_size1()

static int unicoap_options_remove_size1 ( unicoap_options_t options)
inline

Removes the Size1 option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 2645 of file options.h.

◆ unicoap_options_remove_size2()

static int unicoap_options_remove_size2 ( unicoap_options_t options)
inline

Removes the Size2 option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 2689 of file options.h.

◆ unicoap_options_remove_uri_host()

static int unicoap_options_remove_uri_host ( unicoap_options_t options)
inline

Removes the Uri-Host option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 984 of file options.h.

◆ unicoap_options_remove_uri_path()

static int unicoap_options_remove_uri_path ( unicoap_options_t options)
inline

Removes all Uri-Path options, if any.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1944 of file options.h.

◆ unicoap_options_remove_uri_port()

static int unicoap_options_remove_uri_port ( unicoap_options_t options)
inline

Removes the Uri-Port option, if present.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 1077 of file options.h.

◆ unicoap_options_remove_uri_queries()

static int unicoap_options_remove_uri_queries ( unicoap_options_t options)
inline

Removes all Uri-Query options, if any.

Parameters
[in,out]optionsOptions to write to
Returns
Zero on success, negative error number otherwise

Definition at line 2162 of file options.h.

◆ unicoap_options_set_accept()

static ssize_t unicoap_options_set_accept ( unicoap_options_t options,
unicoap_content_format_t  format 
)
inline

Sets the Accept option.

Parameters
[in,out]optionsOptions to write to
formatAccept value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 1220 of file options.h.

◆ unicoap_options_set_block()

static int unicoap_options_set_block ( unicoap_options_t options,
unicoap_option_number_t  number,
unicoap_block_option_t  block 
)
inline

Sets the Block1 or Block2 option.

Parameters
[in,out]optionsOptions to write to
numberOption number (UNICOAP_OPTION_BLOCK1 or UNICOAP_OPTION_BLOCK2)
blockBlock1 or Block2 value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 2506 of file options.h.

◆ unicoap_options_set_block1()

static ssize_t unicoap_options_set_block1 ( unicoap_options_t options,
unicoap_block_option_t  block 
)
inline

Sets the Block1 option.

Parameters
[in,out]optionsOptions to write to
blockBlock1 value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 2541 of file options.h.

◆ unicoap_options_set_block2()

static ssize_t unicoap_options_set_block2 ( unicoap_options_t options,
unicoap_block_option_t  block 
)
inline

Sets the Block2 option.

Parameters
[in,out]optionsOptions to write to
blockBlock2 value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 2587 of file options.h.

◆ unicoap_options_set_content_format()

static ssize_t unicoap_options_set_content_format ( unicoap_options_t options,
unicoap_content_format_t  format 
)
inline

Sets the Content-Format option.

Parameters
[in,out]optionsOptions to write to
formatContent-Format value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 1116 of file options.h.

◆ unicoap_options_set_if_none_match()

static ssize_t unicoap_options_set_if_none_match ( unicoap_options_t options,
bool  value 
)
inline

Sets the If-None-Match option.

Parameters
[in,out]optionsOptions to write to
valueIf-None-Match value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 1021 of file options.h.

◆ unicoap_options_set_max_age()

static ssize_t unicoap_options_set_max_age ( unicoap_options_t options,
uint32_t  age 
)
inline

Sets the Max-Age option.

Parameters
[in,out]optionsOptions to write to
ageMax-Age value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 1168 of file options.h.

◆ unicoap_options_set_no_response()

static ssize_t unicoap_options_set_no_response ( unicoap_options_t options,
uint8_t  value 
)
inline

Sets the No-Response option.

Parameters
[in,out]optionsOptions to write to
valueNo-Response value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 1429 of file options.h.

◆ unicoap_options_set_observe()

static ssize_t unicoap_options_set_observe ( unicoap_options_t options,
uint32_t  observe 
)
inline

Sets the Observe option.

Parameters
[in,out]optionsOptions to write to
observeObserve value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 2427 of file options.h.

◆ unicoap_options_set_observe_generated()

int unicoap_options_set_observe_generated ( unicoap_options_t options)

Sets the Observe option to a randomly generated value.

Parameters
[in]optionsOptions to read from
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

◆ unicoap_options_set_proxy_scheme()

static ssize_t unicoap_options_set_proxy_scheme ( unicoap_options_t options,
char *  scheme,
size_t  length 
)
inline

Sets the Proxy-Scheme option.

Parameters
[in,out]optionsOptions to write to
[in]schemeProxy-Scheme value as buffer of UTF-8 code units
lengthNumber of UTF-8 code units in scheme, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 1276 of file options.h.

◆ unicoap_options_set_proxy_scheme_string()

static ssize_t unicoap_options_set_proxy_scheme_string ( unicoap_options_t options,
char *  scheme 
)
inline

Sets the Proxy-Scheme option from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]schemeProxy-Scheme value as buffer of UTF-8 code units, must be null-terminated
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Uses strlen to calculate the number of code units.

See also
unicoap_options_set_proxy_scheme

Definition at line 1296 of file options.h.

◆ unicoap_options_set_proxy_uri()

static ssize_t unicoap_options_set_proxy_uri ( unicoap_options_t options,
char *  uri,
size_t  length 
)
inline

Sets the Proxy-Uri option.

Parameters
[in,out]optionsOptions to write to
[in]uriProxy-Uri value as buffer of UTF-8 code units
lengthNumber of UTF-8 code units in uri, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option
Precondition
uri must be at least of size 1 bytes
uri size must not exceed 1034 bytes

Definition at line 1354 of file options.h.

◆ unicoap_options_set_proxy_uri_string()

static ssize_t unicoap_options_set_proxy_uri_string ( unicoap_options_t options,
char *  uri 
)
inline

Sets the Proxy-Uri option from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]uriProxy-Uri value as buffer of UTF-8 code units, must be null-terminated
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option
Precondition
uri must be at least of size 1 bytes
uri size must not exceed 1034 bytes

Uses strlen to calculate the number of code units.

See also
unicoap_options_set_proxy_uri

Definition at line 1377 of file options.h.

◆ unicoap_options_set_size1()

static ssize_t unicoap_options_set_size1 ( unicoap_options_t options,
uint32_t  size 
)
inline

Sets the Size1 option.

Parameters
[in,out]optionsOptions to write to
sizeSize1 value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 2632 of file options.h.

◆ unicoap_options_set_size2()

static ssize_t unicoap_options_set_size2 ( unicoap_options_t options,
uint32_t  size 
)
inline

Sets the Size2 option.

Parameters
[in,out]optionsOptions to write to
sizeSize2 value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 2676 of file options.h.

◆ unicoap_options_set_uri_host()

static ssize_t unicoap_options_set_uri_host ( unicoap_options_t options,
char *  host,
size_t  length 
)
inline

Sets the Uri-Host option.

Parameters
[in,out]optionsOptions to write to
[in]hostUri-Host value as buffer of UTF-8 code units
lengthNumber of UTF-8 code units in host, excluding null-terminator (if present) in bytes
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option
Precondition
host must be at least of size 1 bytes
host size must not exceed 255 bytes

Definition at line 948 of file options.h.

◆ unicoap_options_set_uri_host_string()

static ssize_t unicoap_options_set_uri_host_string ( unicoap_options_t options,
char *  host 
)
inline

Sets the Uri-Host option from null-terminated string.

Parameters
[in,out]optionsOptions to write to
[in]hostUri-Host value as buffer of UTF-8 code units, must be null-terminated
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option
Precondition
host must be at least of size 1 bytes
host size must not exceed 255 bytes

Uses strlen to calculate the number of code units.

See also
unicoap_options_set_uri_host

Definition at line 971 of file options.h.

◆ unicoap_options_set_uri_port()

static ssize_t unicoap_options_set_uri_port ( unicoap_options_t options,
uint16_t  port 
)
inline

Sets the Uri-Port option.

Parameters
[in,out]optionsOptions to write to
portUri-Port value
Returns
Zero on success, negative error number otherwise
Return values
<tt>-ENOBUFS</tt>Options buffer lacks sufficient capacity to set option

Definition at line 1064 of file options.h.