Skip to content
Commit 397b2a71 authored by Robert Lubos's avatar Robert Lubos Committed by Carles Cufí
Browse files

net: lwm2m: Add a callback to notify socket errors to engine users



Currently, when socket errors occur during receive, the LwM2M engine
restarts the state machine and registers again to the server. While this
works in simple use case (only RD client socket open), it's not a valid
approach when more sockets are open (FW update socket).

Fix this by introducing socket fault callback, which is registered by
the LwM2M engine users. This way, a proper socket owner is notified on
error and can pertake appropriate action.

For RD socket errors the behaviour remains the same - the state machine
is reset and the client registers again to the server. For FW update
socket, handle the error by reopening the socket and retransmitting the
last request. This allows to resume the download from the point the
error occured, w/o a need to start from scratch.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 97696f3e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment