From b7d4b0057e2c44b42bc31d4024abdee9c8e02ae5 Mon Sep 17 00:00:00 2001 From: Pieterjan Camerlynck Date: Sat, 13 Apr 2019 13:31:22 +0200 Subject: [PATCH] net: lwm2m: fix automatic notification frequency This fixes the issue where observations are automatically reported using the minimum period instead of the maximum. This causes notifications to be sent more frequently than configured when the resource does not change. Signed-off-by: Pieterjan Camerlynck --- subsys/net/lib/lwm2m/lwm2m_engine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index 10e369b3548..2d2ebcc99dd 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -3795,7 +3795,7 @@ static int lwm2m_engine_service(void) * - current timestamp > last_timestamp + max_period_sec */ } else if (timestamp > obs->last_timestamp + - K_SECONDS(obs->min_period_sec)) { + K_SECONDS(obs->max_period_sec)) { obs->last_timestamp = k_uptime_get(); generate_notify_message(obs, false); }