|
comm API Version 2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.comm.CommPort
javax.comm.ParallelPort
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.
CommPort
,
CommPortIdentifier
Field Summary | |
static int |
LPT_MODE_ANY
Picks the best available mode. |
static int |
LPT_MODE_ECP
Enhanced capabilities port. |
static int |
LPT_MODE_EPP
Extended parallel port. |
static int |
LPT_MODE_NIBBLE
Nibble Mode. |
static int |
LPT_MODE_PS2
Byte mode. |
static int |
LPT_MODE_SPP
Compatibility mode. |
Fields inherited from class javax.comm.CommPort |
name |
Constructor Summary | |
ParallelPort()
|
Method Summary | |
abstract void |
addEventListener(ParallelPortEventListener lsnr)
Registers a ParallelPortEventListener object for
ParallelPortEvent s. |
abstract int |
getMode()
Gets the currently configured mode. |
abstract int |
getOutputBufferFree()
Gets the number of bytes available in the output buffer. |
abstract boolean |
isPaperOut()
hecks if the port is indicating an "Out of Paper" state. |
abstract boolean |
isPrinterBusy()
Checks if the port is indicating a "Printer Busy" state. |
abstract boolean |
isPrinterError()
Checks if the printer has encountered an error. |
abstract boolean |
isPrinterSelected()
Checks if the printer is in selected state. |
abstract boolean |
isPrinterTimedOut()
Checks if the printer has timed out. |
abstract void |
notifyOnBuffer(boolean notify)
Expresses interest in being notified when the output buffer is empty. |
abstract void |
notifyOnError(boolean notify)
Expresses interest in being notified of port errors. |
abstract void |
removeEventListener()
Deregisters event listener registered using addEventListener .
|
abstract void |
restart()
Restarts output after an error. |
abstract int |
setMode(int mode)
Sets the printer port mode. |
abstract void |
suspend()
Suspends output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int LPT_MODE_ANY
public static final int LPT_MODE_SPP
public static final int LPT_MODE_PS2
public static final int LPT_MODE_EPP
public static final int LPT_MODE_ECP
public static final int LPT_MODE_NIBBLE
Constructor Detail |
public ParallelPort()
Method Detail |
public abstract void addEventListener(ParallelPortEventListener lsnr) throws TooManyListenersException
ParallelPortEventListener
object for
ParallelPortEvent
s. 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.
lsnr
- A ParallelPortEventListener
object whose parallelEvent
method will be
called to indicate an event.
TooManyListenersException
- If an initial attempt to attach a
listener succeeds, subsequent attempts will throw
TooManyListenersException without effecting the first
listener.public abstract void removeEventListener()
addEventListener
.
This is done automatically when a port is closed.
public abstract void notifyOnError(boolean notify)
notify
- enable or disable error notification based on whether
notify is true
or false
.public abstract void notifyOnBuffer(boolean notify)
notify
- Expresses interest in being notified when the output
buffer is empty.public abstract int getOutputBufferFree()
public abstract boolean isPaperOut()
true
if printer has run out of paper,
false
if printer does not report "Out of paper".public abstract boolean isPrinterBusy()
true
if printer is busy, false
if printer is idlepublic abstract boolean isPrinterSelected()
Note: This method is platform dependent.
true
if printer is selected, false
if printer is in deselected modepublic abstract boolean isPrinterTimedOut()
Note: This method is platform dependent.
true
if printer has timed out, false
if printer does not report "Out of paper".public abstract boolean isPrinterError()
Note: This method is platform dependent.
true
if printer has encountered an error,
false
if printer does not report "Out of paper".public abstract void restart()
public abstract void suspend()
public abstract int getMode()
LPT_MODE_SPP
,
LPT_MODE_PS2
, LPT_MODE_EPP
,
or LPT_MODE_ECP
public abstract int setMode(int mode) throws UnsupportedCommOperationException
mode
- one of LPT_MODE_SPP
,
LPT_MODE_PS2
, LPT_MODE_EPP
,
or LPT_MODE_ECP
UnsupportedCommOperationException
- is thrown if the mode is
not supported by the underline driver.
|
comm API Version 2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |