Skip to content

Commit

Permalink
[Telink] Fix restart BLE adv after basic commissioning fail (#28808)
Browse files Browse the repository at this point in the history
* [Telink] Fix restart BLE adv after basic commissioning fail

* Restyled by whitespace

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 15, 2024
1 parent 2c52c85 commit 3033613
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class AppFabricTableDelegate : public FabricTable::Delegate
{
if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0)
{
bool isCommissioningFailed = chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen();
bool isBasicCommissioningMode = chip::Server::GetInstance().GetCommissioningWindowManager().GetCommissioningMode() ==
Dnssd::CommissioningMode::kEnabledBasic;
ChipLogProgress(DeviceLayer, "Performing erasing of settings partition");

#ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_NVS
Expand All @@ -169,7 +170,7 @@ class AppFabricTableDelegate : public FabricTable::Delegate
status = nvs_clear(static_cast<nvs_fs *>(storage));
}

if (!isCommissioningFailed)
if (!isBasicCommissioningMode)
{
if (!status)
{
Expand All @@ -191,7 +192,7 @@ class AppFabricTableDelegate : public FabricTable::Delegate

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

0 comments on commit 3033613

Please sign in to comment.