MC67-Imager vs RS507 via BT

M Markus Balschbach 2 years 11 months ago
1 1 0

Hi,
 
we start developing our first application von MC67-Android devices using KK as OS-Image.
As we use RS507 with our WindowsMobile MC67-Devices we also need to do this in our Android-Applications.
In our first tests I use the code from the samples for Barcode API but without using the Listener for Scanner-Status:
 
public class ZebraScanner implements EMDKListener, ScannerControl, DataListener {
...
}
 

ScannerControl is one of my own Interfaces
we use HARD-Trigger

 
When we use the internal imager of the MC67 it is possible to scan an barcode or to press and release the hard-trigger without scanning an barcode.
In first case (after reading a barcode) scanner gets "disabled", we have to start the scanner again using Scanner.read(), in second case (no barcode scanned) we don't need to do so, that means if we don't scan a barcode and release the hard-trigger the scanner keeps enabled in state WAITING.
 
Now I used the same code for scanning with RS507. As described in tutorial about pairing the BT-scanner the device activates BT an shows the BT-adressbarcode to scan. After scanning the barcode everything's fine, we can use RS507 to scan any barcode. The difference now is that it's not possible to press the hard-trigger of RS507, release it without scanning a barcode and press it again. The RS507 doesn't change to state WAITING again, we have to activate the scanner again using Scanner.read().
 
I'm not sure whether this behavior is the normal one, the only solution was to implement the StatusListener to activate the scanner again if it's in state IDLE:
 
           ......
           // Different states of Scanner
            switch (state) {
                // Scanner is IDLE
                case IDLE:
                    statusStr = "The scanner enabled and its idle";
                    try {
                        if(scanner!=null) {
                            scanner.read();
                        }
 
 
                    } catch (ScannerException e) {
                        Log.e(TAG_SCANNER, e.getMessage());
                    }
 
 
                    break;
           ......
 
Is this a bug in Barcode API ?
As I don't want to use the StatusListener my question is whether I must do so to keep the RS507 working ?
 
Regards
Markus

Please register or login to post a reply

1 Replies

V Vedsatx Saddvv

Hello Markus, 
     I don't believe this is a bug in the Barcode API's, but likely the barcode api adapting to the the RS507 hardware and bluetooth communication.  I think it's best to always implement the StatusListener, and only call scanner.enable() when status is IDLE, the scanner is enabled and a read is not pending.

case IDLE:
                statusStr = "Scanner is idle and ready to submit read.";
                try {
                    if (scanner.isEnabled() && !scanner.isReadPending()) {
                        scanner.read();
                    }
                } catch (ScannerException e) {
                    e.printStackTrace();
                    statusStr = e.getMessage();
                }
                break;

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