Commit bb98d876 authored by Michael Scott's avatar Michael Scott Committed by Jukka Rissanen
Browse files

net: coap: add COAP_INIT_ACK_TIMEOUT_MS setting

The base CoAP retry setting is quite fast for network technologies
such as LTE-M and LoRa.  Let's add an option to delay retries
a bit longer depending on the need.

Signed-off-by: default avatarMichael Scott <michael@opensourcefoundries.com>
parent 07ec5567
Loading
Loading
Loading
Loading
+7 −0
Changes for subsys/net/lib/coap/Kconfig: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -62,6 +62,13 @@ config COAP_EXTENDED_OPTIONS_LEN_VALUE
	  COAP_EXTENDED_OPTIONS_LEN is enabled. Define the value according to
	  user requirement.

config COAP_INIT_ACK_TIMEOUT_MS
	int "base length of the random generated initial ACK timeout in ms"
	default 2345
	range 2345 100000
	help
	  This value is used as a base value to retry pending CoAP packets.

config NET_DEBUG_COAP
	bool "Debug COAP"
	default n
+1 −1
Changes for subsys/net/lib/coap/coap.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ struct coap_pending *coap_pending_next_to_expire(
 * where ACK_TIMEOUT = 2 and ACK_RANDOM_FACTOR = 1.5 by default
 * Ref: https://tools.ietf.org/html/rfc7252#section-4.8
 */
#define INIT_ACK_TIMEOUT	2345
#define INIT_ACK_TIMEOUT	CONFIG_COAP_INIT_ACK_TIMEOUT_MS

static s32_t next_timeout(s32_t previous)
{