|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.io.CommPort
gnu.io.ParallelPort
gnu.io.LPRPort
LPRPort
Nested Class Summary | |
(package private) class |
LPRPort.MonitorThread
|
(package private) class |
LPRPort.ParallelInputStream
Inner class for ParallelInputStream |
(package private) class |
LPRPort.ParallelOutputStream
Inner class for ParallelOutputStream |
Field Summary | |
private static boolean |
debug
|
private int |
fd
File descriptor |
private LPRPort.ParallelInputStream |
in
Input stream |
private int |
lprmode
return current mode LPT_MODE_SPP, LPT_MODE_PS2, LPT_MODE_EPP, or LPT_MODE_ECP |
private LPRPort.MonitorThread |
monThread
Thread to monitor data |
private LPRPort.ParallelOutputStream |
out
Output stream |
private ParallelPortEventListener |
PPEventListener
Parallel Port Event listener |
private int |
threshold
Receive threshold control |
private int |
timeout
Receive timeout control |
Fields inherited from class gnu.io.ParallelPort |
LPT_MODE_ANY, LPT_MODE_ECP, LPT_MODE_EPP, LPT_MODE_NIBBLE, LPT_MODE_PS2, LPT_MODE_SPP |
Fields inherited from class gnu.io.CommPort |
name |
Constructor Summary | |
LPRPort(java.lang.String name)
Open the named port |
Method Summary | |
void |
addEventListener(ParallelPortEventListener lsnr)
Add an event listener |
boolean |
checkMonitorThread()
|
void |
close()
|
void |
disableReceiveFraming()
|
void |
disableReceiveThreshold()
|
void |
disableReceiveTimeout()
|
protected void |
drain()
|
void |
enableReceiveFraming(int f)
Receive framing control |
void |
enableReceiveThreshold(int t)
|
void |
enableReceiveTimeout(int t)
|
(package private) void |
eventLoop()
Process ParallelPortEvents |
protected void |
finalize()
Finalize the port |
int |
getInputBufferSize()
|
java.io.InputStream |
getInputStream()
|
int |
getMode()
|
int |
getOutputBufferFree()
|
int |
getOutputBufferSize()
|
java.io.OutputStream |
getOutputStream()
|
int |
getReceiveFramingByte()
|
int |
getReceiveThreshold()
|
int |
getReceiveTimeout()
|
private static void |
Initialize()
Initialize the native library |
boolean |
isPaperOut()
|
boolean |
isPrinterBusy()
|
boolean |
isPrinterError()
|
boolean |
isPrinterSelected()
|
boolean |
isPrinterTimedOut()
|
boolean |
isReceiveFramingEnabled()
|
boolean |
isReceiveThresholdEnabled()
|
boolean |
isReceiveTimeoutEnabled()
|
protected int |
nativeavailable()
LPRPort read methods |
private void |
nativeClose()
Close the port |
void |
notifyOnBuffer(boolean enable)
|
void |
notifyOnError(boolean enable)
Note: these have to be separate boolean flags because the ParallelPortEvent constants are NOT bit-flags, they are just defined as integers from 1 to 10 -DPL |
private int |
open(java.lang.String name)
|
protected int |
readArray(byte[] b,
int off,
int len)
|
protected int |
readByte()
|
void |
removeEventListener()
Remove the parallel port event listener |
void |
restart()
|
boolean |
sendEvent(int event,
boolean state)
|
void |
setInputBufferSize(int size)
Input/output buffers These are native stubs... |
boolean |
setLPRMode(int mode)
|
int |
setMode(int mode)
|
void |
setOutputBufferSize(int size)
|
void |
suspend()
|
protected void |
writeArray(byte[] b,
int off,
int len)
|
protected void |
writeByte(int b)
Write to the port |
Methods inherited from class gnu.io.CommPort |
getName, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final boolean debug
private int fd
private final LPRPort.ParallelOutputStream out
private final LPRPort.ParallelInputStream in
private int lprmode
private int timeout
private int threshold
private ParallelPortEventListener PPEventListener
private LPRPort.MonitorThread monThread
Constructor Detail |
public LPRPort(java.lang.String name) throws PortInUseException
Method Detail |
private static void Initialize()
private int open(java.lang.String name) throws PortInUseException
PortInUseException
public java.io.OutputStream getOutputStream()
getOutputStream
in class CommPort
public java.io.InputStream getInputStream()
getInputStream
in class CommPort
public int getMode()
getMode
in class ParallelPort
public int setMode(int mode) throws UnsupportedCommOperationException
setMode
in class ParallelPort
UnsupportedCommOperationException
public void restart()
restart
in class ParallelPort
public void suspend()
suspend
in class ParallelPort
public boolean setLPRMode(int mode) throws UnsupportedCommOperationException
UnsupportedCommOperationException
public boolean isPaperOut()
isPaperOut
in class ParallelPort
public boolean isPrinterBusy()
isPrinterBusy
in class ParallelPort
public boolean isPrinterError()
isPrinterError
in class ParallelPort
public boolean isPrinterSelected()
isPrinterSelected
in class ParallelPort
public boolean isPrinterTimedOut()
isPrinterTimedOut
in class ParallelPort
private void nativeClose()
public void close()
close
in class CommPort
public void enableReceiveFraming(int f) throws UnsupportedCommOperationException
enableReceiveFraming
in class CommPort
UnsupportedCommOperationException
public void disableReceiveFraming()
disableReceiveFraming
in class CommPort
public boolean isReceiveFramingEnabled()
isReceiveFramingEnabled
in class CommPort
public int getReceiveFramingByte()
getReceiveFramingByte
in class CommPort
public void enableReceiveTimeout(int t)
enableReceiveTimeout
in class CommPort
public void disableReceiveTimeout()
disableReceiveTimeout
in class CommPort
public boolean isReceiveTimeoutEnabled()
isReceiveTimeoutEnabled
in class CommPort
public int getReceiveTimeout()
getReceiveTimeout
in class CommPort
public void enableReceiveThreshold(int t)
enableReceiveThreshold
in class CommPort
public void disableReceiveThreshold()
disableReceiveThreshold
in class CommPort
public int getReceiveThreshold()
getReceiveThreshold
in class CommPort
public boolean isReceiveThresholdEnabled()
isReceiveThresholdEnabled
in class CommPort
public void setInputBufferSize(int size)
setInputBufferSize
in class CommPort
public int getInputBufferSize()
getInputBufferSize
in class CommPort
public void setOutputBufferSize(int size)
setOutputBufferSize
in class CommPort
public int getOutputBufferSize()
getOutputBufferSize
in class CommPort
public int getOutputBufferFree()
getOutputBufferFree
in class ParallelPort
protected void writeByte(int b) throws java.io.IOException
java.io.IOException
protected void writeArray(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
protected void drain() throws java.io.IOException
java.io.IOException
protected int nativeavailable() throws java.io.IOException
java.io.IOException
protected int readByte() throws java.io.IOException
java.io.IOException
protected int readArray(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
void eventLoop()
public boolean checkMonitorThread()
public boolean sendEvent(int event, boolean state)
public void addEventListener(ParallelPortEventListener lsnr) throws java.util.TooManyListenersException
addEventListener
in class ParallelPort
java.util.TooManyListenersException
public void removeEventListener()
removeEventListener
in class ParallelPort
public void notifyOnError(boolean enable)
notifyOnError
in class ParallelPort
public void notifyOnBuffer(boolean enable)
notifyOnBuffer
in class ParallelPort
protected void finalize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |