summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-03-09 16:06:25 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-03-09 16:06:25 +0000
commit64386bf323447b173ed9e6cb444d26af4b7f8db6 (patch)
tree3436803ada3466da105ad43f916f72e2850666a9
parentd9689662976b6e83f4c6ac9baacae98cb32700a1 (diff)
Read BD_ADDR if not set and if it is a raw device
-rw-r--r--tools/hciconfig.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 1cc698d8..d8c40e8f 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -75,6 +75,12 @@ static void print_dev_list(int ctl, int flags)
di.dev_id = (dr+i)->dev_id;
if (ioctl(ctl, HCIGETDEVINFO, (void *) &di) < 0)
continue;
+ if (hci_test_bit(HCI_RAW, &di.flags) &&
+ !bacmp(&di.bdaddr, BDADDR_ANY)) {
+ int dd = hci_open_dev(di.dev_id);
+ hci_read_bd_addr(dd, &di.bdaddr, 1000);
+ hci_close_dev(dd);
+ }
print_dev_info(ctl, &di);
}
}
@@ -1217,6 +1223,13 @@ int main(int argc, char **argv, char **env)
exit(1);
}
+ if (hci_test_bit(HCI_RAW, &di.flags) &&
+ !bacmp(&di.bdaddr, BDADDR_ANY)) {
+ int dd = hci_open_dev(di.dev_id);
+ hci_read_bd_addr(dd, &di.bdaddr, 1000);
+ hci_close_dev(dd);
+ }
+
while (argc > 0) {
for (i = 0; command[i].cmd; i++) {
if (strncmp(command[i].cmd, *argv, 5))