Commit 0d650ffd authored by Seppo Takalo's avatar Seppo Takalo Committed by Fabio Baltieri
Browse files

net: lwm2m: Update TX timestamp on zsock_send()

In slow networks, like Nb-IOT, when using queue mode,
there might be significant delay between the time we
put the packet into a transmission queue and the time
we actually start transmitting.
This might cause QUEUE_RX_OFF state to be triggered earlier
than expected. Remedy the issue by updating the timestamp on the
moment where packet is accepted by zsock_send().

Signed-off-by: default avatarSeppo Takalo <seppo.takalo@nordicsemi.no>
parent 01568b57
Loading
Loading
Loading
Loading
+2 −0
Changes for subsys/net/lib/lwm2m/lwm2m_engine.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -684,6 +684,8 @@ static int socket_send_message(struct lwm2m_ctx *client_ctx)
	if (rc < 0) {
		LOG_ERR("Failed to send packet, err %d", errno);
		rc = -errno;
	} else {
		engine_update_tx_time();
	}

	if (msg->type != COAP_TYPE_CON) {