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

[OTA] Set the current state on every attempt for CASE session establishment #15846

Conversation

carol-apple
Copy link
Contributor

Problem

Currently, other than during querying, the current state is not being updated, e.g. when attempting to send a command for ApplyUpdateRequest and NotifyUpdateApplied. This is mostly ok because the current code would eventually set the current state on CASE session establishment. However, when an error is encountered, e.g. when a response for one of these commands is not received, we would be in the wrong state (still showing querying).

Change overview

  • Update the current state before each call to ConnectToProvider
  • Remove all the current state updates after CASE session established in OnConnected
  • Renamed the enum kStartBDX to a more generic kDownload
  • Update the API description for the apply/notify to more match what is does

Testing

  • Verified that happy path of OTA download succeeds
  • Verified that if a response is not received for a command, the state correctly reflects the last action attempted

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

PR #15846: Size comparison from 0b58f58 to 872a1a6

Increases (3 builds for cyw30739, nrfconnect, qpg)
platform target config section 0b58f58 872a1a6 change % change
cyw30739 ota-requestor cyw930739m2evb_01 (read/write) 580290 580298 8 0.0
.app_xip_area 477128 477136 8 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1078139 1078155 16 0.0
text 731912 731920 8 0.0
qpg lock-app qpg6105+debug (read only) 568836 568852 16 0.0
.text 563516 563532 16 0.0
Decreases (1 build for linux)
platform target config section 0b58f58 872a1a6 change % change
linux ota-requestor-app debug (read only) 1891737 1891721 -16 -0.0
.text 1589506 1589490 -16 -0.0
Full report (31 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 0b58f58 872a1a6 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 600294 600294 0 0.0
.app_xip_area 505316 505316 0 0.0
.bss 77660 77660 0 0.0
.data 660 660 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 558290 558290 0 0.0
.app_xip_area 464848 464848 0 0.0
.bss 76164 76164 0 0.0
.data 624 624 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 580290 580298 8 0.0
.app_xip_area 477128 477136 8 0.0
.bss 85524 85524 0 0.0
.data 600 600 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 919804 919804 0 0.0
(read/write) 128840 128840 0 0.0
.bss 126752 126752 0 0.0
.data 2088 2088 0 0.0
.text 919796 919796 0 0.0
BRD4161A+rpc (read only) 949880 949880 0 0.0
(read/write) 145784 145784 0 0.0
.bss 143528 143528 0 0.0
.data 2252 2252 0 0.0
.text 949872 949872 0 0.0
lock-app BRD4161A+wf200 (read only) 988140 988140 0 0.0
(read/write) 120312 120312 0 0.0
.bss 118380 118380 0 0.0
.data 1932 1932 0 0.0
.text 988132 988132 0 0.0
window-app BRD4161A (read only) 853136 853136 0 0.0
(read/write) 126784 126784 0 0.0
.bss 124856 124856 0 0.0
.data 1924 1924 0 0.0
.text 853128 853128 0 0.0
esp32 all-clusters-app c3devkit (read only) 953144 953144 0 0.0
(read/write) 1392586 1392586 0 0.0
.dram0.bss 62536 62536 0 0.0
.dram0.data 14236 14236 0 0.0
.flash.rodata 196896 196896 0 0.0
.flash.text 953144 953144 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1008427 1008427 0 0.0
(read/write) 459700 459700 0 0.0
.dram0.bss 68056 68056 0 0.0
.dram0.data 34080 34080 0 0.0
.flash.rodata 225728 225728 0 0.0
.flash.text 1003043 1003043 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 694008 694008 0 0.0
.bss 77680 77680 0 0.0
.data 1972 1972 0 0.0
.text 608556 608556 0 0.0
lock k32w061+release (read/write) 695760 695760 0 0.0
.bss 77616 77616 0 0.0
.data 1972 1972 0 0.0
.text 610372 610372 0 0.0
linux all-clusters-app debug (read only) 2402769 2402769 0 0.0
(read/write) 144600 144600 0 0.0
.bss 59104 59104 0 0.0
.data 1392 1392 0 0.0
.data.rel.ro 78408 78408 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 912 912 0 0.0
.rodata 205093 205093 0 0.0
.text 2034882 2034882 0 0.0
bridge-app debug+rpc (read only) 1728573 1728573 0 0.0
(read/write) 92560 92560 0 0.0
.bss 47400 47400 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 38056 38056 0 0.0
.dynamic 592 592 0 0.0
.got 3912 3912 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 141652 141652 0 0.0
.text 1471093 1471093 0 0.0
chip-tool debug (read only) 9399325 9399325 0 0.0
(read/write) 305768 305768 0 0.0
.bss 25440 25440 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 273168 273168 0 0.0
.dynamic 608 608 0 0.0
.got 4760 4760 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 497781 497781 0 0.0
.text 8240453 8240453 0 0.0
chip-tool-ipv6only arm64 (read only) 9097844 9097844 0 0.0
(read/write) 418529 418529 0 0.0
.bss 43761 43761 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 317936 317936 0 0.0
.dynamic 560 560 0 0.0
.got 51856 51856 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 473628 473628 0 0.0
.text 7706468 7706468 0 0.0
door-lock-app debug (read only) 1943209 1943209 0 0.0
(read/write) 119008 119008 0 0.0
.bss 50400 50400 0 0.0
.data 1056 1056 0 0.0
.data.rel.ro 62184 62184 0 0.0
.dynamic 592 592 0 0.0
.got 4096 4096 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 173596 173596 0 0.0
.text 1621106 1621106 0 0.0
lighting-app debug+rpc (read only) 2078625 2078625 0 0.0
(read/write) 124432 124432 0 0.0
.bss 51328 51328 0 0.0
.data 1472 1472 0 0.0
.data.rel.ro 66152 66152 0 0.0
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 712 712 0 0.0
.rodata 166044 166044 0 0.0
.text 1757106 1757106 0 0.0
ota-provider-app debug (read only) 1875425 1875425 0 0.0
(read/write) 114640 114640 0 0.0
.bss 50208 50208 0 0.0
.data 1352 1352 0 0.0
.data.rel.ro 57464 57464 0 0.0
.dynamic 608 608 0 0.0
.got 4352 4352 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 158835 158835 0 0.0
.text 1566002 1566002 0 0.0
ota-requestor-app debug (read only) 1891737 1891721 -16 -0.0
(read/write) 117144 117144 0 0.0
.bss 51360 51360 0 0.0
.data 1512 1512 0 0.0
.data.rel.ro 58856 58856 0 0.0
.dynamic 592 592 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 153004 153004 0 0.0
.text 1589506 1589490 -16 -0.0
shell debug (read only) 2371801 2371801 0 0.0
(read/write) 146832 146832 0 0.0
.bss 67176 67176 0 0.0
.data 864 864 0 0.0
.data.rel.ro 73144 73144 0 0.0
.dynamic 592 592 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 205074 205074 0 0.0
.text 2010146 2010146 0 0.0
thermostat-no-ble arm64 (read only) 2169156 2169156 0 0.0
(read/write) 148417 148417 0 0.0
.bss 65121 65121 0 0.0
.data 1072 1072 0 0.0
.data.rel.ro 75048 75048 0 0.0
.dynamic 560 560 0 0.0
.got 4216 4216 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 132900 132900 0 0.0
.text 1817984 1817984 0 0.0
tv-app debug (read only) 2610105 2610105 0 0.0
(read/write) 250744 250744 0 0.0
.bss 167904 167904 0 0.0
.data 3200 3200 0 0.0
.data.rel.ro 73616 73616 0 0.0
.dynamic 592 592 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 199133 199133 0 0.0
.text 2236994 2236994 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2350772 2350772 0 0.0
.bss 187036 187036 0 0.0
.data 5784 5784 0 0.0
.text 1313372 1313372 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1078139 1078155 16 0.0
bss 128900 128900 0 0.0
rodata 142036 142036 0 0.0
text 731912 731920 8 0.0
p6 all-clusters-app default (read/write) 2489640 2489640 0 0.0
.bss 118608 118608 0 0.0
.data 2696 2696 0 0.0
.text 1447904 1447904 0 0.0
light-app default (read/write) 2396728 2396728 0 0.0
.bss 112920 112920 0 0.0
.data 2544 2544 0 0.0
.text 1354992 1354992 0 0.0
lock-app default (read/write) 2360240 2360240 0 0.0
.bss 112664 112664 0 0.0
.data 2504 2504 0 0.0
.text 1318504 1318504 0 0.0
qpg lighting-app qpg6105+debug (read only) 603152 603152 0 0.0
(read/write) 146936 146936 0 0.0
.bss 91056 91056 0 0.0
.data 1172 1172 0 0.0
.text 597832 597832 0 0.0
lock-app qpg6105+debug (read only) 568836 568852 16 0.0
(read/write) 146936 146936 0 0.0
.bss 91064 91064 0 0.0
.data 1124 1124 0 0.0
.text 563516 563532 16 0.0
persistent-storage-app qpg6105+debug (read only) 99520 99520 0 0.0
(read/write) 146940 146940 0 0.0
.bss 24004 24004 0 0.0
.data 176 176 0 0.0
.text 94200 94200 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 887462 887462 0 0.0
bss 86864 86864 0 0.0
noinit 37160 37160 0 0.0
text 626986 626986 0 0.0

@Damian-Nordic Damian-Nordic merged commit f84341f into project-chip:master Mar 4, 2022
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.

3 participants