Use Uniform Resource Identifiers (URIs) to address remote CoAP resources. More...
Use Uniform Resource Identifiers (URIs) to address remote CoAP resources.
Module. Specify USEMODULE += unicoap_client_uri in your application's Makefile.
You do not need to import a CoAP driver to use the CoAP URI parser. The path, host, and URI queries will automatically be added as CoAP options to the request. IPv4 and IPv6 address literals are supported. Zone identifiers are supported too.
To be able to use the Domain Name System (DNS) to resolve names such as example.org with the client API, import RIOT's DNS module (and a DNS implementation).
For example, to send a request to the unicoap_destination_t unicoap_destination_uri("coap://example.org/foo/bar"), import dns and, e.g., sock_dns.
Manually parsing a CoAP URI | |
| int | unicoap_uri_populate (uri_parser_result_t *parsed, unicoap_endpoint_t *endpoint, unicoap_options_t *options) |
| Populates endpoint and CoAP options with URI parser result. | |
| int unicoap_uri_populate | ( | uri_parser_result_t * | parsed, |
| unicoap_endpoint_t * | endpoint, | ||
| unicoap_options_t * | options ) |
Populates endpoint and CoAP options with URI parser result.
| [in,out] | parsed | Parser result (port will be set based on scheme, if unspecified) |
| [in,out] | endpoint | Pre-allocated endpoint |
| [in,out] | options | Pre-initialized options (nullable). If NULL, no options will be extracted from URI |
0 on success -1 or negative errno on error