There are cases where a user will be connecting to the RISC system via a dynamic device. This could be connecting to the RISC via a modem pool on the RISC so that the user may have a different tty each time he dials the system. It may also be a user that is using AADU (AIX Access for Dos Users), and is connecting via a different pts each time. These users at times wish to print something from the RISC to a printer connected to their terminal/PC. If the terminal/PC supports an escape sequence to enable/disable Passthrough Printing, then we can create a solution that will do this.
The following solution is directed toward the AADU connection, but could easily be modified to the above mentioned modem pool by replacing the references to "pts" with "tty".
This document applies to AIX Versions 3.2 and 4.1.
A. Create a queue that prints to a file.
Then on the proceeding screen, enter the following:
ci=\020\022 cr=\020\024
ci=\020\022 cr=\020\024The ci attribute initializes the printer for passthru. mode. The cr attribute restores it at job end. If you wish to view the entire list of attributes, enter * on this screen.
Note: The above sets the ci and cr attribute to the codes for an ibm3151 terminal. If you are using another terminal you would need to modify the \020\022 and \020\024 to the codes for your terminal. \033 is used to represent the escape character.
B. Perform a link to the port each time the user is connected.
ln -fs 'tty' /dev/dynamic_device1
NOTE: Use back-tics, NOT quotes, in the ln command line above. (A back-tic is found in the top number-key row on a regular keyboard, on the key just left of the number 1 key and just above the TAB key.)
The -f flag will automatically remove any old links to the old port from previous sessions. Then it establishes a link to the new port for the current session. Thus this enables you to print through the current port as it changes each time you are logged in. Note that root will have created the /dev/dynamic_device1 with permissions that allow the users to remove and recreate this file.
For each user that wants to access the printer on the DOS machine, all you need to do is create a separate queue for that user and follow the steps outlined above. For example, to print to the aadu queue, we entered the following command:
enq -Paadu filename
Please note that this method prints in passthrough mode only, meaning that the local DOS machine will be temporary inactive while it prints.
Sometimes a user will be dialing in or connecting from different terminal types. The above method only sets a single set of codes and will only work with a single terminal type.
As an alternative, you may define another set of attributes for the queue, and set the ci and cr attribute to obtain the terminal passthrough codes from terminfo. This can be done by modifying the last few steps of the above method (after step 9 in AIX 3.2, after step 8 in AIX 4.1).
cd /var/spool/lpd/pio/custom
cd /var/spool/lpd/pio/@local/custom
In this directory should be a filename that follows the form:
[queuename]:[queue_device]Run each echo statement as one command line:
echo :998:Wo::tput mc5 >> [queuename]:[queue_device] echo :999:Wf::tput mc4 >> [queuename]:[queue_device] chvirprt -q [queuename] -d [queue_device] ci=%\ Wo chvirprt -q [queuename] -d [queue_device] cr=%\ Wf
Note: There is an accent mark or back-quote before the Wo and the Wf in the command lines above that may or may not show up in your printed document.
This will cause the queue to obtain the passthrough strings from the terminfo database at the time of printing.