File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,25 @@ static int bt_esp32_ble_init(void)
303303 return 0 ;
304304}
305305
306+ static int bt_esp32_ble_deinit (void )
307+ {
308+ int ret ;
309+
310+ ret = esp_bt_controller_disable ();
311+ if (ret ) {
312+ LOG_ERR ("Bluetooth controller disable failed %d" , ret );
313+ return ret ;
314+ }
315+
316+ ret = esp_bt_controller_deinit ();
317+ if (ret ) {
318+ LOG_ERR ("Bluetooth controller deinit failed %d" , ret );
319+ return ret ;
320+ }
321+
322+ return 0 ;
323+ }
324+
306325static int bt_esp32_open (void )
307326{
308327 int err ;
@@ -317,10 +336,25 @@ static int bt_esp32_open(void)
317336 return 0 ;
318337}
319338
339+ static int bt_esp32_close (void )
340+ {
341+ int err ;
342+
343+ err = bt_esp32_ble_deinit ();
344+ if (err ) {
345+ return err ;
346+ }
347+
348+ LOG_DBG ("ESP32 BT stopped" );
349+
350+ return 0 ;
351+ }
352+
320353static const struct bt_hci_driver drv = {
321354 .name = "BT ESP32" ,
322355 .open = bt_esp32_open ,
323356 .send = bt_esp32_send ,
357+ .close = bt_esp32_close ,
324358 .bus = BT_HCI_DRIVER_BUS_IPM ,
325359#if defined(CONFIG_BT_DRIVER_QUIRK_NO_AUTO_DLE )
326360 .quirks = BT_QUIRK_NO_AUTO_DLE ,
@@ -329,7 +363,6 @@ static const struct bt_hci_driver drv = {
329363
330364static int bt_esp32_init (void )
331365{
332-
333366 bt_hci_driver_register (& drv );
334367
335368 return 0 ;
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ manifest:
152152 groups :
153153 - hal
154154 - name : hal_espressif
155- revision : 754be4745295a45c26d42c916a8600cdcefddd4e
155+ revision : e98ce93e916eebdc4a0c5bceef864289447e3d63
156156 path : modules/hal/espressif
157157 west-commands : west/west-commands.yml
158158 groups :
You can’t perform that action at this time.
0 commit comments