sendAction

fun sendAction(action: BleAction)

Executes a Bluetooth Low Energy (BLE) action on the connected peripheral.

See also

Parameters

action

The action to send.

Returns: true if the action was successfully sent and queued for execution; otherwise, returns a BleError indicating the reason for failure.

Success Conditions:

  • BleAction.VEHICLE_GET_CONFIG: return BleListener.onTerminalDidGetVehicleStat

  • BleAction.VEHICLE_GET_STATUS: return BleListener.onTerminalDidGetVehicleStatus

  • Other Actions: return BleListener.onTerminalCommandResult

Error Conditions:

  • BleError.NotConnected: The peripheral is not connected.

  • BleError.CtgError: The action resulted in a CTG error.

  • BleError.TooManyRequest: There are too many requests in the queue.

  • BleError.Timeout: The peripheral did not respond within the assigned timeout.