Diff between e6f9affe72b5a074252f442a1b2bc5cf813f1664 and 54fa756e52fc2140b804b1a347ccacddc01e2d71

Changed Files

File Additions Deletions Status
.gitignore +1 -0 modified
Makefile.tools +3 -1 modified
tools/hwdb.c +61 -0 added

Full Patch

diff --git a/.gitignore b/.gitignore
index dd71f95..7fb8a54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@ profiles/cups/bluetooth
 attrib/gatttool
 tools/avinfo
 tools/bccmd
+tools/hwdb
 tools/ciptool
 tools/hciattach
 tools/hciconfig
diff --git a/Makefile.tools b/Makefile.tools
index f53760d..333c16e 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -133,7 +133,7 @@ endif
 
 if EXPERIMENTAL
 noinst_PROGRAMS += tools/bdaddr tools/avinfo tools/avtest tools/scotest \
-			tools/hcieventmask tools/hcisecfilter \
+			tools/hcieventmask tools/hcisecfilter tools/hwdb \
 			tools/btmgmt tools/btattach tools/btsnoop \
 			tools/btiotest tools/mpris-player
 
@@ -148,6 +148,8 @@ tools_scotest_LDADD = lib/libbluetooth-private.la
 
 tools_hcieventmask_LDADD = lib/libbluetooth-private.la
 
+tools_hwdb_LDADD = lib/libbluetooth-private.la
+
 tools_btmgmt_SOURCES = tools/btmgmt.c src/glib-helper.c src/eir.c
 tools_btmgmt_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@
 
diff --git a/tools/hwdb.c b/tools/hwdb.c
new file mode 100644
index 0000000..3e591f7
--- /dev/null
+++ b/tools/hwdb.c
@@ -0,0 +1,61 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2002-2010  Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include <bluetooth/bluetooth.h>
+
+int main(int argc, char *argv[])
+{
+	uint16_t id;
+
+	printf("# This file is part of systemd.\n");
+	printf("#\n");
+	printf("# Data imported from:\n");
+	printf("#  http://www.bluetooth.org/Technical/AssignedNumbers/identifiers.htm\n");
+	printf("\n");
+
+	for (id = 0;; id++) {
+		char *str;
+
+		str = bt_compidtostr(id);
+		if (!str)
+			break;
+
+		if (!strcmp(str, "internal use"))
+			break;
+
+		if (!strcmp(str, "not assigned"))
+			continue;
+
+		printf("bluetooth:v%04X*\n", id);
+		printf(" ID_VENDOR_FROM_DATABASE=%s\n", str);
+		printf("\n");
+	}
+
+	return 0;
+}