Skip to content

Commit cd83499

Browse files
jadhavrohit924ratgr
authored andcommitted
ESP32: Fix ble init and deinit flow. (project-chip#37488)
1 parent 1f6578c commit cd83499

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/platform/ESP32/nimble/BLEManagerImpl.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,8 @@ CHIP_ERROR BLEManagerImpl::InitESPBleLayer(void)
925925
SuccessOrExit(err);
926926
#endif
927927

928-
nimble_port_init();
928+
err = MapBLEError(nimble_port_init());
929+
SuccessOrExit(err);
929930

930931
/* Initialize the NimBLE host configuration. */
931932
ble_hs_cfg.reset_cb = bleprph_on_reset;
@@ -973,7 +974,9 @@ CHIP_ERROR BLEManagerImpl::InitESPBleLayer(void)
973974
void BLEManagerImpl::DeinitESPBleLayer()
974975
{
975976
VerifyOrReturn(DeinitBLE() == CHIP_NO_ERROR);
977+
#ifdef CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING
976978
BLEManagerImpl::ClaimBLEMemory(nullptr, nullptr);
979+
#endif /* CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */
977980
}
978981

979982
void BLEManagerImpl::ClaimBLEMemory(System::Layer *, void *)

0 commit comments

Comments
 (0)