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

[linux] Set DeviceInfoProvider before Server::Init to setup the stora… #21803

Merged
merged 1 commit into from
Aug 15, 2022
Merged

[linux] Set DeviceInfoProvider before Server::Init to setup the stora… #21803

merged 1 commit into from
Aug 15, 2022

Conversation

yufengwangca
Copy link
Contributor

@yufengwangca yufengwangca commented Aug 10, 2022

…ge of DeviceInfoProvider properly.

Problem

What is being fixed? Examples:

  • We have initialization sequence issue in Linux example app. We setup the storage delegate of DeviceInfoprovider in Server::Init (this is common to all platforms) which need DeviceInfoProvider get setup first.
    deviceInfoprovider = DeviceLayer::GetDeviceInfoProvider();
    if (deviceInfoprovider)
    {
        deviceInfoprovider->SetStorageDelegate(mDeviceStorage);
    }
  • But we setup DeviceInfoProvider after Server::Init in ChipLinuxAppMainLoop
    // Init ZCL Data Model and CHIP App Server
    Server::GetInstance().Init(initParams);
    DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
  • I saw we force setup SetStorageDelegate again in ChipLinuxAppMainLoop to workaround this issue, but it does not fix the initialization order issue , we need to first setup DeviceInfoProvider then setup the storage delegate of DeviceInfoProvider.

Change overview

Set DeviceInfoProvider before Server::Init to setup the storage of DeviceInfoProvider properly

Testing

How was this tested? (at least one bullet point required)

  • Verify the userlabel can be read properly from DeviceInfoProvider
. /chip-tool userlabel read label-list 12344321 0
[1660154187.682463][1583886:1583891] CHIP:DMG: ReportDataMessage =
[1660154187.682478][1583886:1583891] CHIP:DMG: {
[1660154187.682489][1583886:1583891] CHIP:DMG:  AttributeReportIBs =
[1660154187.682508][1583886:1583891] CHIP:DMG:  [
[1660154187.682522][1583886:1583891] CHIP:DMG:      AttributeReportIB =
[1660154187.682540][1583886:1583891] CHIP:DMG:      {
[1660154187.682553][1583886:1583891] CHIP:DMG:          AttributeDataIB =
[1660154187.682568][1583886:1583891] CHIP:DMG:          {
[1660154187.682583][1583886:1583891] CHIP:DMG:              DataVersion = 0x24ff1d32,
[1660154187.682597][1583886:1583891] CHIP:DMG:              AttributePathIB =
[1660154187.682613][1583886:1583891] CHIP:DMG:              {
[1660154187.682627][1583886:1583891] CHIP:DMG:                  Endpoint = 0x0,
[1660154187.682642][1583886:1583891] CHIP:DMG:                  Cluster = 0x41,
[1660154187.682657][1583886:1583891] CHIP:DMG:                  Attribute = 0x0000_0000,
[1660154187.682671][1583886:1583891] CHIP:DMG:              }
[1660154187.682687][1583886:1583891] CHIP:DMG:                  
[1660154187.682701][1583886:1583891] CHIP:DMG:              Data = [
[1660154187.682716][1583886:1583891] CHIP:DMG:                      
[1660154187.682731][1583886:1583891] CHIP:DMG:              ],
[1660154187.682745][1583886:1583891] CHIP:DMG:          },
[1660154187.682762][1583886:1583891] CHIP:DMG:          
[1660154187.682775][1583886:1583891] CHIP:DMG:      },
[1660154187.682799][1583886:1583891] CHIP:DMG:      
[1660154187.682811][1583886:1583891] CHIP:DMG:      AttributeReportIB =
[1660154187.682830][1583886:1583891] CHIP:DMG:      {
[1660154187.682843][1583886:1583891] CHIP:DMG:          AttributeDataIB =
[1660154187.682856][1583886:1583891] CHIP:DMG:          {
[1660154187.682870][1583886:1583891] CHIP:DMG:              DataVersion = 0x24ff1d32,
[1660154187.682883][1583886:1583891] CHIP:DMG:              AttributePathIB =
[1660154187.682897][1583886:1583891] CHIP:DMG:              {
[1660154187.682911][1583886:1583891] CHIP:DMG:                  Endpoint = 0x0,
[1660154187.682925][1583886:1583891] CHIP:DMG:                  Cluster = 0x41,
[1660154187.682940][1583886:1583891] CHIP:DMG:                  Attribute = 0x0000_0000,
[1660154187.682954][1583886:1583891] CHIP:DMG:                  ListIndex = Null,
[1660154187.682968][1583886:1583891] CHIP:DMG:              }
[1660154187.682983][1583886:1583891] CHIP:DMG:                  
[1660154187.682997][1583886:1583891] CHIP:DMG:              Data = 
[1660154187.683012][1583886:1583891] CHIP:DMG:              {
[1660154187.683028][1583886:1583891] CHIP:DMG:                  0x0 = "label1" (6 chars), 
[1660154187.683043][1583886:1583891] CHIP:DMG:                  0x1 = "value1" (6 chars), 
[1660154187.683059][1583886:1583891] CHIP:DMG:              },
[1660154187.683072][1583886:1583891] CHIP:DMG:          },
[1660154187.683091][1583886:1583891] CHIP:DMG:          
[1660154187.683103][1583886:1583891] CHIP:DMG:      },
[1660154187.683130][1583886:1583891] CHIP:DMG:      
[1660154187.683142][1583886:1583891] CHIP:DMG:      AttributeReportIB =
[1660154187.683162][1583886:1583891] CHIP:DMG:      {
[1660154187.683174][1583886:1583891] CHIP:DMG:          AttributeDataIB =
[1660154187.683187][1583886:1583891] CHIP:DMG:          {
[1660154187.683201][1583886:1583891] CHIP:DMG:              DataVersion = 0x24ff1d32,
[1660154187.683214][1583886:1583891] CHIP:DMG:              AttributePathIB =
[1660154187.683228][1583886:1583891] CHIP:DMG:              {
[1660154187.683241][1583886:1583891] CHIP:DMG:                  Endpoint = 0x0,
[1660154187.683255][1583886:1583891] CHIP:DMG:                  Cluster = 0x41,
[1660154187.683270][1583886:1583891] CHIP:DMG:                  Attribute = 0x0000_0000,
[1660154187.683301][1583886:1583891] CHIP:DMG:                  ListIndex = Null,
[1660154187.683315][1583886:1583891] CHIP:DMG:              }
[1660154187.683331][1583886:1583891] CHIP:DMG:                  
[1660154187.683344][1583886:1583891] CHIP:DMG:              Data = 
[1660154187.683359][1583886:1583891] CHIP:DMG:              {
[1660154187.683374][1583886:1583891] CHIP:DMG:                  0x0 = "label2" (6 chars), 
[1660154187.683389][1583886:1583891] CHIP:DMG:                  0x1 = "value2" (6 chars), 
[1660154187.683403][1583886:1583891] CHIP:DMG:              },
[1660154187.683416][1583886:1583891] CHIP:DMG:          },
[1660154187.683436][1583886:1583891] CHIP:DMG:          
[1660154187.683448][1583886:1583891] CHIP:DMG:      },
[1660154187.683467][1583886:1583891] CHIP:DMG:      
[1660154187.683479][1583886:1583891] CHIP:DMG:  ],
[1660154187.683510][1583886:1583891] CHIP:DMG:  
[1660154187.683523][1583886:1583891] CHIP:DMG:  SuppressResponse = true, 
[1660154187.683537][1583886:1583891] CHIP:DMG:  InteractionModelRevision = 1
[1660154187.683549][1583886:1583891] CHIP:DMG: }
[1660154187.683827][1583886:1583891] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0041 Attribute 0x0000_0000 DataVersion: 620698930
[1660154187.683892][1583886:1583891] CHIP:TOO:   label list: 2 entries
[1660154187.683916][1583886:1583891] CHIP:TOO:     [1]: {
[1660154187.683928][1583886:1583891] CHIP:TOO:       Label: label1
[1660154187.683940][1583886:1583891] CHIP:TOO:       Value: value1
[1660154187.683953][1583886:1583891] CHIP:TOO:      }
[1660154187.683969][1583886:1583891] CHIP:TOO:     [2]: {
[1660154187.683981][1583886:1583891] CHIP:TOO:       Label: label2
[1660154187.683993][1583886:1583891] CHIP:TOO:       Value: value2
[1660154187.684004][1583886:1583891] CHIP:TOO:      }


@github-actions
Copy link

github-actions bot commented Aug 10, 2022

PR #21803: Size comparison from 57d8d89 to 6febaae

Increases (1 build for esp32)
platform target config section 57d8d89 6febaae change % change
esp32 all-clusters-app c3devkit (read only) 1026616 1026618 2 0.0
.flash.text 1026616 1026618 2 0.0
Decreases (9 builds for linux, telink)
platform target config section 57d8d89 6febaae change % change
linux all-clusters-app debug (read only) 3027977 3027961 -16 -0.0
.text 2575474 2575458 -16 -0.0
all-clusters-minimal-app debug (read only) 2867769 2867737 -32 -0.0
.text 2417842 2417810 -32 -0.0
lighting-app debug+rpc (read only) 2590849 2590817 -32 -0.0
.text 2200978 2200946 -32 -0.0
lock-app debug (read only) 2574793 2574761 -32 -0.0
.text 2171890 2171858 -32 -0.0
ota-provider-app debug (read only) 2352049 2352017 -32 -0.0
.text 1980258 1980226 -32 -0.0
ota-requestor-app debug (read only) 2517425 2517393 -32 -0.0
.text 2129938 2129906 -32 -0.0
thermostat-no-ble arm64 (read only) 2351772 2351740 -32 -0.0
.text 1974528 1974496 -32 -0.0
tv-app debug (read only) 3170041 3170009 -32 -0.0
.text 2722002 2721970 -32 -0.0
telink lighting-app tlsr9518adk80d (read/write) 828440 828432 -8 -0.0
text 588294 588290 -4 -0.0
Full report (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 57d8d89 6febaae change % change
bl602 lighting-app bl602 (read/write) 1380570 1380570 0 0.0
.bss 119762 119762 0 0.0
.data 4480 4480 0 0.0
.text 1048728 1048728 0 0.0
bl602+rpc (read/write) 1425818 1425818 0 0.0
.bss 127202 127202 0 0.0
.data 4600 4600 0 0.0
.text 1080228 1080228 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 671343 671343 0 0.0
(read/write) 180048 180048 0 0.0
.bss 74284 74284 0 0.0
.data 3372 3372 0 0.0
.rodata 88471 88471 0 0.0
.text 582556 582556 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 636743 636743 0 0.0
(read/write) 157860 157860 0 0.0
.bss 73572 73572 0 0.0
.data 3372 3372 0 0.0
.rodata 77727 77727 0 0.0
.text 558692 558692 0 0.0
lock-ftd LP_CC2652R7 (read only) 673051 673051 0 0.0
(read/write) 168532 168532 0 0.0
.bss 71364 71364 0 0.0
.data 3296 3296 0 0.0
.rodata 76411 76411 0 0.0
.text 596160 596160 0 0.0
lock-mtd LP_CC2652R7 (read only) 655667 655667 0 0.0
(read/write) 181604 181604 0 0.0
.bss 67052 67052 0 0.0
.data 3296 3296 0 0.0
.rodata 101363 101363 0 0.0
.text 553824 553824 0 0.0
pump-app LP_CC2652R7 (read only) 683307 683307 0 0.0
(read/write) 159084 159084 0 0.0
.bss 71404 71404 0 0.0
.data 3296 3296 0 0.0
.rodata 89315 89315 0 0.0
.text 593508 593508 0 0.0
pump-controller-app LP_CC2652R7 (read only) 667759 667759 0 0.0
(read/write) 174752 174752 0 0.0
.bss 71524 71524 0 0.0
.data 3292 3292 0 0.0
.rodata 84863 84863 0 0.0
.text 582416 582416 0 0.0
shell LP_CC2652R7 (read only) 664018 664018 0 0.0
(read/write) 182892 182892 0 0.0
.bss 76604 76604 0 0.0
.data 3376 3376 0 0.0
.rodata 85418 85418 0 0.0
.text 578284 578284 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 585118 585118 0 0.0
.app_xip_area 461904 461904 0 0.0
.bss 65656 65656 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) 590918 590918 0 0.0
.app_xip_area 462920 462920 0 0.0
.bss 70440 70440 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) 597466 597466 0 0.0
.app_xip_area 474972 474972 0 0.0
.bss 64968 64968 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) 1097132 1097132 0 0.0
.bss 132860 132860 0 0.0
.data 2068 2068 0 0.0
.text 962180 962180 0 0.0
BRD4161A+rpc (read/write) 1151412 1151412 0 0.0
.bss 149548 149548 0 0.0
.data 2280 2280 0 0.0
.text 999564 999564 0 0.0
BRD4161A+rs911x (read/write) 986644 986644 0 0.0
.bss 162200 162200 0 0.0
.data 2056 2056 0 0.0
.text 822368 822368 0 0.0
lock-app BRD4161A+wf200 (read/write) 1136980 1136980 0 0.0
.bss 144840 144840 0 0.0
.data 2064 2064 0 0.0
.text 990056 990056 0 0.0
window-app BRD4161A (read/write) 1088584 1088584 0 0.0
.bss 134292 134292 0 0.0
.data 2096 2096 0 0.0
.text 952176 952176 0 0.0
esp32 all-clusters-app c3devkit (read only) 1026616 1026618 2 0.0
(read/write) 1487482 1487482 0 0.0
.dram0.bss 70360 70360 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 217080 217080 0 0.0
.flash.text 1026616 1026618 2 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1079907 1079907 0 0.0
(read/write) 489440 489440 0 0.0
.dram0.bss 75864 75864 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 247436 247436 0 0.0
.flash.text 1074523 1074523 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 644076 644076 0 0.0
.bss 69728 69728 0 0.0
.data 2044 2044 0 0.0
.text 569576 569576 0 0.0
lock k32w0+release (read/write) 701364 701364 0 0.0
.bss 70200 70200 0 0.0
.data 2052 2052 0 0.0
.text 626384 626384 0 0.0
linux all-clusters-app debug (read only) 3027977 3027961 -16 -0.0
(read/write) 155760 155760 0 0.0
.bss 61888 61888 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85416 85416 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 273547 273547 0 0.0
.text 2575474 2575458 -16 -0.0
all-clusters-minimal-app debug (read only) 2867769 2867737 -32 -0.0
(read/write) 147496 147496 0 0.0
.bss 61152 61152 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78008 78008 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1152 1152 0 0.0
.rodata 273675 273675 0 0.0
.text 2417842 2417810 -32 -0.0
bridge-app debug+rpc (read only) 2366929 2366929 0 0.0
(read/write) 127456 127456 0 0.0
.bss 50624 50624 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67368 67368 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 202600 202600 0 0.0
.text 2001826 2001826 0 0.0
chip-tool debug (read only) 10605713 10605713 0 0.0
(read/write) 648480 648480 0 0.0
.bss 24856 24856 0 0.0
.data 3266 3266 0 0.0
.data.rel.ro 613832 613832 0 0.0
.dynamic 608 608 0 0.0
.got 5104 5104 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 543989 543989 0 0.0
.text 8560564 8560564 0 0.0
chip-tool-ipv6only arm64 (read only) 10014540 10014540 0 0.0
(read/write) 696209 696209 0 0.0
.bss 32897 32897 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 641392 641392 0 0.0
.dynamic 560 560 0 0.0
.got 13672 13672 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 474444 474444 0 0.0
.text 7907908 7907908 0 0.0
lighting-app debug+rpc (read only) 2590849 2590817 -32 -0.0
(read/write) 130048 130048 0 0.0
.bss 49760 49760 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72248 72248 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 219280 219280 0 0.0
.text 2200978 2200946 -32 -0.0
lock-app debug (read only) 2574793 2574761 -32 -0.0
(read/write) 125416 125416 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69416 69416 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 236368 236368 0 0.0
.text 2171890 2171858 -32 -0.0
ota-provider-app debug (read only) 2352049 2352017 -32 -0.0
(read/write) 118848 118848 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63224 63224 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 208440 208440 0 0.0
.text 1980258 1980226 -32 -0.0
ota-requestor-app debug (read only) 2517425 2517393 -32 -0.0
(read/write) 127192 127192 0 0.0
.bss 50304 50304 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68632 68632 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 848 848 0 0.0
.rodata 215040 215040 0 0.0
.text 2129938 2129906 -32 -0.0
shell debug (read only) 2596345 2596345 0 0.0
(read/write) 141912 141912 0 0.0
.bss 57800 57800 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77024 77024 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1032 1032 0 0.0
.rodata 233650 233650 0 0.0
.text 2204466 2204466 0 0.0
thermostat-no-ble arm64 (read only) 2351772 2351740 -32 -0.0
(read/write) 141681 141681 0 0.0
.bss 55313 55313 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75880 75880 0 0.0
.dynamic 560 560 0 0.0
.got 5040 5040 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 139716 139716 0 0.0
.text 1974528 1974496 -32 -0.0
tv-app debug (read only) 3170041 3170009 -32 -0.0
(read/write) 257872 257872 0 0.0
.bss 167480 167480 0 0.0
.data 4736 4736 0 0.0
.data.rel.ro 79096 79096 0 0.0
.dynamic 608 608 0 0.0
.got 4864 4864 0 0.0
.init 27 27 0 0.0
.init_array 1072 1072 0 0.0
.rodata 258248 258248 0 0.0
.text 2722002 2721970 -32 -0.0
tv-casting-app debug (read only) 5410729 5410729 0 0.0
(read/write) 158992 158992 0 0.0
.bss 51448 51448 0 0.0
.data 2432 2432 0 0.0
.data.rel.ro 98672 98672 0 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 341521 341521 0 0.0
.text 4800882 4800882 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2452976 2452976 0 0.0
.bss 214572 214572 0 0.0
.data 5872 5872 0 0.0
.text 1415620 1415620 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1178359 1178359 0 0.0
bss 143230 143230 0 0.0
rodata 142776 142776 0 0.0
text 813520 813520 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1158383 1158383 0 0.0
bss 142468 142468 0 0.0
rodata 134472 134472 0 0.0
text 802508 802508 0 0.0
p6 all-clusters-app default (read only) 881512 881512 0 0.0
(read/write) 1694476 1694476 0 0.0
.bss 149176 149176 0 0.0
.data 2656 2656 0 0.0
.text 1534256 1534256 0 0.0
all-clusters-minimal-app default (read only) 882232 882232 0 0.0
(read/write) 1638516 1638516 0 0.0
.bss 148456 148456 0 0.0
.data 2656 2656 0 0.0
.text 1479016 1479016 0 0.0
light-app default (read only) 890552 890552 0 0.0
(read/write) 1557348 1557348 0 0.0
.bss 140344 140344 0 0.0
.data 2448 2448 0 0.0
.text 1406168 1406168 0 0.0
lock-app default (read only) 886056 886056 0 0.0
(read/write) 1594516 1594516 0 0.0
.bss 144824 144824 0 0.0
.data 2464 2464 0 0.0
.text 1438840 1438840 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 806472 806472 0 0.0
bss 70976 70976 0 0.0
noinit 43488 43488 0 0.0
text 570178 570178 0 0.0
lighting-app tlsr9518adk80d (read/write) 828440 828432 -8 -0.0
bss 71832 71832 0 0.0
noinit 43488 43488 0 0.0
text 588294 588290 -4 -0.0

@woody-apple woody-apple merged commit e1d596e into project-chip:master Aug 15, 2022
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 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.

5 participants