executeCommand method

Future<CommandResponse> executeCommand(
  1. String deviceId,
  2. ScannerCommand command
)

Sends a command to the connected BLE device.

The deviceId specifies the BLE device to send the command to. The command represents the command to be sent, along with any associated parameters. 3-letter commands should always start with '', and 4-letter commands should start with ''.

Returns a CommandResponse indicating the success or failure of the operation.

Implementation

Future<CommandResponse> executeCommand(
    String deviceId, ScannerCommand command) async {
  try {
    return await _commandExecutorsManager.sendCommand(deviceId, command);
  } catch (e) {
    _appLogger.error("Error sending command to device $deviceId: $e");
    rethrow;
  }
}