From owner-freebsd-questions Tue Sep 10 13:35:47 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA12225 for questions-outgoing; Tue, 10 Sep 1996 13:35:47 -0700 (PDT) Received: from gatekeeper.fsl.noaa.gov (gatekeeper.fsl.noaa.gov [137.75.131.181]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA12220 for ; Tue, 10 Sep 1996 13:35:43 -0700 (PDT) Received: from emu.fsl.noaa.gov (kelly@emu.fsl.noaa.gov [137.75.60.32]) by gatekeeper.fsl.noaa.gov (8.7.5/8.7.3) with ESMTP id UAA24117; Tue, 10 Sep 1996 20:35:41 GMT Message-Id: <199609102035.UAA24117@gatekeeper.fsl.noaa.gov> Received: by emu.fsl.noaa.gov (1.40.112.4/16.2) id AA238287744; Tue, 10 Sep 1996 14:35:44 -0600 Date: Tue, 10 Sep 1996 14:35:44 -0600 From: Sean Kelly To: edward.ing@utoronto.ca Cc: questions@FreeBSD.org In-Reply-To: (edward.ing@utoronto.ca) Subject: Re: stty, printcap, ixon, Postscript printer Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >>>>> edward ing writes: > I have determined that I need to use software flow control to get my > Postcript printer to work properly. Thus I wish to set the ixon flag > terminal setting for port. Sounds good to me. I use software flow control for my PostScript printer, too. > 1. There are printer capability flags in printcap which can be set > for the l-flags and the c-flags. What I wish to know is whether > there is a capability to set the i-flags in printcap file. Actually, it depends on what version of FreeBSD you have. For 2.1.5 and earlier, you're not setting termios l-flags and c-flags at all, but instead the sgtty flags. Use the settings defined in /usr/include/sys/ioctl_compat.h. You'll want the TANDEM flag, and probably the ANYP, LITOUT, FLUSHO, and PASS8 flags. Try these settings in your /etc/printcap. :fs#0x82000c1:xs#0x820: Now, if you're using FreeBSD-current, then you've got a much more friendly interface that even uses the termios settings: :ms=cs8,-cstopb,-parenb,ixon,ixoff,cread,clocal,-opost,-echo,-echonl: > 2. Not knowing how to set the ixon flag in the printcap, I tried to > set it using the stty command. I enter the following "stty -f > /dev/cuaa0 ixon". However when I tried to list the settings( stty > -f /dev/cuaa0) it did not indicate any change. Which is correct. A tty retains its settings only while it's open. The "stty -f /dev/cuaa0 ixon" command opens the tty, sets the flag, then closes it, at which point it reverts to its initial-state settings. What you want to do is use "stty -f /dev/cuaia0" which sets the ixon flag for the initial-state of the device. There's also a lock-state entry, /dev/cuala0 which prevents a certain bit from being set or cleared by other software. Type "man 4 sio" for more information. You usually put commands like "stty -f /dev/cuaia0 ixon" in the file /etc/rc.serial, which is read and executed at bootup. However, I'd prefer using the /etc/printcap solution. When you move a printer from one computer to another and someone tries to use that serial port, there'll be less confusion if the port doesn't have certain flags already set or locked-in. So many options! That's Unix for you. -- Sean Kelly NOAA Forecast Systems Laboratory kelly@fsl.noaa.gov Boulder Colorado USA http://www-sdd.fsl.noaa.gov/~kelly/