-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Bluetooth: Mesh: Fix OOB upload in Fw Distribution server #63739
Conversation
In OOB upload, when Check Firmware OOB procedure completes successfully and the firmware is already received, we send Firmware Distribution Upload Status message with update Phase set to Transfer Success. In this case, we must set Upload Progress to 100%. This can't be done through the callback as the application layer doesn't yet know that the firmware is already received. This will happen by the exist from bt_mesh_dfd_srv_oob_check_complete function, which will return error code -EEXIST. Signed-off-by: Pavel Vasilyev <[email protected]>
@@ -21,7 +21,7 @@ | |||
|
|||
#include <zephyr/logging/log.h> | |||
#define LOG_MODULE_NAME bttester_mesh | |||
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL); | |||
LOG_MODULE_REGISTER(LOG_MODULE_NAME, 4);//CONFIG_BTTESTER_LOG_LEVEL); |
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.
Should this be reverted back.
|
||
dfd_srv_oob_ctx.progress = MIN(dfd_srv_oob_ctx.progress + 25, 99); | ||
|
||
if (dfd_srv_oob_ctx.progress == 99) { |
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.
Should this be >= or <=, or is it correct with exact 99. dfd_srv_oob_ctx.progress can be less than 99.
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.
ASFAIK The image is ready for storing if progress is exactly 99. After storing it will be 100.
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.
No, MIN
will not let it to be set greater than 99.
2dc37c3
to
1d958f9
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.
Seems Ok but requires a bit more changes.
|
||
dfd_srv_oob_ctx.progress = MIN(dfd_srv_oob_ctx.progress + 25, 99); | ||
|
||
if (dfd_srv_oob_ctx.progress == 99) { |
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.
ASFAIK The image is ready for storing if progress is exactly 99. After storing it will be 100.
This message _at least_ 2 bytes long, but can be longer, thus BT_MESH_LEN_MIN should be used. Signed-off-by: Pavel Vasilyev <[email protected]>
1d958f9
to
cb019af
Compare
e1808bc
to
2d33737
Compare
If a Fw Distribution Client sends the Upload OOB Start message, but the application layer didn't call bt_mesh_dfd_srv_oob_check_complete yet, we have no other option other than ignore the message. The next phase in this case could be Transfer Active, Transfer Success or Failed and it will be set only after Check Firmware OOB procedure completes. Signed-off-by: Pavel Vasilyev <[email protected]>
If the previous upload was in-band and it didn't complete, the slot will stay reserved. By design we release slot not at the end of the upload phase, but at the start of a new upload phase. This fixes DFU/SR/FD/BV-13-C. Signed-off-by: Pavel Vasilyev <[email protected]>
2d33737
to
610a41b
Compare
Enable all OOB upload tests except DFU/SR/FD/BV-58-C as we don't support Firmware Retrieval Over HTTPS procedure. Zephyr PR: zephyrproject-rtos/zephyr#63739 Signed-off-by: Pavel Vasilyev <[email protected]>
@PavelVPV is this something you think should be merged for 3.5? If so, please set the target milestone appropriately. |
Enable all OOB upload tests except DFU/SR/FD/BV-58-C as we don't support Firmware Retrieval Over HTTPS procedure. Zephyr PR: zephyrproject-rtos/zephyr#63739 Signed-off-by: Pavel Vasilyev <[email protected]>
status = BT_MESH_DFD_ERR_URI_NOT_SUPPORTED; | ||
} else if (dfd_srv_oob_ctx.uri_len < 7 || memcmp(dfd_srv_oob_ctx.uri, | ||
SUPPORTED_SCHEME "://", | ||
strlen(SUPPORTED_SCHEME) + 3)) { |
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.
If this passes PTS then I guess it's fine, but I think returning SUCCESS for e.g. "http://?:?" (which this does as far as I can tell) is wrong, and can fail if PTS changes. At the very least, make a comment here about this so that if this fails in the future when PTS becomes more diligent then we easily can find where to fix it?
This was wrong, http://?:? is actually valid I think. My second comment still stands
Forget this entire comment, I'm not understanding the RFC I think
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.
This also returns URI_MALFORMED for "https://example.com/" which is definitely wrong, can easilly be fixed by checking the entire SUPPORTED_SCHEME ":"
also when checking for supported URI. It also returns MALFORMED for "http:something" which is correct according to the RFC (even though I think it's invalid in the HTTP spec but that's not what we should check here)
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.
Fixed
This allow to run the following PTS test: - DFU/SR/FD/BV-06-C - DFU/SR/FD/BV-13-C - DFU/SR/FD/BV-14-C - DFU/SR/FD/BV-15-C - DFU/SR/FD/BV-16-C - DFU/SR/FD/BV-17-C - DFU/SR/FD/BV-18-C - DFU/SR/FD/BV-22-C Signed-off-by: Pavel Vasilyev <[email protected]>
this is useful for debugging. Signed-off-by: Pavel Vasilyev <[email protected]>
610a41b
to
8ec9219
Compare
Added milestone (hope it is not too late). |
Is this fixing any bugs? I don't see any "Fixes: ..." entry. |
Sorry, added now. |
The PR fixes bugs related to OOB upload.
This PR also adds support for the following PTS test:
Fixes #63798