Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HID data chunking #619

Open
tresf opened this issue Apr 16, 2020 · 2 comments
Open

HID data chunking #619

tresf opened this issue Apr 16, 2020 · 2 comments
Assignees
Milestone

Comments

@tresf
Copy link
Contributor

tresf commented Apr 16, 2020

Error: Bounds exceeds available space: size=33, offset=83

Very similar upstream bug report: nyholku/purejavahidapi#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"
        }
    }
}
@tresf tresf added this to the 2.1.1 milestone Apr 16, 2020
@Vzor-
Copy link
Contributor

Vzor- commented Apr 30, 2020

Findings so far

  • Using PureJavaHidApi on Windows with a message larger than 33 bytes, an error is thrown.
  • Hid4jJava on Windows does not throw an error, though the report is truncated to 33 bytes (32 bytes of message data)
  • On MacOS using Hid4jJava the entire message is sent to the device without issue

@tresf tresf changed the title HID Error Using PureJavaHIDAPI HID data chunking May 1, 2020
@tresf
Copy link
Contributor Author

tresf commented May 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants