zephyr/subsys/net/lib/lwm2m
Robert Lubos afb73d1d09 net: lwm2m: Fix retransmission logic
The retaransmission logic was not correct in the lwm2m_engine, and could
lead to faulty behavior in case multiple messages were pending for
retransmission in the queue.

1. Since there is a singe delayed work item for entire retransmission
   queue, `coap_pending_next_to_expire` should be called before
   scheduling next timeout, to identify which message is going to expire
   next (and when). Currently, the engine always set next timeout, based
   on timeout from the message being currently re-transmitted.
2. In case the message was re-transmitted several times, and is removed
   from the retansmission queue due to a timeout, next retransmission
   should be scheduled, in case there are other messages on the queue.
3. Verify the timeout of the earliest message to expire in the
   retransmission handler. In case messages from the beginning of the
   queue were removed, we might need to schedule the retransmission
   again, instead of sending message rightaway.
4. `lwm2m_send_message` is not handling retransmissions anyway, so
   there's no need to check send attempts. Instead, verify
   retransmission work item is already pending, and update its timeout
   if needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-28 09:50:45 +03:00
..
buf_util.h net: lwm2m: move to flat buffers 2019-01-31 23:02:56 -05:00
CMakeLists.txt net: lwm2m: add IPSO Accelerometer object support 2019-08-02 12:00:35 +03:00
ipso_accelerometer.c net: lwm2m: add optional timestamp resources to some IPSO objects 2019-12-18 10:43:59 +02:00
ipso_buzzer.c net: lwm2m: Convert to new timeout API 2020-04-28 09:50:45 +03:00
ipso_light_control.c net: lwm2m: cleanup memset usage during init 2019-08-02 12:00:35 +03:00
ipso_onoff_switch.c net: lwm2m: add optional timestamp resources to some IPSO objects 2019-12-18 10:43:59 +02:00
ipso_push_button.c net: lwm2m: add optional timestamp resources to some IPSO objects 2019-12-18 10:43:59 +02:00
ipso_temp_sensor.c net: lwm2m: add optional timestamp resources to some IPSO objects 2019-12-18 10:43:59 +02:00
ipso_timer.c net: lwm2m: Convert to new timeout API 2020-04-28 09:50:45 +03:00
Kconfig net: lwm2m: Add option to register in UDP queue mode 2020-03-10 14:57:29 +02:00
Kconfig.ipso net: lwm2m: add optional timestamp resources to some IPSO objects 2019-12-18 10:43:59 +02:00
lwm2m_engine.c net: lwm2m: Fix retransmission logic 2020-04-28 09:50:45 +03:00
lwm2m_engine.h net: lwm2m: Add option to register in UDP queue mode 2020-03-10 14:57:29 +02:00
lwm2m_obj_connmon.c net: lwm2m: Fix Cell ID resource initialization 2020-04-18 16:27:56 +03:00
lwm2m_obj_device.c net: lwm2m: Convert to new timeout API 2020-04-28 09:50:45 +03:00
lwm2m_obj_firmware.c net: lwm2m: rework resource instance storage / access methods 2019-08-02 12:00:35 +03:00
lwm2m_obj_firmware_pull.c net: lwm2m: Publicize firmware block context 2020-04-09 16:48:45 +02:00
lwm2m_obj_location.c net: lwm2m: add Location object support 2019-08-02 12:00:35 +03:00
lwm2m_obj_security.c net: lwm2m: cleanup memset usage during init 2019-08-02 12:00:35 +03:00
lwm2m_obj_server.c net: lwm2m: Add option to register in UDP queue mode 2020-03-10 14:57:29 +02:00
lwm2m_object.h net: lwm2m: rework resource instance storage / access methods 2019-08-02 12:00:35 +03:00
lwm2m_rd_client.c net: lwm2m: Convert to new timeout API 2020-04-28 09:50:45 +03:00
lwm2m_rd_client.h net: lwm2m: Notify when it's safe to turn RX off 2020-03-10 14:57:29 +02:00
lwm2m_rw_json.c net: lwm2m: json: fix potential buffer overflow 2020-04-06 22:09:12 -04:00
lwm2m_rw_json.h net: lwm2m: remove lwm2m_engine_obj from most handlers/formatter OPs 2019-08-02 12:00:35 +03:00
lwm2m_rw_oma_tlv.c net: lwm2m: support for reading OPAQUE resources with OMA TLV 2020-04-23 10:16:52 +03:00
lwm2m_rw_oma_tlv.h net: lwm2m: remove lwm2m_engine_obj from most handlers/formatter OPs 2019-08-02 12:00:35 +03:00
lwm2m_rw_plain_text.c net: lwm2m: fix printf warning 2019-09-23 22:29:12 +03:00
lwm2m_rw_plain_text.h net: lwm2m: plain text: expose put_float32/64 functions 2019-08-28 10:58:11 +02:00
lwm2m_util.c net: lwm2m: tlv: fix float32/64 sign handling 2019-08-28 10:58:11 +02:00
lwm2m_util.h net: lwm2m: fix float32/64 handling 2019-02-12 21:19:49 -05:00