mac_mlme_comm_status.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // Terms and conditions of usage are described in detail in NORDIC
  2. // SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  3. //
  4. // Licensees are granted free, non-transferable use of the information. NO
  5. // WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  6. // the file.
  7. /**
  8. * Copyright (c) 2016 - 2020 Nordic Semiconductor ASA and Luxoft Global Operations Gmbh.
  9. *
  10. * All Rights Reserved.
  11. *
  12. * Redistribution and use in source and binary forms, with or without modification,
  13. * are permitted provided that the following conditions are met:
  14. *
  15. *
  16. * 1. Redistributions of source code must retain the above copyright notice, this
  17. * list of conditions and the following disclaimer.
  18. *
  19. * 2. Redistributions in binary form, except as embedded into a Nordic
  20. * Semiconductor ASA integrated circuit in a product or a software update for
  21. * such product, must reproduce the above copyright notice, this list of
  22. * conditions and the following disclaimer in the documentation and/or other
  23. * materials provided with the distribution.
  24. *
  25. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  26. * contributors may be used to endorse or promote products derived from this
  27. * software without specific prior written permission.
  28. *
  29. * 4. This software, with or without modification, must only be used with a
  30. * Nordic Semiconductor ASA integrated circuit.
  31. *
  32. * 5. Any software provided in binary form under this license must not be reverse
  33. * engineered, decompiled, modified and/or disassembled.
  34. *
  35. *
  36. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  37. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  38. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  39. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  40. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  41. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  42. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  43. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  44. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  46. *
  47. */
  48. #ifndef MAC_MLME_COMM_STATUS_H_INCLUDED
  49. #define MAC_MLME_COMM_STATUS_H_INCLUDED
  50. #include <stdint.h>
  51. #include "mac_common.h"
  52. /** @file
  53. * The MAC Comm Status module declares the MAC communication status indication routine and
  54. * necessary types/macros according to the MAC specification.
  55. *
  56. * @defgroup mac_comm_status MAC MLME Comm Status API
  57. * @ingroup mac_15_4
  58. * @{
  59. * @brief Module to declare MAC MLME Comm Status API.
  60. * @details The MAC Comm Status module declares communication status indication MLME routine and necessary
  61. * macros/types according to the MAC specification. MAC MLME Comm Status indication is declared as
  62. * mlme_comm_status_ind().
  63. */
  64. /**
  65. * @brief MLME-COMM-STATUS.indication
  66. *
  67. * @details The MLME-COMM-STATUS.indication primitive allows the MLME to indicate a
  68. * communication status.
  69. *
  70. * In accordance with IEEE Std 802.15.4-2006, section 7.1.12.1
  71. */
  72. typedef struct
  73. {
  74. /**
  75. * The 16-bit PAN identifier of the device from which the frame was received or to
  76. * which the frame was being sent.
  77. */
  78. uint16_t pan_id;
  79. /**
  80. * The source addressing mode for this primitive. This value can take one of the
  81. * following values:
  82. * @ref mac_addr_mode_t
  83. * 0x00 = no address (addressing fields omitted).
  84. * 0x01 = reserved.
  85. * 0x02 = 16-bit short address.
  86. * 0x03 = 64-bit extended address.
  87. */
  88. mac_addr_mode_t src_addr_mode;
  89. /**
  90. * The individual device address of the entity from which the frame causing the error
  91. * originated.
  92. */
  93. mac_addr_t src_addr;
  94. /**
  95. * The destination addressing mode for this primitive.
  96. * According to 7.1.12.1.1, Table 69.
  97. */
  98. mac_addr_mode_t dst_addr_mode;
  99. /** The individual device address of the device for which the frame was intended. */
  100. mac_addr_t dst_addr;
  101. /** The communications status. */
  102. mac_status_t status;
  103. uint8_t security_level; /**< Security level. */
  104. uint8_t key_id_mode; /**< Key ID mode. */
  105. uint64_t key_source; /**< Key source. */
  106. uint8_t key_index; /**< Key index. */
  107. } mlme_comm_status_ind_t;
  108. /**
  109. * @brief MLME-COMM-STATUS.indication handler
  110. *
  111. * @details The MLME-COMM-STATUS.indication primitive is generated by the MLME and issued to its next higher
  112. * layer either following a transmission instigated through a response primitive or on receipt of a frame that
  113. * generates an error in its security processing (see 7.5.8.2.3).
  114. *
  115. * @param ind MLME-COMM-STATUS.indication structure.
  116. *
  117. * In accordance with IEEE Std 802.15.4-2006, section 7.1.12.1
  118. */
  119. extern void mlme_comm_status_ind(mlme_comm_status_ind_t * ind);
  120. /** @} */
  121. #endif // MAC_MLME_COMM_STATUS_H_INCLUDED