From edea4da5b92fb3f06f7afcf168f242166122de05 Mon Sep 17 00:00:00 2001 From: zwl Date: Fri, 30 Aug 2024 11:46:13 +0800 Subject: [PATCH] fix(ble): fixed crash issue during deinit host after deinit controller on ESP32-C2 --- .../bt/porting/transport/driver/vhci/hci_driver_standard.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/bt/porting/transport/driver/vhci/hci_driver_standard.c b/components/bt/porting/transport/driver/vhci/hci_driver_standard.c index 2cdab4359e..5e9d02af94 100644 --- a/components/bt/porting/transport/driver/vhci/hci_driver_standard.c +++ b/components/bt/porting/transport/driver/vhci/hci_driver_standard.c @@ -139,6 +139,10 @@ esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback) void esp_vhci_host_send_packet(uint8_t *data, uint16_t len) { + if (esp_bt_controller_get_status() != ESP_BT_CONTROLLER_STATUS_ENABLED) { + return; + } + hci_driver_vhci_tx(data[0], data, len, HCI_DRIVER_DIR_H2C); }