|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.engidea.comm.CommPort
public abstract class CommPort
The main difference are the method read and write. They are needed since it may happen that a port returns less bytes than wanted or writes less bytes that you are expected to write. read and write tells you this. If you want the standard interface just use PortInputStream and PortOutputStream NOTE: Basically all methods return either IOexception or UnsupportedEsception, this is really by design since IO si a messy business and you MUST NOT assume things go smooth and nice. methods may fail for a multitude of reasons, loking, ownership, timeout, BUGS, you HAVE to take care of exception either in the form or reopen or in user notificatino.
Field Summary | |
---|---|
protected java.lang.String |
portName
|
Constructor Summary | |
---|---|
CommPort(java.lang.String portName)
Constructor, needed since portName is final. |
Method Summary | |
---|---|
abstract int |
available()
Return the number of bytes available on read. |
abstract void |
close()
|
abstract void |
disableReceiveFraming()
|
abstract void |
disableReceiveThreshold()
|
abstract void |
disableReceiveTimeout()
|
abstract void |
enableReceiveFraming(int f)
|
abstract void |
enableReceiveThreshold(int thresh)
|
abstract void |
enableReceiveTimeout(int timeoutMilli)
|
abstract void |
flush()
This THROWS AWAY any char that is in the input or output queue !!!! |
abstract int |
getInputBufferSize()
|
java.lang.String |
getName()
Accessor for portName |
abstract int |
getOutputBufferSize()
|
abstract int |
getReceiveFramingByte()
|
abstract int |
getReceiveThreshold()
|
abstract int |
getReceiveTimeout()
|
abstract boolean |
isReceiveFramingEnabled()
|
abstract boolean |
isReceiveThresholdEnabled()
|
abstract boolean |
isReceiveTimeoutEnabled()
|
abstract void |
open()
|
abstract int |
read(byte[] buff,
int offset,
int len)
Port instances are allowed to read less chars than requested at their wish. |
abstract void |
setInputBufferSize(int size)
|
abstract void |
setOutputBufferSize(int size)
|
java.lang.String |
toString()
|
abstract int |
write(byte[] buff,
int offset,
int len)
Port instances are allowed to write less chars than requested. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String portName
Constructor Detail |
---|
public CommPort(java.lang.String portName)
portName
- Method Detail |
---|
public java.lang.String getName()
public abstract void open() throws java.io.IOException
java.io.IOException
public abstract void close()
public abstract int read(byte[] buff, int offset, int len) throws java.io.IOException
buff
- offset
- len
-
java.io.IOException
public abstract int write(byte[] buff, int offset, int len) throws java.io.IOException
buff
- offset
- len
-
java.io.IOException
public abstract int available() throws java.io.IOException
java.io.IOException
public abstract void flush() throws java.io.IOException
java.io.IOException
public abstract void enableReceiveFraming(int f) throws java.io.IOException
java.io.IOException
public abstract void disableReceiveFraming() throws java.io.IOException
java.io.IOException
public abstract boolean isReceiveFramingEnabled() throws java.io.IOException
java.io.IOException
public abstract int getReceiveFramingByte() throws java.io.IOException
java.io.IOException
public abstract void disableReceiveTimeout() throws java.io.IOException
java.io.IOException
public abstract void enableReceiveTimeout(int timeoutMilli) throws java.io.IOException
java.io.IOException
public abstract boolean isReceiveTimeoutEnabled() throws java.io.IOException
java.io.IOException
public abstract int getReceiveTimeout() throws java.io.IOException
java.io.IOException
public abstract void enableReceiveThreshold(int thresh) throws java.io.IOException
java.io.IOException
public abstract void disableReceiveThreshold() throws java.io.IOException
java.io.IOException
public abstract int getReceiveThreshold() throws java.io.IOException
java.io.IOException
public abstract boolean isReceiveThresholdEnabled() throws java.io.IOException
java.io.IOException
public abstract void setInputBufferSize(int size) throws java.io.IOException
java.io.IOException
public abstract int getInputBufferSize() throws java.io.IOException
java.io.IOException
public abstract void setOutputBufferSize(int size) throws java.io.IOException
java.io.IOException
public abstract int getOutputBufferSize() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |