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

net: lwm2m: use path as block context retrieval #57228

Conversation

RomainPelletant
Copy link
Contributor

Replace block context retrieval using object path instead of token. Changing token between each block is a correct behavior and restore a functional link with Leshan/Californium

Fix issue #57165

@RomainPelletant
Copy link
Contributor Author

I have made mistakes on previous PR : #57223
@rlubos mades a review and have to be applied on that PR

Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, looks good otherwise.

Comment on lines 164 to 165
if (memcmp(path, &lwm2m_block1_context()[i].path,
sizeof(struct lwm2m_obj_path)) == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still looks wrongly aligned (please align to the opening bracket):

Suggested change
if (memcmp(path, &lwm2m_block1_context()[i].path,
sizeof(struct lwm2m_obj_path)) == 0) {
if (memcmp(path, &lwm2m_block1_context()[i].path,
sizeof(struct lwm2m_obj_path)) == 0) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

*ctx = NULL;

for (i = 0; i < NUM_BLOCK1_CONTEXT; i++) {
if (block1_contexts[i].tkl == tkl &&
memcmp(token, block1_contexts[i].token, tkl) == 0) {
if (memcmp(path, &lwm2m_block1_context()[i].path,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (memcmp(path, &lwm2m_block1_context()[i].path,
if (memcmp(path, &lwm2m_block1_context[i].path,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@RomainPelletant RomainPelletant force-pushed the net/lwm2m/change-block-context-retrieval branch 5 times, most recently from c176f37 to c8708be Compare April 25, 2023 12:42
@RomainPelletant RomainPelletant changed the title net: lwm2m: use path as block context retrieval [DNM] net: lwm2m: use path as block context retrieval Apr 25, 2023
@RomainPelletant
Copy link
Contributor Author

DNM added : Test scheduled tomorrow with Leshan for FW update in push mode.

@RomainPelletant RomainPelletant force-pushed the net/lwm2m/change-block-context-retrieval branch from c8708be to c2e8786 Compare April 26, 2023 07:32
@RomainPelletant RomainPelletant changed the title [DNM] net: lwm2m: use path as block context retrieval net: lwm2m: use path as block context retrieval Apr 26, 2023
@RomainPelletant
Copy link
Contributor Author

Successfully pushed firmware from Leshan

Replace block context retrieval using object path instead of token.
Update block context structure
Fix issue zephyrproject-rtos#57165

Signed-off-by: romain pelletant <[email protected]>
@RomainPelletant RomainPelletant force-pushed the net/lwm2m/change-block-context-retrieval branch from c2e8786 to 3ed5fcf Compare April 26, 2023 08:32
@RomainPelletant
Copy link
Contributor Author

Missing update in TLV writer found by CI

@carlescufi carlescufi merged commit 75dd2c9 into zephyrproject-rtos:main May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants