Skip to content

Handle LwM2M requests asynchronously #73224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
koalatux opened this issue May 23, 2024 · 2 comments
Open

Handle LwM2M requests asynchronously #73224

koalatux opened this issue May 23, 2024 · 2 comments
Assignees
Labels
area: LWM2M area: Networking Enhancement Changes/Updates/Additions to existing features

Comments

@koalatux
Copy link
Contributor

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

@koalatux koalatux added the Enhancement Changes/Updates/Additions to existing features label May 23, 2024
Copy link

Hi @koalatux! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@boaks
Copy link

boaks commented Aug 6, 2024

At least in the earlier LwM2M TS (1.0) the recommendation was to use "always an empty token", which will not work with parallel pending requests from the same LwM2M server. I guess, pretty much are using none-empty tokens, so in practice that may work. I would consider to add then some notes on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LWM2M area: Networking Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

4 participants