summaryrefslogtreecommitdiffstats
path: root/hcid/dbus.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-10-22 13:03:41 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-10-22 13:03:41 +0000
commit93bb0c7373ea0cb22d4c655717f72fc4c126b073 (patch)
tree554ad5196442e1a1185f440eebedc16b864913e7 /hcid/dbus.c
parentd1e2c347489fd60b211069497e770b63a1bb0430 (diff)
Add support for HCI errors
Diffstat (limited to 'hcid/dbus.c')
-rw-r--r--hcid/dbus.c69
1 files changed, 66 insertions, 3 deletions
diff --git a/hcid/dbus.c b/hcid/dbus.c
index 8cd0a28a..8205b066 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -113,7 +113,7 @@ typedef struct {
const char *str;
}bluez_error_t;
-static const bluez_error_t error_array[] = {
+static const bluez_error_t dbus_error_array[] = {
{ BLUEZ_EDBUS_UNKNOWN_METHOD, "Method not found" },
{ BLUEZ_EDBUS_WRONG_SIGNATURE, "Wrong method signature" },
{ BLUEZ_EDBUS_WRONG_PARAM, "Invalid parameters" },
@@ -121,9 +121,64 @@ static const bluez_error_t error_array[] = {
{ BLUEZ_EDBUS_NO_MEM, "No memory" },
{ BLUEZ_EDBUS_CONN_NOT_FOUND, "Connection not found" },
{ BLUEZ_EDBUS_UNKNOWN_PATH, "Device path is not registered" },
- { 0, NULL }
+ { 0, NULL }
};
+static const bluez_error_t hci_error_array[] = {
+ { HCI_UNKNOWN_COMMAND, "Unknown HCI Command" },
+ { HCI_NO_CONNECTION, "Unknown Connection Identifier" },
+ { HCI_HARDWARE_FAILURE, "Hardware Failure" },
+ { HCI_PAGE_TIMEOUT, "Page Timeout" },
+ { HCI_AUTHENTICATION_FAILURE, "Authentication Failure" },
+ { HCI_PIN_OR_KEY_MISSING, "PIN Missing" },
+ { HCI_MEMORY_FULL, "Memory Capacity Exceeded" },
+ { HCI_CONNECTION_TIMEOUT, "Connection Timeout" },
+ { HCI_MAX_NUMBER_OF_CONNECTIONS, "Connection Limit Exceeded" },
+ { HCI_MAX_NUMBER_OF_SCO_CONNECTIONS, "Synchronous Connection Limit To A Device Exceeded" },
+ { HCI_ACL_CONNECTION_EXISTS, "ACL Connection Already Exists" },
+ { HCI_COMMAND_DISALLOWED, "Command Disallowed" },
+ { HCI_REJECTED_LIMITED_RESOURCES, "Connection Rejected due to Limited Resources" },
+ { HCI_REJECTED_SECURITY, "Connection Rejected Due To Security Reasons" },
+ { HCI_REJECTED_PERSONAL, "Connection Rejected due to Unacceptable BD_ADDR" },
+ { HCI_HOST_TIMEOUT, "Connection Accept Timeout Exceeded" },
+ { HCI_UNSUPPORTED_FEATURE, "Unsupported Feature or Parameter Value" },
+ { HCI_INVALID_PARAMETERS, "Invalid HCI Command Parameters" },
+ { HCI_OE_USER_ENDED_CONNECTION, "Remote User Terminated Connection" },
+ { HCI_OE_LOW_RESOURCES, "Remote Device Terminated Connection due to Low Resources" },
+ { HCI_OE_POWER_OFF, "Remote Device Terminated Connection due to Power Off" },
+ { HCI_CONNECTION_TERMINATED, "Connection Terminated By Local Host" },
+ { HCI_REPEATED_ATTEMPTS, "Repeated Attempts" },
+ { HCI_PAIRING_NOT_ALLOWED, "Pairing Not Allowed" },
+ { HCI_UNKNOWN_LMP_PDU, "Unknown LMP PDU" },
+ { HCI_UNSUPPORTED_REMOTE_FEATURE, "Unsupported Remote Feature" },
+ { HCI_SCO_OFFSET_REJECTED, "SCO Offset Rejected" },
+ { HCI_SCO_INTERVAL_REJECTED, "SCO Interval Rejected" },
+ { HCI_AIR_MODE_REJECTED, "SCO Air Mode Rejected" },
+ { HCI_INVALID_LMP_PARAMETERS, "Invalid LMP Parameters" },
+ { HCI_UNSPECIFIED_ERROR, "Unspecified Error" },
+ { HCI_UNSUPPORTED_LMP_PARAMETER_VALUE, "Unsupported LMP Parameter Value" },
+ { HCI_ROLE_CHANGE_NOT_ALLOWED, "Role Change Not Allowed" },
+ { HCI_LMP_RESPONSE_TIMEOUT, "LMP Response Timeout" },
+ { HCI_LMP_ERROR_TRANSACTION_COLLISION, "LMP Error Transaction Collision" },
+ { HCI_LMP_PDU_NOT_ALLOWED, "LMP PDU Not Allowed" },
+ { HCI_ENCRYPTION_MODE_NOT_ACCEPTED, "Encryption Mode Not Acceptable" },
+ { HCI_UNIT_LINK_KEY_USED, "Link Key Can Not be Changed" },
+ { HCI_QOS_NOT_SUPPORTED, "Requested QoS Not Supported" },
+ { HCI_INSTANT_PASSED, "Instant Passed" },
+ { HCI_PAIRING_NOT_SUPPORTED, "Pairing With Unit Key Not Supported" },
+ { HCI_TRANSACTION_COLLISION, "Different Transaction Collision" },
+ { HCI_QOS_UNACCEPTABLE_PARAMETER, "QoS Unacceptable Parameter" },
+ { HCI_QOS_REJECTED, "QoS Rejected" },
+ { HCI_CLASSIFICATION_NOT_SUPPORTED, "Channel Classification Not Supported" },
+ { HCI_INSUFFICIENT_SECURITY, "Insufficient Security" },
+ { HCI_PARAMETER_OUT_OF_RANGE, "Parameter Out Of Mandatory Range" },
+ { HCI_ROLE_SWITCH_PENDING, "Role Switch Pending" },
+ { HCI_SLOT_VIOLATION, "Reserved Slot Violation" },
+ { HCI_ROLE_SWITCH_FAILED, "Role Switch Failed" },
+ { 0, NULL },
+};
+
+
static const char *bluez_dbus_error_to_str(const uint32_t ecode)
{
const bluez_error_t *ptr;
@@ -136,7 +191,15 @@ static const char *bluez_dbus_error_to_str(const uint32_t ecode)
return strerror(raw_code);
} else if (ecode & BLUEZ_EDBUS_OFFSET) {
/* D-Bus error */
- for (ptr = error_array; ptr->code; ptr++) {
+ for (ptr = dbus_error_array; ptr->code; ptr++) {
+ if (ptr->code == ecode) {
+ syslog(LOG_INFO, "%s - msg:%s", __PRETTY_FUNCTION__, ptr->str);
+ return ptr->str;
+ }
+ }
+ } else {
+ /* BLUEZ_EBT_OFFSET - Bluetooth HCI errors */
+ for (ptr = hci_error_array; ptr->code; ptr++) {
if (ptr->code == ecode) {
syslog(LOG_INFO, "%s - msg:%s", __PRETTY_FUNCTION__, ptr->str);
return ptr->str;