coap_resource_t Struct Reference

`#include <resource.h>`

Collaboration diagram for coap_resource_t:
[legend]

## 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...
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_t * | link_attr
| attributes to be included with the link format More...
coap_subscription_t * | subscribers
| list of observers for this resource More...
coap_str_const_t * | uri_path
| Request URI Path for this resource. More...
int | flags
unsigned int | observe
| The next value for the Observe option. More...
void * | user_data
| This pointer is under user control. More...

## Detailed Description

Definition at line 68 of file resource.h.

## Field Documentation

## cacheable

unsigned int coap_resource_t::cacheable

can be cached

Definition at line 73 of file resource.h.

## dirty

unsigned int coap_resource_t::dirty

set to 1 if resource has changed

Definition at line 69 of file resource.h.

## flags

int coap_resource_t::flags

Definition at line 96 of file resource.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 the handler that corresponds to its request method or generate a 4.05 response if no handler is available.

Definition at line 83 of file resource.h.

## hh

UT_hash_handle coap_resource_t::hh

Definition at line 85 of file resource.h.

## is_unknown

unsigned int coap_resource_t::is_unknown

resource created for unknown handler

Definition at line 74 of file resource.h.

## link_attr

coap_attr_t* coap_resource_t::link_attr

attributes to be included with the link format

Definition at line 87 of file resource.h.

## observable

unsigned int coap_resource_t::observable

can be observed

Definition at line 72 of file resource.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 102 of file resource.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 70 of file resource.h.

## subscribers

coap_subscription_t* coap_resource_t::subscribers

list of observers for this resource

Definition at line 88 of file resource.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 95 of file resource.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 108 of file resource.h.

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

- resource.h