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

[NXP] Add --wifipaf commission in chip-tool and apps of Linux platform #33977

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

crlonxp
Copy link
Contributor

@crlonxp crlonxp commented Jun 18, 2024

* Need to enable the function by adding "chip_device_config_enable_wifipaf=true"
* chip-tool: Add wifi-paf option for pairing. 
*     Example: $ chip-tool pairing wifipaf 1 ap_ssid ap_pwd [setup-pin-code] [discriminator]
* apps: Add --wifipaf. 
*     Example: $ chip-all-clusters-app --wifi --wifipaf Note: Need the usd functions of wpa_supplicant to run this option
crlonxp and others added 19 commits July 15, 2024 19:57
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com>
* Change the name of option to [pair_mode]-[network]
* Remove redundant compile flags
* Move to start the Wi-Fi Manager in initialization stage
* Unconditional the defintion
* Add the cancel-publish / cancel-subscribe dbus interface
* Fix bugs:
	- Redundant callback function registration
	- Remove the incorrect StackLock

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
    - Unconditional functions in SetUpCodePairer
    - Change the description of the comment

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
* Unconditional the SetupCode verification

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
    example:
    - Linux DUT: sudo ./chip-all-clusters-app --wifi --wifipaf
    - Controller: sudo ./chip-tool pairing code-wifi 1 ap_ssid ap_pwd MT:-24J0SGJ10KA0648G00

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
* Add to end of the queue in OnDiscoveredDeviceOverWifiPAF()
* Factor out the long expression into local

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
…allback function

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
Copy link

github-actions bot commented Jul 15, 2024

PR #33977: Size comparison from 05e4c10 to c4e090e

Increases above 0.2%:

