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 Requestor Refactoring -- Part 1 #12119

Merged
merged 38 commits into from
Nov 30, 2021

Conversation

selissia
Copy link
Contributor

@selissia selissia commented Nov 22, 2021

Problem

OTA Requestor needs to have a proper Application and Platform API

Change overview

Note that this is the first in a series of PRs that will fully refactor the Requestor functionality, more changes are coming.

Testing

Confirmed that the Requestor/Provider scenario works in a single Linux node. Commands:
rm -r /tmp/chip_*
./out/debug/chip-ota-provider-app -f /tmp/ota.txt
./out/chip-tool pairing onnetwork 1 20202021
./out/debug/chip-ota-requestor-app -u 5560 -d 42 -i ::1
./out/chip-tool pairing onnetwork-long 2 20202021 42
./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 2 0

@todo
Copy link

todo bot commented Nov 22, 2021

This can be removed once OperationalDeviceProxy can resolve the IP Address from Node ID

// TODO: This can be removed once OperationalDeviceProxy can resolve the IP Address from Node ID
{ "ipaddress", chip::ArgParser::kArgumentRequired, kOptionIPAddress },
{ "delayQuery", chip::ArgParser::kArgumentRequired, kOptionDelayQuery },
{},
};
OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS",
" -n/--providerNodeId <node ID>\n"
" Node ID of the OTA Provider to connect to (hex format)\n\n"
" This assumes that you've already commissioned the OTA Provider node with chip-tool.\n"
" -f/--providerFabricIndex <fabric index>\n"


This comment was generated by todo based on a TODO comment in 28f991b in #12119. cc @selissia.

@todo
Copy link

todo bot commented Nov 22, 2021

enable SetDownloaderInstance(downloaderCore);

// TODO: enable SetDownloaderInstance(downloaderCore);
LinuxOTAImageProcessor *downloaderUser = new LinuxOTAImageProcessor;
// Connect the two objects
downloaderCore->SetImageProcessorDelegate(downloaderUser);
// If a delay is provided, QueryImage after the timer expires REFACTOR DELETE THIS ??
// if (delayQueryTimeInSec > 0)
// {


This comment was generated by todo based on a TODO comment in 28f991b in #12119. cc @selissia.

@todo
Copy link

todo bot commented Nov 22, 2021

Determine where this should be instantiated

// TODO: Determine where this should be instantiated
.imDelegate = chip::Platform::New<chip::Controller::DeviceControllerInteractionModelDelegate>(),
};
chip::CASESessionManagerConfig sessionManagerConfig = {
.sessionInitParams = initParams,
.dnsCache = nullptr,
};
mCASESessionManager = chip::Platform::New<chip::CASESessionManager>(sessionManagerConfig);
}


This comment was generated by todo based on a TODO comment in 28f991b in #12119. cc @selissia.

selissia and others added 8 commits November 23, 2021 10:28
…essfully.

The top-level build fails for all-cluster app.
…estor app

Update .gn files so that clusters/ota-requestor is not built for all example apps (this is different from the rest of the clusters). Instead, explicitly specify clusters/ota-requestor sources in the OTA-Requestor example app
@github-actions
Copy link

github-actions bot commented Nov 29, 2021

PR #12119: Size comparison from 2bd6bd6 to 1543a39

Increases above 0.2%:

