summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-05-17 17:12:30 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-05-17 17:12:30 +0000
commitbf19cd7953fbc8cc916b9514d8f11fc8557f0cec (patch)
tree9ae7fc1ab342cf4032bbc891b11767f4dd901993
parent8e9ea9b77e3c4eaf1f1813cfa1e275c7b7ef219a (diff)
Add hci_devba function
-rw-r--r--include/hci_lib.h1
-rw-r--r--src/hci.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/include/hci_lib.h b/include/hci_lib.h
index ecf180be..02c56a1f 100644
--- a/include/hci_lib.h
+++ b/include/hci_lib.h
@@ -61,6 +61,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to);
inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags);
int hci_devinfo(int dev_id, struct hci_dev_info *di);
+int hci_devba(int dev_id, bdaddr_t *ba);
int hci_local_name(int dd, int len, char *name, int to);
int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to);
diff --git a/src/hci.c b/src/hci.c
index 6af14864..426eb91e 100644
--- a/src/hci.c
+++ b/src/hci.c
@@ -369,6 +369,22 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di)
return err;
}
+int hci_devba(int dev_id, bdaddr_t *ba)
+{
+ struct hci_dev_info di;
+
+ if (hci_devinfo(dev_id, &di))
+ return -1;
+
+ if (!hci_test_bit(HCI_UP, &di.flags)) {
+ errno = ENETDOWN;
+ return -1;
+ }
+
+ bacpy(ba, &di.bdaddr);
+ return 0;
+}
+
inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags)
{
struct hci_inquiry_req *ir;