Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
wy-hh committed Feb 11, 2025
1 parent 7dcc136 commit 8901df4
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/platform/bouffalolab/BL616/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ bool ThreadStackManagerImpl::IsInitialized()
return sInstance.mThreadStackLock != NULL;
}

void ThreadStackManagerImpl::FactoryResetThreadStack(void)
{
VerifyOrReturn(ThreadStackMgrImpl().OTInstance() != NULL);
otInstanceFactoryReset(ThreadStackMgrImpl().OTInstance());
}

} // namespace DeviceLayer
} // namespace chip

Expand Down
6 changes: 6 additions & 0 deletions src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ bool ThreadStackManagerImpl::IsInitialized()
return sInstance.mThreadStackLock != NULL;
}

void ThreadStackManagerImpl::FactoryResetThreadStack(void)
{
VerifyOrReturn(ThreadStackMgrImpl().OTInstance() != NULL);
otInstanceFactoryReset(ThreadStackMgrImpl().OTInstance());
}

} // namespace DeviceLayer
} // namespace chip

Expand Down
6 changes: 6 additions & 0 deletions src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ bool ThreadStackManagerImpl::IsInitialized()
return sInstance.mThreadStackLock != NULL;
}

void ThreadStackManagerImpl::FactoryResetThreadStack(void)
{
VerifyOrReturn(ThreadStackMgrImpl().OTInstance() != NULL);
otInstanceFactoryReset(ThreadStackMgrImpl().OTInstance());
}

} // namespace DeviceLayer
} // namespace chip

Expand Down
11 changes: 11 additions & 0 deletions src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ void ConfigurationManagerImpl::RunConfigUnitTest(void)
BLConfig::RunConfigUnitTest();
}

#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
void ConfigurationManagerImpl::ClearThreadStack()
{
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
ThreadStackMgr().ClearAllSrpHostAndServices();
#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
ChipLogProgress(DeviceLayer, "Clearing Thread provision");
ThreadStackMgr().ErasePersistentInfo();
}
#endif

void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
{
CHIP_ERROR err;
Expand Down
4 changes: 4 additions & 0 deletions src/platform/bouffalolab/common/ConfigurationManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp
CHIP_ERROR StoreTotalOperationalHours(uint32_t totalOperationalHours);
bool IsFullyProvisioned();

#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
void ClearThreadStack();
#endif

private:
// ===== Members that implement the ConfigurationManager private interface.

Expand Down
1 change: 1 addition & 0 deletions src/platform/bouffalolab/common/ThreadStackManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ThreadStackManagerImpl final : public ThreadStackManager,

using ThreadStackManager::InitThreadStack;
CHIP_ERROR InitThreadStack(otInstance * otInst);
void FactoryResetThreadStack(void);

private:
// ===== Methods that implement the ThreadStackManager abstract interface.
Expand Down

0 comments on commit 8901df4

Please sign in to comment.