BTool的GAP_TerminateLink的Reason在哪儿查?
我自己写了个程序,实现类似于BTool的功能,在程序中实现主机(芯片为CC2540)。断开连接后会给出断开原因,类似于下图
我自己写的程序里,有一次断开的提示Reason为62(0x3E),是什么原因?怎么导致的?
这个应该有技术文档说明吧,请问在哪里查?
在HCI.h里,你看到的两个如下
#define HCI_ERROR_CODE_CONN_TERM_BY_LOCAL_HOST 0x16
#define HCI_ERROR_CODE_CONN_FAILED_TO_ESTABLISH 0x3E
#define HCI_SUCCESS 0x00
#define HCI_ERROR_CODE_UNKNOWN_HCI_CMD 0x01
#define HCI_ERROR_CODE_UNKNOWN_CONN_ID 0x02
#define HCI_ERROR_CODE_HW_FAILURE 0x03
#define HCI_ERROR_CODE_PAGE_TIMEOUT 0x04
#define HCI_ERROR_CODE_AUTH_FAILURE 0x05
#define HCI_ERROR_CODE_PIN_KEY_MISSING 0x06
#define HCI_ERROR_CODE_MEM_CAP_EXCEEDED 0x07
#define HCI_ERROR_CODE_CONN_TIMEOUT 0x08
#define HCI_ERROR_CODE_CONN_LIMIT_EXCEEDED 0x09
#define HCI_ERROR_CODE_SYNCH_CONN_LIMIT_EXCEEDED 0x0A
#define HCI_ERROR_CODE_ACL_CONN_ALREADY_EXISTS 0x0B
#define HCI_ERROR_CODE_CMD_DISALLOWED 0x0C
#define HCI_ERROR_CODE_CONN_REJ_LIMITED_RESOURCES 0x0D
#define HCI_ERROR_CODE_CONN_REJECTED_SECURITY_REASONS 0x0E
#define HCI_ERROR_CODE_CONN_REJECTED_UNACCEPTABLE_BDADDR 0x0F
#define HCI_ERROR_CODE_CONN_ACCEPT_TIMEOUT_EXCEEDED 0x10
#define HCI_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE 0x11
#define HCI_ERROR_CODE_INVALID_HCI_CMD_PARAMS 0x12
#define HCI_ERROR_CODE_REMOTE_USER_TERM_CONN 0x13
#define HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_LOW_RESOURCES 0x14
#define HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_POWER_OFF 0x15
#define HCI_ERROR_CODE_CONN_TERM_BY_LOCAL_HOST 0x16
#define HCI_ERROR_CODE_REPEATED_ATTEMPTS 0x17
#define HCI_ERROR_CODE_PAIRING_NOT_ALLOWED 0x18
#define HCI_ERROR_CODE_UNKNOWN_LMP_PDU 0x19
#define HCI_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE 0x1A
#define HCI_ERROR_CODE_SCO_OFFSET_REJ 0x1B
#define HCI_ERROR_CODE_SCO_INTERVAL_REJ 0x1C
#define HCI_ERROR_CODE_SCO_AIR_MODE_REJ 0x1D
#define HCI_ERROR_CODE_INVALID_LMP_PARAMS 0x1E
#define HCI_ERROR_CODE_UNSPECIFIED_ERROR 0x1F
#define HCI_ERROR_CODE_UNSUPPORTED_LMP_PARAM_VAL 0x20
#define HCI_ERROR_CODE_ROLE_CHANGE_NOT_ALLOWED 0x21
#define HCI_ERROR_CODE_LMP_LL_RESP_TIMEOUT 0x22
#define HCI_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION 0x23
#define HCI_ERROR_CODE_LMP_PDU_NOT_ALLOWED 0x24
#define HCI_ERROR_CODE_ENCRYPT_MODE_NOT_ACCEPTABLE 0x25
#define HCI_ERROR_CODE_LINK_KEY_CAN_NOT_BE_CHANGED 0x26
#define HCI_ERROR_CODE_REQ_QOS_NOT_SUPPORTED 0x27
#define HCI_ERROR_CODE_INSTANT_PASSED 0x28
#define HCI_ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 0x29
#define HCI_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION 0x2A
#define HCI_ERROR_CODE_RESERVED1 0x2B
#define HCI_ERROR_CODE_QOS_UNACCEPTABLE_PARAM 0x2C
#define HCI_ERROR_CODE_QOS_REJ 0x2D
#define HCI_ERROR_CODE_CHAN_ASSESSMENT_NOT_SUPPORTED 0x2E
#define HCI_ERROR_CODE_INSUFFICIENT_SECURITY 0x2F
#define HCI_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE 0x30
#define HCI_ERROR_CODE_RESERVED2 0x31
#define HCI_ERROR_CODE_ROLE_SWITCH_PENDING 0x32
#define HCI_ERROR_CODE_RESERVED3 0x33
#define HCI_ERROR_CODE_RESERVED_SLOT_VIOLATION 0x34
#define HCI_ERROR_CODE_ROLE_SWITCH_FAILED 0x35
#define HCI_ERROR_CODE_EXTENDED_INQUIRY_RESP_TOO_LARGE 0x36
#define HCI_ERROR_CODE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST 0x37
#define HCI_ERROR_CODE_HOST_BUSY_PAIRING 0x38
#define HCI_ERROR_CODE_CONN_REJ_NO_SUITABLE_CHAN_FOUND 0x39
#define HCI_ERROR_CODE_CONTROLLER_BUSY 0x3A
#define HCI_ERROR_CODE_UNACCEPTABLE_CONN_PARAMETERS 0x3B
#define HCI_ERROR_CODE_DIRECTED_ADV_TIMEOUT 0x3C
#define HCI_ERROR_CODE_CONN_TERM_MIC_FAILURE 0x3D
#define HCI_ERROR_CODE_CONN_FAILED_TO_ESTABLISH 0x3E
#define HCI_ERROR_CODE_MAC_CONN_FAILED 0x3F
#define HCI_ERROR_CODE_COARSE_CLOCK_ADJUST_REJECTED 0x40
有解释性文档吗?
读字面意思也可以明白。想了解细节,去查蓝牙spec core4.0