Parallel Ports
Parallel ports are most common on PCs. Sun SparcStations from the Sparc V on also have them. However, Macs do not have them, nor do many non-x86 workstations. Parallel ports are sometimes called printer ports, because their original purpose was to support printers. The names of the parallel ports—“LPT1,” “LPT2,” etc.—stand for “Line PrinTer,” reflecting this usage. Nowadays, parallel ports are also used for Zip drives, tape drives, and various other devices. However, parallel ports are still largely limited by their original goal of providing simple printing. A parallel port sends data eight bits at a time on eight wires. These bits are sent at the same time in parallel, hence the name. The original parallel ports only allowed data to flow one way, from the PC to the printer. The printer could only respond by sending a few standard messages on other wires. Each return wire corresponded to a particular message, like “Out of paper” or “Printer busy.” Modern parallel ports allow full, bidirectional communication.
The
javax.comm.ParallelPort
class is a concrete subclass of
javax.comm.CommPort
that provides various methods
and constants useful for working with parallel ports and devices. The
main purposes of the class are to allow the programmer to inspect,
adjust, and monitor changes in the settings of the parallel port.
Simple input and output are accomplished with the methods of the
superclass, CommPort
.
ParallelPort
has a single public constructor, but that shouldn’t ...
Get Java I/O now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.