diff options
author | Max Krasnyansky <maxk@qualcomm.com> | 2002-06-18 18:15:13 +0000 |
---|---|---|
committer | Max Krasnyansky <maxk@qualcomm.com> | 2002-06-18 18:15:13 +0000 |
commit | d316a5fbab4a41ce3f8321eef407db9c53b57e85 (patch) | |
tree | 9ba83af819b9491225fcc41229485185acd65959 /src | |
parent | 4837bd7e9ba55361aeca45610a160dd107d5be2f (diff) |
Added hci_devid function.
Diffstat (limited to 'src')
-rw-r--r-- | src/hci.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |