• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 ASR Microelectronics (Shanghai) Co., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  ****************************************************************************************
18  *
19  * @file sonata_error_api.h
20  *
21  * @brief header file - this file contains the ble error code definition
22  *
23  ****************************************************************************************
24  */
25 
26 #ifndef _SONATA_ERROR_API_H_
27 #define _SONATA_ERROR_API_H_
28 
29 /*
30  * INCLUDE FILES
31  ****************************************************************************************
32  */
33 
34 /*
35  * MACRO DEFINITIONS
36  ****************************************************************************************
37  */
38 /// error code - all module base code
39 #define API_SUCCESS                 0x0000
40 #define API_FAILURE                 0xFFFF
41 #define SONATA_BLE_API_ERR_ID          0x0100
42 #define SONATA_API_TASK_ERR_ID         0x0200
43 #define SONATA_GAP_API_ERR_ID          0x0300
44 #define SONATA_GATT_API_ERR_ID         0x0400
45 #define SONATA_LL_API_ERR_ID           0x0500
46 #define SONATA_SEC_API_ERR_ID          0x0600
47 #define SONATA_MESH_API_ERR_ID         0x1100
48 #define SONATA_DIS_API_ERR_ID          0x1200
49 #define SONATA_PROX_API_ERR_ID         0x1300
50 #define SONATA_OTA_API_ERR_ID          0x1400
51 #define SONATA_BAS_API_ERR_ID          0x1500
52 
53 #define SONATA_NVDS_API_ERR_ID         0x2100
54 #define SONATA_SLEEP_API_ERR_ID        0x2200
55 #define SONATA_UTILS_API_ERR_ID        0x2300
56 
57 /// asr ble api error code
58 
59 /// asr api task error code
60 
61 /// asr gap api error code
62 #define SONATA_GAP_ERR_NO_ERROR                      (0X00 | SONATA_GAP_API_ERR_ID)
63 #define SONATA_GAP_ERR_INVALID_PARAM                 (0x40 | SONATA_GAP_API_ERR_ID)
64 #define SONATA_GAP_ERR_PROTOCOL_PROBLEM              (0x41 | SONATA_GAP_API_ERR_ID)
65 #define SONATA_GAP_ERR_NOT_SUPPORTED                 (0x42 | SONATA_GAP_API_ERR_ID)
66 #define SONATA_GAP_ERR_COMMAND_DISALLOWED            (0x43 | SONATA_GAP_API_ERR_ID)
67 #define SONATA_GAP_ERR_CANCELED                      (0x44 | SONATA_GAP_API_ERR_ID)
68 #define SONATA_GAP_ERR_TIMEOUT                       (0x45 | SONATA_GAP_API_ERR_ID)
69 #define SONATA_GAP_ERR_DISCONNECTED                  (0x46 | SONATA_GAP_API_ERR_ID)
70 #define SONATA_GAP_ERR_NOT_FOUND                     (0x47 | SONATA_GAP_API_ERR_ID)
71 #define SONATA_GAP_ERR_REJECTED                      (0x48 | SONATA_GAP_API_ERR_ID)
72 #define SONATA_GAP_ERR_PRIVACY_CFG_PB                (0x49 | SONATA_GAP_API_ERR_ID)
73 #define SONATA_GAP_ERR_ADV_DATA_INVALID              (0x4A | SONATA_GAP_API_ERR_ID)
74 #define SONATA_GAP_ERR_INSUFF_RESOURCES              (0x4B | SONATA_GAP_API_ERR_ID)
75 #define SONATA_GAP_ERR_UNEXPECTED                    (0x4C | SONATA_GAP_API_ERR_ID)
76 #define SONATA_GAP_ERR_MISMATCH                      (0x4D | SONATA_GAP_API_ERR_ID)
77 
78 /// asr gatt api error code
79 #define SONATA_GATT_ERR_NO_ERROR                      (0X00 | SONATA_GATT_API_ERR_ID)
80 #define SONATA_GATT_ERR_INVALID_PARAM                 (0x40 | SONATA_GATT_API_ERR_ID)
81 /// asr ll api error code
82 
83 /// asr sec api error code
84 
85 /// asr mesh api error code
86 
87 /// asr dis api error code
88 #define SONATA_PRF_DIS_ERR_NO_ERROR                      (0X00 | SONATA_DIS_API_ERR_ID)
89 #define SONATA_PRF_DIS_ERR_INVALID_PARAM                 (0x40 | SONATA_DIS_API_ERR_ID)
90 /// asr bat api error code
91 #define SONATA_PRF_BAS_ERR_NO_ERROR                      (0X00 | SONATA_BAS_API_ERR_ID)
92 #define SONATA_PRF_BAS_ERR_INVALID_PARAM                 (0x40 | SONATA_BAS_API_ERR_ID)
93 /// asr prox api error code
94 
95 /// asr ota api error code
96 
97 /// asr nvds api error code
98 
99 /// asr sleep api error code
100 
101 /// asr utils api error code
102 
103 /// debug trace
104 #ifdef SONATA_UTILS_API_DBG
105 #define SONATA_UTILS_API_TRC    printf
106 #else
107 #define SONATA_UTILS_API_TRC(...)
108 #endif // SONATA_API_TASK_DBG
109 
110 /*
111  * ENUM DEFINITIONS
112  ****************************************************************************************
113  */
114 
115 // C error
116 #define SONATA_CO_ERROR_NO_ERROR                        (0x00)
117 #define SONATA_CO_ERROR_UNKNOWN_HCI_COMMAND             (0x01)
118 #define SONATA_CO_ERROR_UNKNOWN_CONNECTION_ID           (0x02)
119 #define SONATA_CO_ERROR_HARDWARE_FAILURE                (0x03)
120 #define SONATA_CO_ERROR_PAGE_TIMEOUT                    (0x04)
121 #define SONATA_CO_ERROR_AUTH_FAILURE                    (0x05)
122 #define SONATA_CO_ERROR_PIN_MISSING                     (0x06)
123 #define SONATA_CO_ERROR_MEMORY_CAPA_EXCEED              (0x07)
124 #define SONATA_CO_ERROR_CON_TIMEOUT                     (0x08)
125 #define SONATA_CO_ERROR_CON_LIMIT_EXCEED                (0x09)
126 #define SONATA_CO_ERROR_SYNC_CON_LIMIT_DEV_EXCEED       (0x0A)
127 #define SONATA_CO_ERROR_CON_ALREADY_EXISTS              (0x0B)
128 #define SONATA_CO_ERROR_COMMAND_DISALLOWED              (0x0C)
129 #define SONATA_CO_ERROR_CONN_REJ_LIMITED_RESOURCES      (0x0D)
130 #define SONATA_CO_ERROR_CONN_REJ_SECURITY_REASONS       (0x0E)
131 #define SONATA_CO_ERROR_CONN_REJ_UNACCEPTABLE_BDADDR    (0x0F)
132 #define SONATA_CO_ERROR_CONN_ACCEPT_TIMEOUT_EXCEED      (0x10)
133 #define SONATA_CO_ERROR_UNSUPPORTED                     (0x11)
134 #define SONATA_CO_ERROR_INVALID_HCI_PARAM               (0x12)
135 #define SONATA_CO_ERROR_REMOTE_USER_TERM_CON            (0x13)
136 #define SONATA_CO_ERROR_REMOTE_DEV_TERM_LOW_RESOURCES   (0x14)
137 #define SONATA_CO_ERROR_REMOTE_DEV_POWER_OFF            (0x15)
138 #define SONATA_CO_ERROR_CON_TERM_BY_LOCAL_HOST          (0x16)
139 #define SONATA_CO_ERROR_REPEATED_ATTEMPTS               (0x17)
140 #define SONATA_CO_ERROR_PAIRING_NOT_ALLOWED             (0x18)
141 #define SONATA_CO_ERROR_UNKNOWN_LMP_PDU                 (0x19)
142 #define SONATA_CO_ERROR_UNSUPPORTED_REMOTE_FEATURE      (0x1A)
143 #define SONATA_CO_ERROR_SCO_OFFSET_REJECTED             (0x1B)
144 #define SONATA_CO_ERROR_SCO_INTERVAL_REJECTED           (0x1C)
145 #define SONATA_CO_ERROR_SCO_AIR_MODE_REJECTED           (0x1D)
146 #define SONATA_CO_ERROR_INVALID_LMP_PARAM               (0x1E)
147 #define SONATA_CO_ERROR_UNSPECIFIED_ERROR               (0x1F)
148 #define SONATA_CO_ERROR_UNSUPPORTED_LMP_PARAM_VALUE     (0x20)
149 #define SONATA_CO_ERROR_ROLE_CHANGE_NOT_ALLOWED         (0x21)
150 #define SONATA_CO_ERROR_LMP_RSP_TIMEOUT                 (0x22)
151 #define SONATA_CO_ERROR_LMP_COLLISION                   (0x23)
152 #define SONATA_CO_ERROR_LMP_PDU_NOT_ALLOWED             (0x24)
153 #define SONATA_CO_ERROR_ENC_MODE_NOT_ACCEPT             (0x25)
154 #define SONATA_CO_ERROR_LINK_KEY_CANT_CHANGE            (0x26)
155 #define SONATA_CO_ERROR_QOS_NOT_SUPPORTED               (0x27)
156 #define SONATA_CO_ERROR_INSTANT_PASSED                  (0x28)
157 #define SONATA_CO_ERROR_PAIRING_WITH_UNIT_KEY_NOT_SUP   (0x29)
158 #define SONATA_CO_ERROR_DIFF_TRANSACTION_COLLISION      (0x2A)
159 #define SONATA_CO_ERROR_QOS_UNACCEPTABLE_PARAM          (0x2C)
160 #define SONATA_CO_ERROR_QOS_REJECTED                    (0x2D)
161 #define SONATA_CO_ERROR_CHANNEL_CLASS_NOT_SUP           (0x2E)
162 #define SONATA_CO_ERROR_INSUFFICIENT_SECURITY           (0x2F)
163 #define SONATA_CO_ERROR_PARAM_OUT_OF_MAND_RANGE         (0x30)
164 #define SONATA_CO_ERROR_ROLE_SWITCH_PEND                (0x32)
165 #define SONATA_CO_ERROR_RESERVED_SLOT_VIOLATION         (0x34)
166 #define SONATA_CO_ERROR_ROLE_SWITCH_FAIL                (0x35)
167 #define SONATA_CO_ERROR_EIR_TOO_LARGE                   (0x36)
168 #define SONATA_CO_ERROR_SP_NOT_SUPPORTED_HOST           (0x37)
169 #define SONATA_CO_ERROR_HOST_BUSY_PAIRING               (0x38)
170 #define SONATA_CO_ERROR_CONTROLLER_BUSY                 (0x3A)
171 #define SONATA_CO_ERROR_UNACCEPTABLE_CONN_PARAM         (0x3B)
172 #define SONATA_CO_ERROR_ADV_TO                          (0x3C)
173 #define SONATA_CO_ERROR_TERMINATED_MIC_FAILURE          (0x3D)
174 #define SONATA_CO_ERROR_CONN_FAILED_TO_BE_EST           (0x3E)
175 #define SONATA_CO_ERROR_CCA_REJ_USE_CLOCK_DRAG          (0x40)
176 #define SONATA_CO_ERROR_TYPE0_SUBMAP_NOT_DEFINED        (0x41)
177 #define SONATA_CO_ERROR_UNKNOWN_ADVERTISING_ID          (0x42)
178 #define SONATA_CO_ERROR_LIMIT_REACHED                   (0x43)
179 #define SONATA_CO_ERROR_OPERATION_CANCELED_BY_HOST      (0x44)
180 #define SONATA_CO_ERROR_PKT_TOO_LONG                    (0x45)
181 #define SONATA_CO_ERROR_UNDEFINED                       (0xFF)
182 #define SONATA_CO_ERROR_HW_UART_OUT_OF_SYNC             (0x00)
183 #define SONATA_CO_ERROR_HW_MEM_ALLOC_FAIL               (0x01)
184 // C error end
185 
186 // hl_err
187 enum stack_hl_err {
188     /// No error
189     SONATA_HL_GAP_ERR_NO_ERROR                                                               = 0x00,
190 
191     // ----------------------------------------------------------------------------------
192     // -------------------------  ATT Specific Error ------------------------------------
193     // ----------------------------------------------------------------------------------
194     /// No error
195     SONATA_HL_ATT_ERR_NO_ERROR = 0x00,
196     /// 0x01: Handle is invalid
197     SONATA_HL_ATT_ERR_INVALID_HANDLE = 0x01,
198     /// 0x02: Read permission disabled
199     SONATA_HL_ATT_ERR_READ_NOT_PERMITTED = 0x02,
200     /// 0x03: Write permission disabled
201     SONATA_HL_ATT_ERR_WRITE_NOT_PERMITTED = 0x03,
202     /// 0x04: Incorrect PDU
203     SONATA_HL_ATT_ERR_INVALID_PDU = 0x04,
204     /// 0x05: Authentication privilege not enough
205     SONATA_HL_ATT_ERR_INSUFF_AUTHEN = 0x05,
206     /// 0x06: Request not supported or not understood
207     SONATA_HL_ATT_ERR_REQUEST_NOT_SUPPORTED = 0x06,
208     /// 0x07: Incorrect offset value
209     SONATA_HL_ATT_ERR_INVALID_OFFSET = 0x07,
210     /// 0x08: Authorization privilege not enough
211     SONATA_HL_ATT_ERR_INSUFF_AUTHOR = 0x08,
212     /// 0x09: Capacity queue for reliable write reached
213     SONATA_HL_ATT_ERR_PREPARE_QUEUE_FULL = 0x09,
214     /// 0x0A: Attribute requested not existing
215     SONATA_HL_ATT_ERR_ATTRIBUTE_NOT_FOUND                                                    = 0x0A,
216     /// 0x0B: Attribute requested not long
217     SONATA_HL_ATT_ERR_ATTRIBUTE_NOT_LONG = 0x0B,
218     /// 0x0C: Encryption size not sufficient
219     SONATA_HL_ATT_ERR_INSUFF_ENC_KEY_SIZE = 0x0C,
220     /// 0x0D: Invalid length of the attribute value
221     SONATA_HL_ATT_ERR_INVALID_ATTRIBUTE_VAL_LEN = 0x0D,
222     /// 0x0E: Operation not fit to condition
223     SONATA_HL_ATT_ERR_UNLIKELY_ERR = 0x0E,
224     /// 0x0F: Attribute requires encryption before operation
225     SONATA_HL_ATT_ERR_INSUFF_ENC = 0x0F,
226     /// 0x10: Attribute grouping not supported
227     SONATA_HL_ATT_ERR_UNSUPP_GRP_TYPE = 0x10,
228     /// 0x11: Resources not sufficient to complete the request
229     SONATA_HL_ATT_ERR_INSUFF_RESOURCE = 0x11,
230     /// 0x12: The server requests the client to rediscover the database.
231     SONATA_HL_ATT_ERR_DB_OUT_OF_SYNC = 0x12,
232     /// 0x13: The attribute parameter value was not allowed.
233     SONATA_HL_ATT_ERR_VALUE_NOT_ALLOWED = 0x13,
234     /// 0x80: Application error (also used in PRF Errors)
235     SONATA_HL_ATT_ERR_APP_ERROR = 0x80,
236 
237     // ----------------------------------------------------------------------------------
238     // -------------------------- L2C Specific Error ------------------------------------
239     // ----------------------------------------------------------------------------------
240     /// Message cannot be sent because connection lost. (disconnected)
241     SONATA_HL_L2C_ERR_CONNECTION_LOST = 0x30,
242     /// Invalid PDU length exceed MTU
243     SONATA_HL_L2C_ERR_INVALID_MTU_EXCEED = 0x31,
244     /// Invalid PDU length exceed MPS
245     SONATA_HL_L2C_ERR_INVALID_MPS_EXCEED = 0x32,
246     /// Invalid Channel ID
247     SONATA_HL_L2C_ERR_INVALID_CID = 0x33,
248     /// Invalid PDU
249     SONATA_HL_L2C_ERR_INVALID_PDU = 0x34,
250     /// Connection refused - no resources available
251     SONATA_HL_L2C_ERR_NO_RES_AVAIL = 0x35,
252     /// Connection refused - insufficient authentication
253     SONATA_HL_L2C_ERR_INSUFF_AUTHEN = 0x36,
254     /// Connection refused - insufficient authorization
255     SONATA_HL_L2C_ERR_INSUFF_AUTHOR = 0x37,
256     /// Connection refused - insufficient encryption key size
257     SONATA_HL_L2C_ERR_INSUFF_ENC_KEY_SIZE = 0x38,
258     /// Connection Refused - insufficient encryption
259     SONATA_HL_L2C_ERR_INSUFF_ENC = 0x39,
260     /// Connection refused - LE_PSM not supported
261     SONATA_HL_L2C_ERR_LEPSM_NOT_SUPP = 0x3A,
262     /// No more credit
263     SONATA_HL_L2C_ERR_INSUFF_CREDIT = 0x3B,
264     /// Command not understood by peer device
265     SONATA_HL_L2C_ERR_NOT_UNDERSTOOD = 0x3C,
266     /// Credit error, invalid number of credit received
267     SONATA_HL_L2C_ERR_CREDIT_ERROR = 0x3D,
268     /// Channel identifier already allocated
269     SONATA_HL_L2C_ERR_CID_ALREADY_ALLOC = 0x3E,
270     /// Unknown PDU
271     SONATA_HL_L2C_ERR_UNKNOWN_PDU = 0x3F,
272 
273     // ----------------------------------------------------------------------------------
274     // -------------------------- GAP Specific Error ------------------------------------
275     // ----------------------------------------------------------------------------------
276     /// Invalid parameters set
277     SONATA_HL_GAP_ERR_INVALID_PARAM = 0x40,
278     /// Problem with protocol exchange, get unexpected response
279     SONATA_HL_GAP_ERR_PROTOCOL_PROBLEM = 0x41,
280     /// Request not supported by software configuration
281     SONATA_HL_GAP_ERR_NOT_SUPPORTED = 0x42,
282     /// Request not allowed in current state.
283     SONATA_HL_GAP_ERR_COMMAND_DISALLOWED = 0x43,
284     /// Requested operation canceled.
285     SONATA_HL_GAP_ERR_CANCELED = 0x44,
286     /// Requested operation timeout.
287     SONATA_HL_GAP_ERR_TIMEOUT = 0x45,
288     /// Link connection lost during operation.
289     SONATA_HL_GAP_ERR_DISCONNECTED = 0x46,
290     /// Search algorithm finished, but no result found
291     SONATA_HL_GAP_ERR_NOT_FOUND = 0x47,
292     /// Request rejected by peer device
293     SONATA_HL_GAP_ERR_REJECTED = 0x48,
294     /// Problem with privacy configuration
295     SONATA_HL_GAP_ERR_PRIVACY_CFG_PB = 0x49,
296     /// Duplicate or invalid advertising data
297     SONATA_HL_GAP_ERR_ADV_DATA_INVALID = 0x4A,
298     /// Insufficient resources
299     SONATA_HL_GAP_ERR_INSUFF_RESOURCES = 0x4B,
300     /// Unexpected Error
301     SONATA_HL_GAP_ERR_UNEXPECTED = 0x4C,
302     /// Feature mismatch
303     SONATA_HL_GAP_ERR_MISMATCH = 0x4D,
304 
305     // ----------------------------------------------------------------------------------
306     // ------------------------- GATT Specific Error ------------------------------------
307     // ----------------------------------------------------------------------------------
308     /// Problem with ATTC protocol response
309     SONATA_HL_GATT_ERR_INVALID_ATT_LEN = 0x50,
310     /// Error in service search
311     SONATA_HL_GATT_ERR_INVALID_TYPE_IN_SVC_SEARCH = 0x51,
312     /// Invalid write data
313     SONATA_HL_GATT_ERR_WRITE = 0x52,
314     /// Signed write error
315     SONATA_HL_GATT_ERR_SIGNED_WRITE = 0x53,
316     /// No attribute client defined
317     SONATA_HL_GATT_ERR_ATTRIBUTE_CLIENT_MISSING = 0x54,
318     /// No attribute server defined
319     SONATA_HL_GATT_ERR_ATTRIBUTE_SERVER_MISSING = 0x55,
320     /// Permission set in service/attribute are invalid
321     SONATA_HL_GATT_ERR_INVALID_PERM = 0x56,
322 
323     // ----------------------------------------------------------------------------------
324     // ------------------------- SMP Specific Error -------------------------------------
325     // ----------------------------------------------------------------------------------
326     // SMP Protocol Errors detected on local device
327     /// The user input of pass key failed, for example, the user canceled the operation.
328     SONATA_HL_SMP_ERROR_LOC_PASSKEY_ENTRY_FAILED = 0x61,
329     /// The OOB Data is not available.
330     SONATA_HL_SMP_ERROR_LOC_OOB_NOT_AVAILABLE = 0x62,
331     /// The pairing procedure cannot be performed as authentication requirements cannot be met
332     /// due to IO capabilities of one or both devices.
333     SONATA_HL_SMP_ERROR_LOC_AUTH_REQ = 0x63,
334     /// The confirm value does not match the calculated confirm value.
335     SONATA_HL_SMP_ERROR_LOC_CONF_VAL_FAILED = 0x64,
336     /// Pairing is not supported by the device.
337     SONATA_HL_SMP_ERROR_LOC_PAIRING_NOT_SUPP = 0x65,
338     /// The resultant encryption key size is insufficient for the security requirements of
339     /// this device.
340     SONATA_HL_SMP_ERROR_LOC_ENC_KEY_SIZE = 0x66,
341     /// The SMP command received is not supported on this device.
342     SONATA_HL_SMP_ERROR_LOC_CMD_NOT_SUPPORTED = 0x67,
343     /// Pairing failed due to an unspecified reason.
344     SONATA_HL_SMP_ERROR_LOC_UNSPECIFIED_REASON = 0x68,
345     /// Pairing or Authentication procedure is disallowed because too little time has elapsed
346     /// since last pairing request or security request.
347     SONATA_HL_SMP_ERROR_LOC_REPEATED_ATTEMPTS = 0x69,
348     /// The command length is invalid or a parameter is outside of the specified range.
349     SONATA_HL_SMP_ERROR_LOC_INVALID_PARAM = 0x6A,
350     /// Indicates to the remote device that the DHKey Check value received doesn't
351     /// match the one calculated by the local device.
352     SONATA_HL_SMP_ERROR_LOC_DHKEY_CHECK_FAILED = 0x6B,
353     /// Indicates that the confirm values in the numeric comparison protocol do not match.
354     SONATA_HL_SMP_ERROR_LOC_NUMERIC_COMPARISON_FAILED = 0x6C,
355     /// Indicates that the pairing over the LE transport failed due to a Pairing Request sent
356     /// over the BR/EDR transport in process.
357     SONATA_HL_SMP_ERROR_LOC_BREDR_PAIRING_IN_PROGRESS = 0x6D,
358     /// Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be
359     /// used to derive and distribute keys for the LE transport.
360     SONATA_HL_SMP_ERROR_LOC_CROSS_TRANSPORT_KEY_GENERATION_NOT_ALLOWED = 0x6E,
361     // SMP Protocol Errors detected by remote device
362     /// The user input of passkey failed, for example, the user canceled the operation.
363     SONATA_HL_SMP_ERROR_REM_PASSKEY_ENTRY_FAILED = 0x71,
364     /// The OOB Data is not available.
365     SONATA_HL_SMP_ERROR_REM_OOB_NOT_AVAILABLE = 0x72,
366     /// The pairing procedure cannot be performed as authentication requirements cannot be
367     /// met due to IO capabilities of one or both devices.
368     SONATA_HL_SMP_ERROR_REM_AUTH_REQ = 0x73,
369     /// The confirm value does not match the calculated confirm value.
370     SONATA_HL_SMP_ERROR_REM_CONF_VAL_FAILED = 0x74,
371     /// Pairing is not supported by the device.
372     SONATA_HL_SMP_ERROR_REM_PAIRING_NOT_SUPP = 0x75,
373     /// The resultant encryption key size is insufficient for the security requirements of
374     /// this device.
375     SONATA_HL_SMP_ERROR_REM_ENC_KEY_SIZE = 0x76,
376     /// The SMP command received is not supported on this device.
377     SONATA_HL_SMP_ERROR_REM_CMD_NOT_SUPPORTED = 0x77,
378     /// Pairing failed due to an unspecified reason.
379     SONATA_HL_SMP_ERROR_REM_UNSPECIFIED_REASON = 0x78,
380     /// Pairing or Authentication procedure is disallowed because too little time has elapsed
381     /// since last pairing request or security request.
382     SONATA_HL_SMP_ERROR_REM_REPEATED_ATTEMPTS = 0x79,
383     /// The command length is invalid or a parameter is outside of the specified range.
384     SONATA_HL_SMP_ERROR_REM_INVALID_PARAM = 0x7A,
385     /// Indicates to the remote device that the DHKey Check value received doesn't
386     /// match the one calculated by the local device.
387     SONATA_HL_SMP_ERROR_REM_DHKEY_CHECK_FAILED = 0x7B,
388     /// Indicates that the confirm values in the numeric comparison protocol do not match.
389     SONATA_HL_SMP_ERROR_REM_NUMERIC_COMPARISON_FAILED = 0x7C,
390     /// Indicates that the pairing over the LE transport failed due to a Pairing Request sent
391     /// over the BR/EDR transport in process.
392     SONATA_HL_SMP_ERROR_REM_BREDR_PAIRING_IN_PROGRESS = 0x7D,
393     /// Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be
394     /// used to derive and distribute keys for the LE transport.
395     SONATA_HL_SMP_ERROR_REM_CROSS_TRANSPORT_KEY_GENERATION_NOT_ALLOWED = 0x7E,
396     // SMP Errors triggered by local device
397     /// The provided resolvable address has not been resolved.
398     SONATA_HL_SMP_ERROR_ADDR_RESOLV_FAIL = 0x20,
399     /// The Signature Verification Failed
400     SONATA_HL_SMP_ERROR_SIGN_VERIF_FAIL = 0x21,
401     /// The encryption procedure failed because the slave device didn't find the LTK
402     /// needed to start an encryption session.
403     SONATA_HL_SMP_ERROR_ENC_KEY_MISSING = 0x22,
404     /// The encryption procedure failed because the slave device doesn't support the
405     /// encryption feature.
406     SONATA_HL_SMP_ERROR_ENC_NOT_SUPPORTED = 0x23,
407     /// A timeout has occurred during the start encryption session.
408     SONATA_HL_SMP_ERROR_ENC_TIMEOUT = 0x24,
409 
410     // ----------------------------------------------------------------------------------
411     //------------------------ Profiles specific error codes ----------------------------
412     // ----------------------------------------------------------------------------------
413     /// Application Error
414     SONATA_HL_PRF_APP_ERROR = 0x80,
415     /// Invalid parameter in request
416     SONATA_HL_PRF_ERR_INVALID_PARAM = 0x81,
417     /// Inexistent handle for sending a read/write characteristic request
418     SONATA_HL_PRF_ERR_INEXISTENT_HDL = 0x82,
419     /// Discovery stopped due to missing attribute according to specification
420     SONATA_HL_PRF_ERR_STOP_DISC_CHAR_MISSING = 0x83,
421     /// Too many SVC instances found -> protocol violation
422     SONATA_HL_PRF_ERR_MULTIPLE_SVC = 0x84,
423     /// Discovery stopped due to found attribute with incorrect properties
424     SONATA_HL_PRF_ERR_STOP_DISC_WRONG_CHAR_PROP = 0x85,
425     /// Too many Char. instances found-> protocol violation
426     SONATA_HL_PRF_ERR_MULTIPLE_CHAR = 0x86,
427     /// Attribute write not allowed
428     SONATA_HL_PRF_ERR_NOT_WRITABLE = 0x87,
429     /// Attribute read not allowed
430     SONATA_HL_PRF_ERR_NOT_READABLE = 0x88,
431     /// Request not allowed
432     SONATA_HL_PRF_ERR_REQ_DISALLOWED = 0x89,
433     /// Notification Not Enabled
434     SONATA_HL_PRF_ERR_NTF_DISABLED = 0x8A,
435     /// Indication Not Enabled
436     SONATA_HL_PRF_ERR_IND_DISABLED = 0x8B,
437     /// Feature not supported by profile
438     SONATA_HL_PRF_ERR_FEATURE_NOT_SUPPORTED = 0x8C,
439     /// Read value has an unexpected length
440     SONATA_HL_PRF_ERR_UNEXPECTED_LEN = 0x8D,
441     /// Disconnection occurs
442     SONATA_HL_PRF_ERR_DISCONNECTED = 0x8E,
443     /// Procedure Timeout
444     SONATA_HL_PRF_ERR_PROC_TIMEOUT = 0x8F,
445     /// Client characteristic configuration improperly configured
446     SONATA_HL_PRF_CCCD_IMPR_CONFIGURED = 0xFD,
447     /// Procedure already in progress
448     SONATA_HL_PRF_PROC_IN_PROGRESS = 0xFE,
449     /// Out of Range
450     SONATA_HL_PRF_OUT_OF_RANGE = 0xFF,
451 
452     // ----------------------------------------------------------------------------------
453     //-------------------- LL Error codes conveyed to upper layer -----------------------
454     // ----------------------------------------------------------------------------------
455     /// Unknown HCI Command
456     SONATA_HL_LL_ERR_UNKNOWN_HCI_COMMAND = 0x91,
457     /// Unknown Connection Identifier
458     SONATA_HL_LL_ERR_UNKNOWN_CONNECTION_ID = 0x92,
459     /// Hardware Failure
460     SONATA_HL_LL_ERR_HARDWARE_FAILURE = 0x93,
461     /// BT Page Timeout
462     SONATA_HL_LL_ERR_PAGE_TIMEOUT = 0x94,
463     /// Authentication failure
464     SONATA_HL_LL_ERR_AUTH_FAILURE = 0x95,
465     /// Pin code missing
466     SONATA_HL_LL_ERR_PIN_MISSING = 0x96,
467     /// Memory capacity exceed
468     SONATA_HL_LL_ERR_MEMORY_CAPA_EXCEED = 0x97,
469     /// Connection Timeout
470     SONATA_HL_LL_ERR_CON_TIMEOUT = 0x98,
471     /// Connection limit Exceed
472     SONATA_HL_LL_ERR_CON_LIMIT_EXCEED = 0x99,
473     /// Synchronous Connection limit exceed
474     SONATA_HL_LL_ERR_SYNC_CON_LIMIT_DEV_EXCEED = 0x9A,
475     /// ACL Connection exits
476     SONATA_HL_LL_ERR_ACL_CON_EXISTS = 0x9B,
477     /// Command Disallowed
478     SONATA_HL_LL_ERR_COMMAND_DISALLOWED = 0x9C,
479     /// Connection rejected due to limited resources
480     SONATA_HL_LL_ERR_CONN_REJ_LIMITED_RESOURCES = 0x9D,
481     /// Connection rejected due to security reason
482     SONATA_HL_LL_ERR_CONN_REJ_SECURITY_REASONS = 0x9E,
483     /// Connection rejected due to unacceptable BD Addr
484     SONATA_HL_LL_ERR_CONN_REJ_UNACCEPTABLE_BDADDR = 0x9F,
485     /// Connection rejected due to Accept connection timeout
486     SONATA_HL_LL_ERR_CONN_ACCEPT_TIMEOUT_EXCEED = 0xA0,
487     /// Not Supported
488     SONATA_HL_LL_ERR_UNSUPPORTED = 0xA1,
489     /// invalid parameters
490     SONATA_HL_LL_ERR_INVALID_HCI_PARAM = 0xA2,
491     /// Remote user terminate connection
492     SONATA_HL_LL_ERR_REMOTE_USER_TERM_CON = 0xA3,
493     /// Remote device terminate connection due to low resources
494     SONATA_HL_LL_ERR_REMOTE_DEV_TERM_LOW_RESOURCES = 0xA4,
495     /// Remote device terminate connection due to power off
496     SONATA_HL_LL_ERR_REMOTE_DEV_POWER_OFF = 0xA5,
497     /// Connection terminated by local host
498     SONATA_HL_LL_ERR_CON_TERM_BY_LOCAL_HOST = 0xA6,
499     /// Repeated attempts
500     SONATA_HL_LL_ERR_REPEATED_ATTEMPTS = 0xA7,
501     /// Pairing not Allowed
502     SONATA_HL_LL_ERR_PAIRING_NOT_ALLOWED = 0xA8,
503     /// Unknown PDU Error
504     SONATA_HL_LL_ERR_UNKNOWN_LMP_PDU = 0xA9,
505     /// Unsupported remote feature
506     SONATA_HL_LL_ERR_UNSUPPORTED_REMOTE_FEATURE = 0xAA,
507     /// Sco Offset rejected
508     SONATA_HL_LL_ERR_SCO_OFFSET_REJECTED = 0xAB,
509     /// SCO Interval Rejected
510     SONATA_HL_LL_ERR_SCO_INTERVAL_REJECTED = 0xAC,
511     /// SCO air mode Rejected
512     SONATA_HL_LL_ERR_SCO_AIR_MODE_REJECTED = 0xAD,
513     /// Invalid LMP parameters
514     SONATA_HL_LL_ERR_INVALID_LMP_PARAM = 0xAE,
515     /// Unspecified error
516     SONATA_HL_LL_ERR_UNSPECIFIED_ERROR = 0xAF,
517     /// Unsupported LMP Parameter value
518     SONATA_HL_LL_ERR_UNSUPPORTED_LMP_PARAM_VALUE = 0xB0,
519     /// Role Change Not allowed
520     SONATA_HL_LL_ERR_ROLE_CHANGE_NOT_ALLOWED = 0xB1,
521     /// LMP Response timeout
522     SONATA_HL_LL_ERR_LMP_RSP_TIMEOUT = 0xB2,
523     /// LMP Collision
524     SONATA_HL_LL_ERR_LMP_COLLISION = 0xB3,
525     /// LMP Pdu not allowed
526     SONATA_HL_LL_ERR_LMP_PDU_NOT_ALLOWED = 0xB4,
527     /// Encryption mode not accepted
528     SONATA_HL_LL_ERR_ENC_MODE_NOT_ACCEPT = 0xB5,
529     /// Link Key Cannot be changed
530     SONATA_HL_LL_ERR_LINK_KEY_CANT_CHANGE = 0xB6,
531     /// Quality of Service not supported
532     SONATA_HL_LL_ERR_QOS_NOT_SUPPORTED = 0xB7,
533     /// Error, instant passed
534     SONATA_HL_LL_ERR_INSTANT_PASSED = 0xB8,
535     /// Pairing with unit key not supported
536     SONATA_HL_LL_ERR_PAIRING_WITH_UNIT_KEY_NOT_SUP = 0xB9,
537     /// Transaction collision
538     SONATA_HL_LL_ERR_DIFF_TRANSACTION_COLLISION = 0xBA,
539     /// Unacceptable parameters
540     SONATA_HL_LL_ERR_QOS_UNACCEPTABLE_PARAM = 0xBC,
541     /// Quality of Service rejected
542     SONATA_HL_LL_ERR_QOS_REJECTED = 0xBD,
543     /// Channel class not supported
544     SONATA_HL_LL_ERR_CHANNEL_CLASS_NOT_SUP = 0xBE,
545     /// Insufficient security
546     SONATA_HL_LL_ERR_INSUFFICIENT_SECURITY = 0xBF,
547     /// Parameters out of mandatory range
548     SONATA_HL_LL_ERR_PARAM_OUT_OF_MAND_RANGE = 0xC0,
549     /// Role switch pending
550     SONATA_HL_LL_ERR_ROLE_SWITCH_PEND = 0xC2,
551     /// Reserved slot violation
552     SONATA_HL_LL_ERR_RESERVED_SLOT_VIOLATION = 0xC4,
553     /// Role Switch fail
554     SONATA_HL_LL_ERR_ROLE_SWITCH_FAIL = 0xC5,
555     /// Error, EIR too large
556     SONATA_HL_LL_ERR_EIR_TOO_LARGE = 0xC6,
557     /// Simple pairing not supported by host
558     SONATA_HL_LL_ERR_SP_NOT_SUPPORTED_HOST = 0xC7,
559     /// Host pairing is busy
560     SONATA_HL_LL_ERR_HOST_BUSY_PAIRING = 0xC8,
561     /// Controller is busy
562     SONATA_HL_LL_ERR_CONTROLLER_BUSY = 0xCA,
563     /// Unacceptable connection initialization
564     SONATA_HL_LL_ERR_UNACCEPTABLE_CONN_INT = 0xCB,
565     /// Direct Advertising Timeout
566     SONATA_HL_LL_ERR_DIRECT_ADV_TO = 0xCC,
567     /// Connection Terminated due to a MIC failure
568     SONATA_HL_LL_ERR_TERMINATED_MIC_FAILURE = 0xCD,
569     /// Connection failed to be established
570     SONATA_HL_LL_ERR_CONN_FAILED_TO_BE_EST = 0xCE,
571     /// MAC Connection Failed
572     SONATA_HL_LL_ERR_MAC_CONN_FAILED = 0xCF,
573     /// Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging
574     SONATA_HL_LL_ERR_CCA_REJ_USE_CLOCK_DRAG = 0xD0,
575     /// Type0 Submap Not Defined
576     SONATA_HL_LL_ERR_TYPE0_SUBMAP_NOT_DEFINED = 0xD1,
577     /// Unknown Advertising Identifier
578     SONATA_HL_LL_ERR_UNKNOWN_ADVERTISING_ID = 0xD2,
579     /// Limit Reached
580     SONATA_HL_LL_ERR_LIMIT_REACHED = 0xD3,
581     /// Operation Cancelled by Host
582     SONATA_HL_LL_ERR_OPERATION_CANCELED_BY_HOST = 0xD4,
583     /// Packet Too Long
584     SONATA_HL_LL_ERR_PKT_TOO_LONG = 0xD5,
585 };
586 // hl_err end
587 #endif // _SONATA_ERROR_API_H_
588 
589