summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-01-29 03:24:48 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-01-29 03:24:48 +0000
commite6589c0f2a6d1dd3060a86a27d859c8fb08bf278 (patch)
treef1d7420e04b4ac7580c9e0e8383f7a8d0c6f9311 /src
parentf1d23ac858b0593afe27e6b8e00a55d92804a6bb (diff)
Add functions for reading the BD_ADDR and the features
Diffstat (limited to 'src')
-rw-r--r--src/hci.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/hci.c b/src/hci.c
index a68f0122..822c7db4 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -1042,6 +1042,52 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to)
return 0;
}
+int hci_read_local_features(int dd, uint8_t *features, int to)
+{
+ read_local_features_rp rp;
+ struct hci_request rq;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_INFO_PARAM;
+ rq.ocf = OCF_READ_LOCAL_FEATURES;
+ rq.rparam = &rp;
+ rq.rlen = READ_LOCAL_FEATURES_RP_SIZE;
+
+ if (hci_send_req(dd, &rq, to) < 0)
+ return -1;
+
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+
+ memcpy(features, rp.features, 8);
+ return 0;
+}
+
+int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to)
+{
+ read_bd_addr_rp rp;
+ struct hci_request rq;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_INFO_PARAM;
+ rq.ocf = OCF_READ_BD_ADDR;
+ rq.rparam = &rp;
+ rq.rlen = READ_BD_ADDR_RP_SIZE;
+
+ if (hci_send_req(dd, &rq, to) < 0)
+ return -1;
+
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+
+ bacpy(bdaddr, &rp.bdaddr);
+ return 0;
+}
+
int hci_read_class_of_dev(int dd, uint8_t *cls, int to)
{
read_class_of_dev_rp rp;