diff options
author | Sven Gothel <[email protected]> | 2020-06-01 01:37:57 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-06-01 01:37:57 +0200 |
commit | 728cbb0c31ac8cab0cc6e7551c78adab5e2a4a4d (patch) | |
tree | 4df09a49017cce5759e60c6eabc171c8d82d9f6a /java | |
parent | 9ae37c02afdcd6344f32e823e40f9ee8c4a9ae0a (diff) |
Complete using definite tyep HCIErrorCode for disconnect reason; Add Mgmt DisconnectReason <-> HCIErrorCode mapping
BlueZ Kernel Mgmt uses its own disconnect reason code in its implementation, well ...
We add mapping in both directions, Mgmt DisconnectReason <-> HCIErrorCode mapping,
while exposing HCIErrorCode in the front API only as we might move to HCI at one point.
Diffstat (limited to 'java')
-rw-r--r-- | java/org/tinyb/HCIErrorCode.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/org/tinyb/HCIErrorCode.java b/java/org/tinyb/HCIErrorCode.java index cb242a7a..a2ab3ceb 100644 --- a/java/org/tinyb/HCIErrorCode.java +++ b/java/org/tinyb/HCIErrorCode.java @@ -99,7 +99,8 @@ public enum HCIErrorCode { LIMIT_REACHED((byte) 0x43), OPERATION_CANCELLED_BY_HOST((byte) 0x44), PACKET_TOO_LONG((byte) 0x45), - INTERNAL_FAILURE((byte) 0xff); + INTERNAL_FAILURE((byte) 0xfe), + UNKNOWN((byte) 0xff); public final byte value; @@ -194,7 +195,8 @@ public enum HCIErrorCode { case (byte) 0x43: return LIMIT_REACHED; case (byte) 0x44: return OPERATION_CANCELLED_BY_HOST; case (byte) 0x45: return PACKET_TOO_LONG; - case (byte) 0xff: return INTERNAL_FAILURE; + case (byte) 0xfe: return INTERNAL_FAILURE; + case (byte) 0xff: return UNKNOWN; } throw new IllegalArgumentException("Unsupported value "+value); } |