diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-03-09 16:06:25 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-03-09 16:06:25 +0000 |
commit | 64386bf323447b173ed9e6cb444d26af4b7f8db6 (patch) | |
tree | 3436803ada3466da105ad43f916f72e2850666a9 | |
parent | d9689662976b6e83f4c6ac9baacae98cb32700a1 (diff) |
Read BD_ADDR if not set and if it is a raw device
-rw-r--r-- | tools/hciconfig.c | 13 |
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)) |