From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10b612,267113743ad1ea9b X-Google-Attributes: gid10b612,public X-Google-Thread: 11035d,267113743ad1ea9b X-Google-Attributes: gid11035d,public X-Google-Thread: 1164f8,267113743ad1ea9b X-Google-Attributes: gid1164f8,public X-Google-Thread: 1014db,267113743ad1ea9b X-Google-Attributes: gid1014db,public From: ellios@gatwick.geco-prakla.slb.com (Simon Elliott) Subject: Re: Raw Serial Port Date: 1996/10/28 Message-ID: <551ri9$bgf@alpha.gatwick.Geco-Prakla.slb.com>#1/1 X-Deja-AN: 193136034 distribution: inet references: <326CDFC7.41C6@dba-sys.com> content-type: Text/Plain; charset=US-ASCII organization: Schlumberger Geco-Prakla mime-version: 1.0 newsgroups: comp.lang.c,comp.unix.solaris,comp.sys.dec,comp.unix.ultrix In article <326CDFC7.41C6@dba-sys.com>, richf@dba-sys.com says... [SNIP] > Now we are porting to Digital Unix 4.0, which obviously does not >bother with SunOS backwards compatibility. (They do document >BSD compatibity methods for code using sgttyb, but it is not >the same as Sun implemented it.) The "right" way to go should be to >use the new Posix termios method for controlling the serial port. >So, if anyone knows the magic Posix incantation to have Unix not do >any filtering of serial data--period--please share the spell. We're having this problem on Solaris 2.5. The standard POSIX way to get a raw serial port is as follows: struct termios MyTermios; int MyFile; if (tcgetattr (MyFile, &MyTermios) == -1) /* error */ MyTermios.c_cc[VMIN] = 1; MyTermios.c_cc[VTIME] = 0; MyTermios.c_lflag &= ~(ECHO|ICANON|ISIG|ECHOE|ECHOK|ECHONL); MyTermios.c_oflag &= ~(OPOST); if (tcsetattr (MyFile, TCSANOW, &MyTermios) == -1) /* error */ You also probably want to get rid of xon/xoff processing and a few other undesirable things: MyTermios.c_iflag &= ~(BRKINT|ICRNL|INLCR|ISTRIP|IXOFF|IXON|PARMRK); As far as I'm aware there is no standard POSIX way of disabling hardware flow control, should you want to do this. I would be interested in hearing how this works out on your system. Regards Simon Elliott Geco-Prakla Senior Software Engineer Schlumberger House Land Acquisition Technical Support Buckingham Gate voice : +44 1293 55 6649 GATWICK AIRPORT fax : +44 1293 55 6640 RH6 0NZ email : ellios@gatwick.geco-prakla.slb.com United Kingdom