diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-12-27 23:42:42 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-12-27 23:42:42 -0800 |
commit | 54fa756e52fc2140b804b1a347ccacddc01e2d71 (patch) | |
tree | 5a6388c803868bcbff6900178b0d83c94a961710 /tools/hwdb.c | |
parent | e6f9affe72b5a074252f442a1b2bc5cf813f1664 (diff) | |
download | bluez-54fa756e52fc2140b804b1a347ccacddc01e2d71.tar.gz |
tools: Add utility for creating hwdb from company identifiers
Diffstat (limited to 'tools/hwdb.c')
-rw-r--r-- | tools/hwdb.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tools/hwdb.c b/tools/hwdb.c new file mode 100644 index 000000000..3e591f78f --- /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; +} |