| 
Read Block1 (POST/PUT request) or Block2 (GET response) options, and generally useful functions to write block options.  
 | 
| #define  | coap_szx2size(szx)   (1U << ((szx) + 4)) | 
|   | Helper to decode SZX value to size in bytes.  More...
  | 
|   | 
| void  | coap_block_object_init (coap_block1_t *block, size_t blknum, size_t blksize, int more) | 
|   | Initialize a block struct from content information.  More...
  | 
|   | 
| bool  | coap_block_finish (coap_block_slicer_t *slicer, uint16_t option) | 
|   | Finish a block request (block1 or block2)  More...
  | 
|   | 
| static bool  | coap_block1_finish (coap_block_slicer_t *slicer) | 
|   | Finish a block1 request.  More...
  | 
|   | 
| static bool  | coap_block2_finish (coap_block_slicer_t *slicer) | 
|   | Finish a block2 response.  More...
  | 
|   | 
| void  | coap_block2_init (coap_pkt_t *pkt, coap_block_slicer_t *slicer) | 
|   | Initialize a block2 slicer struct for writing the payload.  More...
  | 
|   | 
| void  | coap_block_slicer_init (coap_block_slicer_t *slicer, size_t blknum, size_t blksize) | 
|   | Initialize a block slicer struct from content information.  More...
  | 
|   | 
| size_t  | coap_blockwise_put_bytes (coap_block_slicer_t *slicer, uint8_t *bufpos, const void *c, size_t len) | 
|   | Add a byte array to a block2 reply.  More...
  | 
|   | 
| size_t  | coap_blockwise_put_char (coap_block_slicer_t *slicer, uint8_t *bufpos, char c) | 
|   | Add a single character to a block2 reply.  More...
  | 
|   | 
| int  | coap_get_block (coap_pkt_t *pkt, coap_block1_t *block, uint16_t option) | 
|   | Block option getter.  More...
  | 
|   | 
| static int  | coap_get_block1 (coap_pkt_t *pkt, coap_block1_t *block) | 
|   | Block1 option getter.  More...
  | 
|   | 
| static int  | coap_get_block2 (coap_pkt_t *pkt, coap_block1_t *block) | 
|   | Block2 option getter.  More...
  | 
|   | 
| int  | coap_get_blockopt (coap_pkt_t *pkt, uint16_t option, uint32_t *blknum, uint8_t *szx) | 
|   | Generic block option getter.  More...
  | 
|   | 
| bool  | coap_has_unprocessed_critical_options (const coap_pkt_t *pkt) | 
|   | Check whether any of the packet's options that are critical.  More...
  | 
|   | 
| static unsigned  | coap_size2szx (unsigned len) | 
|   | Helper to encode byte size into next equal or smaller SZX value.  More...
  | 
|   | 
 | 
Read options from a parsed packet. 
Packets accessed through coap_find_option or any of the coap_opt_get_* functions track their access in bit field created at parsing time to enable checking for critical options in coap_has_unprocessed_critical_options. These functions thus have a side effect, and code that calls them on critical options needs to ensure that failure to process the accessed option is propagated into failure to process the message. For example, a server helper that tries to read the If-None-Match option (which is critical) and finds it to be longer than it can process must not return as if no If-None-Match option was present, as it has already triggered the side effect of marking the option as processed.  
 | 
| uint8_t *  | coap_find_option (coap_pkt_t *pkt, unsigned opt_num) | 
|   | Get pointer to an option field by type.  More...
  | 
|   | 
| uint8_t *  | coap_iterate_option (coap_pkt_t *pkt, unsigned opt_num, uint8_t **opt_pos, int *opt_len) | 
|   | Get pointer to an option field, can be called in a loop if there are multiple options with the same number.  More...
  | 
|   | 
| unsigned  | coap_get_content_type (coap_pkt_t *pkt) | 
|   | Get content type from packet.  More...
  | 
|   | 
| unsigned  | coap_get_accept (coap_pkt_t *pkt) | 
|   | Get the Accept option value from a packet if present.  More...
  | 
|   | 
| int  | coap_opt_get_uint (coap_pkt_t *pkt, uint16_t optnum, uint32_t *value) | 
|   | Get a uint32 option value.  More...
  | 
