A type representing a CoAP resource. More...
A type representing a CoAP resource.
This structure models a CoAP resource that can handle requests with a specified set of methods and allowed protocols. Normally, each resource listens for requests matching the given path. If you want to match all paths with a certain path prefix, see UNICOAP_RESOURCE_FLAG_MATCH_SUBTREE.
#include <server.h>
Data Fields | |
| const unicoap_pathspec_t | path |
| Resource path. | |
| unicoap_request_handler_t | handler |
| Request handler callback. | |
| void * | handler_arg |
| Opaque optional argument for the request handler (nullable) | |
| unicoap_resource_flags_t | flags |
| Flags for modifying resource behavior. | |
| unicoap_method_set_t | methods |
| Allowed request methods for this resource. | |
| unicoap_proto_set_t | protocols |
| Allowed transport protocols this resource can be reached over. | |
| unicoap_resource_flags_t unicoap_resource::flags |
Flags for modifying resource behavior.
| unicoap_request_handler_t unicoap_resource::handler |
| void* unicoap_resource::handler_arg |
| unicoap_method_set_t unicoap_resource::methods |
Allowed request methods for this resource.
| const unicoap_pathspec_t unicoap_resource::path |
| unicoap_proto_set_t unicoap_resource::protocols |
Allowed transport protocols this resource can be reached over.
Use this property to, e.g., limit requests to encrypted transport protocols