I'm trying to connect a USB-Device ( build by myself ) to communicate with my development board ( ODROID-X ) Unfortunately, the examples are very little, as far as the asynchronous communication. I'd some problems with the interrupt driven data exchange - how to build the connection by using the asynchronous interrupt mode? In one direction, the transmission was possible ... but in both it doesn't work. Is there an example like this:
- send a ByteBuffer with endpoint_OUT
- get a message from device on endpoint_IN
both in interrupt mode.
Thanks a lot for your support.
Hardy
Perhaps I am misunderstanding the question here. The sample missile lanucher app that is part of the API package from level 12 onwards uses the
queue()
andrequestWait()
methods to handle interrupt type endpoints. Requests are either In or Out and depend on the direction of the EndPoint.The code for a pretty noddy request->reply looks something like this. You would want to structure real code differently but this gives you the gist of what needs to happen (I hope)
If you are actually looking for a way to run this IO in an asynchronous manner without binding a thread to it, then I think you need to consider using the
DeviceConnection.getFilehandle()
method to return a standard file handle which in theory you can then use as if it were any other file type resource. I would note however that I have not tried this.If neither of these addresses the issue please revise the question to clarify what you are struggling to find examples of. I hope this helps.