diff --git a/include/coap3/coap_session.h b/include/coap3/coap_session.h index 9e6913d6..92adec52 100644 --- a/include/coap3/coap_session.h +++ b/include/coap3/coap_session.h @@ -778,7 +778,9 @@ const char *coap_endpoint_str(const coap_endpoint_t *endpoint); * The MAX_LATENCY definition. * RFC 7252, Section 4.8.2 MAX_LATENCY is 100. */ +#ifndef COAP_DEFAULT_MAX_LATENCY #define COAP_DEFAULT_MAX_LATENCY (100U) +#endif /* COAP_DEFAULT_MAX_LATENCY */ /** * Set the CoAP initial ack response timeout before the next re-transmit diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index fc237ac5..a7422e69 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -194,6 +194,7 @@ if(CONFIG_LIBCOAP) $<$:COAP_DEFAULT_MAX_PDU_RX_SIZE=${CONFIG_LIBCOAP_DEFAULT_MAX_PDU_RX_SIZE}> $<$:COAP_RXBUFFER_SIZE=${CONFIG_LIBCOAP_RXBUFFER_SIZE}> $<$:COAP_DEFAULT_MTU=${CONFIG_LIBCOAP_DEFAULT_MTU}> + $<$:COAP_DEFAULT_MAX_LATENCY=${CONFIG_LIBCOAP_DEFAULT_MAX_LATENCY}> $<$:COAP_DEFAULT_SESSION_TIMEOUT=${CONFIG_LIBCOAP_DEFAULT_SESSION_TIMEOUT}> ) diff --git a/zephyr/Kconfig b/zephyr/Kconfig index 39359017..25e805c1 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -216,6 +216,13 @@ config LIBCOAP_OBS_MAX_NON help Number of NON notifications before sending a CON (RFC7641 4.5). +config LIBCOAP_DEFAULT_MAX_LATENCY + int "Default max latency in seconds" + default 100 + help + Maximum network latency used by CoAP timeout calculations. + RFC7252 Section 4.8.2 specifies a default of 100 seconds. + config LIBCOAP_DEFAULT_SESSION_TIMEOUT int "Default session timeout" default 300