Gcoap compile configurations

Detailed Description

Macros

#define GCOAP_MSG_QUEUE_SIZE   (4)
 Size for module message queue.
 
#define GCOAP_PORT   (5683)
 Server port; use RFC 7252 default if not defined.
 
#define GCOAP_PDU_BUF_SIZE   (128)
 Size of the buffer used to build a CoAP request or response.
 
#define GCOAP_REQ_OPTIONS_BUF   (4)
 Reduce payload length by this value for a request. More...
 
#define GCOAP_RESP_OPTIONS_BUF   (4)
 Reduce payload length by this value for a response. More...
 
#define GCOAP_OBS_OPTIONS_BUF   (4)
 Reduce payload length by this value for an observe notification. More...
 
#define GCOAP_REQ_WAITING_MAX   (2)
 Maximum number of requests awaiting a response.
 
#define GCOAP_TOKENLEN   (2)
 Length in bytes for a token. More...
 
#define GCOAP_RECV_TIMEOUT   (1 * US_PER_SEC)
 Time in usec that the event loop waits for an incoming CoAP message.
 
#define GCOAP_NO_RETRANS_BACKOFF
 Turns off retransmission backoff when defined (undefined per default) More...
 
#define GCOAP_NON_TIMEOUT   (5000000U)
 Default time to wait for a non-confirmable response [in usec]. More...
 
#define GCOAP_OBS_CLIENTS_MAX   (2)
 Maximum number of Observe clients.
 
#define GCOAP_OBS_REGISTRATIONS_MAX   (2)
 Maximum number of registrations for Observable resources.
 
#define GCOAP_OBS_VALUE_WIDTH   (3)
 Width in bytes of the Observe option value for a notification. More...
 
#define GCOAP_RESEND_BUFS_MAX   (1)
 Count of PDU buffers available for resending confirmable messages.
 

Macro Definition Documentation

◆ GCOAP_NO_RETRANS_BACKOFF

#define GCOAP_NO_RETRANS_BACKOFF

Turns off retransmission backoff when defined (undefined per default)

In normal operations the timeout between retransmissions doubles. When GCOAP_NO_RETRANS_BACKOFF is defined this doubling does not happen.

See also
COAP_ACK_TIMEOUT
COAP_ACK_VARIANCE

Definition at line 366 of file gcoap.h.

◆ GCOAP_NON_TIMEOUT

#define GCOAP_NON_TIMEOUT   (5000000U)

Default time to wait for a non-confirmable response [in usec].

Set to 0 to disable timeout.

Definition at line 376 of file gcoap.h.

◆ GCOAP_OBS_OPTIONS_BUF

#define GCOAP_OBS_OPTIONS_BUF   (4)

Reduce payload length by this value for an observe notification.

Accommodates writing Content-Format option in gcoap_finish(). May set to zero if function not used.

Definition at line 295 of file gcoap.h.

◆ GCOAP_OBS_VALUE_WIDTH

#define GCOAP_OBS_VALUE_WIDTH   (3)

Width in bytes of the Observe option value for a notification.

This width is used to determine the length of the 'tick' used to measure the time between observable changes to a resource. A tick is expressed internally as GCOAP_OBS_TICK_EXPONENT, which is the base-2 log value of the tick length in microseconds.

The canonical setting for the value width is 3 (exponent 5), which results in a tick length of 32 usec, per sec. 3.4, 4.4 of the RFC. Width 2 (exponent 16) results in a tick length of ~65 msec, and width 1 (exponent 24) results in a tick length of ~17 sec.

The tick length must be short enough so that the Observe value strictly increases for each new notification. The purpose of the value is to allow a client to detect message reordering within the network latency period (128 sec). For resources that change only slowly, the reduced message length is useful when packet size is limited.

Definition at line 438 of file gcoap.h.

◆ GCOAP_REQ_OPTIONS_BUF

#define GCOAP_REQ_OPTIONS_BUF   (4)

Reduce payload length by this value for a request.

Accommodates writing Content-Format option in gcoap_finish(). May set to zero if function not used.

Definition at line 275 of file gcoap.h.

◆ GCOAP_RESP_OPTIONS_BUF

#define GCOAP_RESP_OPTIONS_BUF   (4)

Reduce payload length by this value for a response.

Accommodates writing Content-Format option in gcoap_finish(). May set to zero if function not used.

Definition at line 285 of file gcoap.h.

◆ GCOAP_TOKENLEN

#define GCOAP_TOKENLEN   (2)

Length in bytes for a token.

Value must be in the range 0 to GCOAP_TOKENLEN_MAX.

Definition at line 323 of file gcoap.h.