Console question
Thomas Doerfler
Thomas.Doerfler at imd-systems.de
Mon Nov 1 17:37:06 UTC 2004
Etienne,
yes it's definitively cool! For me, reading the
Linux man pages for tcsetattr/tcgetattr was of great
help, althugh they do some details (concerning
timeouts) differently than RTEMS.
By the way, how are things going concerning th DOSFS
Formatter? I have started to think, how the code
might be arranged, and I have found a solution which
is not TOO difficult to implement and is quite
interwoven with the existing DOSFS/FAT code. With
this, my planned formatter would sit on top of the
RTEMS DOSFS/FAT code, using all the differentiation
already present concerning FAT12/FAT16/FAT32
distinctions.
Does it make sense for me to really start
implementing it, or do you already have a almost
complete solution?
wkr,
Thomas.
> Thanks Thomas,
> So if I understand well, I just have to reconfigure termios with
> tcsetattr() and that's it? Cool!
>
> Etienne Fortin
> Sensio
>
>
> -----Message d'origine-----
> De : Thomas Doerfler [mailto:Thomas.Doerfler at imd-systems.de]
> Envoyé : 1 novembre, 2004 12:26
> À : Etienne Fortin
> Cc : rtems-users at rtems.com
> Objet : Re: Console question
>
>
> Etienne,
>
> as always, it depends :-)
>
> If you have a termios based console driver, things are quite
> simple, you can set your console device to "transparent"
> operation without echo, CR/LF conversion or other special
> character filtering.
>
> Here is a sniplet from one of my applications, setting the
> serial port to transparent mode, and make the receive (read)
> function wait at most 1 second...
>
> --------------------------------------------
> struct termios old_termsettings;
> struct termios new_termsettings;
> /*
> * save old termios settings,
> * set new ones:
> * - read with timeout
> * - set hardware handshake
> */
> if (0 > tcgetattr(dev_fd,&old_termsettings)) {
> rc = pgh_error_io;
> errlog_printf(__FILE__,__LINE__,rc,
> "%s: can't get device attributes for
> %s",argv[0],dev_name);
> }
> else {
> new_termsettings = old_termsettings;
> new_termsettings.c_lflag
> &= ~(ICANON|ECHO|ECHONL|ECHOK|ECHOE|ECHOPRT|ECHOCTL);
> new_termsettings.c_cflag |= CRTSCTS;
> new_termsettings.c_cc[VMIN] = 0; /* minimum receive
> chars: 0 */
> new_termsettings.c_cc[VTIME] = 10; /* minimum time to wait
> for rx: 1sec*/
>
> if (0 > tcsetattr(dev_fd,TCSANOW,&new_termsettings)) {
> --------------------------------------------
> wkr,
> Thomas.
>
>
> > Hi everyone,
> > A very simple question: How does the console deal with the very
> > unpleasant issue of CR/LF end of lines? I mean, is there any
> > conversion or what you receive is exactly what was sent by the remote
> > device and vice-versa?
> >
> > The reason I ask is that I want to code the XMODEM-1K transfer
> > protocol on top of my serial connection, which is controled by
> > termios. I need to know if the CR/LF will get mixed up.
> >
> > Thanks,
> >
> > Etienne Fortin
> > Sensio
>
> --------------------------------------------
> IMD Ingenieurbuero fuer Microcomputertechnik
> Thomas Doerfler Herbststrasse 8
> D-82178 Puchheim Germany
> email: Thomas.Doerfler at imd-systems.de
> PGP public key available at: http://www.imd- systems.de/pgp_keys.htm
>
>
--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler Herbststrasse 8
D-82178 Puchheim Germany
email: Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm
More information about the users
mailing list