Skip to content

Commit

Permalink
setdeviceinstanceinfoprovider use factorydataprovider by default (#25706
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pankore authored Mar 23, 2023
1 parent 7f356db commit ed32443
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 0 additions & 2 deletions examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ extern "C" void ChipTest(void)

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
#if CONFIG_ENABLE_AMEBA_FACTORY_DATA
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
#endif

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);

Expand Down
9 changes: 6 additions & 3 deletions examples/chef/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ extern "C" void ChipTest(void)

initPref();

// Initialize device attestation, commissionable data and device instance info
// TODO: Use our own DeviceInstanceInfoProvider
// SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
mFactoryDataProvider.Init();
SetCommissionableDataProvider(&mFactoryDataProvider);
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

err = deviceMgr.Init(&EchoCallbacks);
Expand All @@ -144,6 +143,10 @@ extern "C" void ChipTest(void)
ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n");
}

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);

statusLED1.Init(STATUS_LED_GPIO_NUM);
Expand Down
9 changes: 6 additions & 3 deletions examples/light-switch-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ extern "C" void ChipTest(void)

initPref();

// Initialize device attestation, commissionable data and device instance info
// TODO: Use our own DeviceInstanceInfoProvider
// SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
mFactoryDataProvider.Init();
SetCommissionableDataProvider(&mFactoryDataProvider);
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

err = deviceMgr.Init(&EchoCallbacks);
Expand All @@ -149,6 +148,10 @@ extern "C" void ChipTest(void)
ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n");
}

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);

statusLED1.Init(STATUS_LED_GPIO_NUM);
Expand Down
9 changes: 6 additions & 3 deletions examples/lighting-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@ extern "C" void ChipTest(void)

initPref();

// Initialize device attestation, commissionable data and device instance info
// TODO: Use our own DeviceInstanceInfoProvider
// SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
mFactoryDataProvider.Init();
SetCommissionableDataProvider(&mFactoryDataProvider);
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

err = deviceMgr.Init(&EchoCallbacks);
Expand All @@ -165,6 +164,10 @@ extern "C" void ChipTest(void)
ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n");
}

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);

statusLED1.Init(STATUS_LED_GPIO_NUM);
Expand Down
8 changes: 5 additions & 3 deletions examples/ota-requestor-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ extern "C" void ChipTest(void)

initPref();

// Initialize device attestation, commissionable data and device instance info
// TODO: Use our own DeviceInstanceInfoProvider
// SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
mFactoryDataProvider.Init();
SetCommissionableDataProvider(&mFactoryDataProvider);
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);

Expand All @@ -112,5 +110,9 @@ extern "C" void ChipTest(void)
ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n");
}

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);
}

0 comments on commit ed32443

Please sign in to comment.