RegionChiou / 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

Only reading zeros from CdcAcmSerialDriver #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect /dev/ttyACM0 device
2. cat /dev/tty/ACM0 and watch serial traffic
3. Use the usb-serial-for-android API and read only 0's for bytes

What is the expected output? What do you see instead?
Data other than 0's.

What version of the product are you using? On what operating system?
ICS 4.1.x

Please provide any additional information below.
I can see traffic by cat'ing the /dev/ttvACM0 device and by using the app 
"android-serialport-api" to do the same.  However, when using this library, all 
I am reading is 0's.  When the CdcAcmSerialDriver reads, it always reads the 
correct amount of data (never less than 0), but the bytes returned in the 
buffer are 0.

Original issue reported on code.google.com by mafish...@gmail.com on 18 Dec 2012 at 5:07

GoogleCodeExporter commented 9 years ago
Are you cat'ing the device concurrently while using this driver, or was that 
just an example done at a separate time?

Are you running the v0.1.0 JAR, or the latest sources in git?

Original comment by mike.wak...@gmail.com on 20 Dec 2012 at 5:35

GoogleCodeExporter commented 9 years ago
Not cat'ing the device concurrently.  Yes, running v0.1.0 JAR.

Upon further investigation, it appears that nothing is being returned at all.  
The value returned from read(...) is 0.

Original comment by mafish...@gmail.com on 20 Dec 2012 at 11:44

GoogleCodeExporter commented 9 years ago
Sorry for the delay in returning to this. Still an issue?

The driver will return 0 when there is (a) no data to be read, or (b) a timeout 
reading data.  Is it possible you are calling read() on a device which doesn't 
have the baud rate set correctly, or with a very short timeout?

Original comment by mike.wak...@gmail.com on 8 Apr 2013 at 5:47

GoogleCodeExporter commented 9 years ago
I saw this while using source instead of prebuilt. 010 jar fixed it.
 (FTDI, Samsung S3(9300),  CM 10.1).

commit 22c4c9b280da08207ea6abf7a17a51c465447e9a

Original comment by ruZ...@gmail.com on 13 May 2013 at 6:05

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

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