libcoap 4.3.2rc2

Data Fields
coap_context_t Struct Reference
Libcoap Internal API » Context Handling

The CoAP stack's global state is stored in a coap_context_t object. More...

`#include <coap_net_internal.h>`

## Data Fields
coap_opt_filter_t | known_options
coap_resource_t * | resources
| hash table or list of known resources More...
coap_resource_t * | unknown_resource
| can be used for handling unknown resources More...
coap_resource_t * | proxy_uri_resource
| can be used for handling proxy URI resources More...
coap_resource_release_userdata_handler_t | release_userdata
| function to release user_data when resource is deleted More...
coap_tick_t | sendqueue_basetime
| The time stamp in the first element of the sendqeue is relative to sendqueue_basetime. More...
coap_queue_t * | sendqueue
coap_endpoint_t * | endpoint
| the endpoints used for listening More...
coap_session_t * | sessions
| client sessions More...
coap_response_handler_t | response_handler
| Called when a response is received. More...
coap_nack_handler_t | nack_handler
| Called when a response issue has occurred. More...
coap_ping_handler_t | ping_handler
| Called when a CoAP ping is received. More...
coap_pong_handler_t | pong_handler
| Called when a ping response is received. More...
coap_observe_added_t | observe_added
| Called when there is a new observe subscription request. More...
coap_observe_deleted_t | observe_deleted
| Called when there is a observe subscription de-register request. More...
void * | observe_user_data
| App provided data for use in observe_added or observe_deleted. More...
uint32_t | observe_save_freq
| How frequently to update observe value. More...
coap_track_observe_value_t | track_observe_value
| Callback to save observe value when updated. More...
coap_dyn_resource_added_t | dyn_resource_added
| Callback to save dynamic resource when created. More...
coap_resource_deleted_t | resource_deleted
| Invoked when resource is deleted. More...
coap_event_handler_t | handle_event
| Callback function that is used to signal events to the application. More...
void * | dtls_context
coap_dtls_spsk_t | spsk_setup_data
| Contains the initial PSK server setup data. More...
unsigned int | session_timeout
| Number of seconds of inactivity after which an unused session will be closed. More...
unsigned int | max_idle_sessions
| Maximum number of simultaneous unused sessions per endpoint. More...
unsigned int | max_handshake_sessions
| Maximum number of simultaneous negotating sessions per endpoint. More...
unsigned int | ping_timeout
| Minimum inactivity time before sending a ping message. More...
unsigned int | csm_timeout
| Timeout for waiting for a CSM from the remote side. More...
uint32_t | csm_max_message_size
| Value for CSM Max-Message-Size. More...
uint64_t | etag
| Next ETag to use. More...
coap_cache_entry_t * | cache
| CoAP cache-entry cache. More...
uint16_t * | cache_ignore_options
| CoAP options to ignore when creating a cache-key. More...
size_t | cache_ignore_count
| The number of CoAP options to ignore when creating a cache-key. More...
void * | app
| application-specific data More...
uint32_t | max_token_size
| Largest token size supported RFC8974. More...
fd_set | readfds
fd_set | writefds
fd_set | exceptfds
| Used for select call in coap_io_process_with_fds() More...
coap_socket_t * | sockets [64]
| Track different socket information in coap_io_process_with_fds. More...
unsigned int | num_sockets
| Number of sockets being tracked. More...
uint8_t | observe_pending
| Observe response pending. More...
uint8_t | observe_no_clear
| Observe 4.04 not to be sent on deleting resource. More...
uint8_t | mcast_per_resource
| Mcast controlled on a per resource basis. More...
uint8_t | block_mode
| Zero or more COAP_BLOCK_ or'd options. More...

## Detailed Description

The CoAP stack's global state is stored in a coap_context_t object.

Definition at line 49 of file coap_net_internal.h.

## Field Documentation

## ◆ app

void* coap_context_t::app

application-specific data

Definition at line 171 of file coap_net_internal.h.

## ◆ block_mode

uint8_t coap_context_t::block_mode

Zero or more COAP_BLOCK_ or'd options.

Definition at line 191 of file coap_net_internal.h.

## ◆ cache

coap_cache_entry_t* coap_context_t::cache

CoAP cache-entry cache.

Definition at line 165 of file coap_net_internal.h.

## ◆ cache_ignore_count

size_t coap_context_t::cache_ignore_count

The number of CoAP options to ignore when creating a cache-key.

Definition at line 168 of file coap_net_internal.h.

## ◆ cache_ignore_options

uint16_t* coap_context_t::cache_ignore_options

CoAP options to ignore when creating a cache-key.

Definition at line 166 of file coap_net_internal.h.

## ◆ csm_max_message_size

uint32_t coap_context_t::csm_max_message_size

Value for CSM Max-Message-Size.

Definition at line 161 of file coap_net_internal.h.

## ◆ csm_timeout

unsigned int coap_context_t::csm_timeout

Timeout for waiting for a CSM from the remote side.

0 means disabled.

Definition at line 159 of file coap_net_internal.h.

## ◆ dtls_context

void* coap_context_t::dtls_context

Definition at line 140 of file coap_net_internal.h.

## ◆ dyn_resource_added

coap_dyn_resource_added_t coap_context_t::dyn_resource_added

Callback to save dynamic resource when created.

Definition at line 118 of file coap_net_internal.h.

## ◆ endpoint

coap_endpoint_t* coap_context_t::endpoint

the endpoints used for listening

Definition at line 75 of file coap_net_internal.h.

## ◆ etag

uint64_t coap_context_t::etag

Next ETag to use.

Definition at line 162 of file coap_net_internal.h.

## ◆ exceptfds

