summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/hciconfig.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 9405de08..797cb775 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -666,42 +666,25 @@ void cmd_inq_mode(int ctl, int hdev, char *opt)
memset(&rq, 0, sizeof(rq));
if (opt) {
- write_inquiry_mode_cp cp;
+ uint8_t mode = atoi(opt);
- cp.mode = atoi(opt);
-
- rq.ogf = OGF_HOST_CTL;
- rq.ocf = OCF_WRITE_INQUIRY_MODE;
- rq.cparam = &cp;
- rq.clen = WRITE_INQUIRY_MODE_RP_SIZE;
-
- if (hci_send_req(dd, &rq, 1000) < 0) {
+ if (hci_write_inquiry_mode(dd, mode, 1000) < 0) {
printf("Can't set inquiry mode on hci%d. %s(%d)\n",
hdev, strerror(errno), errno);
exit(1);
}
} else {
- read_inquiry_mode_rp rp;
-
- rq.ogf = OGF_HOST_CTL;
- rq.ocf = OCF_READ_INQUIRY_MODE;
- rq.rparam = &rp;
- rq.rlen = READ_INQUIRY_MODE_RP_SIZE;
+ uint8_t mode;
- if (hci_send_req(dd, &rq, 1000) < 0) {
+ if (hci_read_inquiry_mode(dd, &mode, 1000) < 0) {
printf("Can't read inquiry mode on hci%d. %s(%d)\n",
hdev, strerror(errno), errno);
exit(1);
}
- if (rp.status) {
- printf("Read inquiry mode on hci%d returned status %d\n",
- hdev, rp.status);
- exit(1);
- }
print_dev_hdr(&di);
printf("\tInquiry mode: %s\n",
- rp.mode == 1 ? "Inquiry with RSSI" : "Standard Inquiry");
+ mode == 1 ? "Inquiry with RSSI" : "Standard Inquiry");
}
}