home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / next / programm / 7166 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.5 KB  |  35 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!marcel
  3. From: marcel@opal.cs.tu-berlin.de (Marcel Weiher)
  4. Subject: Re: Serial port communication difficulties 
  5. Message-ID: <1992Nov11.224715.12841@cs.tu-berlin.de>
  6. Sender: news@cs.tu-berlin.de
  7. Organization: Techn. University of Berlin, Germany
  8. References: <1992Nov10.115012.29368@doug.cae.wisc.edu> <1992Nov11.091546.5251@urz.unibas.ch>
  9. Date: Wed, 11 Nov 1992 22:47:15 GMT
  10. Lines: 23
  11.  
  12.  
  13. >In article <1992Nov10.115012.29368@doug.cae.wisc.edu>  writes:
  14. > Friends,
  15. > This may be more UNIX than NeXT, but here goes.
  16. [...]
  17. > But on the Next, it seems much harder.  I simply thought by opening
  18. > a file being /dev/cua, I could check the ports status via feof().
  19.                                                              ^^^^^^
  20. > But alas, it always says theres more data there, and so it continially
  21. > gets hung on reading after the lasst charachter is read.  I tried all 
  22. > sorts of variations with the cable, conecting various permutaions of 
  23. > RTS/CTS and so on, but to no avail.
  24.  
  25. If you want exact control over the serial lines, don't use buffered
  26. I/O ( fopen,fclose,getchar,feof) but UNIX system calls like open,
  27. write,read and:  ioctl().  This last call will let you set raw/cooked/
  28. cbreak mode, change baud rates, tell write() to treat some parameters
  29. as timers etc.  For more information:  man 4 tty.
  30.  
  31. (BTW:  Your e-mail bounced)
  32.  
  33. Marcel
  34.