|   | 
| ssize_t  | coap_opt_get_string (coap_pkt_t *pkt, uint16_t optnum, uint8_t *target, size_t max_len, char separator) | 
|   | Read a full option as null terminated string into the target buffer.  More...
  | 
|   | 
| static ssize_t  | coap_get_location_path (coap_pkt_t *pkt, uint8_t *target, size_t max_len) | 
|   | Convenience function for getting the packet's LOCATION_PATH option.  More...
  | 
|   | 
| static ssize_t  | coap_get_location_query (coap_pkt_t *pkt, uint8_t *target, size_t max_len) | 
|   | Convenience function for getting the packet's LOCATION_QUERY option.  More...
  | 
|   | 
| static ssize_t  | coap_get_uri_path (coap_pkt_t *pkt, uint8_t *target) | 
|   | Convenience function for getting the packet's URI_PATH.  More...
  | 
|   | 
| static ssize_t  | coap_get_uri_query_string (coap_pkt_t *pkt, char *target, size_t max_len) | 
|   | Convenience function for getting the packet's URI_QUERY option.  More...
  | 
|   | 
| bool  | coap_find_uri_query (coap_pkt_t *pkt, const char *key, const char **value, size_t *len) | 
|   | Find a URI query option of the packet.  More...
  | 
|   | 
| int  | coap_iterate_uri_query (coap_pkt_t *pkt, void **ctx, char *key, size_t key_len_max, char *value, size_t value_len_max) | 
|   | Iterate over a packet's URI Query options.  More...
  | 
|   | 
| ssize_t  | coap_opt_get_next (const coap_pkt_t *pkt, coap_optpos_t *opt, uint8_t **value, bool init_opt) | 
|   | Iterate over a packet's options.  More...
  | 
|   | 
| ssize_t  | coap_opt_get_opaque (coap_pkt_t *pkt, unsigned opt_num, uint8_t **value) | 
|   | Retrieve the value for an option as an opaque array of bytes.  More...
  | 
|   | 
 | 
 Use a coap_pkt_t struct to manage writing Options to the PDU. 
The caller must monitor space remaining in the buffer; however, the API will not write past the end of the buffer, and returns -ENOSPC when it is full.  
 | 
| ssize_t  | coap_opt_add_block (coap_pkt_t *pkt, coap_block_slicer_t *slicer, bool more, uint16_t option) | 
|   | Add block option in descriptive use from a slicer object.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_block1 (coap_pkt_t *pkt, coap_block_slicer_t *slicer, bool more) | 
|   | Add block1 option in descriptive use from a slicer object.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_block2 (coap_pkt_t *pkt, coap_block_slicer_t *slicer, bool more) | 
|   | Add block2 option in descriptive use from a slicer object.  More...
  | 
|   | 
| ssize_t  | coap_opt_add_uint (coap_pkt_t *pkt, uint16_t optnum, uint32_t value) | 
|   | Encode the given uint option into pkt.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_block1_control (coap_pkt_t *pkt, coap_block1_t *block) | 
|   | Encode the given block1 option in control use.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_block2_control (coap_pkt_t *pkt, coap_block1_t *block) | 
|   | Encode the given block2 option in control use.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_accept (coap_pkt_t *pkt, uint16_t format) | 
|   | Append an Accept option to the pkt buffer.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_format (coap_pkt_t *pkt, uint16_t format) | 
|   | Append a Content-Format option to the pkt buffer.  More...
  | 
|   | 
| ssize_t  | coap_opt_add_opaque (coap_pkt_t *pkt, uint16_t optnum, const void *val, size_t val_len) | 
|   | Encode the given buffer as an opaque data option into pkt.  More...
  | 
|   | 
| ssize_t  | coap_opt_add_uri_query2 (coap_pkt_t *pkt, const char *key, size_t key_len, const char *val, size_t val_len) | 
|   | Adds a single Uri-Query option in the form 'key=value' into pkt.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_uri_query (coap_pkt_t *pkt, const char *key, const char *val) | 
|   | Adds a single Uri-Query option in the form 'key=value' into pkt.  More...
  | 
|   | 
| ssize_t  | coap_opt_add_proxy_uri (coap_pkt_t *pkt, const char *uri) | 
|   | Adds a single Proxy-URI option into pkt.  More...
  | 
