DS9808 Signature Capture JPEG issues

// Expert user has replied.
J Jason Williams 2 years 11 months ago
7 2 0

Hi folks,
 
I'm writing a JPOS application that is listening to Signature Capture bar code scanner results and my DS9808 is only sending back a valid JPEG about one in every three scans. Am I possibly doing something wrong.
 
I've scanned the barcode for USB (IBM Hand-held), Enable Signature Capture and JPEG Signature Format (although it's the default) and I'll include some code below.
 
public class Listen implements DirectIOListener, DataListener, ErrorListener, StatusUpdateListener{
public void dataOccurred(DataEvent de) {
 
...
            if(type == 501){
                try{
                    System.out.println("Bytes size start " + bytes.length);
                    byte typeByte = bytes[0];
                    System.out.println("typeByte " +typeByte);
                    byte sigType = bytes[1];
                    System.out.println("sigType " +sigType);
                    byte[] size = new byte[]{bytes[2], bytes[3], bytes[4], bytes[5]};
                    byte[] image = Arrays.copyOfRange(bytes, 6, bytes.length);
                    String base64 = Base64.encode(bytes);
                    System.out.println("Bytes size end " + image.length);
 
                    String s = new String(image);
                    FileOutputStream outputFile = new FileOutputStream("C:\\Users\\jwilliams\\Desktop\\output" + System.currentTimeMillis() + ".jpg");
                    OutputStreamWriter outputSW = new OutputStreamWriter(outputFile, "ISO-8859-1");
                    outputSW.write(s);
                    outputSW.close();
                    outputFile.close();
                    System.out.println("File Closed");
                    sendBeepCode(scn, "20");
 
...
 
Thanks for any help in advance!

Please register or login to post a reply

2 Replies

J Jason Williams

I've noticed that the first two bytes of the "jpeg" image that is bad is never C3 BF but the good images always start with C3 BF and end with C3 99. So, I've at least got a way to detect bad images and report those back to the user now.

R Ritesh Gupta

Hi Jason,

Are you using the SNAPI SDK? https://portal.motorolasolutions.com/Support/US-EN/Resolution?solutionI…

-Ritesh

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