我从中国那里得到了一个假的dongle Bt4.0,并尝试了这个线程的程序:蓝牙信标问题
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Device: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
bcdDevice: 88.91
Kernel: 5.10.3-051003-generic
usb-devices | awk '/0a12/' RS=
T: Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0a12 ProdID=0001 Rev=88.91
S: Product=BT DONGLE10
C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#=0x0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I: If#=0x1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
但是即使在修补程序之后,我也通过hcidump获得了下面的错误:
HCI Event: Command Complete (0x0e) plen 4
Set Event Filter (0x03|0x0005) ncmd 1
status 0x12
Error: Invalid HCI Command Parameters
检查它:https://bugzilla.kernel.org/show_bug.cgi?id=60824#c155
“Pi上的相同设备和相同的问题。”更改#define lmp_bredr_capable(dev)
中的hci_core.h
以返回false就成功了。
我不知道如何做#define lmp_bredr_capable(dev)。有人能帮忙吗?
我完全可以测试它。
发布于 2021-01-03 13:41:25
我通过评论hci_core.c的296和297行(加上补丁)来解决我的问题。
static void bredr_setup(struct hci_request *req)
{
__le16 param;
__u8 flt_type;
/* Read Buffer Size (ACL mtu, max pkt, etc.) */
hci_req_add(req, HCI_OP_READ_BUFFER_SIZE, 0, NULL);
/* Read Class of Device */
hci_req_add(req, HCI_OP_READ_CLASS_OF_DEV, 0, NULL);
/* Read Local Name */
hci_req_add(req, HCI_OP_READ_LOCAL_NAME, 0, NULL);
/* Read Voice Setting */
hci_req_add(req, HCI_OP_READ_VOICE_SETTING, 0, NULL);
/* Read Number of Supported IAC */
hci_req_add(req, HCI_OP_READ_NUM_SUPPORTED_IAC, 0, NULL);
/* Read Current IAC LAP */
hci_req_add(req, HCI_OP_READ_CURRENT_IAC_LAP, 0, NULL);
/* Clear Event Filters */
//flt_type = HCI_FLT_CLEAR_ALL; HERE!!
//hci_req_add(req, HCI_OP_SET_EVENT_FLT, 1, &flt_type);
/* Connection accept timeout ~20 secs */
param = cpu_to_le16(0x7d00);
hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, ¶m);
也许"#define lmp_bredr_capable(dev) 0“也有效。但我不确定。我仍然运行bredr_setup(),但绕过了清除事件筛选步骤..。
中是个难题。
https://askubuntu.com/questions/1304165
复制相似问题