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

Allow and ignore '-' characters in manual pairing codes. #22238

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

bzbarsky-apple
Copy link
Contributor

The spec does not mention these, but the brand guidelines apparently talk about
using them. While ideally all SDK consumers would do the right thing and strip
them out on input, we should probably also try for maximal interop and do the
same stripping in the SDK itself.

Problem

Using something with dashes in it as a manual pairing code does not work.

Change overview

Strip out '-' when initializing the manual code parser.

Testing

Tried doing chip-tool pairing code with a code with severa dashes inserted and made sure it worked.

The spec does not mention these, but the brand guidelines apparently talk about
using them.  While ideally all SDK consumers would do the right thing and strip
them out on input, we should probably also try for maximal interop and do the
same stripping in the SDK itself.
@andy31415
Copy link
Contributor

@bzbarsky-apple if not in the spec, should we do this at all at this stage for 1.0?

@github-actions
Copy link

github-actions bot commented Aug 29, 2022

PR #22238: Size comparison from 50f9835 to e1991ed

Increases (8 builds for cc13x2_26x2, cyw30739, linux, psoc6, telink)
platform target config section 50f9835 e1991ed change % change
cc13x2_26x2 shell LP_CC2652R7 (read only) 665646 665654 8 0.0
.text 579548 579556 8 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586650 586658 8 0.0
.app_xip_area 463308 463316 8 0.0
lock cyw930739m2evb_01 (read/write) 592418 592426 8 0.0
.app_xip_area 464292 464300 8 0.0
linux chip-tool debug (read only) 10902737 10904001 1264 0.0
.text 8818388 8819652 1264 0.0
chip-tool-ipv6only arm64 (read only) 10284308 10284836 528 0.0
.text 8137828 8138356 528 0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_info 26695820 26695821 1 0.0
lock cy8ckit_062s2_43012 .debug_info 22275757 22275758 1 0.0
telink lighting-app tlsr9518adk80d text 589278 589282 4 0.0
Decreases (4 builds for cc13x2_26x2, esp32, psoc6)
platform target config section 50f9835 e1991ed change % change
cc13x2_26x2 shell LP_CC2652R7 (read/write) 181264 181256 -8 -0.0
esp32 all-clusters-app c3devkit (read only) 1031738 1031734 -4 -0.0
.flash.text 1031738 1031734 -4 -0.0
psoc6 all-clusters-minimal cy8ckit_062s2_43012 .debug_info 26432516 26432515 -1 -0.0
light cy8ckit_062s2_43012 .debug_info 21896028 21896027 -1 -0.0
Full report (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
platform target config section 50f9835 e1991ed change % change
bl602 lighting-app bl602 (read/write) 1384998 1384998 0 0.0
.bss 120274 120274 0 0.0
.data 4488 4488 0 0.0
.text 1051400 1051400 0 0.0
bl602+rpc (read/write) 1430894 1430894 0 0.0
.bss 127706 127706 0 0.0
.data 4600 4600 0 0.0
.text 1083416 1083416 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 672947 672947 0 0.0
(read/write) 178444 178444 0 0.0
.bss 74284 74284 0 0.0
.data 3372 3372 0 0.0
.rodata 88835 88835 0 0.0
.text 583796 583796 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637667 637667 0 0.0
(read/write) 157844 157844 0 0.0
.bss 73556 73556 0 0.0
.data 3372 3372 0 0.0
.rodata 77979 77979 0 0.0
.text 559364 559364 0 0.0
lock-ftd LP_CC2652R7 (read only) 673999 673999 0 0.0
(read/write) 167704 167704 0 0.0
.bss 71484 71484 0 0.0
.data 3296 3296 0 0.0
.rodata 76671 76671 0 0.0
.text 596848 596848 0 0.0
lock-mtd LP_CC2652R7 (read only) 656939 656939 0 0.0
(read/write) 180452 180452 0 0.0
.bss 67172 67172 0 0.0
.data 3296 3296 0 0.0
.rodata 101883 101883 0 0.0
.text 554576 554576 0 0.0
pump-app LP_CC2652R7 (read only) 684723 684723 0 0.0
(read/write) 157684 157684 0 0.0
.bss 71420 71420 0 0.0
.data 3296 3296 0 0.0
.rodata 89947 89947 0 0.0
.text 594292 594292 0 0.0
pump-controller-app LP_CC2652R7 (read only) 669215 669215 0 0.0
(read/write) 173304 173304 0 0.0
.bss 71532 71532 0 0.0
.data 3292 3292 0 0.0
.rodata 85503 85503 0 0.0
.text 583232 583232 0 0.0
shell LP_CC2652R7 (read only) 665646 665654 8 0.0
(read/write) 181264 181256 -8 -0.0
.bss 76604 76604 0 0.0
.data 3376 3376 0 0.0
.rodata 85782 85782 0 0.0
.text 579548 579556 8 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586650 586658 8 0.0
.app_xip_area 463308 463316 8 0.0
.bss 65776 65776 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 592418 592426 8 0.0
.app_xip_area 464292 464300 8 0.0
.bss 70560 70560 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599418 599418 0 0.0
.app_xip_area 476796 476796 0 0.0
.bss 65088 65088 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1107408 1107408 0 0.0
.bss 136332 136332 0 0.0
.data 2072 2072 0 0.0
.text 968984 968984 0 0.0
BRD4161A+rpc (read/write) 971524 971524 0 0.0
.bss 150844 150844 0 0.0
.data 2252 2252 0 0.0
.text 818408 818408 0 0.0
BRD4161A+rs911x (read/write) 1001144 1001144 0 0.0
.bss 169088 169088 0 0.0
.data 2064 2064 0 0.0
.text 829972 829972 0 0.0
lock-app BRD4161A+wf200 (read/write) 1149700 1149700 0 0.0
.bss 152168 152168 0 0.0
.data 2072 2072 0 0.0
.text 995440 995440 0 0.0
window-app BRD4161A (read/write) 1098680 1098680 0 0.0
.bss 137772 137772 0 0.0
.data 2096 2096 0 0.0
.text 958792 958792 0 0.0
esp32 all-clusters-app c3devkit (read only) 1031738 1031734 -4 -0.0
(read/write) 1490170 1490170 0 0.0
.dram0.bss 71056 71056 0 0.0
.dram0.data 14608 14608 0 0.0
.flash.rodata 219080 219080 0 0.0
.flash.text 1031738 1031734 -4 -0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1084695 1084695 0 0.0
(read/write) 492084 492084 0 0.0
.dram0.bss 76560 76560 0 0.0
.dram0.data 34152 34152 0 0.0
.flash.rodata 249376 249376 0 0.0
.flash.text 1079311 1079311 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 647244 647244 0 0.0
.bss 70424 70424 0 0.0
.data 2068 2068 0 0.0
.text 572024 572024 0 0.0
lock k32w0+release (read/write) 704256 704256 0 0.0
.bss 70864 70864 0 0.0
.data 2076 2076 0 0.0
.text 628588 628588 0 0.0
linux all-clusters-app debug (read only) 3043257 3043257 0 0.0
(read/write) 156032 156032 0 0.0
.bss 61792 61792 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85768 85768 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1176 1176 0 0.0
.rodata 275307 275307 0 0.0
.text 2588514 2588514 0 0.0
all-clusters-minimal-app debug (read only) 2879089 2879089 0 0.0
(read/write) 147632 147632 0 0.0
.bss 61024 61024 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78264 78264 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 275467 275467 0 0.0
.text 2426962 2426962 0 0.0
bridge-app debug+rpc (read only) 2377353 2377353 0 0.0
(read/write) 127752 127752 0 0.0
.bss 50656 50656 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67640 67640 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 832 832 0 0.0
.rodata 204168 204168 0 0.0
.text 2010274 2010274 0 0.0
chip-tool debug (read only) 10902737 10904001 1264 0.0
(read/write) 657384 657384 0 0.0
.bss 25240 25240 0 0.0
.data 3266 3266 0 0.0
.data.rel.ro 622352 622352 0 0.0
.dynamic 608 608 0 0.0
.got 5096 5096 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 563509 563509 0 0.0
.text 8818388 8819652 1264 0.0
chip-tool-ipv6only arm64 (read only) 10284308 10284836 528 0.0
(read/write) 705233 705233 0 0.0
.bss 33297 33297 0 0.0
.data 3280 3280 0 0.0
.data.rel.ro 649832 649832 0 0.0
.dynamic 560 560 0 0.0
.got 13848 13848 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 494020 494020 0 0.0
.text 8137828 8138356 528 0.0
lighting-app debug+rpc (read only) 2602249 2602249 0 0.0
(read/write) 130536 130536 0 0.0
.bss 49792 49792 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72680 72680 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 221008 221008 0 0.0
.text 2210050 2210050 0 0.0
lock-app debug (read only) 2585249 2585249 0 0.0
(read/write) 125712 125712 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69688 69688 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 238000 238000 0 0.0
.text 2180306 2180306 0 0.0
ota-provider-app debug (read only) 2362505 2362505 0 0.0
(read/write) 119144 119144 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63512 63512 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 209976 209976 0 0.0
.text 1988770 1988770 0 0.0
ota-requestor-app debug (read only) 2527833 2527833 0 0.0
(read/write) 127552 127552 0 0.0
.bss 50368 50368 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68920 68920 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 856 856 0 0.0
.rodata 216704 216704 0 0.0
.text 2138226 2138226 0 0.0
shell debug (read only) 2611561 2611561 0 0.0
(read/write) 142184 142184 0 0.0
.bss 57704 57704 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77376 77376 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1048 1048 0 0.0
.rodata 235410 235410 0 0.0
.text 2217442 2217442 0 0.0
thermostat-no-ble arm64 (read only) 2361492 2361492 0 0.0
(read/write) 141857 141857 0 0.0
.bss 55233 55233 0 0.0
.data 1680 1680 0 0.0
.data.rel.ro 76112 76112 0 0.0
.dynamic 560 560 0 0.0
.got 5056 5056 0 0.0
.init 24 24 0 0.0
.init_array 416 416 0 0.0
.rodata 141276 141276 0 0.0
.text 1982176 1982176 0 0.0
tv-app debug (read only) 3188169 3188169 0 0.0
(read/write) 258040 258040 0 0.0
.bss 167352 167352 0 0.0
.data 4752 4752 0 0.0
.data.rel.ro 79368 79368 0 0.0
.dynamic 608 608 0 0.0
.got 4856 4856 0 0.0
.init 27 27 0 0.0
.init_array 1080 1080 0 0.0
.rodata 259784 259784 0 0.0
.text 2738354 2738354 0 0.0
tv-casting-app debug (read only) 5508817 5508817 0 0.0
(read/write) 160536 160536 0 0.0
.bss 51352 51352 0 0.0
.data 2432 2432 0 0.0
.data.rel.ro 100304 100304 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 1048 1048 0 0.0
.rodata 344913 344913 0 0.0
.text 4892002 4892002 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2454808 2454808 0 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1417452 1417452 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180643 1180643 0 0.0
bss 143641 143641 0 0.0
rodata 143380 143380 0 0.0
text 814684 814684 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159855 1159855 0 0.0
bss 142868 142868 0 0.0
rodata 134968 134968 0 0.0
text 803092 803092 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 842216 842216 0 0.0
(read/write) 1741604 1741604 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188464 188464 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1221325 1221325 0 0.0
.debug_aranges 111696 111696 0 0.0
.debug_frame 372796 372796 0 0.0
.debug_info 26695820 26695821 1 0.0
.debug_line 3654965 3654965 0 0.0
.debug_loc 3568121 3568121 0 0.0
.debug_ranges 337536 337536 0 0.0
.debug_str 3426578 3426578 0 0.0
.heap 842216 842216 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 570457 570457 0 0.0
.symtab 421408 421408 0 0.0
.text 1542088 1542088 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842952 842952 0 0.0
(read/write) 1684804 1684804 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187728 187728 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1213164 1213164 0 0.0
.debug_aranges 111168 111168 0 0.0
.debug_frame 375876 375876 0 0.0
.debug_info 26432516 26432515 -1 -0.0
.debug_line 3675481 3675481 0 0.0
.debug_loc 3555758 3555758 0 0.0
.debug_ranges 336152 336152 0 0.0
.debug_str 3415583 3415583 0 0.0
.heap 842952 842952 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 534931 534931 0 0.0
.symtab 408000 408000 0 0.0
.text 1486024 1486024 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 851184 851184 0 0.0
(read/write) 1602076 1602076 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 179704 179704 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2456 2456 0 0.0
.debug_abbrev 1047983 1047983 0 0.0
.debug_aranges 103344 103344 0 0.0
.debug_frame 346144 346144 0 0.0
.debug_info 21896028 21896027 -1 -0.0
.debug_line 3245946 3245946 0 0.0
.debug_loc 3254064 3254064 0 0.0
.debug_ranges 301624 301624 0 0.0
.debug_str 3220803 3220803 0 0.0
.heap 851184 851184 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 468230 468230 0 0.0
.symtab 375088 375088 0 0.0
.text 1411528 1411528 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 846152 846152 0 0.0
(read/write) 1639780 1639780 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184720 184720 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2472 2472 0 0.0
.debug_abbrev 1055418 1055418 0 0.0
.debug_aranges 104016 104016 0 0.0
.debug_frame 348972 348972 0 0.0
.debug_info 22275757 22275758 1 0.0
.debug_line 3254784 3254784 0 0.0
.debug_loc 3293902 3293902 0 0.0
.debug_ranges 304968 304968 0 0.0
.debug_str 3248278 3248278 0 0.0
.heap 846152 846152 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 474445 474445 0 0.0
.symtab 378272 378272 0 0.0
.text 1444200 1444200 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808584 808584 0 0.0
bss 71344 71344 0 0.0
noinit 43488 43488 0 0.0
text 571186 571186 0 0.0
lighting-app tlsr9518adk80d (read/write) 830468 830468 0 0.0
bss 72200 72200 0 0.0
noinit 43488 43488 0 0.0
text 589278 589282 4 0.0

@bzbarsky-apple
Copy link
Contributor Author

@bzbarsky-apple if not in the spec, should we do this at all at this stage for 1.0?

@andy31415 That is a good question. If we don't, all SDK consumers probably need to. Doable, of course, but might not be as good for interop....

@github-actions
Copy link

github-actions bot commented Aug 30, 2022

PR #22238: Size comparison from 50f9835 to 57b77f4

Increases (3 builds for mbed, nrfconnect)
platform target config section 50f9835 57b77f4 change % change
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2454808 2454872 64 0.0
.text 1417452 1417516 64 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180643 1180691 48 0.0
text 814684 814724 40 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159855 1159871 16 0.0
text 803092 803116 24 0.0
Full report (3 builds for mbed, nrfconnect)
platform target config section 50f9835 57b77f4 change % change
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2454808 2454872 64 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1417452 1417516 64 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180643 1180691 48 0.0
bss 143641 143641 0 0.0
rodata 143380 143380 0 0.0
text 814684 814724 40 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159855 1159871 16 0.0
bss 142868 142868 0 0.0
rodata 134968 134968 0 0.0
text 803092 803116 24 0.0

@andy31415
Copy link
Contributor

Postponed: it seems like applications can ignore - in manual pairing codes, there is no strict need for SDK to check and/or allow it.

@woody-apple woody-apple closed this Sep 7, 2022
@woody-apple woody-apple reopened this Sep 7, 2022
Copy link
Contributor

@andy31415 andy31415 left a comment

Choose a reason for hiding this comment

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

Marking changes requested to wait until after 1.0 branch

@woody-apple
Copy link
Contributor

This seems like we should support this for 1.0, given if we don't fix all clients need to adopt this work.

@tcarmelveilleux
Copy link
Contributor

@andy31415 Please reconsider as this is actually in the spec

@bzbarsky-apple if not in the spec, should we do this at all at this stage for 1.0?

This is in the Setup Code specifications, which is outside the "core spec" and under different review process, but still part of what must be met for certification of matter devices.

image

image

Please consult source of truth in Causeway: https://groups.csa-iot.org/wg/matter-wg/document/27120

@andy31415 andy31415 dismissed their stale review September 8, 2022 14:23

Dismiss for 1.0 acceptance: it seems SVE participants are hitting this, may as well fix it then.

@andy31415 andy31415 merged commit 0969e61 into project-chip:master Sep 8, 2022
@bzbarsky-apple bzbarsky-apple deleted the dashes-in-manual-code branch September 8, 2022 14:48
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
…p#22238)

* Allow and ignore '-' characters in manual pairing codes.

The spec does not mention these, but the brand guidelines apparently talk about
using them.  While ideally all SDK consumers would do the right thing and strip
them out on input, we should probably also try for maximal interop and do the
same stripping in the SDK itself.

* Add test per review comment.
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.

6 participants