home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / sun / misc / 5154 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  2.7 KB

  1. Xref: sparky comp.sys.sun.misc:5154 comp.sys.sun.hardware:5406
  2. 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
  3. From: bender@oobleck (Duke of Canterbury)
  4. Newsgroups: comp.sys.sun.misc,comp.sys.sun.hardware
  5. Subject: Re: Help on Serial Port configuration under SunOS
  6. Date: 8 Nov 1992 17:56:15 GMT
  7. Organization: SPARK's R US
  8. Lines: 51
  9. Message-ID: <lfql5vINNai3@appserv.Eng.Sun.COM>
  10. References: <1992Nov6.180039.24913@inesc.pt>
  11. Reply-To: bender@oobleck.eng.sun.com
  12. NNTP-Posting-Host: oobleck
  13. X-Newsreader: Tin 1.1 PL3
  14.  
  15. vldias@inesc.pt (Victor Lopes Dias) writes:
  16. : I've got a few problems finding information on how to configure the
  17. : serial port device driver under SunOS.
  18. : I looked in the global index of the manuals looking for "line
  19. : discipline", an all I found was a useless piece of information about
  20. : the use of STREAMS, which was no use for me.
  21. : Where can i find information about this "line discipline" stuff ?
  22. : Another question I have is: Where can I find an explanation on what the
  23. : tty flags ANYP, CBREAK, TANDEM and MDMBUF mean ?
  24. : Finally, my last problem: What do IOCLT calls with TIOCLSET and FIONBIO
  25. : do ?
  26.  
  27. Miguel,
  28.   What version of SunOS are you running?  Some of the flags and ioctl()s
  29. that you mention are holdovers from verions of SunOS (and Bezerkely)
  30. pre-SunOS 4.X.  Take a look at termio/termios (i.e. man termio) if you've
  31. got access to a system with SunOS 4.X man pages.  All of the line discipline
  32. stuff was subsumed (consumed? converted?) into STREAMS in SunOS 4.X, which
  33. represneted a major change from the way things were done in SunOS 3.X.
  34.  
  35.   Depending on what you want to with the serial port, most of the setup
  36. stuff like baud rate, parity, flow control, etc... can be done with one of
  37. several related ioctl() calls; for example, here's way to get the current
  38. settings, change a few things, clear a few other things, and tell the driver
  39. to use the whole mess:
  40.  
  41.     #include <sys/termios.h>
  42.     #include <sys/termio.h>
  43.  
  44.     struct termios termios;
  45.  
  46.         if (ioctl(fd,TCGETS,&termios)<0)
  47.                 exit(perror("TCGETS"));
  48.  
  49.         termios.c_cflag = B9600|CS8|CLOCAL|CREAD|CRTSCTS|HUPCL;
  50.         termios.c_iflag = 0;
  51.         termios.c_oflag = 0;
  52.         termios.c_lflag = 0;
  53.  
  54.         if (ioctl(fd,TCSETS,&termios)<0)
  55.                 exit(perror("TCSETS"));
  56.  
  57.  
  58. mike
  59.  
  60. --
  61.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62.  mike bender  DOD# 007  for sale: NX-650 & VT110 Shadow    415-863-8913 (home)
  63.     cheap advertising -->    $2500/obo    $2500/obo
  64.  bender@oobleck.eng.sun.com    nothin' witty here    415-336-6353 (work)
  65.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66.