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
lwm2m: Add offset to post-write callback #72590
lwm2m: Add offset to post-write callback #72590
Conversation
APi changes can be quickly refactored with following Coccinelle script
To use it, save as
|
e31cade
to
2899707
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Would be good to add an entry in the migration guide about the API change.
Looks great! Thanks for implementing this fix @SeppoTakalo |
2899707
to
8980bf7
Compare
Added a migration guide and fixed the copyright date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor things
When Block-Wise transfer restarts, the post-write callback should receive some indication that the block is actually a beginning of new, instead of part of previous transfer. Fixes zephyrproject-rtos#71351 Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Block-Wise GET, PUT and SEND Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Allow Block-Wise writes to resources that have enough buffer for the whole content. Calculate the offset before calling the content specific write handlers when callback is not set. Previously only resources with post-write callback were able to assemble the content. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Enable connection ID because it is on by default on the client example as well. Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
8980bf7
to
8463b42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR also fixes #71269 |
This PR contains fix for #71351 and tests to verify that, but also new fixes for issues that I saw while implementing the tests.
lwm2m: Add offset to post-write callback
When Block-Wise transfer restarts, the post-write callback should
receive some indication that the block is actually a beginning of new,
instead of part of previous transfer.
NOTE: This is API break.
Fixes #71351
Fixes #71269
test: lwm2m: Add tests for Block-Wise transfers
Block-Wise GET, PUT and SEND
lwm2m: Allow Block-Wise write without callbacks
Allow Block-Wise writes to resources that have enough buffer for
the whole content. Calculate the offset before calling the
content specific write handlers when callback is not set.
Previously only resources with post-write callback were able to
assemble the content.
test: lwm2m: Enable DTLS Connection ID
Enable connection ID because it is on by default on the
client example as well.