From 4e37d72b4562ffbfc3e73ef5d9bf0b722e841ab1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 25 Oct 2004 07:37:55 +0000 Subject: Use the library functions for reading and writing the inquiry mode --- tools/hciconfig.c | 27 +++++---------------------- 1 file 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"); } } -- cgit