Bluetooth: hci_usb_h4: Add sample for USB_PID_BLE_HCI_H4_SAMPLE

This sample select CONFIG_USB_PID_BLE_HCI_H4_SAMPLE to use H4 over bulk
endpoints.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2020-02-05 15:10:21 -08:00 committed by Johan Hedberg
commit 33cb1cc399
6 changed files with 77 additions and 0 deletions

View file

@ -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)

View file

@ -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"

View file

@ -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 <bluetooth-samples>` for details.

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2020 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <sys/printk.h>
#include <usb/usb_device.h>
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");
}