@@ -33,7 +33,8 @@ class AppFabricTableDelegate : public chip::FabricTable::Delegate {
3333 {
3434#ifndef CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE
3535 static AppFabricTableDelegate sAppFabricDelegate ;
36- chip::Server::GetInstance ().GetFabricTable ().AddFabricDelegate (&sAppFabricDelegate );
36+ TEMPORARY_RETURN_IGNORED chip::Server::GetInstance ().GetFabricTable ().AddFabricDelegate (
37+ &sAppFabricDelegate );
3738 k_timer_init (&sFabricRemovedTimer , &OnFabricRemovedTimerCallback, nullptr );
3839#endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE
3940 }
@@ -59,35 +60,37 @@ class AppFabricTableDelegate : public chip::FabricTable::Delegate {
5960 {
6061#ifndef CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE
6162 if (chip::Server::GetInstance ().GetFabricTable ().FabricCount () == 0 ) {
62- chip::DeviceLayer::PlatformMgr ().ScheduleWork ([](intptr_t ) {
63+ if (CHIP_NO_ERROR == chip::DeviceLayer::PlatformMgr ().ScheduleWork ([](intptr_t ) {
6364#ifdef CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT
64- chip::Server::GetInstance ().ScheduleFactoryReset ();
65+ chip::Server::GetInstance ().ScheduleFactoryReset ();
6566#elif defined(CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY) || \
6667 defined (CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START)
6768#if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
68- chip::DeviceLayer::ThreadStackMgr ().ClearAllSrpHostAndServices ();
69+ chip::DeviceLayer::ThreadStackMgr ().ClearAllSrpHostAndServices ();
6970#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
70- /* Erase Matter data */
71- chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl ().DoFactoryReset ();
72- /* Erase Network credentials and disconnect */
73- chip::DeviceLayer::ConnectivityMgr ().ErasePersistentInfo ();
71+ /* Erase Matter data */
72+ chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl ().DoFactoryReset ();
73+ /* Erase Network credentials and disconnect */
74+ chip::DeviceLayer::ConnectivityMgr ().ErasePersistentInfo ();
7475#ifdef CONFIG_CHIP_WIFI
75- chip::DeviceLayer::WiFiManager::Instance ().Disconnect ();
76- chip::DeviceLayer::ConnectivityMgr ().ClearWiFiStationProvision ();
76+ chip::DeviceLayer::WiFiManager::Instance ().Disconnect ();
77+ chip::DeviceLayer::ConnectivityMgr ().ClearWiFiStationProvision ();
7778#endif
7879#ifdef CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START
79- /* Start the New BLE advertising */
80- if (!chip::DeviceLayer::ConnectivityMgr ().IsBLEAdvertisingEnabled ()) {
81- if (CHIP_NO_ERROR == chip::Server::GetInstance ()
82- .GetCommissioningWindowManager ()
83- .OpenBasicCommissioningWindow ()) {
84- return ;
85- }
86- }
87- ChipLogError (FabricProvisioning, " Could not start Bluetooth LE advertising" );
80+ /* Start the New BLE advertising */
81+ if (!chip::DeviceLayer::ConnectivityMgr ().IsBLEAdvertisingEnabled ()) {
82+ if (CHIP_NO_ERROR == chip::Server::GetInstance ()
83+ .GetCommissioningWindowManager ()
84+ .OpenBasicCommissioningWindow ()) {
85+ return ;
86+ }
87+ }
88+ ChipLogError (FabricProvisioning, " Could not start Bluetooth LE advertising" );
8889#endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START
8990#endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT
90- });
91+ })) {
92+ ChipLogError (FabricProvisioning, " Could not schedule factory reset" );
93+ }
9194 }
9295#endif // CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE
9396 }
0 commit comments