PTAL device name format

The PTAL (Peripheral Transport Abstraction Library) "device name" is an important concept throughout the hpoj software, especially if you use more than one device with it.

The format of the device name depends on how the device is connected:

Important: The PTAL device name is not the same as traditional Unix device files, such as /dev[/usb]/lp0, or any other path/filename combination. It must conform to the guidelines listed above.

Specifying the device name

Most hpoj command-line utilities take a PTAL device name as the first parameter so they'll know which device to access. In most cases the device name is now optional on the command line, as long as you follow the "ptal-init setup" procedure outlined in the Setting up basic device connectivity document for setting up your device(s).

Default device name

If you have set up only one device, then usually it is automatically used by default. However, if you have set up multiple devices, then the default could be any one of them, and not necessarily the "first" one in alphabetical order. As described in Setting up basic device connectivity, the "ptal-init setup" command allows you to set or unset the system-wide default device name if more than one device is defined.

Individual users may override the system-wide default device name (if any) by any of the following methods:

Listing device names

There are several ways to see what device names are currently defined on your system:

Renaming or reconfiguring existing devices

If you want to rename an already-set-up device or otherwise reconfigure it (for example, switch it from a parallel to a USB connection), then run "ptal-init setup", delete the old device name when it offers to do so, let it re-probe your system for the device, and specify the desired name suffix when it's found.

Since JetDirect-connected devices' names are based on the hostname or IP address of the JetDirect, note that you can't specify an arbitrary device name in this case unless you change the JetDirect's hostname.

Storage of device configuration information

For each device, "ptal-init setup" creates a configuration file under the directory /etc/ptal, with the filename being the PTAL device name. The file contents are used by "ptal-init start" to know which daemons (if any) to start for each device, and what parameters to pass. hpoj applications use libptal to read in the device files under /etc/ptal and build a list of defined devices. Devices which have been designated as "default" (see above) are added to the list first, and then other device files are read and added to the list.

Next steps

Use the Back button on your browser to return to the previous document, or click here to return to the index.