miaotao / android-serialport-api

Automatically exported from code.google.com/p/android-serialport-api
0 stars 1 forks source link

Opening device file with O_DIRECT fails on Dream/CM5.0.8 #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. install SerialPort_0.7.apk (CM5 already has serial port enabled)
2. start SerialPort example, configure it
3. start the console example, it will fail with "The serial port can not be 
opened for an unknown reason"

Problem seems to be in line 96 of SerialPort.c:
> fd = open(path_utf, O_RDWR | O_DIRECT | O_SYNC);
The device file is open()ed using O_DIRECT, which fails on my Dream/CM5.0.8.
Removing O_DIRECT works, but shows another Problem:

At least at my CM image, there seems to be a divisor of 4 configured for the 
ttyMSM2 port. So, when configured to 4800 baud, it will actually use 1200 baud.

This is bad, because from all standard rates, only 1200(4800), 2400(9600) and 
9600(38400) can be used.

Original issue reported on code.google.com by hubert.d...@googlemail.com on 22 Jul 2010 at 11:38

GoogleCodeExporter commented 9 years ago
The issue also exists on cm 6.1 on nexus one. Once O_DIRECT is removed, the 
unknown error will no longer occur.

Original comment by stephen....@gmail.com on 26 Nov 2010 at 9:40

GoogleCodeExporter commented 9 years ago
I'll look into the O_DIRECT issue.. 
I had a problem with O_DIRECT and also the su on a stock iconia A500 device..

Might try and improve the error reporting in the library..

Original comment by npda...@gmail.com on 16 Aug 2011 at 5:53

GoogleCodeExporter commented 9 years ago
O_DIRECT seems problematic, I will remove it in next release, thanks for the 
report.

Original comment by cedric.p...@gmail.com on 23 Oct 2011 at 9:37

GoogleCodeExporter commented 9 years ago

Original comment by cedric.p...@gmail.com on 25 Oct 2011 at 10:13

GoogleCodeExporter commented 9 years ago
Issue 5 has been merged into this issue.

Original comment by cedric.p...@gmail.com on 25 Oct 2011 at 10:15

GoogleCodeExporter commented 9 years ago
Has this issue been fixed in SerialPort_1.1.apk? I am still having the same 
issue on Gingerbread 3.2.2 "Cannot open port for unknown reason." 

Original comment by jrem...@gmail.com on 10 Nov 2011 at 1:35

GoogleCodeExporter commented 9 years ago
O_DIRECT flag has been removed in SerialPort_1.1.apk (maybe in 1.0, I 
forgot...).

Original comment by cedric.p...@gmail.com on 14 Nov 2011 at 5:30