Loading...
Searching...
No Matches
unicoap_resource Struct Reference

A type representing a CoAP resource. More...

Detailed Description

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.

Definition at line 383 of file server.h.

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

Field Documentation

◆ flags

unicoap_resource_flags_t unicoap_resource::flags

Flags for modifying resource behavior.

See also
unicoap_resource_flags_t

Definition at line 409 of file server.h.

◆ handler

unicoap_request_handler_t unicoap_resource::handler

Request handler callback.

Function that will be executed once a new request directed at this resource reaches the server. Will be called from the unicoap thread.

Definition at line 397 of file server.h.

◆ handler_arg

void* unicoap_resource::handler_arg

Opaque optional argument for the request handler (nullable)

Definition at line 402 of file server.h.

◆ methods

unicoap_method_set_t unicoap_resource::methods

Allowed request methods for this resource.

See also
unicoap_method_set_t

Definition at line 416 of file server.h.

◆ path

const unicoap_pathspec_t unicoap_resource::path

Resource path.

See also
unicoap_pathspec_t

Definition at line 389 of file server.h.

◆ protocols

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

See also
unicoap_proto_set_t

Definition at line 425 of file server.h.


The documentation for this struct was generated from the following file: