Article View: comp.sys.next.programmer
Article #1505Re: Serial port communication difficulties
From: Robert Frank
Date: Wed, 11 Nov 1992 09:15
Date: Wed, 11 Nov 1992 09:15
55 lines
3317 bytes
3317 bytes
In article <1992Nov10.115012.29368@doug.cae.wisc.edu> writes:
>
> Friends,
> This may be more UNIX than NeXT, but here goes.
>
> I've been trying to get two way communication between a cheapy slave computer
> and to a Next through their serial ports to shuffle data back and forth.
>
> On the slave I can easily check the ports status, and if there is data,
> I can read it off byte by byte. Writing is also smooth. There are
> good routines to make sure it doesn't get hung.
>
> But on the Next, it seems much harder. I simply thought by opening
> a file being /dev/cua, I could check the ports status via feof().
> But alas, it always says theres more data there, and so it continially
> gets hung on reading after the lasst charachter is read. I tried all
> sorts of variations with the cable, conecting various permutaions of
> RTS/CTS and so on, but to no avail.
>
> In sum, the Next has no trouble reading the data from the port.
> But its only problem is that it can not find a correct answer
> for the status of the port.
>
> Is there a simple solution or a better way?
>
> I'll sumarize if theres enough interest.
>
> Thanks,
> Victor
> v_white@janus.ece.wisc.edu
Just went through NeXT answers and found this about the serial devices and flow
control. It's possibly not what's causing you headaches but you mentioned
trying different RTS / CTS settings:
On 68040 systems, the /dev/ttyfa, /dev/ttydfa, and /dev/cufa (and corresponding
serial port B devices) may be used to enable flow control on the serial port
via the RTS and CTS signals. When the serial port is accessed via these
devices, output on the port will be halted whenever the CTS signal is
deasserted and resumed when CTS is asserted by the remote host. The RTS signal
will be asserted by the NeXT system whenever the NeXT system can receive input
on the port and will be deasserted when further input can not be accepted. When
the /dev/ttyfa, etc. devices are not used (e.g., the port is opened as
/dev/ttya), RTS is always asserted while the device is open and CTS is ignored.
To enable RTS and CTS you must use the /dev/ttyfa or /dev/cufa devices.
But does this change the behavior of EOF???
-Robert
--
Robert Frank tel. + (061) 321 99 67
Institut fuer Informatik fax + (061) 321 99 15
University of Basel, Switzerland
Mittlere Strasse 142 rfc822: frank@ifi.unibas.ch (NeXT mail accepted)
CH-4056 Basel X400: S=frank;OU=ifi;O=unibas;P=switch;A=arcom;C=ch
( if all fails try frank@urz.unibas.ch )
Technical Details
Message-ID:
<1992Nov11.091546.5251@urz.unibas.ch>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!ira.uka.de!chx400!urz.unibas.ch!lucy.ifi.unibas.ch!newsReferences:
<1992Nov10.115012.29368@doug.cae.wisc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!ira.uka.de!chx400!urz.unibas.ch!lucy.ifi.unibas.ch!news Newsgroups: comp.sys.next.programmer Subject: Re: Serial port communication difficulties Message-ID: <1992Nov11.091546.5251@urz.unibas.ch> From: frank@ifi.unibas.ch (Robert Frank) Date: Wed, 11 Nov 1992 09:15:46 GMT Reply-To: frank@ifi.unibas.ch Sender: news@urz.unibas.ch (USENET News System) References: <1992Nov10.115012.29368@doug.cae.wisc.edu> Organization: Institut fuer Informatik Nntp-Posting-Host: woodstock.ifi.unibas.ch Lines: 55