tile_lib.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * NOTICE
  3. *
  4. * Copyright 2020 Tile Inc. All Rights Reserved.
  5. * All code or other information included in the accompanying files ("Tile Source Material")
  6. * is PROPRIETARY information of Tile Inc. ("Tile") and access and use of the Tile Source Material
  7. * is subject to these terms. The Tile Source Material may only be used for demonstration purposes,
  8. * and may not be otherwise distributed or made available to others, including for commercial purposes.
  9. * Without limiting the foregoing , you understand and agree that no production use
  10. * of the Tile Source Material is allowed without a Tile ID properly obtained under a separate
  11. * agreement with Tile.
  12. * You also understand and agree that Tile may terminate the limited rights granted under these terms
  13. * at any time in its discretion.
  14. * All Tile Source Material is provided AS-IS without warranty of any kind.
  15. * Tile does not warrant that the Tile Source Material will be error-free or fit for your purposes.
  16. * Tile will not be liable for any damages resulting from your use of or inability to use
  17. * the Tile Source Material.
  18. *
  19. * Support: firmware_support@tile.com
  20. */
  21. #ifndef TILE_LIB_H_
  22. #define TILE_LIB_H_
  23. /** @defgroup tile_lib Tile Library API
  24. * @{
  25. * @ingroup TOA
  26. * @brief Tile Library Api
  27. */
  28. /**
  29. * @brief Tile Service UUIDs.
  30. * These are 16-bit UUIDs.
  31. */
  32. #define TILE_SHIPPING_UUID 0xFEEC /** Advertised by Tiles in Shipping Mode. */
  33. #define TILE_ACTIVATED_UUID 0xFEED /** Advertised by Tiles in Activated Mode. */
  34. #define TILE_SERVICE_UUID TILE_ACTIVATED_UUID /** Used to declare Tile Gatt Service. */
  35. #define TILE_SVC_BASE_UUID { 0xC0, 0x91, 0xC4, 0x8D, 0xBD, 0xE7, 0x60, 0xBA, 0xDD, 0xF4, 0xD6, 0x35, 0x00, 0x00, 0x41, 0x9D }
  36. #define TILE_TOA_CMD_UUID { 0xC0, 0x91, 0xC4, 0x8D, 0xBD, 0xE7, 0x60, 0xBA, 0xDD, 0xF4, 0xD6, 0x35, 0x18, 0x00, 0x41, 0x9D }
  37. #define TILE_TOA_RSP_UUID { 0xC0, 0x91, 0xC4, 0x8D, 0xBD, 0xE7, 0x60, 0xBA, 0xDD, 0xF4, 0xD6, 0x35, 0x19, 0x00, 0x41, 0x9D }
  38. #define TILE_TILEID_CHAR_UUID { 0xC0, 0x91, 0xC4, 0x8D, 0xBD, 0xE7, 0x60, 0xBA, 0xDD, 0xF4, 0xD6, 0x35, 0x07, 0x00, 0x41, 0x9D }
  39. #define TILE_DEFAULT_ADV_INT_ACTIVATED 3200 // In 0.625 ms Units
  40. #define TILE_DEFAULT_ADV_INT_SHIPPING 160 // In 0.625 ms Units
  41. /**
  42. * TOA Command and Response characteristics lengths in octets.
  43. */
  44. #define TILE_TOA_CMD_CHAR_LEN 20
  45. #define TILE_TOA_RSP_CHAR_LEN 20
  46. /**
  47. * Attribute ID's associated with each Tile attribute.
  48. */
  49. enum TILE_CHARACTERISTICS
  50. {
  51. TILE_TOA_CMD_CHAR,
  52. TILE_TOA_RSP_CHAR,
  53. TILE_TOA_RSP_CCCD,
  54. TILE_ID_CHAR,
  55. TILE_NUM_ATTRS
  56. };
  57. /**
  58. * Length, in bytes, of the Tile ID.
  59. */
  60. #define TILE_ID_LEN 8
  61. /**
  62. * Length, in bytes, of the hashed_tileID.
  63. */
  64. #define TILE_HASHED_TILEID_LEN 8
  65. /**
  66. * Length, in bytes, of the Tile authentication key.
  67. */
  68. #define TILE_AUTH_KEY_LEN 16
  69. /**
  70. * Length, in bytes, of the Tile identity key.
  71. */
  72. #define TILEID_KEY_LEN 16
  73. /**
  74. * Length of the Tile firmware version string.
  75. */
  76. #define TILE_FIRMWARE_VERSION_LEN 10
  77. /**
  78. * Length of the Tile model number string.
  79. */
  80. #define TILE_MODEL_NUMBER_LEN 10
  81. /**
  82. * Length of the Tile hardware version string.
  83. */
  84. #define TILE_HARDWARE_VERSION_LEN 5
  85. /**
  86. * Length of the Tile BDADDR.
  87. */
  88. #define TILE_BDADDR_LEN 6
  89. #define TILE_SERVICE_DATA_MAX_LENGTH 10
  90. /**
  91. * @brief Error codes returned by Tile Lib functions
  92. */
  93. enum TILE_ERROR_CODES
  94. {
  95. TILE_ERROR_SUCCESS = 0,
  96. TILE_ERROR_NOT_INITIALIZED,
  97. TILE_ERROR_ILLEGAL_SERVICE,
  98. TILE_ERROR_ILLEGAL_PARAM,
  99. TILE_ERROR_ILLEGAL_OPERATION,
  100. TILE_ERROR_BUFFER_TOO_SMALL,
  101. TILE_ERROR_TERMINAL,
  102. TILE_ERROR_REENTRANCY,
  103. TILE_ERROR_NUM_TOA_CHANNELS,
  104. };
  105. /**@}*/
  106. #endif