6

I am currently trying to send a string of arbitrary length to a Boca FGL46 Thermal Printer (A HID Printer) with java. On MacOS this works without issue; A 100 byte payload leads to a 100 byte output report. On windows, however, the output report is always 32 bytes + 1 byte for the reportID (0x00). I was able to avoid this issue by chunking the data into 32 byte segments, but I would like to understand the root cause.

I have tried device.setOutputReport(reportId, data, data.length); with both hid4java and purejavahidapi. I have also tried writing data directly to the device path using Windows' WriteFile. In every method, the data was truncated to 32 bytes. The same code on MacOS sends reports of any length. Why does windows have this limitation but MacOS doesn't?

Kyle Berezin
  • 597
  • 4
  • 20
  • 1
    Did you try your code with another HID Printer? My guess is that it is the "feature" of the driver for your printer. `WriteFile` is handled by the driver, Windows doesn't fragment data sent to device-mapped files. – Pak Uula Jun 17 '20 at 01:35
  • This is the only HID printer I have seen. – Kyle Berezin Jun 20 '20 at 20:50
  • So, my guess is the same - it is the issue with the driver. – Pak Uula Jun 22 '20 at 16:07
  • Possibly related: https://github.com/libusb/hidapi/issues/274 since one of the aforementioned libraries uses hidapi. – tresf Jun 24 '22 at 15:44

0 Answers0