zephyr/samples/bluetooth/hci_usb
Vinayak Kariappa Chettimada d382fca6ff Bluetooth: Controller: Fix HCI command buffer allocation failure
Fix HCI command buffer allocation failure, that can cause
loss of Host Number of Completed Packets command.

Fail by rejecting the HCI Host Buffer Size command if the
required number of HCI command buffers are not allocated in
the Controller implementation.

When Controller to Host data flow control is supported in
the Controller only build, ensure that BT_BUF_CMD_TX_COUNT
is greater than or equal to (BT_BUF_RX_COUNT + Ncmd),
where Ncmd is supported maximum Num_HCI_Command_Packets in
the Controller implementation.

Relates to commit 81614307e9 ("Bluetooth: Add workaround
for no command buffer available")'.

Relates to commit 297f4f481f ("Bluetooth: Split HCI
command & event buffers to two pools").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-02-21 11:30:38 +00:00
..
src usb: device_next: Rename usbd_contex to usbd_context 2024-06-03 06:43:20 -07:00
CMakeLists.txt samples: bluetooth: hci_usb: Use common USB sample initialization 2024-03-20 12:34:46 +01:00
Kconfig samples: bluetooth: hci_usb: Use common USB sample initialization 2024-03-20 12:34:46 +01:00
prj.conf Bluetooth: Controller: Fix HCI command buffer allocation failure 2025-02-21 11:30:38 +00:00
README.rst doc: samples: Adopt code-sample-category across tree 2024-09-23 12:00:00 +02:00
sample.yaml samples: bluetooth: remove outdated platform_exclude 2024-09-17 14:52:03 -04:00
usbd_next_prj.conf samples: bluetooth: hci_usb: Use common USB sample initialization 2024-03-20 12:34:46 +01:00

.. zephyr:code-sample:: bluetooth_hci_usb
   :name: HCI USB
   :relevant-api: hci_raw bluetooth _usb_device_core_api usbd_api

   Turn a Zephyr board into a USB Bluetooth dongle (compatible with all operating systems).

Overview
********

Make a USB Bluetooth dongle out of Zephyr. Requires USB device support from the
board it runs on (e.g. :ref:`nrf52840dk_nrf52840` supports both Bluetooth LE and USB).

Requirements
************

* Bluetooth stack running on the host (e.g. BlueZ)
* A board with Bluetooth and USB support in Zephyr

Building and Running
********************
This sample can be found under :zephyr_file:`samples/bluetooth/hci_usb` in the
Zephyr tree.

See :zephyr:code-sample-category:`bluetooth` samples for details.