summaryrefslogtreecommitdiff
path: root/src/oui.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-12-08 23:48:30 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-12-08 23:48:30 +0100
commitd47f4a0410e30c97ba14f426b879da36b72db908 (patch)
tree139def6098b2499c330d026eddeb98166f30cc1b /src/oui.c
parent61afd46c8576660df9f41a4993ddbc0f040251e2 (diff)
core: Introduce batocomp helper function
Diffstat (limited to 'src/oui.c')
-rw-r--r--src/oui.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/oui.c b/src/oui.c
index 2f9c4a7a5..945d81206 100644
--- a/src/oui.c
+++ b/src/oui.c
@@ -34,6 +34,8 @@
#include <sys/stat.h>
#include <sys/mman.h>
+#include <bluetooth/bluetooth.h>
+
#include "oui.h"
/* http://standards.ieee.org/regauth/oui/oui.txt */
@@ -88,3 +90,12 @@ char *ouitocomp(const char *oui)
return str;
}
+
+char *batocomp(const bdaddr_t *ba)
+{
+ char oui[9];
+
+ sprintf(oui, "%2.2X-%2.2X-%2.2X", ba->b[5], ba->b[4], ba->b[3]);
+
+ return ouitocomp(oui);
+}