Skip to content

Commit 7ca2072

Browse files
asm5878carlescufi
authored andcommitted
drivers: bluetooth: hci: Fix stm32wb BLE behavior
Implementing HCI setup function to have a correct and proper initialization procedure to fix #75318 issue Signed-off-by: Alessandro Manganaro <[email protected]>
1 parent c1235bb commit 7ca2072

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

drivers/bluetooth/hci/ipm_stm32wb.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,16 +565,27 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
565565
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
566566
0, K_NO_WAIT);
567567

568+
hci->recv = recv;
569+
570+
LOG_DBG("IPM Channel Open Completed");
571+
572+
return 0;
573+
}
574+
575+
static int bt_ipm_setup(const struct device *dev, const struct bt_hci_setup_params *params)
576+
{
577+
ARG_UNUSED(params);
578+
ARG_UNUSED(dev);
579+
int err;
580+
568581
#ifdef CONFIG_BT_HCI_HOST
569582
err = bt_ipm_ble_init();
570583
if (err) {
571584
return err;
572585
}
573586
#endif /* CONFIG_BT_HCI_HOST */
574587

575-
hci->recv = recv;
576-
577-
LOG_DBG("IPM Channel Open Completed");
588+
LOG_DBG("IPM Channel Setup Completed");
578589

579590
return 0;
580591
}
@@ -613,6 +624,7 @@ static const struct bt_hci_driver_api drv = {
613624
.close = bt_ipm_close,
614625
#endif
615626
.send = bt_ipm_send,
627+
.setup = bt_ipm_setup,
616628
};
617629

618630
static int _bt_ipm_init(const struct device *dev)

0 commit comments

Comments
 (0)