DS9808 Signature Capture JPEG issues

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!

Ritesh Gupta
Hi Jason,Are you using the
Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jason Williams
I am using libraries that I

I am using libraries that I obtained from the Motorola Scanner SDK (64bit) version 2.4

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jason Williams
I've noticed that the first

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.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments