How to cancel a continuous read

Hi,

I want to start and stop a continuos read by button press.

I have set AimType to ScannerConfig.AimType.CONTINUOUS_READ and TriggerType to Scanner.TriggerType.SOFT_ONCE. With the next scanner.read() the continuous reading starts. But how can I cancel the read? Calling scanner.cancelRead()  seems to have no effect in continuous read mode.

Anonymous (not verified)
The documentation for

The documentation for Continuous Read is here: ScannerConfig.AimType (app API)  but only talks about not re-submitting the read.  I suggest trying scanner disable which should forcibly cancel the current read, though you would need to call enable() after before submitting another read: Scanner (app API) .  I suspect the continuous read feature was designed primarily for use with the hardware trigger.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


sadf weafwfwef
Thank you for your reply!

Thank you for your reply!

Disabling the scanner does not help either. If I try to disable the scanner the following error appear in the log:

E/ScannerFramework: [StackAdapter::DisableScanner] Disable scanner failed, Invalid state machine state (6) for user

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Are you holding the button

Are you holding the button down whilst scanning and trying to cancel the read whilst holding the button down? 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


sadf weafwfwef
No. In this scenario I do not

No. In this scenario I do not uese the Hardware Buttons at all.

I start the read like that:

1) set scanner.triggerType = Scanner.TriggerType.SOFT_ONCE

2) call scanner.read()

-> state switches to SCANNING

When I start the read this way and I do not read a barcode then I can cancel the read with scanner.cancelRead(). The state becomes IDLE and then WAITING. But after the first successful read (onData was called) I can not cancel the read anymore. Even calling scanner.disable() has no effect except the error in the log.

Now the only way to cancel the readning is pushing a hardware button short.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Interesting, from the

Interesting, from the description it does sound like a bug, or at least the feature was designed with only the hardware scanner in mind.  Do you have a support contract at all?  I ask because you would get a quicker response or resolution if you went through the support channels... if not, I would still notify our dev team but I couldn't say when it would be addressed.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


sadf weafwfwef
Yes, we have a support

Yes, we have a support contract. I will adress the problem this way. Thanks for your help!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments