Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!sdd.hp.com!decwrl!nsc!pyramid!unify!mason From: mason@Unify.Com (Mark Mason) Newsgroups: comp.sys.m68k Subject: Re: Need help connecting m68k to a UNIX box. Message-ID: Date: 1 Aug 90 23:25:35 GMT References: <14703@unix.SRI.COM> <2254@sauron.Columbia.NCR.COM> Distribution: na Organization: Unify Corporation, Sacramento, CA, USA Lines: 39 In article <2254@sauron.Columbia.NCR.COM> stevem@sauron.UUCP (Steve McClure) writes: >In article <14703@unix.SRI.COM> henry@ginger.sri.com (Henry Pasternack) writes: [del...] >+ I'm having a lot of trouble getting the interface to '/dev/ttyb' >+to work. I admit to knowing virtually nothing about UNIX I/O, and >+the reference manuals aren't much help. The port already seems to be >+configured for 9600 baud, which is convenient. I do an 'fopen' on >+'/dev/ttyb' and use 'gets' and 'fprintf' to perform I/O. The Sun >+has no problem receiving command lines from the client, but when the >+client begins polling for a response after sending a request, it gets >+a garbled copy of its request back. It seems as though the buffer >+UNIX is creating is bidirectional, rather than dual-unidirectional. >+ >+ Can anyone give me an understandable explanation of how to set >+up my SPARCStation to do simple and effective I/O to the serial ports? >+ [del...] you need to do a fflush() on the stream before "changing direction" (reading -> writing or writing -> reading). like: fgets() --> fflush() fprintf() --> fflush() fgets() etc. Hope this helps. mason pyramid!unify!mason for 1 more week... mason@reed.bitnet forever! -- {{ucdavis,csun,lll-crg}!csusac,pyramid,sequent}!unify!mason -or- mason@reed.bitnet The above opinions/falsehoods/misconceptions are my own....