-
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
Detect first block in LWM2M firmware updates. #16122
Comments
@sunkyl Did you want to submit your changes as a PR so we can discuss there while looking at code? |
Sorry, switching accounts here. Thanks. |
This change is to allow access to the firmware block context in order to give the firmware update callback implementation an indication of when to reset the flash context. Additionally, it allows for a validity check between the total expected size downloaded and the actual size downloaded. A simple implementation can check if the block context's current downloaded blocks is equal to the expected block size in order to determine if the flash context needs to be reset. This approach seemed the simplest, and knowing the firmware block context can have other purposes. This has been tested by accessing the block context during the update in the block received callback and confirming that the callback had information regarding the current downloaded bytes. Fixes #16122 Signed-off-by: Kyle Sun <yaomon18@yahoo.com>
This change is to allow access to the firmware block context in order to give the firmware update callback implementation an indication of when to reset the flash context. Additionally, it allows for a validity check between the total expected size downloaded and the actual size downloaded. A simple implementation can check if the block context's current downloaded blocks is equal to the expected block size in order to determine if the flash context needs to be reset. This approach seemed the simplest, and knowing the firmware block context can have other purposes. This has been tested by accessing the block context during the update in the block received callback and confirming that the callback had information regarding the current downloaded bytes. Fixes zephyrproject-rtos#16122 Signed-off-by: Kyle Sun <yaomon18@yahoo.com>
This change is to allow access to the firmware block context in order to give the firmware update callback implementation an indication of when to reset the flash context. Additionally, it allows for a validity check between the total expected size downloaded and the actual size downloaded. A simple implementation can check if the block context's current downloaded blocks is equal to the expected block size in order to determine if the flash context needs to be reset. This approach seemed the simplest, and knowing the firmware block context can have other purposes. This has been tested by accessing the block context during the update in the block received callback and confirming that the callback had information regarding the current downloaded bytes. Fixes zephyrproject-rtos#16122 Signed-off-by: Kyle Sun <yaomon18@yahoo.com>
Problem
Currently, there is no way to detect when to reset the context of a firmware update via LWM2M when the process is interrupted outside of the block received callback (say in the case of a timeout).
Solution
Some indication of a first block for the callback, or exposing more functions within the LWM2M library that allows for writing our own callbacks that can start the transfer.
Alternatives
Currently, there is the extern function inside the subsystem LWM2M files
lwm2m_firmware_start_transfer()
that I can use. I can create a semi-functional imitation of the sample post-write callback for the package URI that resets a variable to indicate a context reset, but it also has no access to the functions to change the update state.Thanks.
The text was updated successfully, but these errors were encountered: