Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Telink] Fix restart BLE adv after commissioning fail (#28606)
Browse files Browse the repository at this point in the history
serhiiSalamakha authored and pull[bot] committed Oct 17, 2023
1 parent e3eacf2 commit 2399472
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
@@ -157,6 +157,7 @@ class AppFabricTableDelegate : public FabricTable::Delegate
{
if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0)
{
bool isCommissioningFailed = chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen();
ChipLogProgress(DeviceLayer, "Performing erasing of settings partition");

#ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_NVS
@@ -168,9 +169,12 @@ class AppFabricTableDelegate : public FabricTable::Delegate
status = nvs_clear(static_cast<nvs_fs *>(storage));
}

if (!status)
if (!isCommissioningFailed)
{
status = nvs_mount(static_cast<nvs_fs *>(storage));
if (!status)
{
status = nvs_mount(static_cast<nvs_fs *>(storage));
}
}

if (status)
@@ -187,6 +191,10 @@ class AppFabricTableDelegate : public FabricTable::Delegate

ConnectivityMgr().ErasePersistentInfo();
#endif
if (isCommissioningFailed)
{
PlatformMgr().Shutdown();
}
}
}
};

0 comments on commit 2399472

Please sign in to comment.