summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-10-25 07:37:55 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-10-25 07:37:55 +0000
commit4e37d72b4562ffbfc3e73ef5d9bf0b722e841ab1 (patch)
tree80e1930924a85331d7b81d5ea9dc28a118c74f3b /tools
parent7e08a09c87660616b173f338aff9baf3f7b61f5d (diff)
Use the library functions for reading and writing the inquiry 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");
}
}