TC75 - soft scan trigerring scontinuous mode

D Deepak Jeswani 3 years 7 months ago
6 1 0

We are using soft scan button in our app to trigger scanning on TC75. But by default, it always starts with continuous mode . The beam stays on for a long time and even if I change the beam timer to 200 , it still stays on.
How can I change soft scan button to not use continuous scanning and work like hard trigger.?
 
Please find the code below:
 
private void softScan() {
  Log.d("DEBUG", "called softScan");
 
 
  if (scanner != null) {
 
 
  try {
 
 
  // Reset continuous flag
  bContinuousMode = false;
 
 
 
  if (scanner.isReadPending()) {
  // Cancel the pending read.
  scanner.cancelRead();
  }
  scanner.triggerType = TriggerType.SOFT_ONCE;
  ScannerConfig config = scanner.getConfig();
                
                 config.readerParams.readerSpecific.laserSpecific.beamTimer=200;
                 config.decoderParams.code11.enabled = true;
      config.decoderParams.code39.enabled = true;
      config.decoderParams.code128.enabled = true;
      config.decoderParams.upca.enabled = true;
      config.decoderParams.ean8.enabled = true;
      config.decoderParams.ean13.enabled = true;
      config.decoderParams.i2of5.enabled = true;
      config.decoderParams.i2of5.redundancy = true;
      config.decoderParams.i2of5.length1 = 10;
      config.decoderParams.i2of5.length2 = 10;
      config.scanParams.decodeAudioFeedbackUri = "system/media/audio/notifications/decode.wav";
 
 
                 scanner.setConfig(config);
  scanner.read();
 
 
  new AsyncUiControlUpdate().execute(true);
 
 
  } catch (ScannerException e) {
 
 
  System.out.println("Status: " + e.getMessage());
  }
  }
  }

Please Register or Login to post a reply

1 Replies

Y Yanis Dalabiras

Hi,

You could initiate the scan with by calling read() when the soft scan button in your app is pressed down.  When the button is released (before a barcode is scanned) you could call cancelRead() which should stop the beam.

Some other thoughts:
- You should only need to configure the scanner once, doing so every time you scan could lead to performance issues
- The beamTimer is not used to limit the time the beam is emitted as you are doing here, though the documentation is unclear I thought it was used in some other case (e.g. continuous scanning), though somebody more knowledgeable may correct me here!
- Have you considered using Swipe Assist? Swipe Assist , it is available on TC75 and can be used to capture data almost as you describe.

CONTACT
Can’t find what you’re looking for?