112/**@defgroup BLE_STACK_ERROR_CODES BLE Stack specific error codes
113* @{
114*/
115
116#define BLE_SUCCESS 0x00 /**< Operation is Successful. */
117/**@brief ATT Specific Error. */
118#define BLE_ATT_ERR_INVALID_HANDLE 0x01 /**< The given attribute handle was not valid on this server. */
119#define BLE_ATT_ERR_READ_NOT_PERMITTED 0x02 /**< The attribute cannot be read. */
120#define BLE_ATT_ERR_WRITE_NOT_PERMITTED 0x03 /**< The attribute cannot be written. */
121#define BLE_ATT_ERR_INVALID_PDU 0x04 /**< The attribute PDU was invalid. */
122#define BLE_ATT_ERR_INSUFF_AUTHEN 0x05 /**< The attribute requires authentication before it can be read or written. */
123#define BLE_ATT_ERR_REQUEST_NOT_SUPPORTED 0x06 /**< Attribute server does not support the request received from the client. */
124#define BLE_ATT_ERR_INVALID_OFFSET 0x07 /**< Offset specified was past the end of the attribute. */
125#define BLE_ATT_ERR_INSUFF_AUTHOR 0x08 /**< The attribute requires authorization before it can be read or written. */
126#define BLE_ATT_ERR_PREPARE_QUEUE_FULL 0x09 /**< Too many prepare writes have been queued. */
127#define BLE_ATT_ERR_ATTRIBUTE_NOT_FOUND 0x0A /**< No attribute found within the given attribute handle range. */
128#define BLE_ATT_ERR_ATTRIBUTE_NOT_LONG 0x0B /**< The attribute cannot be read using the Read Blob Request. */
129#define BLE_ATT_ERR_INSUFF_ENC_KEY_SIZE 0x0C /**< The Encryption Key Size used for encrypting this link is insufficient. */
130#define BLE_ATT_ERR_INVALID_ATTRIBUTE_VAL_LEN 0x0D /**< The attribute value length is invalid for the operation. */
131#define BLE_ATT_ERR_UNLIKELY_ERR 0x0E /**< The attribute request has encountered an unlikely error, so the request could not be completed as requested. */
132#define BLE_ATT_ERR_INSUFF_ENC 0x0F /**< The attribute requires encryption before it can be read or written. */
133#define BLE_ATT_ERR_UNSUPP_GRP_TYPE 0x10 /**< The attribute type is not a supported grouping attribute as defined by a higher layer specification. */
134#define BLE_ATT_ERR_INSUFF_RESOURCE 0x11 /**< Insufficient resources to complete the request. */
135#define BLE_ATT_ERR_DB_OUT_OF_SYNC 0x12 /**< The server requests the client to rediscover the database. */
136#define BLE_ATT_ERR_VALUE_NOT_ALLOWED 0x13 /**< The attribute parameter value was not allowed. */
137
138/**@brief L2CAP Specific Error. */
139#define BLE_L2C_ENH_CB_RECONFIG_INVALID_MTU 0x2C /**< Reconfiguration failed - reduction in size of MTU not allowed. */
140#define BLE_L2C_ENH_CB_RECONFIG_INVALID_MPS 0x2D /**< Reconfiguration failed - reduction in size of MPS not allowed for more than one channel at a time. */
141#define BLE_L2C_ENH_CB_RECONFIG_INVALID_CID 0x2E /**< Reconfiguration failed - one or more Destination CIDs invalid. */
180#define BLE_GATT_ERR_SIGNED_WRITE 0x53 /**< Signed write error. */
181#define BLE_GATT_ERR_ATTRIBUTE_CLIENT_MISSING 0x54 /**< No attribute client defined. */
182#define BLE_GATT_ERR_ATTRIBUTE_SERVER_MISSING 0x55 /**< No attribute server defined. */
183#define BLE_GATT_ERR_INVALID_PERM 0x56 /**< Permission set in service/attribute is invalid. */
184#define BLE_GATT_ERR_BROWSE_NO_ANY_MORE 0x57 /**< GATT browses no any more contents. */
185#define BLE_GATT_ERR_CACHE_UPDATING 0x58 /**< GATT Cache in updating process. */
186#define BLE_GATT_ERR_CACHE_FINISH 0x59 /**< GATT Cache is updated or checked. */
187#define BLE_GATT_ERR_SERVICE_NOT_EXIST 0x5a /**< GATT service is not exist. */
188
189/**@brief SEC Specific Error by local. */
190#define BLE_SEC_ERR_LOCAL_PASSKEY_ENTRY_FAIL 0x61 /**< The user input of passkey failed. */
191#define BLE_SEC_ERR_LOCAL_OOB_NOT_AVAILBL 0x62 /**< The OOB data is not available. */
192#define BLE_SEC_ERR_LOCAL_AUTH_REQ 0x63 /**< The pairing procedure cannot be performed as authentication requirements cannot be met due to IO incapability of one or both devices. */
193#define BLE_SEC_ERR_LOCAL_CONFIRM_VAL_FAIL 0x64 /**< The confirm value does not match the calculated compare value. */
194#define BLE_SEC_ERR_LOCAL_PAIRING_NOT_SUPPORT 0x65 /**< Pairing is not supported by the device. */
195#define BLE_SEC_ERR_LOCAL_ENCRPT_KEY_SIZE 0x66 /**< The resultant encryption key size is insufficient for the security requirements of this device. */
196#define BLE_SEC_ERR_LOCAL_COMMAND_NOT_SUPPORT 0x67 /**< The SMP command received is not supported on this device. */
197#define BLE_SEC_ERR_LOCAL_UNSPECIFIED 0x68 /**< Pairing failed due to an unspecified reason. */
198#define BLE_SEC_ERR_LOCAL_REPEAT_ATTEMPT 0x69 /**< Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request. */
199#define BLE_SEC_ERR_LOCAL_INVALID_PARAM 0x6A /**< The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range. */
200#define BLE_SEC_ERR_LOCAL_DHKEY_CHECK_FAIL 0x6B /**< Indicate to the remote device that the DHKey Check value received doesn't match the one calculated by the local device. */
201#define BLE_SEC_ERR_LOCAL_NUM_CMP_FAIL 0x6C /**< Indicate that the confirm values in the numeric comparison protocol do not match. */
202#define BLE_SEC_ERR_LOCAL_BR_EDR_IN_PROGRESS 0x6D /**< Indicate that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process. */
203#define BLE_SEC_ERR_LOCAL_KEY_DRIV_GEN_NOT_ALLOW 0x6E /**< Indicate that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for the LE transport. */
204#define BLE_SEC_ERR_LOCAL_LTK_MISSING 0x6F /**< Indicate the LTK of peer devices missing. */
205
206/**@brief SEC Specific Error by remote. */
207#define BLE_SEC_ERR_REMOTE_PASSKEY_ENTRY_FAIL 0x71 /**< The user input of passkey failed. */
208#define BLE_SEC_ERR_REMOTE_OOB_NOT_AVAILBL 0x72 /**< The OOB data is not available. */
209#define BLE_SEC_ERR_REMOTE_AUTH_REQ 0x73 /**< The pairing procedure cannot be performed as authentication requirements cannot be met due to IO incapability of one or both devices. */
210#define BLE_SEC_ERR_REMOTE_CONFIRM_VAL_FAIL 0x74 /**< The confirm value does not match the calculated compare value. */
211#define BLE_SEC_ERR_REMOTE_PAIRING_NOT_SUPPORT 0x75 /**< Pairing is not supported by the device. */
212#define BLE_SEC_ERR_REMOTE_ENCRPT_KEY_SIZE 0x76 /**< The resultant encryption key size is insufficient for the security requirements of this device. */
213#define BLE_SEC_ERR_REMOTE_COMMAND_NOT_SUPPORT 0x77 /**< The SMP command received is not supported on this device. */
214#define BLE_SEC_ERR_REMOTE_UNSPECIFIED 0x78 /**< Pairing failed due to an unspecified reason. */
215#define BLE_SEC_ERR_REMOTE_REPEAT_ATTEMPT 0x79 /**< Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request. */
216#define BLE_SEC_ERR_REMOTE_INVALID_PARAM 0x7A /**< The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range. */
217#define BLE_SEC_ERR_REMOTE_DHKEY_CHECK_FAIL 0x7B /**< Indicate to the remote device that the DHKey Check value received doesn't match the one calculated by the local device. */
218#define BLE_SEC_ERR_REMOTE_NUM_CMP_FAIL 0x7C /**< Indicate that the confirm values in the numeric comparison protocol do not match. */
219#define BLE_SEC_ERR_REMOTE_BR_EDR_IN_PROGRESS 0x7D /**< Indicate that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process. */
220#define BLE_SEC_ERR_REMOTE_KEY_DRIV_GEN_NOT_ALLOW 0x7E /**< Indicate that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for the LE transport. */
221#define BLE_SEC_ERR_REMOTE_LTK_MISSING 0x7F /**< Indicate the LTK of peer devices missing. */