mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-07 20:13:21 +08:00
Set inquiry mode only when its feature bit is present
This commit is contained in:
parent
dd3e8a6ab8
commit
14e7b4e9a3
20
hcid/main.c
20
hcid/main.c
@ -252,11 +252,25 @@ static void configure_device(int hdev)
|
||||
}
|
||||
|
||||
/* Set inquiry mode */
|
||||
if ((device_opts->flags & (1 << HCID_SET_INQMODE)) &&
|
||||
(di.features[3] & LMP_RSSI_INQ)) {
|
||||
if ((device_opts->flags & (1 << HCID_SET_INQMODE))) {
|
||||
write_inquiry_mode_cp cp;
|
||||
|
||||
cp.mode = device_opts->inqmode;
|
||||
switch (device_opts->inqmode) {
|
||||
case 2:
|
||||
if (di.features[6] & LMP_EXT_INQ) {
|
||||
cp.mode = 2;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
if (di.features[3] & LMP_RSSI_INQ) {
|
||||
cp.mode = 1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
cp.mode = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
hci_send_cmd(s, OGF_HOST_CTL, OCF_WRITE_INQUIRY_MODE,
|
||||
WRITE_INQUIRY_MODE_CP_SIZE, &cp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user