platform target config section 05e4c10 c4e090e change % change
bl602 lighting-app bl602 RAM 95328 95656 328 0.3
bl602+mfd RAM 95472 95800 328 0.3
bl602+rpc RAM 103752 104080 328 0.3
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 RAM 109180 109596 416 0.4
lock-ftd LP_EM_CC1354P10_6 RAM 116948 117364 416 0.4
lock-mtd LP_EM_CC1354P10_6 RAM 111236 111652 416 0.4
pump-app LP_EM_CC1354P10_6 RAM 105328 105744 416 0.4
pump-controller-app LP_EM_CC1354P10_6 RAM 105576 105992 416 0.4
cc32xx air-purifier CC3235SF_LAUNCHXL RAM 204508 205276 768 0.4
lock CC3235SF_LAUNCHXL RAM 204780 205548 768 0.4
cyw30739 light CYW30739B2-P5-EVK-01 RAM 77644 78100 456 0.6
CYW30739B2-P5-EVK-02 RAM 80276 80732 456 0.6
CYW30739B2-P5-EVK-03 RAM 80276 80732 456 0.6
CYW930739M2EVB-02 RAM 72712 73168 456 0.6
light-switch CYW30739B2-P5-EVK-01 RAM 70804 71260 456 0.6
CYW30739B2-P5-EVK-02 RAM 73356 73812 456 0.6
CYW30739B2-P5-EVK-03 RAM 73356 73812 456 0.6
lock CYW30739B2-P5-EVK-01 RAM 73820 74276 456 0.6
CYW30739B2-P5-EVK-02 RAM 76372 76828 456 0.6
CYW30739B2-P5-EVK-03 RAM 76372 76828 456 0.6
thermostat CYW30739B2-P5-EVK-01 RAM 67788 68244 456 0.7
CYW30739B2-P5-EVK-02 RAM 70420 70876 456 0.6
CYW30739B2-P5-EVK-03 RAM 70420 70876 456 0.6
efr32 lighting-app BRD4187C RAM 137528 137976 448 0.3
lock-app BRD4338a RAM 207892 208340 448 0.2
window-app BRD4187C RAM 129632 130080 448 0.3
esp32 all-clusters-app c3devkit DRAM 90924 91228 304 0.3
m5stack DRAM 117412 117724 312 0.3
linux thermostat-no-ble arm64 RAM 235840 238000 2160 0.9
mbed lock-app-release cy8cproto_062_4343w RAM 226648 227216 568 0.3
nxp contact k32w0+release RAM 70024 70328 304 0.4
k32w1+release RAM 74056 74360 304 0.4
light k32w0+release RAM 69500 69804 304 0.4
k32w1+release RAM 82816 83120 304 0.4
psoc6 all-clusters cy8ckit_062s2_43012 RAM 209692 210468 776 0.4
all-clusters-minimal cy8ckit_062s2_43012 RAM 206588 207364 776 0.4
light cy8ckit_062s2_43012 RAM 199876 200652 776 0.4
lock cy8ckit_062s2_43012 RAM 224388 225164 776 0.3
qpg lighting-app qpg6105+debug RAM 104564 104868 304 0.3
lock-app qpg6105+debug RAM 99240 99544 304 0.3
tizen all-clusters-app arm RAM 48548 50444 1896 3.9
Full report (54 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, tizen)
platform target config section 05e4c10 c4e090e change % change
bl602 lighting-app bl602 FLASH 1271432 1271978 546 0.0
RAM 95328 95656 328 0.3
bl602+mfd FLASH 1285946 1286236 290 0.0
RAM 95472 95800 328 0.3
bl602+rpc FLASH 1310648 1311194 546 0.0
RAM 103752 104080 328 0.3
bl702 lighting-app bl702 FLASH 1092522 1093324 802 0.1
RAM 15161 15161 0 0.0
bl702+mfd FLASH 1103216 1104018 802 0.1
RAM 15313 15313 0 0.0
bl702+rpc FLASH 1182332 1183134 802 0.1
RAM 24181 24181 0 0.0
bl706-eth FLASH 875672 876210 538 0.1
RAM 27272 27272 0 0.0
bl706-wifi FLASH 1128098 1128780 682 0.1
RAM 14605 14605 0 0.0
bl702l lighting-app bl702l FLASH 1079408 1080210 802 0.1
RAM 21732 21732 0 0.0
bl702l+mfd FLASH 1090670 1091472 802 0.1
RAM 21892 21892 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 798504 798812 308 0.0
RAM 109180 109596 416 0.4
lock-ftd LP_EM_CC1354P10_6 FLASH 816548 816848 300 0.0
RAM 116948 117364 416 0.4
lock-mtd LP_EM_CC1354P10_6 FLASH 808176 808476 300 0.0
RAM 111236 111652 416 0.4
pump-app LP_EM_CC1354P10_6 FLASH 760840 761156 316 0.0
RAM 105328 105744 416 0.4
pump-controller-app LP_EM_CC1354P10_6 FLASH 746552 746860 308 0.0
RAM 105576 105992 416 0.4
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 606406 606770 364 0.1
RAM 204508 205276 768 0.4
lock CC3235SF_LAUNCHXL FLASH 651730 652102 372 0.1
RAM 204780 205548 768 0.4
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 667625 667897 272 0.0
RAM 77644 78100 456 0.6
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 687469 687741 272 0.0
RAM 80276 80732 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 687469 687741 272 0.0
RAM 80276 80732 456 0.6
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 644405 644685 280 0.0
RAM 72712 73168 456 0.6
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609265 609553 288 0.0
RAM 70804 71260 456 0.6
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 628901 629197 296 0.0
RAM 73356 73812 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 628901 629197 296 0.0
RAM 73356 73812 456 0.6
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 625001 625289 288 0.0
RAM 73820 74276 456 0.6
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 644717 645005 288 0.0
RAM 76372 76828 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 644717 645005 288 0.0
RAM 76372 76828 456 0.6
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 593349 593629 280 0.0
RAM 67788 68244 456 0.7
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 613209 613481 272 0.0
RAM 70420 70876 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 613209 613481 272 0.0
RAM 70420 70876 456 0.6
efr32 lighting-app BRD4187C FLASH 924588 924884 296 0.0
RAM 137528 137976 448 0.3
lock-app BRD4338a FLASH 733836 734180 344 0.0
RAM 207892 208340 448 0.2
window-app BRD4187C FLASH 1012628 1012988 360 0.0
RAM 129632 130080 448 0.3
esp32 all-clusters-app c3devkit DRAM 90924 91228 304 0.3
FLASH 1469484 1469768 284 0.0
IRAM 75570 75570 0 0.0
m5stack DRAM 117412 117724 312 0.3
FLASH 1538415 1538703 288 0.0
IRAM 125403 125403 0 0.0
linux chip-tool-ipv6only arm64 unknown 20128 20128 0 0.0
FLASH 10908044 10909692 1648 0.0
RAM 596616 596616 0 0.0
thermostat-no-ble arm64 unknown 9184 9184 0 0.0
FLASH 4169596 4170684 1088 0.0
RAM 235840 238000 2160 0.9
mbed lock-app-release cy8cproto_062_4343w FLASH 1502884 1503092 208 0.0
RAM 226648 227216 568 0.3
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 882612 882900 288 0.0
RAM 142229 142533 304 0.2
nrf7002dk_nrf5340_cpuapp FLASH 953128 953420 292 0.0
RAM 140657 140961 304 0.2
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 828104 828388 284 0.0
RAM 141123 141427 304 0.2
nxp contact k32w0+release FLASH 576132 576380 248 0.0
RAM 70024 70328 304 0.4
k32w1+release FLASH 591496 591768 272 0.0
RAM 74056 74360 304 0.4
light k32w0+release FLASH 610360 610656 296 0.0
RAM 69500 69804 304 0.4
k32w1+release FLASH 675104 675464 360 0.1
RAM 82816 83120 304 0.4
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1615564 1615956 392 0.0
RAM 209692 210468 776 0.4
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1536436 1536844 408 0.0
RAM 206588 207364 776 0.4
light cy8ckit_062s2_43012 FLASH 1463044 1463444 400 0.0
RAM 199876 200652 776 0.4
lock cy8ckit_062s2_43012 FLASH 1463788 1464196 408 0.0
RAM 224388 225164 776 0.3
qpg lighting-app qpg6105+debug FLASH 651372 651628 256 0.0
RAM 104564 104868 304 0.3
lock-app qpg6105+debug FLASH 611912 612176 264 0.0
RAM 99240 99544 304 0.3
stm32 light STM32WB5MM-DK FLASH 473712 473976 264 0.1
RAM 144196 144500 304 0.2
tizen all-clusters-app arm unknown 1584 1584 0 0.0
FLASH 1639268 1639500 232 0.0
RAM 48548 50444 1896 3.9
chip-tool-ubsan arm unknown 2384 2384 0 0.0
FLASH 16292958 16295474 2516 0.0
RAM 7156248 7156932 684 0.0
Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
Copy link

github-actions bot commented Jul 15, 2024

PR #33977: Size comparison from 05e4c10 to ea75eeb

Increases above 0.2%:

platform target config section 05e4c10 ea75eeb change % change
bl602 lighting-app bl602 RAM 95328 95656 328 0.3
bl602+mfd RAM 95472 95800 328 0.3
bl602+rpc RAM 103752 104080 328 0.3
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 RAM 109180 109596 416 0.4
lock-ftd LP_EM_CC1354P10_6 RAM 116948 117364 416 0.4
lock-mtd LP_EM_CC1354P10_6 RAM 111236 111652 416 0.4
pump-app LP_EM_CC1354P10_6 RAM 105328 105744 416 0.4
pump-controller-app LP_EM_CC1354P10_6 RAM 105576 105992 416 0.4
cc32xx air-purifier CC3235SF_LAUNCHXL RAM 204508 205276 768 0.4
lock CC3235SF_LAUNCHXL RAM 204780 205548 768 0.4
cyw30739 light CYW30739B2-P5-EVK-01 RAM 77644 78100 456 0.6
CYW30739B2-P5-EVK-02 RAM 80276 80732 456 0.6
CYW30739B2-P5-EVK-03 RAM 80276 80732 456 0.6
CYW930739M2EVB-02 RAM 72712 73168 456 0.6
light-switch CYW30739B2-P5-EVK-01 RAM 70804 71260 456 0.6
CYW30739B2-P5-EVK-02 RAM 73356 73812 456 0.6
CYW30739B2-P5-EVK-03 RAM 73356 73812 456 0.6
lock CYW30739B2-P5-EVK-01 RAM 73820 74276 456 0.6
CYW30739B2-P5-EVK-02 RAM 76372 76828 456 0.6
CYW30739B2-P5-EVK-03 RAM 76372 76828 456 0.6
thermostat CYW30739B2-P5-EVK-01 RAM 67788 68244 456 0.7
CYW30739B2-P5-EVK-02 RAM 70420 70876 456 0.6
CYW30739B2-P5-EVK-03 RAM 70420 70876 456 0.6
efr32 lighting-app BRD4187C RAM 137528 137976 448 0.3
window-app BRD4187C RAM 129632 130080 448 0.3
esp32 all-clusters-app c3devkit DRAM 90924 91228 304 0.3
m5stack DRAM 117412 117724 312 0.3
linux air-purifier-app debug RAM 125112 127448 2336 1.9
all-clusters-app debug RAM 493240 495576 2336 0.5
all-clusters-minimal-app debug RAM 235704 238040 2336 1.0
bridge-app debug RAM 212832 215168 2336 1.1
fabric-bridge-app debug RAM 198992 201328 2336 1.2
lighting-app debug+rpc+ui RAM 224136 226472 2336 1.0
lock-app debug RAM 200456 202792 2336 1.2
ota-provider-app debug RAM 194544 196880 2336 1.2
ota-requestor-app debug RAM 199168 201504 2336 1.2
shell debug RAM 153008 155376 2368 1.5
thermostat-no-ble arm64 RAM 235840 238000 2160 0.9
tv-app debug RAM 342120 344520 2400 0.7
tv-casting-app debug RAM 402936 404216 1280 0.3
mbed lock-app-release cy8cproto_062_4343w RAM 226648 227216 568 0.3
nxp contact k32w0+release RAM 70024 70328 304 0.4
k32w1+release RAM 74056 74360 304 0.4
light k32w0+release RAM 69500 69804 304 0.4
k32w1+release RAM 82816 83120 304 0.4
psoc6 all-clusters cy8ckit_062s2_43012 RAM 209692 210468 776 0.4
all-clusters-minimal cy8ckit_062s2_43012 RAM 206588 207364 776 0.4
light cy8ckit_062s2_43012 RAM 199876 200652 776 0.4
lock cy8ckit_062s2_43012 RAM 224388 225164 776 0.3
qpg lighting-app qpg6105+debug RAM 104564 104868 304 0.3
lock-app qpg6105+debug RAM 99240 99544 304 0.3
telink air-quality-sensor-app tlsr9528a_retention RAM 50528 50800 272 0.5
all-clusters-minimal-app tlsr9528a RAM 113212 113516 304 0.3
bridge-app tlsr9258a RAM 95304 95608 304 0.3
contact-sensor-app tlsr9528a_retention RAM 50572 50844 272 0.5
light-switch-app-ota-shell-factory-data tlsr9528a RAM 77148 77428 280 0.4
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d RAM 103040 103344 304 0.3
lock-app-dfu tlsr9528a RAM 69852 70124 272 0.4
ota-requestor-app tlsr9258a RAM 95028 95332 304 0.3
pump-app tlsr9518adk80d RAM 56952 57224 272 0.5
pump-controller-app tlsr9518adk80d RAM 56752 57024 272 0.5
shell tlsr9518adk80d RAM 72484 72732 248 0.3
smoke_co_alarm-app tlsr9528a_retention RAM 52200 52552 352 0.7
temperature-measurement-app-mars-ota tlsr9518adk80d RAM 60388 60660 272 0.5
thermostat tlsr9518adk80d RAM 57084 57356 272 0.5
window-covering tlsr9118bdk40d RAM 97800 98072 272 0.3
tizen all-clusters-app arm RAM 48548 50444 1896 3.9
Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 05e4c10 ea75eeb change % change
bl602 lighting-app bl602 FLASH 1271432 1271978 546 0.0
RAM 95328 95656 328 0.3
bl602+mfd FLASH 1285946 1286236 290 0.0
RAM 95472 95800 328 0.3
bl602+rpc FLASH 1310648 1311194 546 0.0
RAM 103752 104080 328 0.3
bl702 lighting-app bl702 FLASH 1092522 1093324 802 0.1
RAM 15161 15161 0 0.0
bl702+mfd FLASH 1103216 1104018 802 0.1
RAM 15313 15313 0 0.0
bl702+rpc FLASH 1182332 1183134 802 0.1
RAM 24181 24181 0 0.0
bl706-eth FLASH 875672 876210 538 0.1
RAM 27272 27272 0 0.0
bl706-wifi FLASH 1128098 1128780 682 0.1
RAM 14605 14605 0 0.0
bl702l lighting-app bl702l FLASH 1079408 1080210 802 0.1
RAM 21732 21732 0 0.0
bl702l+mfd FLASH 1090670 1091472 802 0.1
RAM 21892 21892 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 798504 798812 308 0.0
RAM 109180 109596 416 0.4
lock-ftd LP_EM_CC1354P10_6 FLASH 816548 816848 300 0.0
RAM 116948 117364 416 0.4
lock-mtd LP_EM_CC1354P10_6 FLASH 808176 808476 300 0.0
RAM 111236 111652 416 0.4
pump-app LP_EM_CC1354P10_6 FLASH 760840 761156 316 0.0
RAM 105328 105744 416 0.4
pump-controller-app LP_EM_CC1354P10_6 FLASH 746552 746860 308 0.0
RAM 105576 105992 416 0.4
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 606406 606770 364 0.1
RAM 204508 205276 768 0.4
lock CC3235SF_LAUNCHXL FLASH 651730 652102 372 0.1
RAM 204780 205548 768 0.4
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 667625 667897 272 0.0
RAM 77644 78100 456 0.6
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 687469 687741 272 0.0
RAM 80276 80732 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 687469 687741 272 0.0
RAM 80276 80732 456 0.6
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 644405 644685 280 0.0
RAM 72712 73168 456 0.6
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609265 609553 288 0.0
RAM 70804 71260 456 0.6
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 628901 629197 296 0.0
RAM 73356 73812 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 628901 629197 296 0.0
RAM 73356 73812 456 0.6
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 625001 625289 288 0.0
RAM 73820 74276 456 0.6
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 644717 645005 288 0.0
RAM 76372 76828 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 644717 645005 288 0.0
RAM 76372 76828 456 0.6
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 593349 593629 280 0.0
RAM 67788 68244 456 0.7
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 613209 613481 272 0.0
RAM 70420 70876 456 0.6
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 613209 613481 272 0.0
RAM 70420 70876 456 0.6
efr32 lighting-app BRD4187C FLASH 924588 924884 296 0.0
RAM 137528 137976 448 0.3
lock-app BRD4338a FLASH 733836 734180 344 0.0
RAM 207892 208340 448 0.2
window-app BRD4187C FLASH 1012628 1012988 360 0.0
RAM 129632 130080 448 0.3
esp32 all-clusters-app c3devkit DRAM 90924 91228 304 0.3
FLASH 1469484 1469768 284 0.0
IRAM 75570 75570 0 0.0
m5stack DRAM 117412 117724 312 0.3
FLASH 1538415 1538703 288 0.0
IRAM 125403 125403 0 0.0
linux air-purifier-app debug unknown 4592 4592 0 0.0
FLASH 2531184 2532656 1472 0.1
RAM 125112 127448 2336 1.9
all-clusters-app debug unknown 5368 5368 0 0.0
FLASH 5592254 5593894 1640 0.0
RAM 493240 495576 2336 0.5
all-clusters-minimal-app debug unknown 5288 5288 0 0.0
FLASH 5065344 5066976 1632 0.0
RAM 235704 238040 2336 1.0
bridge-app debug unknown 5256 5256 0 0.0
FLASH 4479584 4481216 1632 0.0
RAM 212832 215168 2336 1.1
chip-tool debug unknown 5728 5728 0 0.0
FLASH 11797831 11800151 2320 0.0
RAM 547618 547618 0 0.0
chip-tool-ipv6only arm64 unknown 20128 20128 0 0.0
FLASH 10908044 10909692 1648 0.0
RAM 596616 596616 0 0.0
fabric-admin debug unknown 5616 5616 0 0.0
FLASH 10879159 10881383 2224 0.0
RAM 544650 544650 0 0.0
fabric-bridge-app debug unknown 4544 4544 0 0.0
FLASH 4248240 4249824 1584 0.0
RAM 198992 201328 2336 1.2
lighting-app debug+rpc+ui unknown 5936 5936 0 0.0
FLASH 5383938 5385602 1664 0.0
RAM 224136 226472 2336 1.0
lock-app debug unknown 5192 5192 0 0.0
FLASH 4546000 4547632 1632 0.0
RAM 200456 202792 2336 1.2
ota-provider-app debug unknown 4576 4576 0 0.0
FLASH 4198992 4200576 1584 0.0
RAM 194544 196880 2336 1.2
ota-requestor-app debug unknown 4512 4512 0 0.0
FLASH 4324352 4325936 1584 0.0
RAM 199168 201504 2336 1.2
shell debug unknown 4112 4112 0 0.0
FLASH 2805709 2807181 1472 0.1
RAM 153008 155376 2368 1.5
thermostat-no-ble arm64 unknown 9184 9184 0 0.0
FLASH 4169596 4170684 1088 0.0
RAM 235840 238000 2160 0.9
tv-app debug unknown 5472 5472 0 0.0
FLASH 5627600 5629632 2032 0.0
RAM 342120 344520 2400 0.7
tv-casting-app debug unknown 5096 5096 0 0.0
FLASH 9967742 9969454 1712 0.0
RAM 402936 404216 1280 0.3
mbed lock-app-release cy8cproto_062_4343w FLASH 1502884 1503092 208 0.0
RAM 226648 227216 568 0.3
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 882612 882900 288 0.0
RAM 142229 142533 304 0.2
nrf7002dk_nrf5340_cpuapp FLASH 953128 953420 292 0.0
RAM 140657 140961 304 0.2
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 828104 828388 284 0.0
RAM 141123 141427 304 0.2
nxp contact k32w0+release FLASH 576132 576380 248 0.0
RAM 70024 70328 304 0.4
k32w1+release FLASH 591496 591768 272 0.0
RAM 74056 74360 304 0.4
light k32w0+release FLASH 610360 610656 296 0.0
RAM 69500 69804 304 0.4
k32w1+release FLASH 675104 675464 360 0.1
RAM 82816 83120 304 0.4
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1615564 1615956 392 0.0
RAM 209692 210468 776 0.4
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1536436 1536844 408 0.0
RAM 206588 207364 776 0.4
light cy8ckit_062s2_43012 FLASH 1463044 1463444 400 0.0
RAM 199876 200652 776 0.4
lock cy8ckit_062s2_43012 FLASH 1463788 1464196 408 0.0
RAM 224388 225164 776 0.3
qpg lighting-app qpg6105+debug FLASH 651372 651628 256 0.0
RAM 104564 104868 304 0.3
lock-app qpg6105+debug FLASH 611912 612176 264 0.0
RAM 99240 99544 304 0.3
stm32 light STM32WB5MM-DK FLASH 473712 473976 264 0.1
RAM 144196 144500 304 0.2
telink air-quality-sensor-app tlsr9528a_retention FLASH 632926 633182 256 0.0
RAM 50528 50800 272 0.5
all-clusters-app tlsr9118bdk40d FLASH 658818 659070 252 0.0
RAM 148408 148712 304 0.2
all-clusters-minimal-app tlsr9528a FLASH 779090 779342 252 0.0
RAM 113212 113516 304 0.3
bridge-app tlsr9258a FLASH 675922 676174 252 0.0
RAM 95304 95608 304 0.3
contact-sensor-app tlsr9528a_retention FLASH 634510 634766 256 0.0
RAM 50572 50844 272 0.5
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 720370 720646 276 0.0
RAM 77148 77428 280 0.4
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613924 614176 252 0.0
RAM 144636 144940 304 0.2
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 801676 801928 252 0.0
RAM 103040 103344 304 0.3
lock-app-dfu tlsr9528a FLASH 666340 666596 256 0.0
RAM 69852 70124 272 0.4
ota-requestor-app tlsr9258a FLASH 695252 695504 252 0.0
RAM 95028 95332 304 0.3
pump-app tlsr9518adk80d FLASH 616784 617040 256 0.0
RAM 56952 57224 272 0.5
pump-controller-app tlsr9518adk80d FLASH 607168 607424 256 0.0
RAM 56752 57024 272 0.5
shell tlsr9518adk80d FLASH 466356 466496 140 0.0
RAM 72484 72732 248 0.3
smoke_co_alarm-app tlsr9528a_retention FLASH 641128 641406 278 0.0
RAM 52200 52552 352 0.7
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 650994 651250 256 0.0
RAM 60388 60660 272 0.5
thermostat tlsr9518adk80d FLASH 626058 626314 256 0.0
RAM 57084 57356 272 0.5
window-covering tlsr9118bdk40d FLASH 519318 519574 256 0.0
RAM 97800 98072 272 0.3
tizen all-clusters-app arm unknown 1584 1584 0 0.0
FLASH 1639268 1639500 232 0.0
RAM 48548 50444 1896 3.9
chip-tool-ubsan arm unknown 2384 2384 0 0.0
FLASH 16292958 16295474 2516 0.0
RAM 7156248 7156932 684 0.0
crlonxp and others added 2 commits July 17, 2024 20:30
@@ -90,6 +93,10 @@ using namespace chip::Encoding;
#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY
using namespace chip::Protocols::UserDirectedCommissioning;
#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
static std::shared_ptr<DeviceCommissioner> DevCommPtr;
Copy link
Contributor

