mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 08:14:28 +08:00
autopair: Add more common PIN codes for audio devices
PIN codes "1111", and "1234" are fairly common PIN codes used for audio devices such as speakers and headsets. This replaces similar quirks already present in gnome-bluetooth's PIN database.
This commit is contained in:
parent
b9b070ff30
commit
c8ef6d8abe
@ -92,10 +92,20 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
|
||||
case 0x06: /* Headphones */
|
||||
case 0x07: /* Portable Audio */
|
||||
case 0x0a: /* HiFi Audio Device */
|
||||
if (attempt > 1)
|
||||
return 0;
|
||||
memcpy(pinbuf, "0000", 4);
|
||||
return 4;
|
||||
{
|
||||
const char *pincodes[] = {
|
||||
"0000",
|
||||
"1234",
|
||||
"1111"
|
||||
};
|
||||
const char *pincode;
|
||||
|
||||
if (attempt > G_N_ELEMENTS(pincodes))
|
||||
return 0;
|
||||
pincode = pincodes[attempt - 1];
|
||||
memcpy(pinbuf, pincode, strlen(pincode));
|
||||
return strlen(pincode);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user