acemind / usb-serial-for-android

Automatically exported from code.google.com/p/usb-serial-for-android
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Problems with bidirection sending/recieving with CdcAcmSerialDriver #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the latest code from git, I'm attempting to use the CdcAcmSerialDriver 
with an Android Nexus 7 (Android 4.3) tablet and an Arduino Mega with ROS 
(Robot Operating System) running ROS Serial protocol between the two devices. 
As long as I make sure that protocol packets are sent exclusively in one 
direction or the other (ie. not sending and receiving at the same time) things 
run fine.  

However, very soon after I allow packets to flow in both directions 
asynchronously I'll very quickly get an error with the 
mConnection.bulkTransfer() in the write() method returning less than zero and 
an exception being thrown which aborts the running of the 
SerialInputOutputManager.  The exception text is:

Run ending due to exception: Error writing 134 bytes at offset 0 length=134

Any ideas on what things I might try to get high speed bi-directioal transfer 
of data packets over the serial connection?

I'm going to try reducing the amount of data that bulkTransfer() will try to 
send or receive at one time or perhaps which to the UsbRequest interface which 
should it's issue with not returning how many bytes received being fixed in 
Android 4.2.  However, I thought others might have already found a solution.

Mike Thompson

Original issue reported on code.google.com by mpthomp...@gmail.com on 21 Aug 2013 at 8:53

GoogleCodeExporter commented 9 years ago
moved to github: https://github.com/mik3y/usb-serial-for-android/issues/25

Original comment by mike.wak...@gmail.com on 13 Sep 2013 at 4:39