fd_set coap_context_t::exceptfds

Used for select call in coap_io_process_with_fds()

Definition at line 178 of file coap_net_internal.h.

## ◆ handle_event

coap_event_handler_t coap_context_t::handle_event

Callback function that is used to signal events to the application.

This field is set by coap_set_event_handler().

Definition at line 138 of file coap_net_internal.h.

## ◆ known_options

coap_opt_filter_t coap_context_t::known_options

Definition at line 50 of file coap_net_internal.h.

## ◆ max_handshake_sessions

unsigned int coap_context_t::max_handshake_sessions

Maximum number of simultaneous negotating sessions per endpoint.

0 means use default.

Definition at line 153 of file coap_net_internal.h.

## ◆ max_idle_sessions

unsigned int coap_context_t::max_idle_sessions

Maximum number of simultaneous unused sessions per endpoint.

0 means no maximum.

Definition at line 150 of file coap_net_internal.h.

## ◆ max_token_size

uint32_t coap_context_t::max_token_size

Largest token size supported RFC8974.

Definition at line 172 of file coap_net_internal.h.

## ◆ mcast_per_resource

uint8_t coap_context_t::mcast_per_resource

Mcast controlled on a per resource basis.

Definition at line 188 of file coap_net_internal.h.

## ◆ nack_handler

coap_nack_handler_t coap_context_t::nack_handler

Called when a response issue has occurred.

Definition at line 102 of file coap_net_internal.h.

## ◆ num_sockets

unsigned int coap_context_t::num_sockets

Number of sockets being tracked.

Definition at line 182 of file coap_net_internal.h.

## ◆ observe_added

coap_observe_added_t coap_context_t::observe_added

Called when there is a new observe subscription request.

Definition at line 109 of file coap_net_internal.h.

## ◆ observe_deleted

coap_observe_deleted_t coap_context_t::observe_deleted

Called when there is a observe subscription de-register request.

Definition at line 111 of file coap_net_internal.h.

## ◆ observe_no_clear

uint8_t coap_context_t::observe_no_clear

Observe 4.04 not to be sent on deleting resource.

Definition at line 186 of file coap_net_internal.h.

## ◆ observe_pending

uint8_t coap_context_t::observe_pending

Observe response pending.

Definition at line 185 of file coap_net_internal.h.

## ◆ observe_save_freq

uint32_t coap_context_t::observe_save_freq

How frequently to update observe value.

Definition at line 115 of file coap_net_internal.h.

## ◆ observe_user_data

void* coap_context_t::observe_user_data

App provided data for use in observe_added or observe_deleted.

Definition at line 113 of file coap_net_internal.h.

## ◆ ping_handler

coap_ping_handler_t coap_context_t::ping_handler

Called when a CoAP ping is received.

Definition at line 104 of file coap_net_internal.h.

## ◆ ping_timeout

unsigned int coap_context_t::ping_timeout

Minimum inactivity time before sending a ping message.

0 means disabled.

Definition at line 156 of file coap_net_internal.h.

## ◆ pong_handler

coap_pong_handler_t coap_context_t::pong_handler

Called when a ping response is received.

Definition at line 105 of file coap_net_internal.h.

## ◆ proxy_uri_resource

coap_resource_t* coap_context_t::proxy_uri_resource

can be used for handling proxy URI resources

Definition at line 56 of file coap_net_internal.h.

## ◆ readfds

fd_set coap_context_t::readfds

Definition at line 178 of file coap_net_internal.h.

## ◆ release_userdata

coap_resource_release_userdata_handler_t coap_context_t::release_userdata

function to release user_data when resource is deleted

Definition at line 58 of file coap_net_internal.h.

## ◆ resource_deleted

coap_resource_deleted_t coap_context_t::resource_deleted

Invoked when resource is deleted.

Definition at line 120 of file coap_net_internal.h.

## ◆ resources

coap_resource_t* coap_context_t::resources

hash table or list of known resources

Definition at line 52 of file coap_net_internal.h.

## ◆ response_handler

coap_response_handler_t coap_context_t::response_handler

Called when a response is received.

Definition at line 99 of file coap_net_internal.h.

## ◆ sendqueue

coap_queue_t* coap_context_t::sendqueue

Definition at line 73 of file coap_net_internal.h.

## ◆ sendqueue_basetime

coap_tick_t coap_context_t::sendqueue_basetime

The time stamp in the first element of the sendqeue is relative to sendqueue_basetime.

Definition at line 72 of file coap_net_internal.h.

## ◆ session_timeout

unsigned int coap_context_t::session_timeout

Number of seconds of inactivity after which an unused session will be closed.

0 means use default.

Definition at line 147 of file coap_net_internal.h.

## ◆ sessions

coap_session_t* coap_context_t::sessions

client sessions

Definition at line 78 of file coap_net_internal.h.

## ◆ sockets

coap_socket_t* coap_context_t::sockets[64]

Track different socket information in coap_io_process_with_fds.

Definition at line 180 of file coap_net_internal.h.

## ◆ spsk_setup_data

coap_dtls_spsk_t coap_context_t::spsk_setup_data

Contains the initial PSK server setup data.

Definition at line 143 of file coap_net_internal.h.

## ◆ track_observe_value

coap_track_observe_value_t coap_context_t::track_observe_value

Callback to save observe value when updated.

Definition at line 116 of file coap_net_internal.h.

## ◆ unknown_resource

coap_resource_t* coap_context_t::unknown_resource

can be used for handling unknown resources

Definition at line 54 of file coap_net_internal.h.

## ◆ writefds

fd_set coap_context_t::writefds

Definition at line 178 of file coap_net_internal.h.

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

- coap_net_internal.h