tile_tpi_module.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. /** @file tile_tpi_module.h
  22. ** @brief Tile Private Identification API module
  23. */
  24. #ifndef TILE_TPI_MODULE_H_
  25. #define TILE_TPI_MODULE_H_
  26. #include <stdint.h>
  27. #include <stdbool.h>
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /**
  32. * Tile TPI API module.
  33. *
  34. * This module is used by Tile Lib in order to implement PrivateID
  35. */
  36. struct tile_tpi_module
  37. {
  38. /**
  39. * tileID_counter, Maintained by TileLib and persistently stored by the Application at each update.
  40. */
  41. uint16_t* tileID_counter;
  42. /**
  43. * Tile Identity Key. Saved by the Application in persistent memory when the key is refreshed.
  44. * 16 bytes.
  45. */
  46. uint8_t* tileID_key;
  47. /**
  48. * Hashed TileID, Created by TileLib and to be accessed and used by the Application to advertise.
  49. * 8 bytes.
  50. */
  51. uint8_t* hashed_tileID;
  52. /**
  53. * The tileID_counter was incremented and its new value shall be saved into flash by the application.
  54. * Also, Advertising Data need to be updated with the new hashed_tileID.
  55. */
  56. int (*tileID_counter_updated)(void);
  57. };
  58. /**
  59. ****************************************************************************************
  60. * @brief Register TPI Module.
  61. *
  62. * @param[in] module Pointer to the TPI Module struct.
  63. *
  64. ****************************************************************************************
  65. */
  66. int tile_tpi_register(struct tile_tpi_module *module);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif // TILE_TPI_MODULE_H_