BleListener

interface BleListener

Represents a listener for events and state changes related to a BleTerminal. This interface provides methods that will be invoked by the BleTerminal to notify the listener about connection status, data received, errors, etc.

Functions

Link copied to clipboard
abstract fun onError(bleError: BleError)

Called when an error occurs during a BleTerminal operation.

Link copied to clipboard
abstract fun onReconnect()

Called when bluetooth gatt return GATT_ERROR or GATT_FAILURE, after reconnect 3 times then return BleError.GATTError

Link copied to clipboard
abstract fun onRemoveAuthKeySuccess()

Called when the authentication key is successfully removed.

Link copied to clipboard
abstract fun onSaveAuthKeySuccess(terminal: BleTerminal, authKey: String)

Called when the authentication key is successfully saved.

Link copied to clipboard
abstract fun onSignalStrength(strength: BleSignalStrength, rssiValue: Int)

Called when the signal strength changes.

Link copied to clipboard
abstract fun onTerminalCommandResult(action: BleAction)

Called when a terminal command returns a result.

Link copied to clipboard
abstract fun onTerminalConnected(terminal: BleTerminal)

Called when the BleTerminal successfully connects to a device.

Link copied to clipboard
abstract fun onTerminalDidGetVehicleStats(command: Byte, getVehicleStats: GetVehicleStats)

Called when fetching vehicle stat

Link copied to clipboard
abstract fun onTerminalDidGetVehicleStatus(command: Byte, getVehicleStatus: GetVehicleStatus)

Called when fetching vehicle status

Link copied to clipboard
abstract fun onTerminalDisconnected(terminal: BleTerminal)

Called when terminal is disconnected