platform target config section 2bd6bd6 1543a39 change % change
linux ota-requestor-app debug (read only) 1406873 1410401 3528 0.3
.data.rel.ro 27272 27640 368 1.3
.rodata 126400 126752 352 0.3
qpg lighting-app qpg6100+debug .bss 50400 77464 27064 53.7
lock-app qpg6100+debug .bss 49272 76376 27104 55.0
persistent-storage-app qpg6100+debug .bss 12002 35218 23216 193.4
Increases (29 builds for esp32, k32w, linux, mbed, nrfconnect, p6, qpg)
platform target config section 2bd6bd6 1543a39 change % change
esp32 all-clusters-app c3devkit .flash.rodata 165968 166080 112 0.1
m5stack .flash.rodata 193804 193916 112 0.1
k32w lighting-app k32w061+se05x+release .text 637272 637380 108 0.0
lock-app k32w061+debug .text 535932 536040 108 0.0
shell k32w061+debug .text 590128 590240 112 0.0
linux all-clusters-app debug (read only) 1775081 1775209 128 0.0
.rodata 138965 139093 128 0.1
chip-tool debug (read only) 6088437 6090405 1968 0.0
.data.rel.ro 152000 152048 48 0.0
.got 4456 4464 8 0.2
.rodata 292840 292936 96 0.0
.text 5406325 5408037 1712 0.0
lighting-app debug+rpc (read only) 1629065 1629193 128 0.0
.rodata 131889 132017 128 0.1
ota-requestor-app debug (read only) 1406873 1410401 3528 0.3
(read/write) 80144 80208 64 0.1
.data.rel.ro 27272 27640 368 1.3
.rodata 126400 126752 352 0.3
.text 1177330 1179858 2528 0.2
shell debug (read only) 820321 820449 128 0.0
.rodata 79023 79154 131 0.2
tv-app debug (read only) 1921185 1921345 160 0.0
.rodata 160872 161032 160 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2294976 2295088 112 0.0
.heap 849320 849432 112 0.0
.text 1257576 1257688 112 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2280256 2280368 112 0.0
.heap 858352 858464 112 0.0
.text 1242856 1242968 112 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2253336 2253448 112 0.0
.heap 859552 859664 112 0.0
.text 1215936 1216048 112 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2050936 2051040 104 0.0
.heap 874968 875080 112 0.0
.text 1013536 1013640 104 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 875611 875615 4 0.0
rodata 97188 97296 108 0.1
nrf52840dk_nrf52840+rpc (read/write) 838187 838191 4 0.0
rodata 88436 88544 108 0.1
nrf5340dk_nrf5340_cpuapp rodata 92444 92556 112 0.1
lock-app nrf52840dk_nrf52840 rodata 92972 93084 112 0.1
nrf5340dk_nrf5340_cpuapp rodata 88260 88372 112 0.1
pump-app nrf52840dk_nrf52840 rodata 94680 94792 112 0.1
pump-controller-app nrf52840dk_nrf52840 rodata 92844 92952 108 0.1
shell nrf52840dk_nrf52840 (read/write) 778447 778451 4 0.0
rodata 73084 73192 108 0.1
nrf5340dk_nrf5340_cpuapp rodata 67724 67836 112 0.2
p6 all-clusters-app default (read/write) 2311304 2311416 112 0.0
.heap 916112 916224 112 0.0
.text 1269568 1269680 112 0.0
lock-app default (read/write) 2223120 2223232 112 0.0
.heap 929952 930064 112 0.0
.text 1181384 1181496 112 0.0
qpg lighting-app qpg6100+debug .bss 50400 77464 27064 53.7
lock-app qpg6100+debug (read/write) 114140 114144 4 0.0
.bss 49272 76376 27104 55.0
persistent-storage-app qpg6100+debug (read only) 105424 105612 188 0.2
.bss 12002 35218 23216 193.4
.text 100104 100292 188 0.2
Decreases (20 builds for esp32, k32w, linux, mbed, nrfconnect, p6, qpg)
platform target config section 2bd6bd6 1543a39 change % change
esp32 all-clusters-app c3devkit (read only) 836536 836012 -524 -0.1
.dram0.data 14100 13988 -112 -0.8
.flash.text 836536 836012 -524 -0.1
.iram0.text 61394 61390 -4 -0.0
m5stack .dram0.data 34072 33960 -112 -0.3
k32w lighting-app k32w061+se05x+release (read/write) 723320 723316 -4 -0.0
.data 1956 1844 -112 -5.7
lock-app k32w061+debug (read/write) 612392 612388 -4 -0.0
.data 1920 1808 -112 -5.8
shell k32w061+debug .data 1892 1780 -112 -5.9
linux all-clusters-app debug (read/write) 131544 131416 -128 -0.1
.data 1170 1040 -130 -11.1
chip-tool debug (read/write) 198808 198744 -64 -0.0
.data 1136 1008 -128 -11.3
lighting-app debug+rpc (read/write) 111104 110976 -128 -0.1
.data 1362 1232 -130 -9.5
ota-requestor-app debug .bss 46752 46432 -320 -0.7
shell debug (read/write) 66936 66808 -128 -0.2
.data 338 224 -114 -33.7
tv-app debug (read/write) 319072 318944 -128 -0.0
.data 1632 1504 -128 -7.8
mbed all-clusters-app CY8CPROTO_062_4343W+release .data 5240 5128 -112 -2.1
lighting-app CY8CPROTO_062_4343W+release .data 5600 5488 -112 -2.0
lock-app CY8CPROTO_062_4343W+release .data 5584 5472 -112 -2.0
shell CY8CPROTO_062_4343W+release .data 4984 4872 -112 -2.2
nrfconnect pump-controller-app nrf52840dk_nrf52840 (read/write) 845619 845615 -4 -0.0
p6 all-clusters-app default .data 2544 2432 -112 -4.4
lock-app default .data 2416 2304 -112 -4.6
qpg lighting-app qpg6100+debug (read only) 503096 493652 -9444 -1.9
.data 1024 920 -104 -10.2
.text 497776 488332 -9444 -1.9
lock-app qpg6100+debug (read only) 475804 466328 -9476 -2.0
.data 980 872 -108 -11.0
.text 470484 461008 -9476 -2.0
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 2bd6bd6 1543a39 change % change
efr32 lighting-app BRD4161A (read only) 762200 762200 0 0.0
(read/write) 119836 119836 0 0.0
.bss 118012 118012 0 0.0
.data 1820 1820 0 0.0
.text 762192 762192 0 0.0
BRD4161A+rpc (read only) 790632 790632 0 0.0
(read/write) 138132 138132 0 0.0
.bss 136212 136212 0 0.0
.data 1920 1920 0 0.0
.text 790624 790624 0 0.0
lock-app BRD4161A (read only) 736144 736144 0 0.0
(read/write) 117540 117540 0 0.0
.bss 115764 115764 0 0.0
.data 1776 1776 0 0.0
.text 736136 736136 0 0.0
window-app BRD4161A (read only) 739208 739208 0 0.0
(read/write) 117972 117972 0 0.0
.bss 116188 116188 0 0.0
.data 1784 1784 0 0.0
.text 739200 739200 0 0.0
esp32 all-clusters-app c3devkit (read only) 836536 836012 -524 -0.1
(read/write) 1224474 1224474 0 0.0
.dram0.bss 59144 59144 0 0.0
.dram0.data 14100 13988 -112 -0.8
.flash.rodata 165968 166080 112 0.1
.flash.text 836536 836012 -524 -0.1
.iram0.text 61394 61390 -4 -0.0
m5stack (read only) 907919 907919 0 0.0
(read/write) 423692 423692 0 0.0
.dram0.bss 64536 64536 0 0.0
.dram0.data 34072 33960 -112 -0.3
.flash.rodata 193804 193916 112 0.1
.flash.text 902535 902535 0 0.0
.iram0.text 122943 122943 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 723320 723316 -4 -0.0
.bss 78292 78292 0 0.0
.data 1956 1844 -112 -5.7
.text 637272 637380 108 0.0
lock-app k32w061+debug (read/write) 612392 612388 -4 -0.0
.bss 68740 68740 0 0.0
.data 1920 1808 -112 -5.8
.text 535932 536040 108 0.0
shell k32w061+debug (read/write) 677712 677712 0 0.0
.bss 79892 79892 0 0.0
.data 1892 1780 -112 -5.9
.text 590128 590240 112 0.0
linux all-clusters-app debug (read only) 1775081 1775209 128 0.0
(read/write) 131544 131416 -128 -0.1
.bss 60144 60144 0 0.0
.data 1170 1040 -130 -11.1
.data.rel.ro 64928 64928 0 0.0
.dynamic 592 592 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 576 576 0 0.0
.rodata 138965 139093 128 0.1
.text 1497746 1497746 0 0.0
bridge-app debug+rpc (read only) 1349405 1349405 0 0.0
(read/write) 77856 77856 0 0.0
.bss 41744 41744 0 0.0
.data 1680 1680 0 0.0
.data.rel.ro 29384 29384 0 0.0
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 424 424 0 0.0
.rodata 113596 113596 0 0.0
.text 1135717 1135717 0 0.0
chip-tool debug (read only) 6088437 6090405 1968 0.0
(read/write) 198808 198744 -64 -0.0
.bss 40096 40096 0 0.0
.data 1136 1008 -128 -11.3
.data.rel.ro 152000 152048 48 0.0
.dynamic 592 592 0 0.0
.got 4456 4464 8 0.2
.init 27 27 0 0.0
.init_array 496 496 0 0.0
.rodata 292840 292936 96 0.0
.text 5406325 5408037 1712 0.0
lighting-app debug+rpc (read only) 1629065 1629193 128 0.0
(read/write) 111104 110976 -128 -0.1
.bss 47440 47440 0 0.0
.data 1362 1232 -130 -9.5
.data.rel.ro 56976 56976 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 131889 132017 128 0.1
.text 1359458 1359458 0 0.0
ota-provider-app debug (read only) 1310401 1310401 0 0.0
(read/write) 76312 76312 0 0.0
.bss 44320 44320 0 0.0
.data 912 912 0 0.0
.data.rel.ro 25944 25944 0 0.0
.dynamic 592 592 0 0.0
.got 4048 4048 0 0.0
.init 27 27 0 0.0
.init_array 464 464 0 0.0
.rodata 114896 114896 0 0.0
.text 1095154 1095154 0 0.0
ota-requestor-app debug (read only) 1406873 1410401 3528 0.3
(read/write) 80144 80208 64 0.1
.bss 46752 46432 -320 -0.7
.data 976 976 0 0.0
.data.rel.ro 27272 27640 368 1.3
.dynamic 592 592 0 0.0
.got 4032 4032 0 0.0
.init 27 27 0 0.0
.init_array 488 488 0 0.0
.rodata 126400 126752 352 0.3
.text 1177330 1179858 2528 0.2
shell debug (read only) 820321 820449 128 0.0
(read/write) 66936 66808 -128 -0.2
.bss 23496 23496 0 0.0
.data 338 224 -114 -33.7
.data.rel.ro 38560 38560 0 0.0
.dynamic 592 592 0 0.0
.got 3560 3560 0 0.0
.init 27 27 0 0.0
.init_array 360 360 0 0.0
.rodata 79023 79154 131 0.2
.text 634610 634610 0 0.0
tv-app debug (read only) 1921185 1921345 160 0.0
(read/write) 319072 318944 -128 -0.0
.bss 250264 250264 0 0.0
.data 1632 1504 -128 -7.8
.data.rel.ro 61480 61480 0 0.0
.dynamic 592 592 0 0.0
.got 4432 4432 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 160872 161032 160 0.1
.text 1611970 1611970 0 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2294976 2295088 112 0.0
.bss 181884 181884 0 0.0
.data 5240 5128 -112 -2.1
.heap 849320 849432 112 0.0
.text 1257576 1257688 112 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2280256 2280368 112 0.0
.bss 172492 172492 0 0.0
.data 5600 5488 -112 -2.0
.heap 858352 858464 112 0.0
.text 1242856 1242968 112 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2253336 2253448 112 0.0
.bss 171308 171308 0 0.0
.data 5584 5472 -112 -2.0
.heap 859552 859664 112 0.0
.text 1215936 1216048 112 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139744 1139744 0 0.0
.bss 11752 11752 0 0.0
.data 4368 4368 0 0.0
.heap 1020328 1020328 0 0.0
.text 103128 103128 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2050936 2051040 104 0.0
.bss 156496 156496 0 0.0
.data 4984 4872 -112 -2.2
.heap 874968 875080 112 0.0
.text 1013536 1013640 104 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 875611 875615 4 0.0
bss 112660 112660 0 0.0
rodata 97188 97296 108 0.1
text 590116 590116 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 838187 838191 4 0.0
bss 109012 109012 0 0.0
rodata 88436 88544 108 0.1
text 564432 564432 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 800650 800650 0 0.0
bss 114036 114036 0 0.0
rodata 92444 92556 112 0.1
text 519580 519580 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 846539 846539 0 0.0
bss 109700 109700 0 0.0
rodata 92972 93084 112 0.1
text 568388 568388 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 771810 771810 0 0.0
bss 111108 111108 0 0.0
rodata 88260 88372 112 0.1
text 497940 497940 0 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497327 497327 0 0.0
bss 51824 51824 0 0.0
rodata 45780 45780 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 852511 852511 0 0.0
bss 109836 109836 0 0.0
rodata 94680 94792 112 0.1
text 572432 572432 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 845619 845615 -4 -0.0
bss 109712 109712 0 0.0
rodata 92844 92952 108 0.1
text 567512 567512 0 0.0
shell nrf52840dk_nrf52840 (read/write) 778447 778451 4 0.0
bss 109180 109180 0 0.0
rodata 73084 73192 108 0.1
text 521576 521576 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 693482 693482 0 0.0
bss 110164 110164 0 0.0
rodata 67724 67836 112 0.2
text 442184 442184 0 0.0
p6 all-clusters-app default (read/write) 2311304 2311416 112 0.0
.bss 114688 114688 0 0.0
.data 2544 2432 -112 -4.4
.heap 916112 916224 112 0.0
.text 1269568 1269680 112 0.0
lock-app default (read/write) 2223120 2223232 112 0.0
.bss 100976 100976 0 0.0
.data 2416 2304 -112 -4.6
.heap 929952 930064 112 0.0
.text 1181384 1181496 112 0.0
qpg lighting-app qpg6100+debug (read only) 503096 493652 -9444 -1.9
(read/write) 114144 114144 0 0.0
.bss 50400 77464 27064 53.7
.data 1024 920 -104 -10.2
.text 497776 488332 -9444 -1.9
lock-app qpg6100+debug (read only) 475804 466328 -9476 -2.0
(read/write) 114140 114144 4 0.0
.bss 49272 76376 27104 55.0
.data 980 872 -108 -11.0
.text 470484 461008 -9476 -2.0
persistent-storage-app qpg6100+debug (read only) 105424 105612 188 0.2
(read/write) 114138 114138 0 0.0
.bss 12002 35218 23216 193.4
.data 276 276 0 0.0
.text 100104 100292 188 0.2
telink lighting-app tlsr9518adk80d (read/write) 777398 777398 0 0.0
bss 79236 79236 0 0.0
noinit 37160 37160 0 0.0
text 540724 540724 0 0.0

Copy link
Contributor

@woody-apple woody-apple left a comment

Choose a reason for hiding this comment

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

Fast tracking given this has been in review for a while.

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.

4 participants