Set inquiry mode only when its feature bit is present

This commit is contained in:
Marcel Holtmann 2005-10-28 13:55:29 +00:00
parent dd3e8a6ab8
commit 14e7b4e9a3

View File

@ -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);
}