termios

Angelo Fraietta angelo at hunterlink.net.au
Tue Sep 18 01:31:17 UTC 2001


I am using the following for my raw data through termios. I have not ahd an error
yet. The read blocks until a char is ready.

 bool ret = false;
 struct termios ts; // define a termios structure to modify in order to set the
terminal parameters

 Close();
 _file = open (port_name, O_RDWR);

 if (_file >= 0)
  {
   ret = true;
   // let us set the terminal up
   tcgetattr(_file, &ts);
   ts.c_lflag &= ~(ICANON | ISIG | ECHO | ECHOE |ECHOK | ECHONL | ECHOPRT);
   ts.c_cc[VMIN] = 1;
   ts.c_cc[VTIME] = 0;
   ts.c_oflag &= ~OPOST;
   ts.c_iflag &= ~ICRNL;
   ts.c_iflag &= ~BRKINT;
   ts.c_iflag |= IGNBRK;
   ts.c_iflag &= ~CRTSCTS;
   ts.c_iflag &= ~(IXON | IXOFF | IXANY);

   tcsetattr(_file, TCSANOW, &ts);
   _isOpen = true;
  }

 return ret;


peter.o.mueller at gmx.de wrote:

> Hello,
>
> I want to use the ns16550 serial driver/termios for implementing a serial
> protocol. Sending and receiving ascII data works without problems. Also sending
> binary data seems to work. But when I try to receive binary data with bit 8
> set data bytes are ignored by termios (I have checked that the 16550 driver
> receives that chars).
>
> I assume that my termios settings are not correct. Can anyone send me
> termios settings for sending/receiving binary data that are known to work? I have
> configured termios to return after one byte was recieved without timeout.
>
> We use not the latest snapshot (may 2001). Are there changes in newer
> snapshots relevant for the termios code?
>
> Thanks,
> Peter
>
> --
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net

--
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page

http://www.users.bigpond.com/angelo_f/

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)





More information about the users mailing list