wakaama
wakaama copied to clipboard
Add function to reset lwm2m-context of a client
Does lwm2m_context.nextMID need to be reset as well?
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.
@pehrnord With the answer given by @boaks, Do you plan on updating this PR?