home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.misc:5154 comp.sys.sun.hardware:5406
- Path: sparky!uunet!pmafire!news.dell.com!natinst.com!cs.utexas.edu!sun-barr!news2me.EBay.Sun.COM!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!oobleck!bender
- From: bender@oobleck (Duke of Canterbury)
- Newsgroups: comp.sys.sun.misc,comp.sys.sun.hardware
- Subject: Re: Help on Serial Port configuration under SunOS
- Date: 8 Nov 1992 17:56:15 GMT
- Organization: SPARK's R US
- Lines: 51
- Message-ID: <lfql5vINNai3@appserv.Eng.Sun.COM>
- References: <1992Nov6.180039.24913@inesc.pt>
- Reply-To: bender@oobleck.eng.sun.com
- NNTP-Posting-Host: oobleck
- X-Newsreader: Tin 1.1 PL3
-
- vldias@inesc.pt (Victor Lopes Dias) writes:
- : I've got a few problems finding information on how to configure the
- : serial port device driver under SunOS.
- : I looked in the global index of the manuals looking for "line
- : discipline", an all I found was a useless piece of information about
- : the use of STREAMS, which was no use for me.
- : Where can i find information about this "line discipline" stuff ?
- : Another question I have is: Where can I find an explanation on what the
- : tty flags ANYP, CBREAK, TANDEM and MDMBUF mean ?
- : Finally, my last problem: What do IOCLT calls with TIOCLSET and FIONBIO
- : do ?
-
- Miguel,
- What version of SunOS are you running? Some of the flags and ioctl()s
- that you mention are holdovers from verions of SunOS (and Bezerkely)
- pre-SunOS 4.X. Take a look at termio/termios (i.e. man termio) if you've
- got access to a system with SunOS 4.X man pages. All of the line discipline
- stuff was subsumed (consumed? converted?) into STREAMS in SunOS 4.X, which
- represneted a major change from the way things were done in SunOS 3.X.
-
- Depending on what you want to with the serial port, most of the setup
- stuff like baud rate, parity, flow control, etc... can be done with one of
- several related ioctl() calls; for example, here's way to get the current
- settings, change a few things, clear a few other things, and tell the driver
- to use the whole mess:
-
- #include <sys/termios.h>
- #include <sys/termio.h>
-
- struct termios termios;
-
- if (ioctl(fd,TCGETS,&termios)<0)
- exit(perror("TCGETS"));
-
- termios.c_cflag = B9600|CS8|CLOCAL|CREAD|CRTSCTS|HUPCL;
- termios.c_iflag = 0;
- termios.c_oflag = 0;
- termios.c_lflag = 0;
-
- if (ioctl(fd,TCSETS,&termios)<0)
- exit(perror("TCSETS"));
-
-
- mike
-
- --
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- mike bender DOD# 007 for sale: NX-650 & VT110 Shadow 415-863-8913 (home)
- cheap advertising --> $2500/obo $2500/obo
- bender@oobleck.eng.sun.com nothin' witty here 415-336-6353 (work)
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-