|   | 
| ssize_t  | coap_opt_add_chars (coap_pkt_t *pkt, uint16_t optnum, const char *chars, size_t chars_len, char separator) | 
|   | Encode the given array of characters as option(s) into pkt.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_string (coap_pkt_t *pkt, uint16_t optnum, const char *string, char separator) | 
|   | Encode the given string as option(s) into pkt.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_uri_path (coap_pkt_t *pkt, const char *path) | 
|   | Adds one or multiple Uri-Path options in the form '/path' into pkt.  More...
  | 
|   | 
| static ssize_t  | coap_opt_add_uri_path_buffer (coap_pkt_t *pkt, const char *path, size_t path_len) | 
|   | Adds one or multiple Uri-Path options in the form '/path' into pkt.  More...
  | 
|   | 
| ssize_t  | coap_opt_finish (coap_pkt_t *pkt, uint16_t flags) | 
|   | Finalizes options as required and prepares for payload.  More...
  | 
|   | 
| ssize_t  | coap_opt_remove (coap_pkt_t *pkt, uint16_t optnum) | 
|   | Removes an option previously added with function in the coap_opt_add_...() group.  More...
  | 
|   | 
 | 
Write PDU Options directly to the array of bytes for a message. 
The caller must provide the last option number written as well as the buffer position. The caller is primarily responsible for tracking and managing the space remaining in the buffer.  
 | 
| size_t  | coap_opt_put_block (uint8_t *buf, uint16_t lastonum, coap_block_slicer_t *slicer, bool more, uint16_t option) | 
|   | Insert block option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_block1 (uint8_t *buf, uint16_t lastonum, coap_block_slicer_t *slicer, bool more) | 
|   | Insert block1 option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_block2 (uint8_t *buf, uint16_t lastonum, coap_block_slicer_t *slicer, bool more) | 
|   | Insert block2 option into buffer.  More...
  | 
|   | 
| size_t  | coap_opt_put_uint (uint8_t *buf, uint16_t lastonum, uint16_t onum, uint32_t value) | 
|   | Encode the given uint option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_block1_control (uint8_t *buf, uint16_t lastonum, coap_block1_t *block) | 
|   | Insert block1 option into buffer in control usage.  More...
  | 
|   | 
| static size_t  | coap_opt_put_block2_control (uint8_t *buf, uint16_t lastonum, coap_block1_t *block) | 
|   | Insert block2 option into buffer in control usage.  More...
  | 
|   | 
| static size_t  | coap_opt_put_observe (uint8_t *buf, uint16_t lastonum, uint32_t obs) | 
|   | Insert an CoAP Observe Option into the buffer.  More...
  | 
|   | 
| size_t  | coap_opt_put_string_with_len (uint8_t *buf, uint16_t lastonum, uint16_t optnum, const char *string, size_t len, char separator) | 
|   | Encode the given string as multi-part option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_string (uint8_t *buf, uint16_t lastonum, uint16_t optnum, const char *string, char separator) | 
|   | Encode the given string as multi-part option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_location_path (uint8_t *buf, uint16_t lastonum, const char *location) | 
|   | Convenience function for inserting LOCATION_PATH option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_location_query (uint8_t *buf, uint16_t lastonum, const char *location) | 
|   | Convenience function for inserting LOCATION_QUERY option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_uri_path (uint8_t *buf, uint16_t lastonum, const char *uri) | 
|   | Convenience function for inserting URI_PATH option into buffer.  More...
  | 
|   | 
| static size_t  | coap_opt_put_uri_query (uint8_t *buf, uint16_t lastonum, const char *uri) | 
|   | Convenience function for inserting URI_QUERY option into buffer.  More...
  | 
|   | 
| size_t  | coap_opt_put_uri_pathquery (uint8_t *buf, uint16_t *lastonum, const char *uri) | 
|   | Convenience function for inserting URI_PATH and URI_QUERY into buffer This function will automatically split path and query parameters.  More...
  | 
|   | 
| static size_t  | coap_opt_put_proxy_uri (uint8_t *buf, uint16_t lastonum, const char *uri) | 
|   | Convenience function for inserting PROXY_URI option into buffer.  More...
  | 
|   | 
| size_t  | coap_put_block1_ok (uint8_t *pkt_pos, coap_block1_t *block1, uint16_t lastonum) | 
|   | Insert block1 option into buffer (from coap_block1_t)  More...
  | 
