Skip to content
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

Add function to reset lwm2m-context of a client #664

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pehrnord
Copy link

Signed-off-by: Pehr Nord pehr.nord@husqvarnagroup.com

#663

@pehrnord
Copy link
Author

Does lwm2m_context.nextMID need to be reset as well?

@pehrnord pehrnord force-pushed the lwm2m-reset branch 2 times, most recently from 0196c19 to fb1312e Compare May 23, 2022 13:38
- No existing API for "closing" a lwm2m connection if for example the
  underlying connection is terminated.
- lwm2m_deregister does not fit since it assumes the underlying
  connection is active.

Signed-off-by: Pehr Nord <pehr.nord@husqvarnagroup.com>
@boaks
Copy link

boaks commented May 30, 2022

Does lwm2m_context.nextMID need to be reset as well?

Maybe, you check RFC7252, Section 4 about the usage of the MID. Then you may describe the issue you consider in your case and how a reset or not reset will solve that.

In my experience, don't reset it. I only know one issue with MIDs after client restart: you may hit an coap-exchange, which is still kept for deduplication. But the probability of that doesn't change, if you reset the MID in advance. You may just check, if the response (if piggybacked) matches by the MID but not by the token. If that happens after a device restart, you may consider to reset the device MID by a new random value. Or wait for 247s (EXCHANGE_LIFETIME) in order to ensure, that the server's deduplication store is cleaned up.

@rettichschnidi
Copy link
Contributor

rettichschnidi commented Mar 1, 2023

@pehrnord With the answer given by @boaks, Do you plan on updating this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants