Loading...
Searching...
No Matches
gcoap_listener Struct Reference

A modular collection of resources for a server. More...

Detailed Description

A modular collection of resources for a server.

Definition at line 777 of file gcoap.h.

#include <gcoap.h>

Data Fields

const coap_resource_tresources
 First element in the array of resources.
 
size_t resources_len
 Length of array.
 
gcoap_socket_type_t tl_type
 Transport type for the listener.
 
gcoap_link_encoder_t link_encoder
 Writes a link for a resource.
 
struct gcoap_listenernext
 Next listener in list.
 
gcoap_request_matcher_t request_matcher
 Function that picks a suitable request handler from a request.
 

Field Documentation

◆ link_encoder

gcoap_link_encoder_t gcoap_listener::link_encoder

Writes a link for a resource.

Definition at line 790 of file gcoap.h.

◆ next

struct gcoap_listener* gcoap_listener::next

Next listener in list.

Definition at line 791 of file gcoap.h.

◆ request_matcher

gcoap_request_matcher_t gcoap_listener::request_matcher

Function that picks a suitable request handler from a request.

Note
Leaving this NULL selects the default strategy that picks handlers by matching their Uri-Path to resource paths (as per the documentation of the resources and resources_len fields). Alternative handlers may cast the resources and resources_len fields to fit their needs.

Definition at line 803 of file gcoap.h.

◆ resources

const coap_resource_t* gcoap_listener::resources

First element in the array of resources.

Definition at line 778 of file gcoap.h.

◆ resources_len

size_t gcoap_listener::resources_len

Length of array.

Definition at line 779 of file gcoap.h.

◆ tl_type

gcoap_socket_type_t gcoap_listener::tl_type

Transport type for the listener.

Any transport supported by the implementation can be set as a flag. If GCOAP_SOCKET_TYPE_UNDEF is set, the listener listens on all supported transports. If non of the transports beyond UDP are compiled in (i.e. no usage of modules gcoap_dtls, ...) this will be ignored and GCOAP_SOCKET_TYPE_UDP assumed.

Definition at line 789 of file gcoap.h.


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