|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.io.CommPort
gnu.io.RS485Port
gnu.io.RS485
Nested Class Summary | |
(package private) class |
RS485.MonitorThread
|
(package private) class |
RS485.RS485InputStream
Inner class for RS485InputStream |
(package private) class |
RS485.RS485OutputStream
Inner class for RS485OutputStream |
Field Summary | |
private int |
dataAvailable
|
private int |
dataBits
Data bits port parameter |
static int |
DATABITS_5
|
static int |
DATABITS_6
|
static int |
DATABITS_7
|
static int |
DATABITS_8
|
(package private) static boolean |
dsrFlag
DSR flag |
private int |
fd
File descriptor |
static int |
FLOWCONTROL_NONE
|
static int |
FLOWCONTROL_RTSCTS_IN
|
static int |
FLOWCONTROL_RTSCTS_OUT
|
static int |
FLOWCONTROL_XONXOFF_IN
|
static int |
FLOWCONTROL_XONXOFF_OUT
|
private int |
flowmode
Flow control |
private RS485.RS485InputStream |
in
Input stream |
private int |
InputBuffer
FIXME I think this refers to FOPEN(3)/SETBUF(3)/FREAD(3)/FCLOSE(3) taj@www.linux.org.uk These are native stubs... |
private RS485.MonitorThread |
monThread
Thread to monitor data |
private RS485.RS485OutputStream |
out
Output stream |
private int |
OutputBuffer
|
private int |
parity
Parity port parameter |
static int |
PARITY_EVEN
|
static int |
PARITY_MARK
|
static int |
PARITY_NONE
|
static int |
PARITY_ODD
|
static int |
PARITY_SPACE
|
private int |
speed
Line speed in bits-per-second |
private RS485PortEventListener |
SPEventListener
RS485 Port Event listener |
private int |
stopBits
Stop bits port parameter |
static int |
STOPBITS_1
|
static int |
STOPBITS_1_5
|
static int |
STOPBITS_2
|
private int |
threshold
Receive threshold control |
private int |
timeout
Receive timeout control |
Fields inherited from class gnu.io.CommPort |
name |
Constructor Summary | |
RS485(java.lang.String name)
Open the named port |
Method Summary | |
void |
addEventListener(RS485PortEventListener lsnr)
Add an event listener |
void |
close()
|
void |
disableReceiveFraming()
|
void |
disableReceiveThreshold()
|
void |
disableReceiveTimeout()
|
private void |
drain()
|
void |
enableReceiveFraming(int f)
Receive framing control |
void |
enableReceiveThreshold(int thresh)
|
void |
enableReceiveTimeout(int time)
|
(package private) void |
eventLoop()
Process RS485PortEvents |
protected void |
finalize()
Finalize the port |
int |
getBaudRate()
|
int |
getDataBits()
|
int |
getFlowControlMode()
|
int |
getInputBufferSize()
|
java.io.InputStream |
getInputStream()
|
int |
getOutputBufferSize()
|
java.io.OutputStream |
getOutputStream()
|
int |
getParity()
|
int |
getReceiveFramingByte()
|
int |
getReceiveThreshold()
|
int |
getReceiveTimeout()
|
int |
getStopBits()
|
private static void |
Initialize()
Initialize the native library |
boolean |
isCD()
|
boolean |
isCTS()
|
boolean |
isDSR()
|
boolean |
isDTR()
Line status methods |
boolean |
isReceiveFramingEnabled()
|
boolean |
isReceiveThresholdEnabled()
|
boolean |
isReceiveTimeoutEnabled()
|
boolean |
isRI()
|
boolean |
isRTS()
|
private int |
nativeavailable()
RS485 read methods |
private void |
nativeClose()
Close the port |
void |
NativeEnableReceiveTimeoutThreshold(int time,
int threshold,
int InputBuffer)
|
int |
NativegetReceiveTimeout()
|
boolean |
NativeisReceiveTimeoutEnabled()
|
private void |
nativeSetRS485PortParams(int speed,
int dataBits,
int stopBits,
int parity)
Set the native RS485 port parameters |
void |
notifyOnBreakInterrupt(boolean enable)
|
void |
notifyOnCarrierDetect(boolean enable)
|
void |
notifyOnCTS(boolean enable)
|
void |
notifyOnDataAvailable(boolean enable)
|
void |
notifyOnDSR(boolean enable)
|
void |
notifyOnFramingError(boolean enable)
|
void |
notifyOnOutputEmpty(boolean enable)
|
void |
notifyOnOverrunError(boolean enable)
|
void |
notifyOnParityError(boolean enable)
|
void |
notifyOnRingIndicator(boolean enable)
|
private int |
open(java.lang.String name)
|
private int |
readArray(byte[] b,
int off,
int len)
|
private int |
readByte()
|
void |
removeEventListener()
Remove the RS485 port event listener |
void |
sendBreak(int duration)
Write to the port |
void |
sendEvent(int event,
boolean state)
|
private void |
setDSR(boolean state)
|
void |
setDTR(boolean state)
|
(package private) void |
setflowcontrol(int flowcontrol)
|
void |
setFlowControlMode(int flowcontrol)
|
void |
setInputBufferSize(int size)
|
void |
setOutputBufferSize(int size)
|
void |
setRS485PortParams(int b,
int d,
int s,
int p)
Set the RS485Port parameters |
void |
setRTS(boolean state)
|
private void |
writeArray(byte[] b,
int off,
int len)
|
private void |
writeByte(int b)
|
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 int fd
static boolean dsrFlag
private final RS485.RS485OutputStream out
private final RS485.RS485InputStream in
private int speed
private int dataBits
private int stopBits
private int parity
private int flowmode
private int timeout
private int threshold
private int InputBuffer
private int OutputBuffer
private RS485PortEventListener SPEventListener
private RS485.MonitorThread monThread
private int dataAvailable
public static final int DATABITS_5
public static final int DATABITS_6
public static final int DATABITS_7
public static final int DATABITS_8
public static final int PARITY_NONE
public static final int PARITY_ODD
public static final int PARITY_EVEN
public static final int PARITY_MARK
public static final int PARITY_SPACE
public static final int STOPBITS_1
public static final int STOPBITS_1_5
public static final int STOPBITS_2
public static final int FLOWCONTROL_NONE
public static final int FLOWCONTROL_RTSCTS_IN
public static final int FLOWCONTROL_RTSCTS_OUT
public static final int FLOWCONTROL_XONXOFF_IN
public static final int FLOWCONTROL_XONXOFF_OUT
Constructor Detail |
public RS485(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 void setRS485PortParams(int b, int d, int s, int p) throws UnsupportedCommOperationException
setRS485PortParams
in class RS485Port
UnsupportedCommOperationException
private void nativeSetRS485PortParams(int speed, int dataBits, int stopBits, int parity) throws UnsupportedCommOperationException
UnsupportedCommOperationException
public int getBaudRate()
getBaudRate
in class RS485Port
public int getDataBits()
getDataBits
in class RS485Port
public int getStopBits()
getStopBits
in class RS485Port
public int getParity()
getParity
in class RS485Port
public void setFlowControlMode(int flowcontrol)
setFlowControlMode
in class RS485Port
public int getFlowControlMode()
getFlowControlMode
in class RS485Port
void setflowcontrol(int flowcontrol) throws java.io.IOException
java.io.IOException
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 int NativegetReceiveTimeout()
public boolean NativeisReceiveTimeoutEnabled()
public void NativeEnableReceiveTimeoutThreshold(int time, int threshold, int InputBuffer)
public void disableReceiveTimeout()
disableReceiveTimeout
in class CommPort
public void enableReceiveTimeout(int time)
enableReceiveTimeout
in class CommPort
public boolean isReceiveTimeoutEnabled()
isReceiveTimeoutEnabled
in class CommPort
public int getReceiveTimeout()
getReceiveTimeout
in class CommPort
public void enableReceiveThreshold(int thresh)
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 boolean isDTR()
isDTR
in class RS485Port
public void setDTR(boolean state)
setDTR
in class RS485Port
public void setRTS(boolean state)
setRTS
in class RS485Port
private void setDSR(boolean state)
public boolean isCTS()
isCTS
in class RS485Port
public boolean isDSR()
isDSR
in class RS485Port
public boolean isCD()
isCD
in class RS485Port
public boolean isRI()
isRI
in class RS485Port
public boolean isRTS()
isRTS
in class RS485Port
public void sendBreak(int duration)
sendBreak
in class RS485Port
private void writeByte(int b) throws java.io.IOException
java.io.IOException
private void writeArray(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
private void drain() throws java.io.IOException
java.io.IOException
private int nativeavailable() throws java.io.IOException
java.io.IOException
private int readByte() throws java.io.IOException
java.io.IOException
private int readArray(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
void eventLoop()
public void sendEvent(int event, boolean state)
public void addEventListener(RS485PortEventListener lsnr) throws java.util.TooManyListenersException
addEventListener
in class RS485Port
java.util.TooManyListenersException
public void removeEventListener()
removeEventListener
in class RS485Port
public void notifyOnDataAvailable(boolean enable)
notifyOnDataAvailable
in class RS485Port
public void notifyOnOutputEmpty(boolean enable)
notifyOnOutputEmpty
in class RS485Port
public void notifyOnCTS(boolean enable)
notifyOnCTS
in class RS485Port
public void notifyOnDSR(boolean enable)
notifyOnDSR
in class RS485Port
public void notifyOnRingIndicator(boolean enable)
notifyOnRingIndicator
in class RS485Port
public void notifyOnCarrierDetect(boolean enable)
notifyOnCarrierDetect
in class RS485Port
public void notifyOnOverrunError(boolean enable)
notifyOnOverrunError
in class RS485Port
public void notifyOnParityError(boolean enable)
notifyOnParityError
in class RS485Port
public void notifyOnFramingError(boolean enable)
notifyOnFramingError
in class RS485Port
public void notifyOnBreakInterrupt(boolean enable)
notifyOnBreakInterrupt
in class RS485Port
private void nativeClose()
public void close()
close
in class CommPort
protected void finalize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |