在哪里可以找到Core Bluetooth的Apple iOS错误列表?

时间:2013-10-01 13:28:52

标签: ios bluetooth core-bluetooth

我正在测试长寿/健壮性问题,需要调试偶尔的核心蓝牙错误,例如#242。

Apple是否列出了每个核心蓝牙错误的含义?

2 个答案:

答案 0 :(得分:3)

通常,CoreBluetooth使用Bluetooth Core Spec V4.0 Vol 3 Part F Sec 3.4.1.1 Table 3.3 Error Codes中定义的标准错误代码。

                             Error 
Name                         Code  Description
==============================================================================
Invalid Handle               0x01  The attribute handle given was not valid on 
                                   this server.
Read Not Permitted           0x02  The attribute cannot be read.
Write Not Permitted          0x03  The attribute cannot be written.
Invalid PDU                  0x04  The attribute PDU was invalid.
Insufficient Authentication  0x05  The attribute requires authentication 
                                   before it can be read or written.
Request Not Supported        0x06  Attribute server does not support the 
                                   request received from the client.
Invalid Offset               0x07  Offset specified was past the end of the 
                                   attribute.
Insufficient Authorization   0x08  The attribute requires authorization before 
                                   it can be read or written.
Prepare Queue Full           0x09  Too many prepare writes have been queued.
Attribute Not Found          0x0A  No attribute found within the given 
                                   attribute handle range.
Attribute Not Long           0x0B  The attribute cannot be read or written 
                                   using the Read Blob Request
Insufficient Encryption Key  0x0C  The Encryption Key Size used for encrypting
Size                               this link is insufficient.
Invalid Attribute Value      0x0D  The attribute value length is invalid for 
Length                             the operation.
Unlikely Error               0x0E  The attribute request that was requested 
                                   has encountered an error that was unlikely, 
                                   and therefore could not be completed as 
                                   requested. 
Insufficient Encryption      0x0F  The attribute requires encryption before it 
                                   can be read or written.
Unsupported Group Type       0x10  The attribute type is not a supported 
                                   grouping attribute as defined by a higher 
                                   layer specification.
Insufficient Resources       0x11  Insufficient Resources to complete the 
                                   request
Reserved             0x012 – 0x7F  Reserved for future use.
Application Error     0x80 – 0xFF  Application error code defined by a higher 
                                   layer specification.

请注意,iOS存在显示任意错误代码的某些问题。例如,如果您在一定时间内未能将请求作为外围应用程序回答,则返回的错误代码没有任何意义。

实际错误代码始终仅在打印到控制台的警告中可见。在任何情况下,NSError都没有提供我目前遇到的CoreBluetooth的任何详细信息。

答案 1 :(得分:2)

Apple的文档包含CoreBluetooth Constants列表,其中包含您将从框架中收到的大多数错误代码。

我还开始Wikia site for CoreBluetooth收集有关人们遇到特定errors的情况的其他信息。