Skip to content

Commit

Permalink
drivers: bluetooth: hci: Fix stm32wb BLE behavior
Browse files Browse the repository at this point in the history
Implementing HCI setup function to have a correct and proper
initialization procedure to fix #75318 issue

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
(cherry picked from commit 7ca2072)
  • Loading branch information
asm5878 authored and nashif committed Aug 6, 2024
1 parent 67a6217 commit d698d40
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions drivers/bluetooth/hci/ipm_stm32wb.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,27 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
0, K_NO_WAIT);

hci->recv = recv;

LOG_DBG("IPM Channel Open Completed");

return 0;
}

static int bt_ipm_setup(const struct device *dev, const struct bt_hci_setup_params *params)
{
ARG_UNUSED(params);
ARG_UNUSED(dev);
int err;

#ifdef CONFIG_BT_HCI_HOST
err = bt_ipm_ble_init();
if (err) {
return err;
}
#endif /* CONFIG_BT_HCI_HOST */

hci->recv = recv;

LOG_DBG("IPM Channel Open Completed");
LOG_DBG("IPM Channel Setup Completed");

return 0;
}
Expand Down Expand Up @@ -613,6 +624,7 @@ static const struct bt_hci_driver_api drv = {
.close = bt_ipm_close,
#endif
.send = bt_ipm_send,
.setup = bt_ipm_setup,
};

static int _bt_ipm_init(const struct device *dev)
Expand Down

0 comments on commit d698d40

Please sign in to comment.