summaryrefslogtreecommitdiffstats
path: root/hcid/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-10-28 13:55:29 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-10-28 13:55:29 +0000
commit14e7b4e9a3c868b3bded7b08488aac89210984a6 (patch)
treeefe44f3c944cae753bc50d0bd79d0eed230a7b79 /hcid/main.c
parentdd3e8a6ab8938c4d8f62765e7c03a005807fbb64 (diff)
Set inquiry mode only when its feature bit is present
Diffstat (limited to 'hcid/main.c')
-rw-r--r--hcid/main.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/hcid/main.c b/hcid/main.c
index d3d285da..ca123bb0 100644
--- a/hcid/main.c
+++ b/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);
}