Declare CoAP resources at compile time. More...
Declare CoAP resources at compile time.
Module. Specify USEMODULE += unicoap_server_resource_declarations in your application's Makefile.
Use UNICOAP_RESOURCE to define resources across files as follows. The name you supply for the resource must be unique among resource definitions but has otherwise no meaning. It is needed purely for technical reasons involving the implementation of cross file arrays. The resource macro must be followed by a constant unicoap_resource_t initializer. In the example below, we define a resource reachable under /hello-world using the designated initializer.
Declaring a CoAP resource at compile time | |
| #define | UNICOAP_RESOURCE(name) |
| Declares a static CoAP resource. | |
| #define UNICOAP_RESOURCE | ( | name | ) |
Declares a static CoAP resource.
| name | Internal name of the resource entry, must be unique |
Places resource definition in cross-file array (XFA) of resources read upon initialization.
You must supply a constant initializer following the macro invocation. The name you supply is needed for technical reasons but has otherwise no meaning.