Skip to content

Commit 6dd40aa

Browse files
committed
Merge branch 'backport-ble-deinit' into 'release/v1.2'
[v1.2] Added an event when BLE is deinitialized and memory is reclaimed See merge request app-frameworks/esp-matter!651
2 parents 0b51594 + ffbf283 commit 6dd40aa

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

components/esp_matter/esp_matter.h

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ enum
127127
/** Signals that operational credentials are changed, which may not be persistent.
128128
Can be used to affect what is needed for UpdateNOC prior to commit */
129129
kFabricUpdated,
130+
/** Signals that BLE is deinitialized and heap memory is reclaimed */
131+
kBLEDeinitialized,
130132
};
131133

132134
} // DeviceEventType

components/esp_matter/esp_matter_core.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ static void deinit_ble_if_commissioned(void)
876876
return;
877877
}
878878
ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed");
879+
PostEvent(chip::DeviceLayer::DeviceEventType::kBLEDeinitialized);
879880
}
880881
#endif /* CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */
881882
}

examples/esp-now_bridge_light/main/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## IDF Component Manager Manifest File
22
dependencies:
3-
espressif/esp-now: ">=2.2.0"
3+
espressif/esp-now: "==2.4.0"
44
## Required IDF version
55
idf:
66
version: ">=4.1.0"

examples/light/main/app_main.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ static void app_event_cb(const ChipDeviceEvent *event, intptr_t arg)
106106
case chip::DeviceLayer::DeviceEventType::kFabricCommitted:
107107
ESP_LOGI(TAG, "Fabric is committed");
108108
break;
109+
110+
case chip::DeviceLayer::DeviceEventType::kBLEDeinitialized:
111+
ESP_LOGI(TAG, "BLE deinitialized and memory reclaimed");
112+
break;
113+
109114
default:
110115
break;
111116
}

0 commit comments

Comments
 (0)