2

I am trying to use a Datalogic barcode scanner (Gryphon 44xx model) on a Mac, from an application (i.e. I am not writing a device driver).

Instead of using the scanner's keyboard emulation I'd like to use the special USB HID scanner protocol, called "USB-OEM" mode by Datalogic.

I've already successfully managed to use a different scanner in this mode (a GoDEX model), which sends me HID packets whenever it scans a code.

However, the Datalog scanner doesn't attempt to scan nor sends scanning data to the Mac.

I then learned that the Datalogic scanner expects to get additional configuration data from the host before it starts scanning. I was told that I need to send a HID datagram with the following contents: {0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} or {1, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} (the person had figured that out by using a USB packet sniffer). (See German forum article).

However, I have no clue how to accomplish that on OS X. Or rather, whatever I've tried, it doesn't work. At best, I get a response with the values 81 00 00 00 00 00 00 00 00, but have no idea what that means, either.

I've tried using the USB Prober (on OS X 10.7.5) to see what data actually gets transmitted to the scanner but the tool doesn't seem to be able to show me the transferred packets, either: When using its logging feature at level 6, I see nothing, while at 7 I get 1000s of lines of output per second and have no way of finding any packet data related to my communication in it - sadly, there's also no docs for this tool, or are there?.

I've also had a look at some of the USB HID and POS (Point Of Sale) specs, but I do not understand any of it, despite looking at it for hours.

Can anyone give me some pointers on how to interpret the POS specs, how to find that option to enable the scanner in it, and how it relates to the IOKit (user level) functions for configuring it? I mean, there's all that talk about reports and such, but I cannot connect the dots between the specs and the OS X API.

Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149

1 Answers1

4

Turns out that I had interpreted the logged data incorrectly.

The scanner needs to be sent a message with only 11 bytes: {17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

That will enable it.

The scanner then responds with datagram of 64 byte length in this format:

Byte 0: length of payload
Byte 1: status byte 0
Byte 2: status byte 2
Byte 3: status byte 2
Byte 4 to <length minus 4>: barcode data and type code
Byte <length of payload> to 63: zero

The type code is one to three bytes that identify the label type, e.g. it's 00h 33h 0Bh for QR Code and 00h 18h 0Bh for Code 128.

Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149
  • Where did you find all this information? I've found out that DataLogic is using IBM SurePOS but I can't find the spec anywhere. I'm trying to backwards engineer the thing with some software called ShowHidCom(https://honeywellsps.my.salesforce.com/sfc/p/00000000SK3U/a/A00000000Grs/qqBL24sOaoFgV1U5oa1LaVBO41IUFT0PbmB7q_0B60w) and Wireshark USB PCAP. I also have a Symbol scanner with the same IBM SurePOS spec. My Honeywell scanner uses the standard HID POS (https://www.usb.org/document-library/hid-point-sale-usage-tables-102). – Austen Stone Feb 14 '20 at 20:49
  • I got the info from someone who did RE it, too. I found no official specs – Thomas Tempelmann Feb 16 '20 at 05:58
  • 2
    I've reverse-engineered a bit more of it. The Zebra LS2208 scanner in "IBM Hand-Held USB" mode sends the same format. For fixed-length symbologies, there is only a single symbology identifier byte following the barcode. For variable-length symbologies, the last byte is always 0x0B and the previous byte identifies the symbology and the byte before that is either 0x00 or 0x10 depending on whether the barcode data continues in the following input report. (More: https://supportcommunity.zebra.com/s/question/0D50H00008JjMgF. Zebra doesn't seem to know anything about this format.) – jnm2 Oct 31 '20 at 02:34