🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #70

Re: Sending special characters to serial connected LaserWriter

#70
From: Chris Lewis
Date: Wed, 28 Oct 1992 23:30
68 lines
3700 bytes
In article <4353@vidiot.UUCP> brown@vidiot.UUCP (Vidiot) writes:
>You will need to send to output to a PostScript printer that has a parallel
>port, and not a serial port.  Binary data cannot be sent through a serial
>port, plain and simple.  Too many problems.  Things like Xmodem work because
>there is a program on each end that works with serial ports to transfer data
>in binary (or what is know as Unix raw mode).  But, with a printer, raw mode
>can't be used, otherwise XON/XOFF woudln't work for software handshaking.

Sorry Michael, this is really close to being 100% bogus...

Raw has nothing to do with 8 bit.  Except in really primitive (V7 or
older pure BSD) systems.

Any system that supports termio or termios (System V, SunOS, HPUX, AIX,
*anything* with any pretensions of being Posix compliant) can go to 8 bit
and transmit *any* byte from 0x00 through 0xff without going "raw" or even
"cbreak" or losing XON/XOFF flow control.  It's just a "stty cs8 -opost".
(8 bit, plus no output processing - tab expansion, and \n processing
must be disabled.)

If this didn't work, there'd be a *lot* of very unhappy psroff users who's
psroff -> HP Laserjet (or groff -> psroff -> HP Laserjet ;-) configurations
wouldn't work anymore - psroff downloads PCL fonts which are binary....

Lots of people run serial terminals with this turned on and they don't lose
XON/XOFF either.  In fact, for grins, I include a "stty -a" of my current
terminal session:

    speed 9600 baud; line = 0; intr = DEL; quit = ^|; erase = ^h; kill = ^u;
	eof = ^d; eol = ^`
    -parenb -parodd cs8 -cstopb hupcl cread -clocal 
    -ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc 
    ixon -ixany -ixoff 
    isig icanon -xcase echo echoe echok -echonl -noflsh 
    opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 

See?  I'm running in 8 bit mode now.  And XON/XOFF does work just fine.

Your sentence "Things like Xmodem work because there is a program" seems
kinda funny, because the spooler is a program too.  Both BSDish lpr
and SVish lp support the notion of being able to arbitrarily set the
serial line characteristics.  SV dumb printers have something like
the following prolog:

	stty <baudrate> cs7 opost <output mode settings> xon ... <&1
	
For 8 bit binary, it'll look something like this:

	stty <baudrate> cs8 -opost xon .. <&1

Moderately sophisticated interface programs allow this to be decided
based upon an argument (-oraw is common) to lp.

lprish spoolers have mode words in the /etc/printcap file to do the
same thing.

For your .01% right - if you're unlucky enough to be on such primitive
trash as a machine that doesn't support termio or termios, you're probably
be SOL.

The original poster's problem is actually making sure that the *printer*
doesn't barf on control characters.  Like having 0x03 in an image causing
the printer to abort the job.  As others have mentioned, *some* printers
can't manage this.
-- 
Chris Lewis; clewis@ferret.ocunix.on.ca; Phone: Canada 613 832-0541
Psroff 3.0 info: psroff-request@ferret.ocunix.on.ca
Ferret list: ferret-request@ferret.ocunix.on.ca
Technical Details
Message-ID: <3929@ecicrl.ocunix.on.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!cunews!revcan!ecicrl!clewis
References: <1992Oct26.202733.5318@island.COM> <4353@vidiot.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!cunews!revcan!ecicrl!clewis
From: clewis@ferret.ocunix.on.ca (Chris Lewis)
Newsgroups: comp.lang.postscript,comp.periphs.printers,comp.protocols.appletalk
Subject: Re: Sending special characters to serial connected LaserWriter
Message-ID: <3929@ecicrl.ocunix.on.ca>
Date: 28 Oct 92 23:30:52 GMT
References: <1992Oct26.202733.5318@island.COM> <4353@vidiot.UUCP>
Followup-To: comp.lang.postscript
Organization: Elegant Communications Inc., Ottawa, Canada
Lines: 68