switchScannerByIndex method

Future<void> switchScannerByIndex(
  1. int scannerIndex, {
  2. String? commandTag,
  3. bool requestResult = true,
})

Switches to a scanner by its numeric index.

scannerIndex is the index of the scanner as reported by enumerateScanners.

Implementation

Future<void> switchScannerByIndex(
  int scannerIndex, {
  String? commandTag,
  bool requestResult = true,
}) {
  return sendCommand(
    command: DataWedgeApi.switchScanner,
    value: scannerIndex.toString(),
    commandTag: commandTag ?? 'SWITCH_SCANNER_INDEX_$scannerIndex',
    requestResult: requestResult,
  );
}