All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.comm.ParallelPort

java.lang.Object
   |
   +----javax.comm.CommPort
           |
           +----javax.comm.ParallelPort

public abstract class ParallelPort
extends CommPort
A parallel communications port. ParallelPort describes the low-level interface to a parallel communications port made available by the underlying system. ParallelPort defines the minimum required functionality for parallel communications ports.

See Also:
CommPort, CommPortIdentifier

Variable Index

 o LPT_MODE_ANY
Picks the best available mode.
 o LPT_MODE_ECP
Enhanced capabilities port.
 o LPT_MODE_EPP
Extended parallel port.
 o LPT_MODE_NIBBLE
Nibble Mode.
 o LPT_MODE_PS2
Byte mode.
 o LPT_MODE_SPP
Compatibility mode.

Constructor Index

 o ParallelPort()

Method Index

 o addEventListener(ParallelPortEventListener)
Registers a ParallelPortEventListener object for ParallelPortEvents.
 o getMode()
Gets the currently configured mode.
 o getOutputBufferFree()
Gets the number of bytes available in the output buffer.
 o isPaperOut()
Checks if the port is indicating an "Out of Paper" state.
 o isPrinterBusy()
Checks if the port is indicating a "Printer Busy" state.
 o isPrinterError()
Checks if the printer has encountered an error.
 o isPrinterSelected()
Checks if the printer is in selected state.
 o isPrinterTimedOut()
Checks if the printer has timed out.
 o notifyOnBuffer(boolean)
Expresses interest in being notified when the output buffer is empty.
 o notifyOnError(boolean)
Expresses interest in being notified of port errors.
 o removeEventListener()
Deregisters event listener registered using addEventListener.
 o restart()
Restarts output after an error.
 o setMode(int)
Sets the printer port mode.
 o suspend()
Suspends output.

Variables

 o LPT_MODE_ANY
 public static final int LPT_MODE_ANY
Picks the best available mode.

 o LPT_MODE_SPP
 public static final int LPT_MODE_SPP
Compatibility mode. Unidirectional.

 o LPT_MODE_PS2
 public static final int LPT_MODE_PS2
Byte mode. Bi-directional.

 o LPT_MODE_EPP
 public static final int LPT_MODE_EPP
Extended parallel port.

 o LPT_MODE_ECP
 public static final int LPT_MODE_ECP
Enhanced capabilities port.

 o LPT_MODE_NIBBLE
 public static final int LPT_MODE_NIBBLE
Nibble Mode. Bi-directional. HP Bi-tronics. 4 bits at a time.

Constructors

 o ParallelPort
 public ParallelPort()

Methods

 o addEventListener
 public abstract void addEventListener(ParallelPortEventListener lsnr) throws TooManyListenersException
Registers a ParallelPortEventListener object for ParallelPortEvents. Interest in specific events may be expressed by using the notifyOnError and notifyOnBuffer methods.

Only one listener per ParallelPort is supported. Calling addEventListener multiple times will simply replace the current ParallelPortEventListener object.

After the port is closed, no more event will be generated. Another call to open() of the port's CommPortIdentifier object will return a new CommPort object, and the lsnr has to be added again to the new CommPort object to receive event from this port.

Parameters:
lsnr - A ParallelPortEventListener object whose parallelEvent method will be called to indicate an event.

Throws: TooManyListenersException
If an initial attempt to attach a listener succeeds, subsequent attempts will throw TooManyListenersException without effecting the first listener.
 o removeEventListener
 public abstract void removeEventListener()
Deregisters event listener registered using addEventListener. This is done automatically when a port is closed.

 o notifyOnError
 public abstract void notifyOnError(boolean notify)
Expresses interest in being notified of port errors.

Parameters:
notify - enable or disable error notification based on whether notify is true or false
 o notifyOnBuffer
 public abstract void notifyOnBuffer(boolean notify)
Expresses interest in being notified when the output buffer is empty.

Parameters:
boolean - true enables notification; false disables notification.
 o getOutputBufferFree
 public abstract int getOutputBufferFree()
Gets the number of bytes available in the output buffer.

Returns:
integer value corresponding to the number of bytes available in the output buffer
 o isPaperOut
 public abstract boolean isPaperOut()
Checks if the port is indicating an "Out of Paper" state.

Returns:
true if printer has run out of paper, false if printer does not report "Out of paper".
 o isPrinterBusy
 public abstract boolean isPrinterBusy()
Checks if the port is indicating a "Printer Busy" state.

Returns:
true if printer is busy, false if printer is idle
 o isPrinterSelected
 public abstract boolean isPrinterSelected()
Checks if the printer is in selected state.

Returns:
true if printer is selected, false if printer is in deselected mode
 o isPrinterTimedOut
 public abstract boolean isPrinterTimedOut()
Checks if the printer has timed out.

Returns:
true if printer has timed out, false if printer does not report "Out of paper".
 o isPrinterError
 public abstract boolean isPrinterError()
Checks if the printer has encountered an error.

Returns:
true if printer has encountered an error, false if printer does not report "Out of paper".
 o restart
 public abstract void restart()
Restarts output after an error.

 o suspend
 public abstract void suspend()
Suspends output.

 o getMode
 public abstract int getMode()
Gets the currently configured mode.

Returns:
mode returned is one of LPT_MODE_SPP, LPT_MODE_PS2, LPT_MODE_EPP, or LPT_MODE_ECP
 o setMode
 public abstract int setMode(int mode) throws UnsupportedCommOperationException
Sets the printer port mode.

Parameters:
mode - one of LPT_MODE_ANY, LPT_MODE_SPP, LPT_MODE_PS2, LPT_MODE_EPP, or LPT_MODE_ECP

Throws: UnsupportedCommOperationException
is thrown if the mode is not supported by the underline driver.

All Packages  Class Hierarchy  This Package  Previous  Next  Index