Skip to content

Handle LwM2M requests asynchronously #73224

@koalatux

Description

@koalatux

Is your enhancement proposal related to a problem? Please describe.
Handling of LwM2M requests is done in a blocking way. While handling a request no other requests can be handled at that time. To build a response we would like to query information from an external component, which can take some seconds. We would like to handle other LwM2M requests during that time.

Describe the solution you'd like
In a request callback we would like to store the LwM2M request context away, send an empty CoAP ACK and tell the LwM2M engine it should not send a response upon returning of the callback. Later we want to send the response separately from a different thread using the previously stored request context.

Describe alternatives you've considered
We considered calling lwm2m_acknowledge() to send an empty CoAP ACK and then block the LwM2M thread until we have the final response. While this somewhat lowers the pain it still does not allow handling of other LwM2M messages nor does it send repeated acknowledge messages for receiving duplicate requests in case the first acknowledge got lost.

Additional context
None

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions