ble_hci.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without modification,
  6. * are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. *
  11. * 2. Redistributions in binary form, except as embedded into a Nordic
  12. * Semiconductor ASA integrated circuit in a product or a software update for
  13. * such product, must reproduce the above copyright notice, this list of
  14. * conditions and the following disclaimer in the documentation and/or other
  15. * materials provided with the distribution.
  16. *
  17. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  18. * contributors may be used to endorse or promote products derived from this
  19. * software without specific prior written permission.
  20. *
  21. * 4. This software, with or without modification, must only be used with a
  22. * Nordic Semiconductor ASA integrated circuit.
  23. *
  24. * 5. Any software provided in binary form under this license must not be reverse
  25. * engineered, decompiled, modified and/or disassembled.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  28. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  29. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  30. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  31. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  32. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  33. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  34. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  35. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  36. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. */
  38. /**
  39. @addtogroup BLE_COMMON
  40. @{
  41. */
  42. #ifndef BLE_HCI_H__
  43. #define BLE_HCI_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /** @defgroup BLE_HCI_STATUS_CODES Bluetooth status codes
  48. * @{ */
  49. #define BLE_HCI_STATUS_CODE_SUCCESS 0x00 /**< Success. */
  50. #define BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND 0x01 /**< Unknown BLE Command. */
  51. #define BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER 0x02 /**< Unknown Connection Identifier. */
  52. /*0x03 Hardware Failure
  53. 0x04 Page Timeout
  54. */
  55. #define BLE_HCI_AUTHENTICATION_FAILURE 0x05 /**< Authentication Failure. */
  56. #define BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING 0x06 /**< Pin or Key missing. */
  57. #define BLE_HCI_MEMORY_CAPACITY_EXCEEDED 0x07 /**< Memory Capacity Exceeded. */
  58. #define BLE_HCI_CONNECTION_TIMEOUT 0x08 /**< Connection Timeout. */
  59. /*0x09 Connection Limit Exceeded
  60. 0x0A Synchronous Connection Limit To A Device Exceeded
  61. 0x0B ACL Connection Already Exists*/
  62. #define BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED 0x0C /**< Command Disallowed. */
  63. /*0x0D Connection Rejected due to Limited Resources
  64. 0x0E Connection Rejected Due To Security Reasons
  65. 0x0F Connection Rejected due to Unacceptable BD_ADDR
  66. 0x10 Connection Accept Timeout Exceeded
  67. 0x11 Unsupported Feature or Parameter Value*/
  68. #define BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS 0x12 /**< Invalid BLE Command Parameters. */
  69. #define BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION 0x13 /**< Remote User Terminated Connection. */
  70. #define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES 0x14 /**< Remote Device Terminated Connection due to low resources.*/
  71. #define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF 0x15 /**< Remote Device Terminated Connection due to power off. */
  72. #define BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION 0x16 /**< Local Host Terminated Connection. */
  73. /*
  74. 0x17 Repeated Attempts
  75. 0x18 Pairing Not Allowed
  76. 0x19 Unknown LMP PDU
  77. */
  78. #define BLE_HCI_UNSUPPORTED_REMOTE_FEATURE 0x1A /**< Unsupported Remote Feature. */
  79. /*
  80. 0x1B SCO Offset Rejected
  81. 0x1C SCO Interval Rejected
  82. 0x1D SCO Air Mode Rejected*/
  83. #define BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS 0x1E /**< Invalid LMP Parameters. */
  84. #define BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR 0x1F /**< Unspecified Error. */
  85. /*0x20 Unsupported LMP Parameter Value
  86. 0x21 Role Change Not Allowed
  87. */
  88. #define BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT 0x22 /**< LMP Response Timeout. */
  89. #define BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION 0x23 /**< LMP Error Transaction Collision/LL Procedure Collision. */
  90. #define BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED 0x24 /**< LMP PDU Not Allowed. */
  91. /*0x25 Encryption Mode Not Acceptable
  92. 0x26 Link Key Can Not be Changed
  93. 0x27 Requested QoS Not Supported
  94. */
  95. #define BLE_HCI_INSTANT_PASSED 0x28 /**< Instant Passed. */
  96. #define BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED 0x29 /**< Pairing with Unit Key Unsupported. */
  97. #define BLE_HCI_DIFFERENT_TRANSACTION_COLLISION 0x2A /**< Different Transaction Collision. */
  98. /*
  99. 0x2B Reserved
  100. 0x2C QoS Unacceptable Parameter
  101. 0x2D QoS Rejected
  102. 0x2E Channel Classification Not Supported
  103. 0x2F Insufficient Security
  104. */
  105. #define BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE 0x30 /**< Parameter Out Of Mandatory Range. */
  106. /*
  107. 0x31 Reserved
  108. 0x32 Role Switch Pending
  109. 0x33 Reserved
  110. 0x34 Reserved Slot Violation
  111. 0x35 Role Switch Failed
  112. 0x36 Extended Inquiry Response Too Large
  113. 0x37 Secure Simple Pairing Not Supported By Host.
  114. 0x38 Host Busy - Pairing
  115. 0x39 Connection Rejected due to No Suitable Channel Found*/
  116. #define BLE_HCI_CONTROLLER_BUSY 0x3A /**< Controller Busy. */
  117. #define BLE_HCI_CONN_INTERVAL_UNACCEPTABLE 0x3B /**< Connection Interval Unacceptable. */
  118. #define BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT 0x3C /**< Directed Advertisement Timeout. */
  119. #define BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE 0x3D /**< Connection Terminated due to MIC Failure. */
  120. #define BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED 0x3E /**< Connection Failed to be Established. */
  121. /** @} */
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125. #endif // BLE_HCI_H__
  126. /** @} */