home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / xenix / sco / 2794 < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.2 KB  |  34 lines

  1. Newsgroups: comp.unix.xenix.sco
  2. Path: sparky!uunet!mcsun!ieunet!tcdcs!maths.tcd.ie!jaymin
  3. From: jaymin@maths.tcd.ie (Jo Jaquinta)
  4. Subject: Writing 8-bit data out tty ports
  5. Message-ID: <1992Sep2.154342.19442@maths.tcd.ie>
  6. Organization: Dept. of Maths, Trinity College, Dublin, Ireland.
  7. Date: Wed, 2 Sep 1992 15:43:42 GMT
  8. Lines: 24
  9.  
  10.     We have our own in-house communications protocol and I am porting
  11. it to work under SCO unix. The problem is I just can't seem to get it
  12. to send 8-bit data out the serial ports. The relevant code is:
  13.     ...
  14.     sprintf(fname, "/dev/tty1%c", com + '@');
  15.     portfd = open(fname, O_RDWR);
  16.     if (portfd < 0)
  17.         return(-1);
  18.     x = ioctl(portfd, TCGETA, &tty);
  19.     tty.c_cflag = (B4800|CS8|CREAD|CLOCAL);
  20.     tty.c_lflag = 0;
  21.     tty.c_cc[VMIN] = 0;
  22.     tty.c_cc[VTIME] = 0;
  23.     x = ioctl(portfd, TCSETA, &tty);
  24.     ...
  25. Am I missing some obvious ioctl flag?
  26.         Cheers,
  27.                     Jo Grant
  28.  
  29. _______________________________________________________________________________
  30. Jo Grant            | "Love is blind, or so it seems, to make me
  31. jaymin@lanczos.maths.tcd.ie    | offer you my dreams. But after all is said and
  32. 44 Bancroft Ave., Tallaght,    | done, a blind man's dreams are not much fun."
  33. Dublin 24, IRELAND        | -- Horslips, "The Blind Can't Lead the Blind"
  34.