libcoap 4.3.3
coap_resource_t Struct Reference

Abstraction of resource that can be attached to coap_context_t. More...

#include <coap_resource_internal.h>

+ Collaboration diagram for coap_resource_t:

Data Fields

unsigned int dirty:1
 set to 1 if resource has changed More...
 
unsigned int partiallydirty:1
 set to 1 if some subscribers have not yet been notified of the last change More...
 
unsigned int observable:1
 can be observed More...
 
unsigned int cacheable:1
 can be cached More...
 
unsigned int is_unknown:1
 resource created for unknown handler More...
 
unsigned int is_proxy_uri:1
 resource created for proxy URI handler More...
 
coap_method_handler_t handler [7]
 Used to store handlers for the seven coap methods GET, POST, PUT, DELETE, FETCH, PATCH and IPATCH. More...
 
UT_hash_handle hh
 
coap_attr_tlink_attr
 attributes to be included with the link format More...
 
coap_subscription_tsubscribers
 list of observers for this resource More...
 
coap_str_const_turi_path
 Request URI Path for this resource. More...
 
int flags
 zero or more COAP_RESOURCE_FLAGS_* or'd together More...
 
unsigned int observe
 The next value for the Observe option. More...
 
coap_context_tcontext
 Pointer back to the context that 'owns' this resource. More...
 
size_t proxy_name_count
 Count of valid names this host is known by (proxy support) More...
 
coap_str_const_t ** proxy_name_list
 Array valid names this host is known by (proxy support) More...
 
void * user_data
 This pointer is under user control. More...
 

Detailed Description

Abstraction of resource that can be attached to coap_context_t.

The key is uri_path.

Definition at line 53 of file coap_resource_internal.h.

Field Documentation

◆ cacheable

unsigned int coap_resource_t::cacheable

can be cached

Definition at line 58 of file coap_resource_internal.h.

◆ context

coap_context_t* coap_resource_t::context

Pointer back to the context that 'owns' this resource.

Definition at line 94 of file coap_resource_internal.h.

◆ dirty

unsigned int coap_resource_t::dirty

set to 1 if resource has changed

Definition at line 54 of file coap_resource_internal.h.

◆ flags

int coap_resource_t::flags

zero or more COAP_RESOURCE_FLAGS_* or'd together

Definition at line 83 of file coap_resource_internal.h.

◆ handler

coap_method_handler_t coap_resource_t::handler[7]

Used to store handlers for the seven coap methods GET, POST, PUT, DELETE, FETCH, PATCH and IPATCH.

coap_dispatch() will pass incoming requests to handle_request() and then to the handler that corresponds to its request method or generate a 4.05 response if no handler is available.

Definition at line 69 of file coap_resource_internal.h.

◆ hh

UT_hash_handle coap_resource_t::hh

Definition at line 71 of file coap_resource_internal.h.

◆ is_proxy_uri

unsigned int coap_resource_t::is_proxy_uri

resource created for proxy URI handler

Definition at line 60 of file coap_resource_internal.h.

◆ is_unknown

unsigned int coap_resource_t::is_unknown

resource created for unknown handler

Definition at line 59 of file coap_resource_internal.h.

◆ link_attr

coap_attr_t* coap_resource_t::link_attr

attributes to be included with the link format

Definition at line 73 of file coap_resource_internal.h.

◆ observable

unsigned int coap_resource_t::observable

can be observed

Definition at line 57 of file coap_resource_internal.h.

◆ observe

unsigned int coap_resource_t::observe

The next value for the Observe option.

This field must be increased each time the resource changes. Only the lower 24 bits are sent.

Definition at line 89 of file coap_resource_internal.h.

◆ partiallydirty

unsigned int coap_resource_t::partiallydirty

set to 1 if some subscribers have not yet been notified of the last change

Definition at line 55 of file coap_resource_internal.h.

◆ proxy_name_count

size_t coap_resource_t::proxy_name_count

Count of valid names this host is known by (proxy support)

Definition at line 99 of file coap_resource_internal.h.

◆ proxy_name_list

coap_str_const_t** coap_resource_t::proxy_name_list

Array valid names this host is known by (proxy support)

Definition at line 104 of file coap_resource_internal.h.

◆ subscribers

coap_subscription_t* coap_resource_t::subscribers

list of observers for this resource

Definition at line 74 of file coap_resource_internal.h.

◆ uri_path

coap_str_const_t* coap_resource_t::uri_path

Request URI Path for this resource.

This field will point into static or allocated memory which must remain there for the duration of the resource. the key used for hash lookup for this resource

Definition at line 81 of file coap_resource_internal.h.

◆ user_data

void* coap_resource_t::user_data

This pointer is under user control.

It can be used to store context for the coap handler.

Definition at line 110 of file coap_resource_internal.h.


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