How to clear data pipe?

Skip to first unread message

Aug 15, 2018, 11:10:55 PM8/15/18
to usb4java

I am currently using usb4java to interact with a famoco device. Whenever the device gets disconnected during interaction, it raises a -9 error code, which is normal considering the device got disconnected. However my issue is that when I re-connect the device to the app. It raises a -7 error code, which according to the usb4java documentation means that there is a communication timeout. The device is not communicating with the app despite being successfully reconnected.

I figured that the problem was with the data pipe since it did get disconnected in the middle of communication. Is there any way to do this?

There is currently no information about this in the documentation. I have already tried closing and re opening the connections to the device but that did not work.

Dennis Sheirer

Aug 17, 2018, 5:40:49 AM8/17/18
to usb4java
If the device has been physically disconnected from the USB port and then reconnected, I'd imagine that LibUSB would assign it a new device handle and the previous device handle that you're still attempting to use is no longer valid, thus the -7 error code.

I think there's a way to monitor the bus for new device connections ... maybe you could add a listener to be notified when new devices are connected, inspect the VID/PID for your device, and then react accordingly.

Reply all
Reply to author
0 new messages