13 Asynchronous Devices
Successful execution of a REQUEST statement addressing a terminal causes TIO to implicitly execute the OFF INPUT # statement. Syntax of the REQUEST statement is as follows:
REQUEST port number [,return variable]
The REQUEST statement first checks to see if the requested device is a printer or a port. Printers and ports are defined in the user, group, and global configuration files using the PRINTER and PORT statements.
If the return variable is omitted and the device is already reserved by another program, ERROR 131 results. If the requested device is not defined in the user, group, or global configuration file, ERROR 132 results. If the user has no access rights or if there are currently more than 4 ports in use, ERROR 313 - Can't access port results.
If the requested device is a printer, it then checks if it is spooled or not. Spooled printers are indicated by "PIPE" in the PRINTER statement in a configuration file. The word "FILE" in a PRINTER statement indicates a non-spooled printer. If the requested printer is not spooled, the corresponding HP-UX device file is locked, thereby reserving the device for your use. This is not necessary for a spooled printer.
If the requested device is a port, the corresponding HP-UX device file is locked, reserving it for your use. The user must have read and write permission to the port, e.g. crw-rw-rw- 1 root bin 58 0x000005 Aug 29 14:36 /dev/tty0p5
The value returned to the return variable, if present, is based upon the following criteria:
RELEASE port number
DISABLE
ENABLE
CURKEY numeric variable
The values CURKEY returns are shown in the following table:
Value | Condition |
---|---|
0 | No interrupts have occurred |
1-24 | Softkeys 1 through 24 |
25-27 | Port 11 |
28-30 | Port 12 |
31-33 | Port 13 |
34-36 | Port 14 |
37-39 | Port 15 |
40-42 | Port 16 |
43-45 | Port 17 |
46-48 | Port 18 |
49-51 | Port 19 |
52-54 | Port 20 |
55 | ON DELAY |
Three values are allocated for each port. An ON INPUT # interrupt returns the first value (25 for port 11, 28 for port 12, and so on). The second and third values (26 and 27 for port 11, 29 and 30 for port 12, and so on) are reserved for future use.