summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-06-18 18:15:13 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-06-18 18:15:13 +0000
commitd316a5fbab4a41ce3f8321eef407db9c53b57e85 (patch)
tree9ba83af819b9491225fcc41229485185acd65959 /src
parent4837bd7e9ba55361aeca45610a160dd107d5be2f (diff)
Added hci_devid function.
Diffstat (limited to 'src')
-rw-r--r--src/hci.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hci.c b/src/hci.c
index bc645686..f72ef760 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -399,6 +399,14 @@ static int __other_bdaddr(int s, int dev_id, long arg)
return bacmp((bdaddr_t *)arg, &di.bdaddr);
}
+static int __same_bdaddr(int s, int dev_id, long arg)
+{
+ struct hci_dev_info di = {dev_id: dev_id};
+ if (ioctl(s, HCIGETDEVINFO, (void*) &di))
+ return 0;
+ return !bacmp((bdaddr_t *)arg, &di.bdaddr);
+}
+
int hci_get_route(bdaddr_t *bdaddr)
{
if (bdaddr)
@@ -407,6 +415,11 @@ int hci_get_route(bdaddr_t *bdaddr)
return hci_for_each_dev(HCI_UP, NULL, 0);
}
+int hci_devid(bdaddr_t *bdaddr)
+{
+ return hci_for_each_dev(HCI_UP, __same_bdaddr, (long) bdaddr);
+}
+
int hci_devinfo(int dev_id, struct hci_dev_info *di)
{
int s, err;