Skip to content

Commit 6e344ba

Browse files
loopjfabiobaltieri
authored andcommitted
drivers: bluetooth: hci: silabs: Implement hci_close
Implements HCI close support for the silabs efr32 HCI driver. Calling `bt_disable()` now works as expected, which is particularly important for multiprotocol applications. Signed-off-by: James Smith <[email protected]>
1 parent 68afaf5 commit 6e344ba

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/bluetooth/hci/hci_silabs_efr32.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,18 @@ static int slz_bt_open(const struct device *dev, bt_hci_recv_t recv)
327327
return ret;
328328
}
329329

330+
static int slz_bt_close(const struct device *dev)
331+
{
332+
k_thread_abort(&slz_ll_thread);
333+
k_thread_abort(&slz_rx_thread);
334+
335+
sl_btctrl_deinit();
336+
337+
LOG_DBG("SiLabs BT HCI stopped");
338+
339+
return 0;
340+
}
341+
330342
bool sli_pending_btctrl_events(void)
331343
{
332344
return false; /* TODO: check if this should really return false! */
@@ -346,6 +358,7 @@ void BTLE_LL_EventRaise(uint32_t events)
346358

347359
static DEVICE_API(bt_hci, drv) = {
348360
.open = slz_bt_open,
361+
.close = slz_bt_close,
349362
.send = slz_bt_send,
350363
};
351364

0 commit comments

Comments
 (0)