client: Generate message ID for all block transfer #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Generate and set the message ID when handling a Block2 Option in the response (such as a 2.05 response for GET). When using either Block1 or Block2 options, a single operation can be split into multiple CoAP message exchanges. As specified in [RFC7252], each of these message exchanges uses their own CoAP Message ID.
This commit also updates the send_request() API to conditionally generate and set a message ID in the non-block transfer path. The intent is to make the API consistent with the block transfer path, which always generates and overrides the message ID, but preserve the previous behavior of allowing callers to provide their own non-zero message IDs (e.g. allow an observer to manage its own message ID).
https://datatracker.ietf.org/doc/html/rfc7959#section-2.3
https://datatracker.ietf.org/doc/html/rfc7252#section-4