summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-06-16 13:53:08 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-06-16 13:53:08 +0000
commitf38a7523b3e2ec2109cd5c5f65803da5a354da03 (patch)
tree0140e68c4ecd4dce4177d62fd2b3c8a1db6c0cb6 /src
parente8c8131bc6c67b3592a5b5ec1882f2d8abf00608 (diff)
Add support for reading and writing the inquiry scan type
Diffstat (limited to 'src')
-rw-r--r--src/hci.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/hci.c b/src/hci.c
index 60898e9b..b52b53fa 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -1564,6 +1564,57 @@ int hci_exit_park_mode(int dd, uint16_t handle, int to)
return 0;
}
+int hci_read_inquiry_scan_type(int dd, uint8_t *type, int to)
+{
+ read_inquiry_scan_type_rp rp;
+ struct hci_request rq;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_HOST_CTL;
+ rq.ocf = OCF_READ_INQUIRY_SCAN_TYPE;
+ rq.rparam = &rp;
+ rq.rlen = READ_INQUIRY_SCAN_TYPE_RP_SIZE;
+
+ if (hci_send_req(dd, &rq, to) < 0)
+ return -1;
+
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+
+ *type = rp.type;
+ return 0;
+}
+
+int hci_write_inquiry_scan_type(int dd, uint8_t type, int to)
+{
+ write_inquiry_scan_type_cp cp;
+ write_inquiry_scan_type_rp rp;
+ struct hci_request rq;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.type = type;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_HOST_CTL;
+ rq.ocf = OCF_WRITE_INQUIRY_SCAN_TYPE;
+ rq.cparam = &cp;
+ rq.clen = WRITE_INQUIRY_SCAN_TYPE_CP_SIZE;
+ rq.rparam = &rp;
+ rq.rlen = WRITE_INQUIRY_SCAN_TYPE_RP_SIZE;
+
+ if (hci_send_req(dd, &rq, to) < 0)
+ return -1;
+
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+
int hci_read_inquiry_mode(int dd, uint8_t *mode, int to)
{
read_inquiry_mode_rp rp;