CtgError
Sealed Class: CtgError
Error Handler related to CTG Terminal. It reaches your app wrapped in BleError.CtgError. InvalidKey, Fail, NoKey, ScriptFail and NoScript are answers from the terminal; Timeout, Unsuccessful and TooManyRequest are raised by the SDK itself. None of them closes the connection.
Parameters
errorCode- Error code identifierlocalizedDescription- Human-readable error descriptionactionCode- Action code associated with the error
Error Types
Fail
class Fail(val actionCode: Int) : CtgError
- Terminal response failed, default return value
- ErrorCode: 23
- Description: Terminal error: Failed
actionCodecarries the raw command byte of the command that failed, as anInt:
actionCode | Command |
|---|---|
| 57 | LOCK |
| 58 | UNLOCK |
| 59 | HEADLIGHT |
| 60 | HORN |
| 61 | UNLOCK_NOKEYFOB |
| 63 | GET_LOCK_STATE, including the lock-state read the SDK makes itself after connecting and after LOCK and UNLOCK |
| 45 or 56 | The connection handshake or the authentication |
| -1 | An answer the SDK could not match to a command |
InvalidKey
object InvalidKey : CtgError
- Terminal response failed with invalid key
- ErrorCode: 21
- Description: Terminal error: Invalid key
NoKey
object NoKey : CtgError
- Terminal response failed with no key
- ErrorCode: 24
- Description: Terminal error: No key
NoScript
object NoScript : CtgError
- Terminal response failed with no script
- ErrorCode: 27
- Description: Terminal error: No script
ScriptFail
object ScriptFail : CtgError
- Terminal response failed with script fail
- ErrorCode: 26
- Description: Terminal error: Script failed
Timeout
object Timeout : CtgError
- Raised by the SDK: the terminal did not answer a command, or the authentication, within the timeout given to
BleTerminal.scanAndConnectToPeripheral(). From 3.0.4 also raised when the terminal accepted the Bluetooth connection but did not answer the handshake in time. The connection stays open. - ErrorCode: 22
- Description: Terminal error: Timeout
Unsuccessful
object Unsuccessful : CtgError
- Raised by the SDK: the answer to
VEHICLE_GET_CONFIGorVEHICLE_GET_STATUScould not be read - ErrorCode: 25
- Description: Terminal error: Unsuccessful
TooManyRequest
object TooManyRequest : CtgError
- Raised by the SDK: 3 commands are already waiting for an answer, so this one was not sent to the terminal. Any additional command can be sent once one of the 3 previously sent commands is completed. The lock-state read the SDK makes itself right after connecting counts as one of the 3.
- ErrorCode: 28
- Description: Terminal error: Exceed maximum 3 concurrent commands
Properties
actionCode: Int
Action code associated with the error
errorCode: Int
Error code identifier
localizedDescription: String
Human-readable description of the error
See Also
- BleError - Parent error class
- GattError - GATT-specific errors
- BleListener - For error handling callbacks