Ho un falso dongle BT 4.0 dalla Cina e provo la procedura da questo thread:problema dongle Bluetooth
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
Ma anche dopo la patch, ricevo l'errore di seguito tramite hcidump:
HCI Event: Command Complete (0x0e) plen 4
Set Event Filter (0x03|0x0005) ncmd 1
status 0x12
Error: Invalid HCI Command Parameters
Controllalo:https://bugzilla.kernel.org/show_bug.cgi?id=60824#c155
“Stesso dispositivo e stesso problema su Pi Zero. “Cambiare il #define lmp_bredr_capable(dev)
in hci_core.h
restituire false ha funzionato."
Non so come farlo #define lmp_bredr_capable(dev). Qualcuno potrebbe aiutarmi?
Sono pienamente disponibile per testarlo.
Risposta accettata:
ho risolto il mio problema commentando le righe 296 e 297 di hci_core.c (più patch).
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);
Forse anche "#define lmp_bredr_capable(dev) 0" funziona. Ma non sono sicuro. Eseguo ancora bredr_setup() ma ignoro il passaggio del filtro degli eventi di cancellazione...
obs:funziona perfettamente per 2 giorni. Unico problema, non riesco a trasformarlo in un profilo HSP\HSP ma penso che sia un'altra storia (anche dopo l'ofono gambiarra). Il Bluetooth in Linux è una rottura di $..
Correlati:come aggiungere un utente esistente a un gruppo esistente in Ubuntu?