Skip to main content

BleError

Sealed Class: BleError

Error Handler related to BLE Connection

Properties

actionCode: Int

Action code associated with the error

errorCode: Int

Error code identifier

localizedDescription: String

Human-readable description of the error

Parameters

  • errorCode - Error code identifier
  • localizedDescription - Human-readable error description
  • actionCode - Action code associated with the error

Error Types

BluetoothDisabled

object BluetoothDisabled : BleError
  • Bluetooth is disabled
  • ErrorCode: 2
  • Description: Phone: Bluetooth is disabled, please go to settings to enable it

BluetoothUnauthorized

object BluetoothUnauthorized : BleError
  • Bluetooth permission is not granted. Ask user to grant permission from phone settings
  • ErrorCode: 1
  • Description: Phone: Bluetooth permission is not granted, please go to settings to grant permission

BluetoothUnsupported

object BluetoothUnsupported : BleError  
  • Device does not support Bluetooth Low Energy
  • ErrorCode: 3
  • Description: Phone: Device does not support Bluetooth Low Energy

KeyInvalid

object KeyInvalid : BleError
  • Authentication key in Shared Preference is invalid
  • ErrorCode: 6
  • Description: BLE: Authentication key is invalid

KeyNotFound

object KeyNotFound : BleError
  • Authentication key not found in Shared Preference
  • ErrorCode: 5
  • Description: Shared Preference: Authentication key not found

LocationUnauthorized

object LocationUnauthorized : BleError
  • Location permission is not granted
  • ErrorCode: 9
  • Description: Phone: Location permission is not granted, please go to settings - to grant permission

NotConnected

object NotConnected : BleError
  • Not connected to Ble Terminal. Call BleTerminal.connect() to connect first
  • ErrorCode: 8
  • Description: Not connected to Ble Terminal. Please connect first.

SaveAuthKeyFailed

object SaveAuthKeyFailed : BleError
  • Failed to save authentication key in Shared Preference
  • ErrorCode: 4
  • Description: Shared Preference: Failed to save the key in Shared Preference

TerminalNotFound

object TerminalNotFound : BleError
  • Unable to discover Ble Terminal, terminal might be out of range
  • ErrorCode: 7
  • Description: BLE Scan: Terminal not found

CtgError

class CtgError(ctgError: CtgError?) : BleError

Failed due to Terminal action, refer to CtgError

GattError

class GattError(gattError: GattError?) : BleError

Gatt Error. Called when BluetoothGatt onConnectionStateChange return other than GATT_SUCCESS.

See Also