es_slot_reg.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /**
  2. * Copyright (c) 2016 - 2020, Nordic Semiconductor ASA
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form, except as embedded into a Nordic
  13. * Semiconductor ASA integrated circuit in a product or a software update for
  14. * such product, must reproduce the above copyright notice, this list of
  15. * conditions and the following disclaimer in the documentation and/or other
  16. * materials provided with the distribution.
  17. *
  18. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * 4. This software, with or without modification, must only be used with a
  23. * Nordic Semiconductor ASA integrated circuit.
  24. *
  25. * 5. Any software provided in binary form under this license must not be reverse
  26. * engineered, decompiled, modified and/or disassembled.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  29. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef ES_SLOT_REG_H__
  41. #define ES_SLOT_REG_H__
  42. #include <stdint.h>
  43. #include "es_slot.h"
  44. /**
  45. * @file
  46. * @addtogroup eddystone_slot
  47. * @{
  48. */
  49. /** @brief Function for checking if an eTLM frame is required.
  50. *
  51. * @param[in] p_reg Pointer to the slot registry.
  52. *
  53. * @retval true If an eTLM frame is required.
  54. * @retval false Otherwise.
  55. */
  56. bool es_slot_reg_etlm_required(const es_slot_reg_t * p_reg);
  57. /** @brief Function for clearing a slot.
  58. *
  59. * @param[in] p_reg Pointer to the slot registry.
  60. * @param[in] slot_no The slot number to clear.
  61. *
  62. * @retval true If an EID slot was cleared.
  63. */
  64. bool es_slot_reg_clear_slot(es_slot_reg_t * p_reg, uint8_t slot_no);
  65. /** @brief Function for updating the state of the slot registry after adding a slot.
  66. *
  67. * @param[in] p_reg Pointer to the slot registry.
  68. * @param[in] slot_no The slot number that was added.
  69. * @param[in] frame_type The frame type that was added.
  70. * @param[in] init Information if the data is loaded during initialization. Set this
  71. * parameter to false if the call is a result of a write to the Eddystone Configuration Service.
  72. */
  73. void es_slot_reg_update_slot_list_info_on_add(es_slot_reg_t * p_reg, uint8_t slot_no, es_frame_type_t frame_type, bool init);
  74. /** @brief Function for initializing the slot registry.
  75. *
  76. * @param[in] p_reg Pointer to the slot registry to initialize.
  77. */
  78. void es_slot_reg_init(es_slot_reg_t * p_reg);
  79. /**
  80. * @}
  81. */
  82. #endif // ES_SLOT_REG_H__