The ecosbaud2posixbaud table in termiostty.c is incomplete. The baud
rate entry B1800 is missing.
I have attached a fix.

real_termios_init() is called from termios_lookup() only if the init
flag was not set before. 
I could't found where the flag is set. I think it is missing in
real_termios_init?

Because of the flag isn't set, real_termios_init() is called every time
the device is opened and requests the current device baudrate from the
ecos device.
But the value returned from map_ecosbaud_to_posixbaud() could be wrong
because of the missing B1800 entry.

One consequence is that setting a new baud rate could fail after reopen
a device (e.g. current 19200 -> new 38400), because in set_attr () the
new baud rate is only set if it is different from the current one.
nice bug ;-)

Rainer
Index: termiostty.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/serial/current/src/common/termiostty.c,v
retrieving revision 1.9
diff -u -r1.9 termiostty.c
--- termiostty.c        3 Sep 2006 17:32:31 -0000       1.9
+++ termiostty.c        30 Jan 2008 15:25:15 -0000
@@ -190,7 +190,7 @@
 
 // map eCos bitrates to POSIX bitrates.
 static speed_t ecosbaud2posixbaud[] = {
-    0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B2400, B3600,
+    0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, B2400, 
B3600,
     B4800, B7200, B9600, B14400, B19200, B38400, B57600, B115200, B230400 };
 
 // map POSIX bitrates to eCos bitrates.

Reply via email to