summaryrefslogtreecommitdiffstats
path: root/test/bdaddr.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-09-27 15:19:14 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-09-27 15:19:14 +0000
commitd577091a3632210b7c5d8a07bc7698097f0042a6 (patch)
treeb6490ef5521584432f9ce46491aaf43e02cea2ac /test/bdaddr.c
parentca1b11b40db46287fc63024d5bb824d9695c1b67 (diff)
Show the OUI and include a manual page for the bdaddr utility
Diffstat (limited to 'test/bdaddr.c')
-rw-r--r--test/bdaddr.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/test/bdaddr.c b/test/bdaddr.c
index 57d9b005..92b43de8 100644
--- a/test/bdaddr.c
+++ b/test/bdaddr.c
@@ -41,6 +41,8 @@
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
+#include "oui.h"
+
static int transient = 0;
#define OCF_ERICSSON_WRITE_BD_ADDR 0x000d
@@ -246,7 +248,7 @@ int main(int argc, char *argv[])
struct hci_dev_info di;
struct hci_version ver;
bdaddr_t bdaddr;
- char addr[18];
+ char addr[18], oui[9], *comp;
int i, dd, opt, dev = 0, reset = 0;
bacpy(&bdaddr, BDADDR_ANY);
@@ -314,8 +316,17 @@ int main(int argc, char *argv[])
printf("Manufacturer: %s (%d)\n",
bt_compidtostr(ver.manufacturer), ver.manufacturer);
+ ba2oui(&bdaddr, oui);
+ comp = ouitocomp(oui);
+
ba2str(&bdaddr, addr);
- printf("Device address: %s\n", addr);
+ printf("Device address: %s", addr);
+
+ if (comp) {
+ printf(" (%s)\n", comp);
+ free(comp);
+ } else
+ printf("\n");
if (argc < 1) {
hci_close_dev(dd);
@@ -330,8 +341,18 @@ int main(int argc, char *argv[])
for (i = 0; vendor[i].compid != 65535; i++)
if (ver.manufacturer == vendor[i].compid) {
+ ba2oui(&bdaddr, oui);
+ comp = ouitocomp(oui);
+
ba2str(&bdaddr, addr);
- printf("New BD address: %s\n\n", addr);
+ printf("New BD address: %s", addr);
+
+ if (comp) {
+ printf(" (%s)\n\n", comp);
+ free(comp);
+ } else
+ printf("\n\n");
+
if (vendor[i].write_bd_addr(dd, &bdaddr) < 0) {
fprintf(stderr, "Can't write new address\n");