Skip to content

Commit 3905d38

Browse files
committed
Revert "Platform Event when ble is deinitialized (project-chip#33186) (project-chip#33211)"
This reverts commit 0ac02ea. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent ff507c6 commit 3905d38

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

examples/platform/esp32/common/CommonDeviceCallbacks.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i
4141
{
4242
switch (event->Type)
4343
{
44-
case DeviceEventType::kBLEDeinitialized:
45-
ESP_LOGI(TAG, "BLE is deinitialized");
46-
break;
47-
4844
case DeviceEventType::kInternetConnectivityChange:
4945
OnInternetConnectivityChange(event);
5046
break;

src/include/platform/CHIPDeviceEvent.h

-5
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,6 @@ enum PublicEventTypes
245245
* sending messages to other nodes.
246246
*/
247247
kServerReady,
248-
249-
/**
250-
* Signals that BLE is deinitialized.
251-
*/
252-
kBLEDeinitialized,
253248
};
254249

255250
/**

src/platform/ESP32/nimble/BLEManagerImpl.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -1027,20 +1027,17 @@ void BLEManagerImpl::ClaimBLEMemory(System::Layer *, void *)
10271027

10281028
VerifyOrReturn(err == ESP_OK, ChipLogError(DeviceLayer, "BLE deinit failed"));
10291029
ChipLogProgress(DeviceLayer, "BLE deinit successful and memory reclaimed");
1030-
1031-
ChipDeviceEvent event;
1032-
event.Type = DeviceEventType::kBLEDeinitialized;
1033-
VerifyOrDo(CHIP_NO_ERROR == PlatformMgr().PostEvent(&event), ChipLogError(DeviceLayer, "Failed to post BLE deinit event"));
1030+
// TODO: post an event when ble is deinitialized and memory is added to heap
10341031
}
10351032
}
10361033

10371034
CHIP_ERROR BLEManagerImpl::DeinitBLE()
10381035
{
1039-
esp_err_t err = ESP_OK;
10401036
VerifyOrReturnError(ble_hs_is_enabled(), CHIP_ERROR_INCORRECT_STATE, ChipLogProgress(DeviceLayer, "BLE already deinited"));
10411037
VerifyOrReturnError(0 == nimble_port_stop(), MapBLEError(ESP_FAIL), ChipLogError(DeviceLayer, "nimble_port_stop() failed"));
10421038

1043-
nimble_port_deinit();
1039+
esp_err_t err = nimble_port_deinit();
1040+
VerifyOrReturnError(err == ESP_OK, MapBLEError(err));
10441041

10451042
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
10461043
err = esp_nimble_hci_and_controller_deinit();

0 commit comments

Comments
 (0)