net: lwm2m: Reset ongoing notification in case token changes

In case observation token changes (the LwM2M server re-sends
observation request to the client), the LwM2M engine should cancel any
ongoing notifications based on the old token. Otherwise, it will be
impossible to match the pending notification reply (ACK) with the
observer context anymore, causing new notifications for this
observation to stall.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2023-10-03 15:35:24 +02:00 committed by Carles Cufí
commit 1b21109c2c
5 changed files with 25 additions and 13 deletions

View file

@ -238,7 +238,7 @@ ZTEST(lwm2m_engine, test_check_notifications)
obs.last_timestamp = k_uptime_get();
obs.event_timestamp = k_uptime_get() + 1000U;
obs.resource_update = false;
obs.active_tx_operation = false;
obs.active_notify = NULL;
sys_slist_append(&ctx.observer, &obs.node);