|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.io.CommPort
gnu.io.SerialPort
gnu.io.RXTXPort
public final class RXTXPort
An extension of gnu.io.SerialPort
SerialPort
Field Summary |
---|
Fields inherited from interface gnu.io.SerialPortInterface |
---|
DATABITS_5, DATABITS_6, DATABITS_7, DATABITS_8, FLOWCONTROL_NONE, FLOWCONTROL_RTSCTS_IN, FLOWCONTROL_RTSCTS_OUT, FLOWCONTROL_XONXOFF_IN, FLOWCONTROL_XONXOFF_OUT, PARITY_EVEN, PARITY_MARK, PARITY_NONE, PARITY_ODD, PARITY_SPACE, STOPBITS_1, STOPBITS_1_5, STOPBITS_2 |
Constructor Summary | |
---|---|
RXTXPort(java.lang.String name)
Open the named port |
Method Summary | |
---|---|
void |
addEventListener(SerialPortEventListener lsnr)
|
boolean |
checkMonitorThread()
|
void |
close()
Closes this communications port. |
void |
disableReceiveFraming()
Disables receive framing. |
void |
disableReceiveThreshold()
Disables receive threshold. |
void |
disableReceiveTimeout()
Disables receive timeout. |
void |
enableReceiveFraming(int f)
Receive framing control |
void |
enableReceiveThreshold(int thresh)
Enables receive threshold. |
void |
enableReceiveTimeout(int time)
Enables receive timeout. |
int |
getBaudBase()
Extension to CommAPI |
int |
getBaudRate()
|
boolean |
getCallOutHangup()
Extension to CommAPI returns boolean true on success |
int |
getDataBits()
|
int |
getDivisor()
Extension to CommAPI |
byte |
getEndOfInputChar()
Extension to CommAPI This is an extension to CommAPI. |
int |
getFlowControlMode()
|
int |
getInputBufferSize()
|
java.io.InputStream |
getInputStream()
get the InputStream |
boolean |
getLowLatency()
Extension to CommAPI returns boolean true on success |
int |
getOutputBufferSize()
|
java.io.OutputStream |
getOutputStream()
get the OutputStream |
int |
getParity()
|
byte |
getParityErrorChar()
Extension to CommAPI This is an extension to CommAPI. |
int |
getReceiveFramingByte()
|
int |
getReceiveThreshold()
|
int |
getReceiveTimeout()
|
int |
getStopBits()
|
java.lang.String |
getUARTType()
Extension to CommAPI This is an extension to CommAPI. |
boolean |
isCD()
|
boolean |
isCTS()
|
boolean |
isDSR()
|
boolean |
isDTR()
|
boolean |
isReceiveFramingEnabled()
|
boolean |
isReceiveThresholdEnabled()
|
boolean |
isReceiveTimeoutEnabled()
|
boolean |
isRI()
|
boolean |
isRTS()
|
int |
NativegetReceiveTimeout()
|
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)
|
void |
removeEventListener()
Remove the serial port event listener |
void |
sendBreak(int duration)
Write to the port |
boolean |
sendEvent(int event,
boolean state)
|
boolean |
setBaudBase(int BaudBase)
Extension to CommAPI |
boolean |
setCallOutHangup(boolean NoHup)
Extension to CommAPI returns boolean true on success |
boolean |
setDivisor(int Divisor)
Extension to CommAPI |
void |
setDTR(boolean state)
Sets or clears the DTR bit in the UART. |
boolean |
setEndOfInputChar(byte b)
Extension to CommAPI This is an extension to CommAPI. |
void |
setFlowControlMode(int flowcontrol)
Sets the flow control mode. |
void |
setInputBufferSize(int size)
Sets the input buffer size. |
boolean |
setLowLatency()
Extension to CommAPI returns boolean true on success |
void |
setOutputBufferSize(int size)
Sets the output buffer size. |
boolean |
setParityErrorChar(byte b)
Extension to CommAPI This is an extension to CommAPI. |
void |
setRcvFifoTrigger(int trigger)
Deprecated. deprecated but used in Kaffe |
void |
setRTS(boolean state)
Sets or clears the RTS bit in the UART. |
void |
setSerialPortParams(int b,
int d,
int s,
int p)
Sets the serial port parameters. |
boolean |
setUARTType(java.lang.String type,
boolean test)
Extension to CommAPI This is an extension to CommAPI. |
static int |
staticGetBaudRate(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static int |
staticGetDataBits(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static int |
staticGetParity(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static int |
staticGetStopBits(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticIsCD(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticIsCTS(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticIsDSR(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticIsDTR(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticIsRI(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticIsRTS(java.lang.String port)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticSetDSR(java.lang.String port,
boolean flag)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticSetDTR(java.lang.String port,
boolean flag)
Extension to CommAPI This is an extension to CommAPI. |
static boolean |
staticSetRTS(java.lang.String port,
boolean flag)
Extension to CommAPI This is an extension to CommAPI. |
static void |
staticSetSerialPortParams(java.lang.String f,
int b,
int d,
int s,
int p)
Extension to CommAPI This is an extension to CommAPI. |
Methods inherited from class gnu.io.CommPort |
---|
getName, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface comm.CommPortInterface |
---|
getName, toString |
Constructor Detail |
---|
public RXTXPort(java.lang.String name) throws PortInUseException
name
- the name of the device to open
PortInUseException
SerialPort
Method Detail |
---|
public java.io.OutputStream getOutputStream()
public java.io.InputStream getInputStream()
InputStream
public void setSerialPortParams(int b, int d, int s, int p) throws UnsupportedCommOperationException
SerialPortInterface
b
- the baud rated
- the number of data bits: DATABITS_5,
DATABITS_6, DATABITS_7, or DATABITS_8s
- the number of stop bits: STOPBITS_1,
STOPBITS_2, or STOPBITS_1_5p
- the parity schema: PARITY_NONE, PARITY_ODD,
PARITY_EVEN, PARITY_MARK or PARITY_SPACE
UnsupportedCommOperationException
public int getBaudRate()
public int getDataBits()
public int getStopBits()
public int getParity()
public void setFlowControlMode(int flowcontrol)
SerialPortInterface
flowcontrol
- FLOWCONTROL_NONE is defaultSerialPortInterface.FLOWCONTROL_NONE
public int getFlowControlMode()
public void enableReceiveFraming(int f) throws UnsupportedCommOperationException
f
- framming
UnsupportedCommOperationException
CommPortInterface.disableReceiveFraming()
public void disableReceiveFraming()
CommPortInterface
CommPortInterface.enableReceiveFraming(int)
public boolean isReceiveFramingEnabled()
CommPortInterface.enableReceiveFraming(int)
public int getReceiveFramingByte()
CommPortInterface.enableReceiveFraming(int)
public int NativegetReceiveTimeout()
public void disableReceiveTimeout()
CommPortInterface
CommPortInterface.enableReceiveTimeout(int)
public void enableReceiveTimeout(int time)
CommPortInterface
time
- CommPortInterface.disableReceiveTimeout()
public boolean isReceiveTimeoutEnabled()
CommPortInterface.enableReceiveTimeout(int)
public int getReceiveTimeout()
CommPortInterface.enableReceiveTimeout(int)
public void enableReceiveThreshold(int thresh)
CommPortInterface
thresh
- thresholdCommPortInterface.disableReceiveThreshold()
public void disableReceiveThreshold()
CommPortInterface
CommPortInterface.enableReceiveThreshold(int)
public int getReceiveThreshold()
CommPortInterface.enableReceiveThreshold(int)
public boolean isReceiveThresholdEnabled()
CommPortInterface.enableReceiveThreshold(int)
public void setInputBufferSize(int size)
CommPortInterface
size
- public int getInputBufferSize()
public void setOutputBufferSize(int size)
CommPortInterface
size
- public int getOutputBufferSize()
public boolean isDTR()
SerialPortInterface.setDTR(boolean)
public void setDTR(boolean state)
SerialPortInterface
state
- SerialPortInterface.isDTR()
public void setRTS(boolean state)
SerialPortInterface
state
- public boolean isCTS()
SerialPortInterface.setDTR(boolean)
public boolean isDSR()
public boolean isCD()
public boolean isRI()
public boolean isRTS()
SerialPortInterface.setRTS(boolean)
public void sendBreak(int duration)
duration
- public boolean checkMonitorThread()
public boolean sendEvent(int event, boolean state)
event
- state
-
public void addEventListener(SerialPortEventListener lsnr) throws java.util.TooManyListenersException
java.util.TooManyListenersException
public void removeEventListener()
public void notifyOnDataAvailable(boolean enable)
public void notifyOnOutputEmpty(boolean enable)
enable
- public void notifyOnCTS(boolean enable)
enable
- public void notifyOnDSR(boolean enable)
enable
- public void notifyOnRingIndicator(boolean enable)
enable
- public void notifyOnCarrierDetect(boolean enable)
enable
- public void notifyOnOverrunError(boolean enable)
enable
- public void notifyOnParityError(boolean enable)
enable
- public void notifyOnFramingError(boolean enable)
enable
- public void notifyOnBreakInterrupt(boolean enable)
enable
- public void close()
CommPortInterface
close
in interface CommPortInterface
close
in class CommPort
public void setRcvFifoTrigger(int trigger)
trigger
- the trigger levelpublic static int staticGetBaudRate(java.lang.String port) throws UnsupportedCommOperationException
port
- the name of the port thats been preopened
UnsupportedCommOperationException;
- This will not behave as expected with custom speeds
UnsupportedCommOperationException
public static int staticGetDataBits(java.lang.String port) throws UnsupportedCommOperationException
port
- the name of the port thats been preopened
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static int staticGetParity(java.lang.String port) throws UnsupportedCommOperationException
port
- the name of the port thats been preopened
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static int staticGetStopBits(java.lang.String port) throws UnsupportedCommOperationException
port
- the name of the port thats been preopened
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static void staticSetSerialPortParams(java.lang.String f, int b, int d, int s, int p) throws UnsupportedCommOperationException
f
- filenameb
- baudrated
- databitss
- stopbitsp
- parity
UnsupportedCommOperationException
UnsupportedCommOperationException
public static boolean staticSetDSR(java.lang.String port, boolean flag) throws UnsupportedCommOperationException
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticSetDTR(java.lang.String port, boolean flag) throws UnsupportedCommOperationException
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticSetRTS(java.lang.String port, boolean flag) throws UnsupportedCommOperationException
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticIsRTS(java.lang.String port) throws UnsupportedCommOperationException
port
-
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticIsCD(java.lang.String port) throws UnsupportedCommOperationException
port
-
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticIsCTS(java.lang.String port) throws UnsupportedCommOperationException
port
-
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticIsDSR(java.lang.String port) throws UnsupportedCommOperationException
port
-
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticIsDTR(java.lang.String port) throws UnsupportedCommOperationException
port
-
UnsupportedCommOperationException;
UnsupportedCommOperationException
public static boolean staticIsRI(java.lang.String port) throws UnsupportedCommOperationException
port
-
UnsupportedCommOperationException;
UnsupportedCommOperationException
public byte getParityErrorChar() throws UnsupportedCommOperationException
UnsupportedCommOperationException;
- Anyone know how to do this in Unix?
UnsupportedCommOperationException
public boolean setParityErrorChar(byte b) throws UnsupportedCommOperationException
b
- Parity Error Character
UnsupportedCommOperationException;
- Anyone know how to do this in Unix?
UnsupportedCommOperationException
public byte getEndOfInputChar() throws UnsupportedCommOperationException
UnsupportedCommOperationException;
- Anyone know how to do this in Unix?
UnsupportedCommOperationException
public boolean setEndOfInputChar(byte b) throws UnsupportedCommOperationException
b
- End Of Input Character
UnsupportedCommOperationException;
UnsupportedCommOperationException
public boolean setUARTType(java.lang.String type, boolean test) throws UnsupportedCommOperationException
type
- String representation of the UART type which mayb
be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2"
or "16750".test
- boolean flag to determin if the UART should be tested.
UnsupportedCommOperationException;
UnsupportedCommOperationException
public java.lang.String getUARTType() throws UnsupportedCommOperationException
UnsupportedCommOperationException;
UnsupportedCommOperationException
public boolean setBaudBase(int BaudBase) throws UnsupportedCommOperationException
BaudBase
- The clock frequency divided by 16. Default
BaudBase is 115200.
UnsupportedCommOperationException
public int getBaudBase() throws UnsupportedCommOperationException
UnsupportedCommOperationException
public boolean setDivisor(int Divisor) throws UnsupportedCommOperationException
Divisor;
-
UnsupportedCommOperationException
public int getDivisor() throws UnsupportedCommOperationException
UnsupportedCommOperationException
public boolean setLowLatency() throws UnsupportedCommOperationException
UnsupportedCommOperationException
public boolean getLowLatency() throws UnsupportedCommOperationException
UnsupportedCommOperationException
public boolean setCallOutHangup(boolean NoHup) throws UnsupportedCommOperationException
UnsupportedCommOperationException
public boolean getCallOutHangup() throws UnsupportedCommOperationException
UnsupportedCommOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |