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 <pieterjan.camerlynck@gmail.com>
This commit is contained in:
Pieterjan Camerlynck 2019-04-13 13:31:22 +02:00 committed by Jukka Rissanen
commit b7d4b0057e

View file

@ -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);
}