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?
WriteFile
is handled by the driver, Windows doesn't fragment data sent to device-mapped files. – Hallock