SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
Bundling changes the content of a group of files and then accepts or rejects the changes for all the files in the group simultaneously. The bundle is used by the OTA process, which downloads a group of files and needs the ability to first test the files and then to accept or reject the downloaded content.
Table 9-12 shows a common work flow of using the bundle.
Step | Operation | System State After Operation |
---|---|---|
1 | Create (with failsafe flag), write, close n files | Bundle STOPPED |
2 | For each of the n files, open the file for write with the bundle flag, write the file and close it. | Bundle STARTED, reading the files results in their old copy. Before the file closure they are in the OPEN_BUNDLE_COMMIT state. After the file closure they are in the PENDING_BUNDLE_COMMIT state. |
3 | Call sl_Stop(X>0) and sl_Start(). On this step, the host is responsible for testing the system, to make sure that the downloaded content is functioning as expected. | Bundle state is PENDING_COMMIT, Reading the files results in their new copy. Each n file is in PENDING_BUNDLE_COMMIT state. |
4 | In case the system test passed successfully, the host approves the bundle (call to bundle commit), else initiate rollback of the files (call the bundle rollback). | Bundle state is STOPPED. Rollback of the bundle files makes their old copy the valid one. Commit of the bundle files makes their new copy the valid one. |
In case of power failure before the content approval (failure during Step 2 or 3), the device automatically calls the bundle rollback. | Bundle state is STOPPED. Reading the files results in their old copy. |