-
Notifications
You must be signed in to change notification settings - Fork 397
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
NodeJs library #56
Comments
What is the issue you are having with |
We are using write method - device.write(data) from node-hid to write into hid device using windows 10. We are appending first byte as '4' as per this fix reported here - node-hid/node-hid#187 Following is the example data buffer that we send to the device 4,103,73,72,48,115,67,105,65,103,73,109,108,107,73,106,111,103,73,106,65,121,79,68,89,53,78,71,81,119,76,87,69,53,78,68,89,116,77,84,70,108,79,83,49,104,78,122,82,104,76,84,100,107,89,50,73,119,89,106,81,121,78,122,73 For single write, it works fine. But when we write in a loop for about 100/500 times without any delay, it hangs in the write method. |
How fast are you attempting to write data? How big is the HID report you are attempting to send and what is the size of your device's max packet size? USB HID can only support one report every 1 millisecond. At best, and that depends on how many hubs are between the OS and the device and the HID driver on the OS. In practice it's usually much less. It would be interesting to see if you could write a native C version of your loop (using |
We have tested hidapi with native C. we are able to reproduce this issue. so the issue seems to be with hidapi. For workaround, we tried to introduce a delay of 20 milliseconds between writes in native C. In that case, it doesn't hang. Can you please let us know how to introduce this kind of delay in write operation when using node-hid module? |
That's more of a general Node.js question and depends on how your code is structured. But I might approach it using Node Timers:
|
Hi Team,
We want to use this library as node module. Having issues in using node-hid library. Can you please let us know if this library has node library?
Regards,
Gayathri
The text was updated successfully, but these errors were encountered: