hwdb.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
  7. *
  8. *
  9. */
  10. #ifdef HAVE_CONFIG_H
  11. #include <config.h>
  12. #endif
  13. #include <stdio.h>
  14. #include "lib/bluetooth.h"
  15. static const struct {
  16. uint16_t vendor;
  17. uint16_t product;
  18. const char *str;
  19. } product_table[] = {
  20. { 0x0078, 0x0001, "Nike+ FuelBand" },
  21. { 0x0097, 0x0002, "COOKOO watch" },
  22. { }
  23. };
  24. int main(int argc, char *argv[])
  25. {
  26. uint16_t id;
  27. printf("# This file is part of systemd.\n");
  28. printf("#\n");
  29. printf("# Data imported from:\n");
  30. printf("# http://www.bluetooth.org/Technical/AssignedNumbers/identifiers.htm\n");
  31. for (id = 0;; id++) {
  32. const char *str;
  33. int i;
  34. str = bt_compidtostr(id);
  35. if (!str)
  36. break;
  37. if (!strcmp(str, "internal use"))
  38. break;
  39. if (!strcmp(str, "not assigned"))
  40. continue;
  41. printf("\n");
  42. printf("bluetooth:v%04X*\n", id);
  43. printf(" ID_VENDOR_FROM_DATABASE=%s\n", str);
  44. for (i = 0; product_table[i].str; i++) {
  45. if (product_table[i].vendor != id)
  46. continue;
  47. printf("\n");
  48. printf("bluetooth:v%04Xp%04X*\n",
  49. id, product_table[i].product);
  50. printf(" ID_PRODUCT_FROM_DATABASE=%s\n",
  51. product_table[i].str);
  52. }
  53. }
  54. return 0;
  55. }