mac_mlme_reset.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * Copyright (c) 2016 - 2020 Nordic Semiconductor ASA and Luxoft Global Operations Gmbh.
  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. *
  10. * 1. Redistributions of source code must retain the above copyright notice, this
  11. * list of conditions and the following disclaimer.
  12. *
  13. * 2. Redistributions in binary form, except as embedded into a Nordic
  14. * Semiconductor ASA integrated circuit in a product or a software update for
  15. * such product, must reproduce the above copyright notice, this list of
  16. * conditions and the following disclaimer in the documentation and/or other
  17. * materials provided with the distribution.
  18. *
  19. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  20. * contributors may be used to endorse or promote products derived from this
  21. * software without specific prior written permission.
  22. *
  23. * 4. This software, with or without modification, must only be used with a
  24. * Nordic Semiconductor ASA integrated circuit.
  25. *
  26. * 5. Any software provided in binary form under this license must not be reverse
  27. * engineered, decompiled, modified and/or disassembled.
  28. *
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  31. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  32. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  33. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  34. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  35. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  36. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  38. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  39. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. *
  41. */
  42. #ifndef MAC_MLME_RESET_H_INCLUDED
  43. #define MAC_MLME_RESET_H_INCLUDED
  44. #include <stdint.h>
  45. #include <stdbool.h>
  46. #include "mac_common.h"
  47. #include "mac_task_scheduler.h"
  48. /** @file
  49. * The MAC MLME Reset module declares the MAC Reset primitives and necessary types
  50. * according to the MAC specification.
  51. *
  52. * @defgroup mac_reset MAC MLME Reset API
  53. * @ingroup mac_15_4
  54. * @{
  55. * @brief Module to declare MAC MLME Reset API.
  56. * @details The MAC Reset module declares MLME Reset primitives and necessary types according to
  57. * the MAC specification. More specifically, MLME Reset request aka mlme_reset_req(), and MLME
  58. * Reset confirm callback typedef aka mlme_reset_conf_cb_t primitives are declared.
  59. */
  60. /**@brief MLME-Reset.confirm
  61. *
  62. * @details The MLME-Reset.confirm primitive reports the results of a request
  63. * to reset MAC layer of the device.
  64. *
  65. * In accordance with IEEE Std 802.15.4-2006, section 7.1.9.2
  66. */
  67. typedef struct
  68. {
  69. mac_status_t status; /**< Status of operation. */
  70. } mlme_reset_conf_t;
  71. /**@brief MLME-RESET.request
  72. *
  73. * @details The MLME-RESET.request primitive allows the next
  74. * higher layer to request that the MLME performs a reset operation.
  75. *
  76. * In accordance with IEEE Std 802.15.4-2006, section 7.1.9.1
  77. */
  78. typedef struct
  79. {
  80. /** Do not edit this field. */
  81. mac_abstract_req_t service;
  82. /** Confirm to this request. */
  83. mlme_reset_conf_t confirm;
  84. bool set_default_pib; /**< Set the default PIB. */
  85. } mlme_reset_req_t;
  86. /**
  87. * @brief MLME-RESET confirm callback
  88. *
  89. * @details The MLME-RESET.confirm primitive is generated by the MLME and
  90. * issued to its next higher layer in response to an MLME-RESET.request primitive and
  91. * following the receipt of the PLME-SET-TRXSTATE.confirm primitive.
  92. *
  93. * @param reset status (@c MAC_SUCCESS only).
  94. *
  95. * In accordance with IEEE Std 802.15.4-2006, section 7.1.9.2
  96. */
  97. typedef void (* mlme_reset_conf_cb_t)(mlme_reset_conf_t *);
  98. /**
  99. * @brief MLME-RESET request
  100. *
  101. * @details The MLME-RESET.request primitive is generated by the next higher layer and
  102. * issued to the MLME to request a reset of the MAC sublayer to its initial conditions.
  103. * The MLME-RESET.request primitive is issued prior to the use of the MLME-START.request
  104. * or the MLME-ASSOCIATE.request primitives.
  105. *
  106. * @param[in] req pointer to MCPS-RESET.request structure.
  107. * @param[in] conf_cb pointer to user callback.
  108. *
  109. * In accordance with IEEE Std 802.15.4-2006, section 7.1.9.1
  110. */
  111. void mlme_reset_req(mlme_reset_req_t * req, mlme_reset_conf_cb_t conf_cb);
  112. /** @} */
  113. #endif // MAC_MLME_RESET_H_INCLUDED