Skip to content

Commit

Permalink
ESP32: Fix ble init and deinit flow. (project-chip#37488)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 authored Feb 12, 2025
1 parent c81b3d4 commit d0e4459
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,8 @@ CHIP_ERROR BLEManagerImpl::InitESPBleLayer(void)
SuccessOrExit(err);
#endif

nimble_port_init();
err = MapBLEError(nimble_port_init());
SuccessOrExit(err);

/* Initialize the NimBLE host configuration. */
ble_hs_cfg.reset_cb = bleprph_on_reset;
Expand Down Expand Up @@ -973,7 +974,9 @@ CHIP_ERROR BLEManagerImpl::InitESPBleLayer(void)
void BLEManagerImpl::DeinitESPBleLayer()
{
VerifyOrReturn(DeinitBLE() == CHIP_NO_ERROR);
#ifdef CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING
BLEManagerImpl::ClaimBLEMemory(nullptr, nullptr);
#endif /* CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */
}

void BLEManagerImpl::ClaimBLEMemory(System::Layer *, void *)
Expand Down

0 comments on commit d0e4459

Please sign in to comment.