mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
net/coap: allow user to configure message retry macros
This commit is contained in:
parent
07ceddd9b1
commit
94660f4db7
@ -157,20 +157,52 @@ extern "C" {
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Timing parameters
|
||||
* @defgroup net_coap_conf CoAP compile configurations
|
||||
* @ingroup net_coap
|
||||
* @ingroup config
|
||||
* @{
|
||||
*/
|
||||
#define COAP_ACK_TIMEOUT (2U)
|
||||
#define COAP_RANDOM_FACTOR (1.5)
|
||||
/**
|
||||
* @brief Maximum variation for confirmable timeout.
|
||||
* @brief Timeout in seconds for a response to a confirmable request
|
||||
*
|
||||
* This value is for the response to the *initial* confirmable message. The
|
||||
* timeout doubles for subsequent retries. To avoid synchronization of resends
|
||||
* across hosts, the actual timeout is chosen randomly between
|
||||
* @ref COAP_ACK_TIMEOUT and (@ref COAP_ACK_TIMEOUT * @ref COAP_RANDOM_FACTOR).
|
||||
*/
|
||||
#ifndef COAP_ACK_TIMEOUT
|
||||
#define COAP_ACK_TIMEOUT (2U)
|
||||
#endif
|
||||
|
||||
/** @brief Used to calculate upper bound for timeout; see @ref COAP_ACK_TIMEOUT */
|
||||
#ifndef COAP_RANDOM_FACTOR
|
||||
#define COAP_RANDOM_FACTOR (1.5)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Approximation for maximum variation for confirmable timeout
|
||||
*
|
||||
* Must be an integer, defined as:
|
||||
*
|
||||
* (COAP_ACK_TIMEOUT * COAP_RANDOM_FACTOR) - COAP_ACK_TIMEOUT
|
||||
*
|
||||
* Like @ref COAP_ACK_TIMEOUT, this value is valid for the initial confirmable
|
||||
* message, and doubles for subsequent retries.
|
||||
*/
|
||||
#ifndef COAP_ACK_VARIANCE
|
||||
#define COAP_ACK_VARIANCE (1U)
|
||||
#endif
|
||||
|
||||
/** @brief Maximum number of retransmissions for a confirmable request */
|
||||
#ifndef COAP_MAX_RETRANSMIT
|
||||
#define COAP_MAX_RETRANSMIT (4)
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Timing parameters
|
||||
* @{
|
||||
*/
|
||||
#define COAP_NSTART (1)
|
||||
#define COAP_DEFAULT_LEISURE (5)
|
||||
/** @} */
|
||||
|
Loading…
Reference in New Issue
Block a user