diff --git a/samples/bluetooth/hci_usb_h4/CMakeLists.txt b/samples/bluetooth/hci_usb_h4/CMakeLists.txt new file mode 100644 index 00000000000..1c64dd88908 --- /dev/null +++ b/samples/bluetooth/hci_usb_h4/CMakeLists.txt @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.13.1) +include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) +project(hci_usb_h4) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/bluetooth/hci_usb_h4/Kconfig b/samples/bluetooth/hci_usb_h4/Kconfig new file mode 100644 index 00000000000..821c8be2c52 --- /dev/null +++ b/samples/bluetooth/hci_usb_h4/Kconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2019 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config USB_DEVICE_PID + default USB_PID_BLE_HCI_H4_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/bluetooth/hci_usb_h4/README.rst b/samples/bluetooth/hci_usb_h4/README.rst new file mode 100644 index 00000000000..74d5b214715 --- /dev/null +++ b/samples/bluetooth/hci_usb_h4/README.rst @@ -0,0 +1,24 @@ +.. _bluetooth-hci-usb-h4-sample: + +Bluetooth: HCI H4 over USB +########################## + +Overview +******** + +Make a USB H4 Bluetooth dongle out of Zephyr. Requires USB device support from +the board it runs on (e.g. :ref:`nrf52840dk_nrf52840` supports both BLE 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_h4` in +the Zephyr tree. + +See :ref:`bluetooth samples section ` for details. diff --git a/samples/bluetooth/hci_usb_h4/prj.conf b/samples/bluetooth/hci_usb_h4/prj.conf new file mode 100644 index 00000000000..8e0e0b3d321 --- /dev/null +++ b/samples/bluetooth/hci_usb_h4/prj.conf @@ -0,0 +1,8 @@ +CONFIG_STDOUT_CONSOLE=y +CONFIG_GPIO=y +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +CONFIG_USB=y +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_BT_H4=y diff --git a/samples/bluetooth/hci_usb_h4/sample.yaml b/samples/bluetooth/hci_usb_h4/sample.yaml new file mode 100644 index 00000000000..f0cb317064f --- /dev/null +++ b/samples/bluetooth/hci_usb_h4/sample.yaml @@ -0,0 +1,9 @@ +sample: + name: Bluetooth over USB sample +tests: + sample.bluetooth.hci_usb_h4: + harness: bluetooth + depends_on: usb_device ble + tags: usb bluetooth + # FIXME: exclude due to build error + platform_exclude: 96b_carbon diff --git a/samples/bluetooth/hci_usb_h4/src/main.c b/samples/bluetooth/hci_usb_h4/src/main.c new file mode 100644 index 00000000000..98a133a431f --- /dev/null +++ b/samples/bluetooth/hci_usb_h4/src/main.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +void main(void) +{ + int ret; + + ret = usb_enable(NULL); + if (ret != 0) { + printk("Failed to enable USB"); + return; + } + + printk("Bluetooth H:4 over USB sample\n"); +}