@bzbarsky-apple bzbarsky-apple Jul 18, 2024

Choose a reason for hiding this comment

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

I don't understand how this is supposed to work. Per C++ spec:

If the object pointed to by ptr is already owned, the function generally results in undefined behavior. 

and that's the scenario here, no? There are non-shared-ptr bits that will happily delete that object out from under you.

Maybe the intent was that you then reset the static shared_ptr when you get deleted? That would at least kind of work in that a properly created weak_ptr from that shared_ptr (which is also not happening here) would get notified when the shared_ptr gets reset, I think. But:

  1. That's not happening here.
  2. You can't use a static because multiple DeviceCommissioner instances might be trying to commission things at once, no?
}
DevCommPtr.reset(this, custom_del);
mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = params;
DeviceLayer::ConnectivityMgr().WiFiPAFConnect(params.GetSetupDiscriminator().value(), (void *) (&(DevCommPtr)),
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, so this passes a pointer to the shared_ptr as the void*, right?

#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
void DeviceCommissioner::OnWiFiPAFSubscribeComplete(void * appState)
{
std::weak_ptr<DeviceCommissioner> * caller = (std::weak_ptr<DeviceCommissioner> *) (appState);
Copy link
Contributor

Choose a reason for hiding this comment

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

But this is casting the pointer we passed (to shared_ptr) to a weak_ptr?

I don't understand how this works.

@@ -243,6 +253,39 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverSoftAP()
return CHIP_NO_ERROR;
}

#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
static std::shared_ptr<SetUpCodePairer> SetUpCodeParserPtr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, I don't think this works. SetUpCodePairer lifetime is not managed via the shared ptr....

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to repeat for the Nth time: this needs tests. Not manual things that got run. Just fix the file in the tests directory under here to test these bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are saying to add the tests in setup_payload/tests/TestQRCode.cpp, right?
I add more tests in the last commit. Please review. Thank you

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that is much better, thank you, except for the missing checks.

crlonxp and others added 2 commits July 19, 2024 18:24
* Add more tests in QRCode test

Signed-off-by: Lo,Chin-Ran <chin-ran.lo@nxp.com>
Comment on lines +53 to +54
bool mWiFiPAF = false;
const char * mWiFiPafExtCmds = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the inconsistent capitalization?


inPayload.rendezvousInformation.SetValue(RendezvousInformationFlags(
RendezvousInformationFlag::kWiFiPAF, RendezvousInformationFlag::kSoftAP, RendezvousInformationFlag::kOnNetwork));

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be a EXPECT_TRUE(CheckWriteRead(inPayload)) here? Otherwise, the next line will just reset things and this is not tested...


inPayload.rendezvousInformation.SetValue(RendezvousInformationFlags(
RendezvousInformationFlag::kWiFiPAF, RendezvousInformationFlag::kBLE, RendezvousInformationFlag::kOnNetwork));

Copy link
Contributor

Choose a reason for hiding this comment

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

Again, should have EXPECT_TRUE(CheckWriteRead(inPayload)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment