gary-rowe / hid4java

A cross-platform Java Native Access (JNA) wrapper for the libusb/hidapi library. Works out of the box on Windows/Mac/Linux.
MIT License
229 stars 71 forks source link

The second connection is not working properly #88

Closed WanManito closed 4 years ago

WanManito commented 4 years ago

In version 0.5.0, I tested read and write normally, But here's what I did when I tried to free up resources image

No exception was reported, but when the device was opened again, it was found to be null,as shown below , image

The normal situation would be as follows image

Strangely enough, after I waited a while, the device was able to connect back to normal

I don't know if I release resources incorrectly or some other reason

gary-rowe commented 4 years ago

That looks correct, but it may be that the resources are taking longer to be released than expected. Is it still happening with latest develop-SNAPSHOT version?

WanManito commented 4 years ago

I dropped this solution in favor of USB4Java,I don't know if the solution you wrote supports Linux

gary-rowe commented 4 years ago

Thanks for getting back to me. hid4java does support Linux but if you've moved on to use usb4java instead then I'll close this issue for now.