1

I'm using a SocketScan Mobile scanner in SPP mode. When I read the scanned data I get a Unicode prefix/suffix appended to the barcode text (which does not appear to be encoded in Unicode). I've set the scanner to "data as is" mode, using the No Prefix or Suffix barcode (#FNB 4160C100000#) found in the Command Barcodes manual. I was not expecting to see any prefix or suffix. The Unicode encoding does not decode into anything meaningful.

Can someone tell me what is being prepended/appended when I read the raw data from the COM port?

I suspect it is information on the type of barcode scanned. Here is an example of what I get when I scan the barcode EQ0000013158 (I think it's a UPC-8 code, but not sure):

\u0002\0)\0d\u0001\0\u0017\0\0\0\0\0\f\0\u0001\0\u0006EQ0000013158\r]C0DB3`E5\u0003

Even better can someone point me to a technical manual that describes what these codes mean?

soundslikeodd
  • 1,078
  • 3
  • 19
  • 32
Los2000
  • 54
  • 8

1 Answers1

1

In SPP mode, the Scanner is using a protocol. That's is what you're seing. In your case the protocol starts by 02 and ends by 03.

EricG
  • 154
  • 5
  • So, if I understand correctly, this is the raw data that's encoded in the bar code, and not something the scanner is inserting? BTW, it's Code 128-B. – Los2000 Jan 23 '17 at 23:11
  • The protocol is added by the firmware to send the barcode decoded data to the host. So these "extra" bytes are not part of the barcode. – EricG Jan 25 '17 at 17:36
  • Thanks EricG. I guess my concern is if this protocol data is consistent, and can just be filtered out, or does the format change based on the type of barcode scanned. I searched the internet for encoding protocols related to barcodes, especially for Code-128 which is the type of barcode I'm testing with, and none of them seemed to match up with the data I'm seeing. I suppose I'll try other formats to see if there are any differences. – Los2000 Jan 25 '17 at 22:43
  • The number of bytes in front of the barcode decoded data might change because there is a sequence number and a payload size that might get DLE'd. The 02 is STX and 03 is ETX if these bytes are found in the orginal payload they are escaped with DLE (0x10). Also Socket uses different protocol on different scanner models. Hope this helps. – EricG Jan 27 '17 at 02:30