From feb69dcd95584a23d60df4b34e886b66fed4b1c4 Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Mon, 29 Jan 2024 20:51:06 +0800 Subject: [PATCH] add zephyr bluetooth submodule --- .gitmodules | 3 +++ class/wireless/usbh_bluetooth.c | 10 ++++++++++ .../ble_hci_usbh.c | 7 +------ third_party/zephyr_bluetooth-2.7.5/zephyr_bluetooth | 1 + 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 .gitmodules rename third_party/{zephyr_bluetooth-2.x.x => zephyr_bluetooth-2.7.5}/ble_hci_usbh.c (98%) create mode 160000 third_party/zephyr_bluetooth-2.7.5/zephyr_bluetooth diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..f0e9fc77 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "third_party/zephyr_bluetooth-2.7.5/zephyr_bluetooth"] + path = third_party/zephyr_bluetooth-2.7.5/zephyr_bluetooth + url = git@github.com:sakumisu/zephyr_bluetooth.git diff --git a/class/wireless/usbh_bluetooth.c b/class/wireless/usbh_bluetooth.c index 82a2b07e..a774985f 100644 --- a/class/wireless/usbh_bluetooth.c +++ b/class/wireless/usbh_bluetooth.c @@ -392,4 +392,14 @@ CLASS_INFO_DEFINE const struct usbh_class_info bluetooth_h4_nrf_class_info = { .pid = 0x000c, .class_driver = &bluetooth_class_driver }; +#else +CLASS_INFO_DEFINE const struct usbh_class_info bluetooth_class_info = { + .match_flags = USB_CLASS_MATCH_INTF_CLASS | USB_CLASS_MATCH_INTF_SUBCLASS | USB_CLASS_MATCH_INTF_PROTOCOL, + .class = USB_DEVICE_CLASS_WIRELESS, + .subclass = 0x01, + .protocol = 0x01, + .vid = 0x00, + .pid = 0x00, + .class_driver = &bluetooth_class_driver +}; #endif diff --git a/third_party/zephyr_bluetooth-2.x.x/ble_hci_usbh.c b/third_party/zephyr_bluetooth-2.7.5/ble_hci_usbh.c similarity index 98% rename from third_party/zephyr_bluetooth-2.x.x/ble_hci_usbh.c rename to third_party/zephyr_bluetooth-2.7.5/ble_hci_usbh.c index 940fb741..0f30f341 100644 --- a/third_party/zephyr_bluetooth-2.x.x/ble_hci_usbh.c +++ b/third_party/zephyr_bluetooth-2.7.5/ble_hci_usbh.c @@ -1,12 +1,7 @@ #include "usbh_core.h" #include "usbh_bluetooth.h" -#include -#include - -#ifndef CONFIG_BT_RECV_IS_RX_THREAD -#error usb bluetooth must enable CONFIG_BT_RECV_IS_RX_THREAD -#endif +#include /* compatible with low version that less than v2.7.5 */ diff --git a/third_party/zephyr_bluetooth-2.7.5/zephyr_bluetooth b/third_party/zephyr_bluetooth-2.7.5/zephyr_bluetooth new file mode 160000 index 00000000..2549662b --- /dev/null +++ b/third_party/zephyr_bluetooth-2.7.5/zephyr_bluetooth @@ -0,0 +1 @@ +Subproject commit 2549662b2a5b1aa9f2c32e5117890ccf5b40fc2d