How can I "read" the tty port?

Daniel Notov danno at 3b2.UUCP
Wed Oct 19 23:55:41 AEST 1988


I hope I'm missing the obvious on this one.

Cast of characters:
	AT&T 3B2/400 UNIX SVR3.1 and/or AT&T 6386E 386/UNIX SVR3.1
	Texas Intruments Omnilaser 2115

The TI OMNILASER is a postscript printer that also has HP LaserJet+
Emulation.  Mode selection can be controlled via PS and HP commands.

I have set up my interface file to swtich into the mode wanted via command
line options.   The problem occurs when the file has spooled out to the
printer the printer is still processing,  and the next job is sent down
the line.  

The next job is stored in its buffer,  but when the printer changes modes,
it may lose that info.  To combat this problem,  I inserted sleep's in the
script at the beginning when I change modes, and at the end when the file
has completed despooling.  The first sleep is O.K. because I know
approximately how long it takes to change modes.  The ending sleep is n.g.
because, I do NOT know when the job has completed processing.

Playing with cu,  I discovered that a ^T <CNTRL-T> causes the printer to
echo the following:
	1) In postscript mode,  job status:
		%%[status: busy; source: serial 25]
			or
		%%[status: idle]
	2) In LaserJet mode, the printer echos nothing.  The ^T's are
	discarded, and don't interfere with the text being printed.

My idea:
	After the file is despooled, and the reset sequences are sent,
	periodically poll the printer by sending ^T's.  My question,  how
	do I capture the messages echoed back by the printer? Once I get
	it,  I can guess on the the following states:

	1) Captured: nothing; still processing LaserJet Job
	2) Captured: %%[...busy...]; still processing PS Job
	3) Captured: %%[...idle...]; all processing complete,  exit script.

Sorry for rambling at length.  I wanted to get all the facts in.  Please e-mail
any responses.  I'll summarize if the volume warrants.

Tx.
danno
-- 
	Daniel S. Notov		|	{monster,uunet}!onm3b2!danno     
	Ogilvy & Mather, Inc.	|	(212) 907-4255		
	New York, NY		|				



More information about the Comp.sys.att mailing list