|   | 
| size_t  | coap_put_option (uint8_t *buf, uint16_t lastonum, uint16_t onum, const void *odata, size_t olen) | 
|   | Insert a CoAP option into buffer.  More...
  | 
|   | 
| static size_t  | coap_put_option_block1 (uint8_t *buf, uint16_t lastonum, unsigned blknum, unsigned szx, int more) | 
|   | Insert block1 option into buffer.  More...
  | 
|   | 
| static size_t  | coap_put_option_ct (uint8_t *buf, uint16_t lastonum, uint16_t content_type) | 
|   | Insert content type option into buffer.  More...
  | 
|   | 
 | 
Functions to support sending and receiving messages.  
 | 
| ssize_t  | coap_block2_build_reply (coap_pkt_t *pkt, unsigned code, uint8_t *rbuf, unsigned rlen, unsigned payload_len, coap_block_slicer_t *slicer) | 
|   | Build reply to CoAP block2 request.  More...
  | 
|   | 
| ssize_t  | coap_build_hdr (coap_hdr_t *hdr, unsigned type, const void *token, size_t token_len, unsigned code, uint16_t id) | 
|   | Builds a CoAP header.  More...
  | 
|   | 
| ssize_t  | coap_build_reply (coap_pkt_t *pkt, unsigned code, uint8_t *rbuf, unsigned rlen, unsigned max_data_len) | 
|   | Build reply to CoAP request.  More...
  | 
|   | 
| ssize_t  | coap_build_empty_ack (coap_pkt_t *pkt, coap_hdr_t *ack) | 
|   | Build empty reply to CoAP request.  More...
  | 
|   | 
| ssize_t  | coap_handle_req (coap_pkt_t *pkt, uint8_t *resp_buf, unsigned resp_buf_len, coap_request_ctx_t *ctx) | 
|   | Handle incoming CoAP request.  More...
  | 
|   | 
| ssize_t  | coap_tree_handler (coap_pkt_t *pkt, uint8_t *resp_buf, unsigned resp_buf_len, coap_request_ctx_t *ctx, const coap_resource_t *resources, size_t resources_numof) | 
|   | Pass a coap request to a matching handler.  More...
  | 
|   | 
| ssize_t  | coap_subtree_handler (coap_pkt_t *pkt, uint8_t *resp_buf, size_t resp_buf_len, coap_request_ctx_t *context) | 
|   | Generic coap subtree handler.  More...
  | 
|   | 
| static coap_method_flags_t  | coap_method2flag (unsigned code) | 
|   | Convert message code (request method) into a corresponding bit field.  More...
  | 
|   | 
| int  | coap_parse (coap_pkt_t *pkt, uint8_t *buf, size_t len) | 
|   | Parse a CoAP PDU.  More...
  | 
|   | 
| void  | coap_pkt_init (coap_pkt_t *pkt, uint8_t *buf, size_t len, size_t header_len) | 
|   | Initialize a packet struct, to build a message buffer.  More...
  | 
|   | 
| static void  | coap_payload_advance_bytes (coap_pkt_t *pkt, size_t len) | 
|   | Advance the payload pointer.  More...
  | 
|   | 
| ssize_t  | coap_payload_put_bytes (coap_pkt_t *pkt, const void *data, size_t len) | 
|   | Add payload data to the CoAP request.  More...
  | 
|   | 
| ssize_t  | coap_payload_put_char (coap_pkt_t *pkt, char c) | 
|   | Add a single character to the payload data of the CoAP request.  More...
  | 
|   | 
| ssize_t  | coap_build_reply_header (coap_pkt_t *pkt, unsigned code, void *buf, size_t len, uint16_t ct, void **payload, size_t *payload_len_max) | 
|   | Create CoAP reply header (convenience function)  More...
  | 
|   | 
| ssize_t  | coap_reply_simple (coap_pkt_t *pkt, unsigned code, uint8_t *buf, size_t len, uint16_t ct, const void *payload, size_t payload_len) | 
|   | Create CoAP reply (convenience function)  More...
  | 
|   | 
| 
ssize_t  | coap_well_known_core_default_handler (coap_pkt_t *pkt, uint8_t *buf, size_t len, coap_request_ctx_t *context) | 
|   | Reference to the default .well-known/core handler defined by the application. 
  | 
|   |