HP-UX Reference (11i v3 07/02) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
h
hil(7) hil(7)
NAME
hil - HP-HIL device driver
SYNOPSIS
#include <sys/hilioctl.h>
DESCRIPTION
HP-HIL, the Hewlett-Packard Human Interface Link, is the Hewlett-Packard standard for interfacing a
personal computer, terminal, or workstation to its input devices.
hil supports devices such as keyboards,
mice, control knobs, ID modules, button boxes, digitizers, quadrature devices, bar code readers, and
touchscreens.
On systems with a single link, HP-HIL device file names use the following format:
/dev/hiln
where n represents a single digit that specifies the physical HP-HIL device address, which ranges from 1 to
7. For example, /dev/hil3 is used to access the third HP-HIL device.
On systems with more than one link, HP-HIL device file names use the following format:
/dev/hil_m.n
where m represents the instance number, and n represents the physical HP-HIL device address. For exam-
ple, /dev/hil_0.2 would be used to access the second device on the link which has an instance number
of zero. Likewise, /dev/hil_12.7
references the seventh device on the link with instance number
twelve.
Note that HP-HIL device addresses are determined only by the order in which devices are attached to the
link. The first device attached to the link becomes device one, the second device attached becomes device
two, etc.
HP-HIL devices are classified as "slow" devices. This means that system calls to
hil can be interrupted by
caught signals (see signal(5)).
hil can only read HP-HIL keyboards in raw keycode mode. Raw keycode mode means that all keyboard
input is read unfiltered. HP-HIL keyboards return keycodes that represent key press and key release
events.
Use hilkbd(7) to read mapped keycodes from HP-HIL keyboards. Use the Internal Terminal Emulator
(ITE) described in termio(7) to read ASCII characters from HP-HIL keyboards.
System Calls
open(2) gives exclusive access to the specified HP-HIL device. Any previously queued input from the device
is discarded. If the device is a keyboard, it is opened in raw keycode mode. A side effect of opening a key-
board in raw keycode mode is that the ITE (see termio(7)) and mapped keyboard driver (see hilkbd(7)) lose
input from that keyboard until it is closed. Only device implemented auto-repeat functionality is available
while in raw keycode mode (see HILER1 and HILER2).
The file status flag, O_NDELAY, can be set to enable nonblocking reads (see open(2)).
close(2) returns an HP-HIL keyboard to mapped keycode mode, making its input available to the ITE or
mapped keyboard driver (see hilkbd(7)).
read(2) returns data from the specified HP-HIL device, in time-stamped packets:
unsigned char packet_length;
unsigned char time_stamp[4];
unsigned char poll_record_header;
unsigned char data[ packet_length-6];
packet_length specifies the number of bytes in the packet including itself, and can range from six to twenty
bytes. time_stamp, when repacked into an integer, specifies the time, in tens of milliseconds, that the sys-
tem has been running since the last system boot. The most significant byte of the time stamp is
time_stamp[0]. poll_record_header indicates the type and quantity of information to follow, and reports
simple device status information. The number of data bytes is device dependent. Refer to the text listed in
SEE ALSO for descriptions of the poll_record_header and device-specific data.
Usually two system calls are required to read each data packet, the first system call reads the data packet
length; the second system call reads the actual data packet. Some devices always return the same amount
52 Hewlett-Packard Company − 1 − HP-UX 11i Version 3: February 2007