summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Crane <steve.crane@rococosoft.com>2003-02-03 17:39:11 +0000
committerStephen Crane <steve.crane@rococosoft.com>2003-02-03 17:39:11 +0000
commit805b906186b0a5ea0ce77824b4a7c659b6b7b598 (patch)
treef81c4587976d87d16ff385d536068fa2535b39e8 /src
parentbe47bbe6b4e691321240443f2915c5fba4a7d748 (diff)
use error codes
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/src/bluetooth.c b/src/bluetooth.c
index b60b0191..4548b121 100644
--- a/src/bluetooth.c
+++ b/src/bluetooth.c
@@ -105,62 +105,61 @@ int bt_error(uint16_t code)
switch (code) {
case 0:
return 0;
- case 0x01:
+ case HCI_UNKNOWN_COMMAND:
return EBADRQC;
- case 0x02:
+ case HCI_NO_CONNECTION:
return ENOTCONN;
- case 0x03:
+ case HCI_HARDWARE_FAILURE:
return EIO;
- case 0x04:
+ case HCI_PAGE_TIMEOUT:
return EHOSTDOWN;
- case 0x05:
+ case HCI_AUTHENTICATION_FAILURE:
return EACCES;
- case 0x06:
+ case HCI_KEY_MISSING:
return EINVAL;
- case 0x07:
+ case HCI_MEMORY_FULL:
return ENOMEM;
- case 0x08:
+ case HCI_CONNECTION_TIMEOUT:
return ETIMEDOUT;
- case 0x09:
+ case HCI_MAX_NUMBER_OF_CONNECTIONS:
+ case HCI_MAX_NUMBER_OF_SCO_CONNECTIONS:
return EMLINK;
- case 0x0a:
- return EMLINK;
- case 0x0b:
+ case HCI_ACL_CONNECTION_EXISTS:
return EALREADY;
- case 0x0c:
+ case HCI_COMMAND_DISALLOWED:
return EBUSY;
- case 0x0d:
- case 0x0e:
- case 0x0f:
+ case HCI_REJECTED_LIMITED_RESOURCES:
+ case HCI_REJECTED_SECURITY:
+ case HCI_REJECTED_PERSONAL:
return ECONNREFUSED;
- case 0x10:
+ case HCI_HOST_TIMEOUT:
return ETIMEDOUT;
- case 0x11:
- case 0x27:
- case 0x29:
- case 0x20:
+ case HCI_UNSUPPORTED_FEATURE:
+ case HCI_QOS_NOT_SUPPORTED:
+ case HCI_PAIRING_NOT_SUPPORTED:
+ case HCI_UNSUPPORTED_LMP_PARAMETER_VALUE:
return EOPNOTSUPP;
- case 0x12:
+ case HCI_INVALID_PARAMETERS:
return EINVAL;
- case 0x13:
- case 0x14:
- case 0x15:
+ case HCI_OE_USER_ENDED_CONNECTION:
+ case HCI_OE_LOW_RESOURCES:
+ case HCI_OE_POWER_OFF:
return ECONNRESET;
- case 0x16:
+ case HCI_CONNECTION_TERMINATED:
return ECONNABORTED;
- case 0x17:
+ case HCI_REPEATED_ATTEMPTS:
return ELOOP;
- case 0x18:
+ case HCI_PAIRING_NOT_ALLOWED:
return EACCES;
- case 0x1a:
+ case HCI_UNSUPPORTED_REMOTE_FEATURE:
return EPROTONOSUPPORT;
- case 0x1b:
+ case HCI_SCO_OFFSET_REJECTED:
return ECONNREFUSED;
- case 0x19:
- case 0x1e:
- case 0x23:
- case 0x24:
- case 0x25:
+ case HCI_UNKNOWN_LMP_PDU:
+ case HCI_INVALID_LMP_PARAMETERS:
+ case HCI_LMP_ERROR_TRANSACTION_COLLISION:
+ case HCI_LMP_PDU_NOT_ALLOWED:
+ case HCI_ENCRYPTION_MODE_NOT_ACCEPTED:
return EPROTO;
default:
return ENOSYS;