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

Descriptor cluser's new attribute : EndpointUniqueId is added as per latest spec 0.7-fall2024-ncr(V1.5) #37990

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

Conversation

suneelsignify
Copy link

@suneelsignify suneelsignify commented Mar 13, 2025

Specification for V1.5 (https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/9171) defines a new attribute EndpointUniqueId in Descriptor cluster. The Changes in the request are related to adding this new attribute.

Testing

Testing was done using the bridge-app and the DUT deive by reading the EndpointUniqueId attribute using the chip-tool.

Copy link

github-actions bot commented Mar 13, 2025

PR #37990: Size comparison from 5adee57 to c9431c6

Increases above 0.2%:

platform target config section 5adee57 c9431c6 change % change
bl702 lighting-app bl702+wifi RAM 22257 22313 56 0.3
linux air-purifier-app debug RAM 112304 112632 328 0.3
bridge-app debug RAM 201000 201648 648 0.3
fabric-bridge-app debug RAM 188200 188816 616 0.3
nrfconnect all-clusters-app nrf7002dk_nrf5340_cpuapp RAM 123173 123533 360 0.3
telink contact-sensor-app tlsr9528a_retention RAM 31488 31608 120 0.4
light-app-ota-compress-lzma-shell-factory-data tl3218x RAM 40420 40540 120 0.3
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention RAM 52192 52372 180 0.3
light-switch-app-ota-shell-factory-data tl3218x_retention RAM 37664 37844 180 0.5
tizen all-clusters-app arm RAM 94168 94412 244 0.3
Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 5adee57 c9431c6 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1098296 1098574 278 0.0
RAM 94866 94914 48 0.1
bl702 lighting-app bl702+eth FLASH 653274 653548 274 0.0
RAM 33533 33589 56 0.2
bl702+wifi FLASH 830546 830820 274 0.0
RAM 22257 22313 56 0.3
bl706+mfd+rpc+littlefs FLASH 1062944 1063218 274 0.0
RAM 32181 32237 56 0.2
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 893786 894060 274 0.0
RAM 26920 26976 56 0.2
lighting-app bl702l+mfd+littlefs FLASH 976682 976956 274 0.0
RAM 24668 24724 56 0.2
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 818264 818556 292 0.0
RAM 120296 120344 48 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 827176 827468 292 0.0
RAM 125392 125440 48 0.0
pump-app LP_EM_CC1354P10_6 FLASH 774036 774328 292 0.0
RAM 113764 113812 48 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 758320 758612 292 0.0
RAM 113972 114020 48 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 541830 542090 260 0.0
RAM 205152 205296 144 0.1
lock CC3235SF_LAUNCHXL FLASH 575930 576206 276 0.0
RAM 205400 205448 48 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 659957 660237 280 0.0
RAM 75436 75484 48 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 679809 680089 280 0.0
RAM 78076 78124 48 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 679809 680089 280 0.0
RAM 78076 78124 48 0.1
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 636741 637021 280 0.0
RAM 70504 70552 48 0.1
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620189 620477 288 0.0
RAM 71676 71748 72 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 639833 640121 288 0.0
RAM 74220 74300 80 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 639833 640121 288 0.0
RAM 74220 74300 80 0.1
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 639693 639989 296 0.0
RAM 74684 74732 48 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 659417 659713 296 0.0
RAM 77228 77276 48 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 659417 659713 296 0.0
RAM 77228 77276 48 0.1
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616041 616345 304 0.0
RAM 68772 68820 48 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635893 636197 304 0.0
RAM 71412 71460 48 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635893 636197 304 0.0
RAM 71412 71460 48 0.1
efr32 lock-app BRD4187C FLASH 940776 941064 288 0.0
RAM 159944 160004 60 0.0
BRD4338a FLASH 734440 734744 304 0.0
RAM 234856 234912 56 0.0
window-app BRD4187C FLASH 1033320 1033600 280 0.0
RAM 128048 128136 88 0.1
esp32 all-clusters-app c3devkit DRAM 98728 98872 144 0.1
FLASH 1594414 1594682 268 0.0
IRAM 83820 83820 0 0.0
m5stack DRAM 117524 117660 136 0.1
FLASH 1561018 1561322 304 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2659017 2660157 1140 0.0
RAM 112304 112632 328 0.3
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5980676 5981832 1156 0.0
RAM 516696 517088 392 0.1
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5317024 5318160 1136 0.0
RAM 222680 222944 264 0.1
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4630812 4632010 1198 0.0
RAM 201000 201648 648 0.3
camera-app debug unknown 5456 5456 0 0.0
FLASH 4682134 4683262 1128 0.0
RAM 195968 196200 232 0.1
camera-controller debug unknown 5776 5776 0 0.0
FLASH 11345413 11346299 886 0.0
RAM 597312 597416 104 0.0
chip-tool debug unknown 6112 6112 0 0.0
FLASH 13365471 13366613 1142 0.0
RAM 605952 606056 104 0.0
chip-tool-ipv6only arm64 unknown 22120 22120 0 0.0
FLASH 11551288 11552152 864 0.0
RAM 658632 658696 64 0.0
fabric-admin debug unknown 5800 5800 0 0.0
FLASH 1163666 11637517 854 0.0
RAM 605736 605840 104 0.0
fabric-bridge-app debug unknown 4720 4720 0 0.0
FLASH 4461800 4462980 1180 0.0
RAM 188200 188816 616 0.3
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5578885 5580069 1184 0.0
RAM 471968 472616 648 0.1
lighting-app debug+rpc+ui unknown 6192 6192 0 0.0
FLASH 5525105 5526241 1136 0.0
RAM 205168 205400 232 0.1
lock-app debug unknown 5424 5424 0 0.0
FLASH 4697588 4698710 1122 0.0
RAM 192360 192592 232 0.1
ota-provider-app debug unknown 4760 4760 0 0.0
FLASH 4319734 4320874 1140 0.0
RAM 181016 181216 200 0.1
ota-requestor-app debug unknown 4712 4712 0 0.0
FLASH 4450118 4451284 1166 0.0
RAM 185504 185736 232 0.1
shell debug unknown 4240 4240 0 0.0
FLASH 2957436 2958556 1120 0.0
RAM 145456 145816 360 0.2
thermostat-no-ble arm64 unknown 9456 9456 0 0.0
FLASH 4146712 4147528 816 0.0
RAM 229848 230000 152 0.1
tv-app debug unknown 5752 5752 0 0.0
FLASH 5917765 5918981 1216 0.0
RAM 595400 596080 680 0.1
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11537997 11539725 1728 0.0
RAM 721744 721976 232 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 915844 916104 260 0.0
RAM 144929 145289 360 0.2
nrf7002dk_nrf5340_cpuapp FLASH 908884 908940 56 0.0
RAM 123173 123533 360 0.3
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852628 852872 244 0.0
RAM 141243 141483 240 0.2
nxp contact k32w0+release FLASH 588336 588608 272 0.0
RAM 71004 71056 52 0.1
mcxw71+release FLASH 603560 603840 280 0.0
RAM 63144 63192 48 0.1
light k32w0+release FLASH 614132 614388 256 0.0
RAM 70292 70352 60 0.1
k32w1+release FLASH 687680 687968 288 0.0
RAM 72056 72112 56 0.1
lock mcxw71+release FLASH 752456 752744 288 0.0
RAM 67556 67604 48 0.1
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661380 1661684 304 0.0
RAM 212344 212496 152 0.1
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1565644 1565932 288 0.0
RAM 208560 208656 96 0.0
light cy8ckit_062s2_43012 FLASH 1442380 1442684 304 0.0
RAM 197320 197376 56 0.0
lock cy8ckit_062s2_43012 FLASH 1471276 1471564 288 0.0
RAM 224984 225032 48 0.0
qpg lighting-app qpg6105+debug FLASH 664876 665148 272 0.0
RAM 105180 105232 52 0.0
lock-app qpg6105+debug FLASH 623328 623600 272 0.0
RAM 99792 99844 52 0.1
stm32 light STM32WB5MM-DK FLASH 460952 461232 280 0.1
RAM 141496 141544 48 0.0
telink bridge-app tl7218x FLASH 665726 666014 288 0.0
RAM 90712 90892 180 0.2
contact-sensor-app tlsr9528a_retention FLASH 623308 623632 324 0.1
RAM 31488 31608 120 0.4
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 762082 762418 336 0.0
RAM 40420 40540 120 0.3
light-app-ota-shell-factory-data tl7218x FLASH 755190 755526 336 0.0
RAM 97540 97660 120 0.1
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 682240 682542 302 0.0
RAM 52192 52372 180 0.3
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 710798 711100 302 0.0
RAM 73400 73580 180 0.2
light-switch-app-ota-shell-factory-data tl3218x_retention FLASH 703348 703650 302 0.0
RAM 37664 37844 180 0.5
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 602918 603254 336 0.1
RAM 138640 138760 120 0.1
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 790206 790542 336 0.0
RAM 96388 96508 120 0.1
tizen all-clusters-app arm unknown 5152 5156 4 0.1
FLASH 1783248 1783836 588 0.0
RAM 94168 94412 244 0.3
chip-tool-ubsan arm unknown 11560 11560 0 0.0
FLASH 19092774 19107078 14304 0.1
RAM 8355048 8356012 964 0.0

Copy link

github-actions bot commented Mar 14, 2025

PR #37990: Size comparison from f217707 to 4b48c44

Increases above 0.2%:

platform target config section f217707 4b48c44 change % change
bl702 lighting-app bl702+wifi RAM 22257 22313 56 0.3
linux air-purifier-app debug RAM 112304 112632 328 0.3
bridge-app debug RAM 201000 201648 648 0.3
fabric-bridge-app debug RAM 188200 188816 616 0.3
telink contact-sensor-app tlsr9528a_retention RAM 31488 31608 120 0.4
light-app-ota-compress-lzma-shell-factory-data tl3218x RAM 40420 40540 120 0.3
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention RAM 52192 52372 180 0.3
light-switch-app-ota-shell-factory-data tl3218x_retention RAM 37664 37844 180 0.5
tizen all-clusters-app arm RAM 94168 94412 244 0.3
Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section f217707 4b48c44 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1098296 1098574 278 0.0
RAM 94866 94914 48 0.1
bl702 lighting-app bl702+eth FLASH 653274 653548 274 0.0
RAM 33533 33589 56 0.2
bl702+wifi FLASH 830546 830820 274 0.0
RAM 22257 22313 56 0.3
bl706+mfd+rpc+littlefs FLASH 1062944 1063218 274 0.0
RAM 32181 32237 56 0.2
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 893786 894060 274 0.0
RAM 26920 26976 56 0.2
lighting-app bl702l+mfd+littlefs FLASH 976682 976956 274 0.0
RAM 24668 24724 56 0.2
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 818264 818556 292 0.0
RAM 120296 120344 48 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 827176 827468 292 0.0
RAM 125392 125440 48 0.0
pump-app LP_EM_CC1354P10_6 FLASH 774036 774328 292 0.0
RAM 113764 113812 48 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 758320 758612 292 0.0
RAM 113972 114020 48 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 541830 542090 260 0.0
RAM 205152 205296 144 0.1
lock CC3235SF_LAUNCHXL FLASH 575930 576206 276 0.0
RAM 205400 205448 48 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 659957 660237 280 0.0
RAM 75436 75484 48 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 679809 680089 280 0.0
RAM 78076 78124 48 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 679809 680089 280 0.0
RAM 78076 78124 48 0.1
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 636741 637021 280 0.0
RAM 70504 70552 48 0.1
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620189 620477 288 0.0
RAM 71676 71748 72 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 639833 640121 288 0.0
RAM 74220 74300 80 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 639833 640121 288 0.0
RAM 74220 74300 80 0.1
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 639693 639989 296 0.0
RAM 74684 74732 48 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 659417 659713 296 0.0
RAM 77228 77276 48 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 659417 659713 296 0.0
RAM 77228 77276 48 0.1
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616041 616345 304 0.0
RAM 68772 68820 48 0.1
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635893 636197 304 0.0
RAM 71412 71460 48 0.1
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635893 636197 304 0.0
RAM 71412 71460 48 0.1
efr32 lock-app BRD4187C FLASH 940816 941104 288 0.0
RAM 159944 160004 60 0.0
BRD4338a FLASH 734456 734776 320 0.0
RAM 234844 234900 56 0.0
window-app BRD4187C FLASH 1033344 1033664 320 0.0
RAM 128048 128136 88 0.1
esp32 all-clusters-app c3devkit DRAM 98728 98872 144 0.1
FLASH 1594414 1594682 268 0.0
IRAM 83820 83820 0 0.0
m5stack DRAM 117524 117660 136 0.1
FLASH 1561018 1561322 304 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2659017 2660157 1140 0.0
RAM 112304 112632 328 0.3
all-clusters-app debug unknown 5560 5560 0 0.0
FLASH 5980676 5981832 1156 0.0
RAM 516696 517088 392 0.1
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5317024 5318160 1136 0.0
RAM 222680 222944 264 0.1
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4630812 4632010 1198 0.0
RAM 201000 201648 648 0.3
camera-app debug unknown 5456 5456 0 0.0
FLASH 4682134 4683262 1128 0.0
RAM 195968 196200 232 0.1
camera-controller debug unknown 5776 5776 0 0.0
FLASH 11345413 11346299 886 0.0
RAM 597312 597416 104 0.0
chip-tool debug unknown 6112 6112 0 0.0
FLASH 13365471 13366613 1142 0.0
RAM 605952 606056 104 0.0
chip-tool-ipv6only arm64 unknown 22120 22120 0 0.0
FLASH 11551288 11552152 864 0.0
RAM 658632 658696 64 0.0
fabric-admin debug unknown 5800 5800 0 0.0
FLASH 1163666 11637517 854 0.0
RAM 605736 605840 104 0.0
fabric-bridge-app debug unknown 4720 4720 0 0.0
FLASH 4461800 4462980 1180 0.0
RAM 188200 188816 616 0.3
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5578885 5580069 1184 0.0
RAM 471968 472616 648 0.1
lighting-app debug+rpc+ui unknown 6192 6192 0 0.0
FLASH 5525105 5526241 1136 0.0
RAM 205168 205400 232 0.1
lock-app debug unknown 5424 5424 0 0.0
FLASH 4697588 4698710 1122 0.0
RAM 192360 192592 232 0.1
ota-provider-app debug unknown 4760 4760 0 0.0
FLASH 4319734 4320874 1140 0.0
RAM 181016 181216 200 0.1
ota-requestor-app debug unknown 4712 4712 0 0.0
FLASH 4450118 4451284 1166 0.0
RAM 185504 185736 232 0.1
shell debug unknown 4240 4240 0 0.0
FLASH 2957436 2958556 1120 0.0
RAM 145456 145816 360 0.2
thermostat-no-ble arm64 unknown 9456 9456 0 0.0
FLASH 4146712 4147528 816 0.0
RAM 229848 230000 152 0.1
tv-app debug unknown 5752 5752 0 0.0
FLASH 5917765 5918981 1216 0.0
RAM 595400 596080 680 0.1
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11537997 11539725 1728 0.0
RAM 721744 721976 232 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 915844 916104 260 0.0
RAM 167457 167817 360 0.2
nrf7002dk_nrf5340_cpuapp FLASH 908884 908940 56 0.0
RAM 145701 146061 360 0.2
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852628 852872 244 0.0
RAM 141243 141483 240 0.2
nxp contact k32w0+release FLASH 588336 588608 272 0.0
RAM 71004 71056 52 0.1
mcxw71+release FLASH 603560 603840 280 0.0
RAM 63144 63192 48 0.1
light k32w0+release FLASH 614132 614388 256 0.0
RAM 70292 70352 60 0.1
k32w1+release FLASH 687680 687968 288 0.0
RAM 72056 72112 56 0.1
lock mcxw71+release FLASH 752456 752744 288 0.0
RAM 67556 67604 48 0.1
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661380 1661684 304 0.0
RAM 212344 212496 152 0.1
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1565644 1565932 288 0.0
RAM 208560 208656 96 0.0
light cy8ckit_062s2_43012 FLASH 1442380 1442684 304 0.0
RAM 197320 197376 56 0.0
lock cy8ckit_062s2_43012 FLASH 1471276 1471564 288 0.0
RAM 224984 225032 48 0.0
qpg lighting-app qpg6105+debug FLASH 664876 665148 272 0.0
RAM 105180 105232 52 0.0
lock-app qpg6105+debug FLASH 623328 623600 272 0.0
RAM 99792 99844 52 0.1
stm32 light STM32WB5MM-DK FLASH 460952 461232 280 0.1
RAM 141496 141544 48 0.0
telink bridge-app tl7218x FLASH 665726 666014 288 0.0
RAM 90712 90892 180 0.2
contact-sensor-app tlsr9528a_retention FLASH 623308 623632 324 0.1
RAM 31488 31608 120 0.4
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 762082 762418 336 0.0
RAM 40420 40540 120 0.3
light-app-ota-shell-factory-data tl7218x FLASH 755190 755526 336 0.0
RAM 97540 97660 120 0.1
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 682240 682542 302 0.0
RAM 52192 52372 180 0.3
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 710798 711100 302 0.0
RAM 73400 73580 180 0.2
light-switch-app-ota-shell-factory-data tl3218x_retention FLASH 703348 703650 302 0.0
RAM 37664 37844 180 0.5
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 602918 603254 336 0.1
RAM 138640 138760 120 0.1
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 790206 790542 336 0.0
RAM 96388 96508 120 0.1
tizen all-clusters-app arm unknown 5152 5156 4 0.1
FLASH 1783248 1783836 588 0.0
RAM 94168 94412 244 0.3
chip-tool-ubsan arm unknown 11560 11560 0 0.0
FLASH 19092774 19107078 14304 0.1
RAM 8355048 8356012 964 0.0


CHIP_ERROR DescriptorAttrAccess::ReadEndpointUniqueId(EndpointId endpoint, AttributeValueEncoder & aEncoder)
{
char endpointUniqueId[32 + 1] = { 0 };
Copy link
Member

Choose a reason for hiding this comment

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

can we get a consexpr for this 32 with a name that reflect what it is and why it is 32

Comment on lines +1087 to +1090
if (endpointIndex == 0xFFFF)
{
return CHIP_ERROR_NOT_FOUND;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (endpointIndex == 0xFFFF)
{
return CHIP_ERROR_NOT_FOUND;
}
VerifyOrReturnError(endpointIndex != chip::kInvalidEndpointId, CHIP_ERROR_NOT_FOUND);

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple Mar 14, 2025

Choose a reason for hiding this comment

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

No, endpoint indices are not the same as endpoint ids. The documented behavior of emberAfIndexFromEndpoint is:

Will return 0xFFFF if this is not a valid endpoint id or if the endpoint is disabled.

and the right thing to check for is 0xFFFF.

Comment on lines +1122 to +1125
if (endpointIndex == 0xFFFF)
{
return CHIP_ERROR_INVALID_ARGUMENT;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (endpointIndex == 0xFFFF)
{
return CHIP_ERROR_INVALID_ARGUMENT;
}
VerifyOrReturnError(endpointIndex != chip::kInvalidEndpointId, CHIP_ERROR_INVALID_ARGUMENT);

@@ -236,6 +237,8 @@ struct EmberAfDefinedEndpoint
* Span pointing to a list of tags. Lifetime has to outlive usage, and data is owned by callers.
*/
chip::Span<const chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type> tagList;

std::string endpointUniqueId;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not OK to use std::string in general in embedded code. This needs a different representation.

Comment on lines +1087 to +1090
if (endpointIndex == 0xFFFF)
{
return CHIP_ERROR_NOT_FOUND;
}
Copy link
Contributor

@bzbarsky-apple bzbarsky-apple Mar 14, 2025

Choose a reason for hiding this comment

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

No, endpoint indices are not the same as endpoint ids. The documented behavior of emberAfIndexFromEndpoint is:

Will return 0xFFFF if this is not a valid endpoint id or if the endpoint is disabled.

and the right thing to check for is 0xFFFF.

Comment on lines +1121 to +1122
uint16_t endpointIndex = emberAfIndexFromEndpoint(endpoint);
if (endpointIndex == 0xFFFF)
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks wrong to me. Shouldn't it be possible to set the unique ID of a disabled endpoint before enabling it?

But separately: are unique IDs allowed to change? If not, shouldn't the unique ID be part of the "add the endpoint" machinery, not a separate setter?

I know you copy/pasted this stuff from the existing SetTagList bits and whatnot, but those look wrong too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants