Skip to content

Commit 44c1101

Browse files
rluboscarlescufi
authored andcommitted
net: lwm2m: Make Registration Update ahead time configurable
Allow to configure, how long before registration timeout should the Registration Update be sent. The fixed 6 seconds used so far, might not be enough in slower networks (like NB-IoT), resulting in frequent re-registrations at LWM2M level. Signed-off-by: Robert Lubos <[email protected]>
1 parent 1af73a6 commit 44c1101

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

subsys/net/lib/lwm2m/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ config LWM2M_ENGINE_DEFAULT_LIFETIME
8383
help
8484
Set the default lifetime (in seconds) for the LWM2M library engine
8585

86+
config LWM2M_SECONDS_TO_UPDATE_EARLY
87+
int "LWM2M Registration Update transmission time before timeout"
88+
default 6
89+
range 1 65535
90+
help
91+
Time in seconds before the registration timeout, when the LWM2M
92+
Registration Update is sent by the engine. In networks with large
93+
round trip times (like NB-IoT), it might be needed to set this value
94+
higher, in order to allow the response to arrive before timeout.
95+
8696
config LWM2M_QUEUE_MODE_ENABLED
8797
bool "Enable Queue Mode UDP binding"
8898
help

subsys/net/lib/lwm2m/lwm2m_rd_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
6161

6262
#define LWM2M_RD_CLIENT_URI "rd"
6363

64-
#define SECONDS_TO_UPDATE_EARLY 6
64+
#define SECONDS_TO_UPDATE_EARLY CONFIG_LWM2M_SECONDS_TO_UPDATE_EARLY
6565
#define STATE_MACHINE_UPDATE_INTERVAL_MS 500
6666

6767
/* Leave room for 32 hexadeciaml digits (UUID) + NULL */

0 commit comments

Comments
 (0)