diff --git a/components/esp_matter/esp_matter.h b/components/esp_matter/esp_matter.h index 13f709fa1..3e8864f15 100644 --- a/components/esp_matter/esp_matter.h +++ b/components/esp_matter/esp_matter.h @@ -127,6 +127,8 @@ enum /** Signals that operational credentials are changed, which may not be persistent. Can be used to affect what is needed for UpdateNOC prior to commit */ kFabricUpdated, + /** Signals that BLE is deinitialized and heap memory is reclaimed */ + kBLEDeinitialized, }; } // DeviceEventType diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp index ae55917f6..b8330de09 100644 --- a/components/esp_matter/esp_matter_core.cpp +++ b/components/esp_matter/esp_matter_core.cpp @@ -941,6 +941,7 @@ static void device_callback_internal(const ChipDeviceEvent * event, intptr_t arg return; } ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed"); + PostEvent(chip::DeviceLayer::DeviceEventType::kBLEDeinitialized); } break; #endif /* CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ diff --git a/examples/light/main/app_main.cpp b/examples/light/main/app_main.cpp index ce4428086..96d7ca7d2 100644 --- a/examples/light/main/app_main.cpp +++ b/examples/light/main/app_main.cpp @@ -106,6 +106,11 @@ static void app_event_cb(const ChipDeviceEvent *event, intptr_t arg) case chip::DeviceLayer::DeviceEventType::kFabricCommitted: ESP_LOGI(TAG, "Fabric is committed"); break; + + case chip::DeviceLayer::DeviceEventType::kBLEDeinitialized: + ESP_LOGI(TAG, "BLE deinitialized and memory reclaimed"); + break; + default: break; }