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:
parent
2534ab11c0
commit
33cb1cc399
6 changed files with 77 additions and 0 deletions
7
samples/bluetooth/hci_usb_h4/CMakeLists.txt
Normal file
7
samples/bluetooth/hci_usb_h4/CMakeLists.txt
Normal 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)
|
7
samples/bluetooth/hci_usb_h4/Kconfig
Normal file
7
samples/bluetooth/hci_usb_h4/Kconfig
Normal 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"
|
24
samples/bluetooth/hci_usb_h4/README.rst
Normal file
24
samples/bluetooth/hci_usb_h4/README.rst
Normal 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.
|
8
samples/bluetooth/hci_usb_h4/prj.conf
Normal file
8
samples/bluetooth/hci_usb_h4/prj.conf
Normal 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
|
9
samples/bluetooth/hci_usb_h4/sample.yaml
Normal file
9
samples/bluetooth/hci_usb_h4/sample.yaml
Normal 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
|
22
samples/bluetooth/hci_usb_h4/src/main.c
Normal file
22
samples/bluetooth/hci_usb_h4/src/main.c
Normal 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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue