qzind / tray

Browser plugin for sending documents and raw commands to a printer or attached device.
https://qz.io
Other
855 stars 277 forks source link

HID data chunking #619

Open tresf opened 4 years ago

tresf commented 4 years ago
Error: Bounds exceeds available space: size=33, offset=83

Very similar upstream bug report: https://github.com/nyholku/purejavahidapi/issues/49 Similar stack-overflow question: https://stackoverflow.com/q/59030053/3196753

StackOverflow question: https://stackoverflow.com/questions/61552293/how-to-send-data-64-bytes-to-hid-printer-on-windows

"call": "hid.sendData",
"params": {
  "vendorId": "0a43",
  "productId": "0201",
  "usagePage": "0001",
  "serial": "0000277387",
    "data": {
      "data": "...", // truncated
      "type": "PLAIN"
        }
    }
}
Vzor- commented 4 years ago

Findings so far

tresf commented 4 years ago

I believe the API should be expanded to allow 32-byte data chunking, which seems to resolve this issue. @bberenz would you prefer this lives inside Java or JavaScript?

Working code snippet: https://gist.github.com/Vzor-/5ea13e104f91ad80cb336099edd8c277