Closed a751116023 closed 3 years ago
Thank you for bringing this to my attention. I need more details before I can comment.
Which version of hid4java
are you using?
What are you expecting to see that you are not?
An error code of -1 indicates a failure so can you provide more details.
Google translate: 谢谢您引起我的注意。 我需要更多详细信息才能发表评论。
您使用的是哪个版本的hid4java?
您期望看到什么不是您?
错误代码-1表示失败,因此您可以提供更多详细信息。
我用的0.7.0版本的
Google translate: I use version 0.7.0
这个是监听厂家软件发送的usb数据包的截图:
Google translate: This is a screenshot of the usb data packet sent by the manufacturer's software
这个是hid4java-0.7.0发送的write()函数的数据包的截图:
Google translate: This is a screenshot of the data packet of the write() function sent by hid4java-0.7.0:
问题解决了,原因是一个读卡器在操作系统注册了2个HID device,hid4java默认拿的第一个设备操作,第二个是可以正常使用的。我改下代码重新打包下使用
Google translate: The problem is solved. The reason is that a card reader registers 2 HID devices in the operating system. Hid4java uses the first device to operate by default, and the second one can be used normally. I changed the code to repackage and use
That is good news. I'm glad you were able to fix the problem. Good luck with your project.
Google translate: 这是个好消息。 很高兴您能够解决此问题。 祝您的项目好运。
厂家软件监听到的USB用的是这个函数,我用hid4java的write()和sendFeatureReport()方法都报错-1,监听到的数据包用的还是函数。
比如我的代码,设备已经被打开:
Google translate: The USB monitored by the manufacturer's software uses this function. I used hid4java's write() and sendFeatureReport() methods to report an error of -1. The monitored data packets are still functions. For example, in my code, the device has been opened: