[Telink] Fixed hanging on BLE Shutdown (TC-SC-4.1) (#30152)
* [Telink] Fixed hanging on BLE Shutdown (TC-SC-4.1)
Refactored BLE shutdown condition to pass test TC-SC-4.1.
Device would become stuck at scheduler routines after open-basic-commissioning-window time expires.
Signed-off-by: Dmytro Huz <dmytro.huz@telink-semi.com>
* Restyled by clang-format
---------
Signed-off-by: Dmytro Huz <dmytro.huz@telink-semi.com>
Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/src/platform/telink/BLEManagerImpl.cpp b/src/platform/telink/BLEManagerImpl.cpp
index c0fb499..220501a 100644
--- a/src/platform/telink/BLEManagerImpl.cpp
+++ b/src/platform/telink/BLEManagerImpl.cpp
@@ -180,8 +180,11 @@
void BLEManagerImpl::_Shutdown()
{
- bt_disable();
- mBLERadioInitialized = false;
+ if (mBLERadioInitialized)
+ {
+ bt_disable();
+ mBLERadioInitialized = false;
+ }
}
void BLEManagerImpl::DriveBLEState(intptr_t arg)