|
Knopflerfish OSGi 5.2.1 | ||||||||
| 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 | |
|---|---|
protected static boolean |
debug
|
protected static boolean |
debug_events
|
protected static boolean |
debug_read
|
protected static boolean |
debug_read_results
|
protected static boolean |
debug_verbose
|
protected static boolean |
debug_write
|
| Fields inherited from class gnu.io.SerialPort |
|---|
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 |
| Fields inherited from class gnu.io.CommPort |
|---|
name |
| Constructor Summary | |
|---|---|
RXTXPort(java.lang.String name)
Open the named port |
|
| Method Summary | |
|---|---|
void |
addEventListener(SerialPortEventListener lsnr)
|
boolean |
checkMonitorThread()
|
boolean |
clearCommInput()
Extension to CommAPI returns boolean true on success |
void |
close()
|
void |
disableReceiveFraming()
|
void |
disableReceiveThreshold()
|
void |
disableReceiveTimeout()
|
void |
enableReceiveFraming(int f)
Receive framing control |
void |
enableReceiveThreshold(int thresh)
|
void |
enableReceiveTimeout(int time)
|
protected void |
finalize()
Finalize the port |
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()
|
protected int |
nativeavailable()
RXTXPort read methods |
protected boolean |
nativeDrain(boolean i)
|
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)
|
protected int |
readArray(byte[] b,
int off,
int len)
|
protected int |
readByte()
|
protected int |
readTerminatedArray(byte[] b,
int off,
int len,
byte[] t)
|
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)
|
boolean |
setEndOfInputChar(byte b)
Extension to CommAPI This is an extension to CommAPI. |
void |
setFlowControlMode(int flowcontrol)
|
void |
setInputBufferSize(int size)
|
boolean |
setLowLatency()
Extension to CommAPI returns boolean true on success |
void |
setOutputBufferSize(int 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)
|
void |
setSerialPortParams(int b,
int d,
int s,
int p)
|
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. |
protected void |
waitForTheNativeCodeSilly()
Give the native code a chance to start listening to the hardware or should we say give the native code control of the issue. |
protected void |
writeArray(byte[] b,
int off,
int len,
boolean i)
|
protected void |
writeByte(int b,
boolean i)
|
| 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 |
|---|
protected static final boolean debug
protected static final boolean debug_read
protected static final boolean debug_read_results
protected static final boolean debug_write
protected static final boolean debug_events
protected static final boolean debug_verbose
| Constructor Detail |
|---|
public RXTXPort(java.lang.String name)
throws PortInUseException
name - the name of the device to open
PortInUseExceptionSerialPort| Method Detail |
|---|
public java.io.OutputStream getOutputStream()
getOutputStream in class CommPortpublic java.io.InputStream getInputStream()
getInputStream in class CommPortInputStream
public void setSerialPortParams(int b,
int d,
int s,
int p)
throws UnsupportedCommOperationException
setSerialPortParams in class SerialPortUnsupportedCommOperationExceptionpublic int getBaudRate()
getBaudRate in class SerialPortpublic int getDataBits()
getDataBits in class SerialPortpublic int getStopBits()
getStopBits in class SerialPortpublic int getParity()
getParity in class SerialPortpublic void setFlowControlMode(int flowcontrol)
setFlowControlMode in class SerialPortflowcontrol - FLOWCONTROL_NONE is defaultSerialPort.FLOWCONTROL_NONEpublic int getFlowControlMode()
getFlowControlMode in class SerialPort
public void enableReceiveFraming(int f)
throws UnsupportedCommOperationException
enableReceiveFraming in class CommPortf - framming
UnsupportedCommOperationExceptionpublic void disableReceiveFraming()
disableReceiveFraming in class CommPortpublic boolean isReceiveFramingEnabled()
isReceiveFramingEnabled in class CommPortpublic int getReceiveFramingByte()
getReceiveFramingByte in class CommPortpublic int NativegetReceiveTimeout()
public void disableReceiveTimeout()
disableReceiveTimeout in class CommPortpublic void enableReceiveTimeout(int time)
enableReceiveTimeout in class CommPorttime - public boolean isReceiveTimeoutEnabled()
isReceiveTimeoutEnabled in class CommPortpublic int getReceiveTimeout()
getReceiveTimeout in class CommPortpublic void enableReceiveThreshold(int thresh)
enableReceiveThreshold in class CommPortthresh - thresholdpublic void disableReceiveThreshold()
disableReceiveThreshold in class CommPortpublic int getReceiveThreshold()
getReceiveThreshold in class CommPortpublic boolean isReceiveThresholdEnabled()
isReceiveThresholdEnabled in class CommPortpublic void setInputBufferSize(int size)
setInputBufferSize in class CommPortsize - public int getInputBufferSize()
getInputBufferSize in class CommPortpublic void setOutputBufferSize(int size)
setOutputBufferSize in class CommPortsize - public int getOutputBufferSize()
getOutputBufferSize in class CommPortpublic boolean isDTR()
isDTR in class SerialPortpublic void setDTR(boolean state)
setDTR in class SerialPortstate - public void setRTS(boolean state)
setRTS in class SerialPortstate - public boolean isCTS()
isCTS in class SerialPortpublic boolean isDSR()
isDSR in class SerialPortpublic boolean isCD()
isCD in class SerialPortpublic boolean isRI()
isRI in class SerialPortpublic boolean isRTS()
isRTS in class SerialPortpublic void sendBreak(int duration)
sendBreak in class SerialPortduration -
protected void writeByte(int b,
boolean i)
throws java.io.IOException
java.io.IOException
protected void writeArray(byte[] b,
int off,
int len,
boolean i)
throws java.io.IOException
java.io.IOException
protected boolean nativeDrain(boolean i)
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
protected int readTerminatedArray(byte[] b,
int off,
int len,
byte[] t)
throws java.io.IOException
java.io.IOExceptionpublic boolean checkMonitorThread()
public boolean sendEvent(int event,
boolean state)
event - state -
public void addEventListener(SerialPortEventListener lsnr)
throws java.util.TooManyListenersException
addEventListener in class SerialPortjava.util.TooManyListenersExceptionpublic void removeEventListener()
removeEventListener in class SerialPortprotected void waitForTheNativeCodeSilly()
public void notifyOnDataAvailable(boolean enable)
notifyOnDataAvailable in class SerialPortpublic void notifyOnOutputEmpty(boolean enable)
notifyOnOutputEmpty in class SerialPortenable - public void notifyOnCTS(boolean enable)
notifyOnCTS in class SerialPortenable - public void notifyOnDSR(boolean enable)
notifyOnDSR in class SerialPortenable - public void notifyOnRingIndicator(boolean enable)
notifyOnRingIndicator in class SerialPortenable - public void notifyOnCarrierDetect(boolean enable)
notifyOnCarrierDetect in class SerialPortenable - public void notifyOnOverrunError(boolean enable)
notifyOnOverrunError in class SerialPortenable - public void notifyOnParityError(boolean enable)
notifyOnParityError in class SerialPortenable - public void notifyOnFramingError(boolean enable)
notifyOnFramingError in class SerialPortenable - public void notifyOnBreakInterrupt(boolean enable)
notifyOnBreakInterrupt in class SerialPortenable - public void close()
close in class CommPortprotected void finalize()
finalize in class java.lang.Objectpublic void setRcvFifoTrigger(int trigger)
public 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
UnsupportedCommOperationExceptionUnsupportedCommOperationException
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
getParityErrorChar in class SerialPortUnsupportedCommOperationException; - Anyone know how to do this in Unix?
UnsupportedCommOperationException
public boolean setParityErrorChar(byte b)
throws UnsupportedCommOperationException
setParityErrorChar in class SerialPortb - Parity Error Character
UnsupportedCommOperationException; - Anyone know how to do this in Unix?
UnsupportedCommOperationException
public byte getEndOfInputChar()
throws UnsupportedCommOperationException
getEndOfInputChar in class SerialPortUnsupportedCommOperationException; - Anyone know how to do this in Unix?
UnsupportedCommOperationException
public boolean setEndOfInputChar(byte b)
throws UnsupportedCommOperationException
setEndOfInputChar in class SerialPortb - End Of Input Character
UnsupportedCommOperationException;
UnsupportedCommOperationException
public boolean setUARTType(java.lang.String type,
boolean test)
throws UnsupportedCommOperationException
setUARTType in class SerialPorttype - 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
getUARTType in class SerialPortUnsupportedCommOperationException;
UnsupportedCommOperationException
public boolean setBaudBase(int BaudBase)
throws UnsupportedCommOperationException,
java.io.IOException
setBaudBase in class SerialPortBaudBase - The clock frequency divided by 16. Default
BaudBase is 115200.
UnsupportedCommOperationException, - IOException
UnsupportedCommOperationException
java.io.IOException
public int getBaudBase()
throws UnsupportedCommOperationException,
java.io.IOException
getBaudBase in class SerialPortUnsupportedCommOperationException, - IOException
UnsupportedCommOperationException
java.io.IOException
public boolean setDivisor(int Divisor)
throws UnsupportedCommOperationException,
java.io.IOException
setDivisor in class SerialPortDivisor -
UnsupportedCommOperationException, - IOException
UnsupportedCommOperationException
java.io.IOException
public int getDivisor()
throws UnsupportedCommOperationException,
java.io.IOException
getDivisor in class SerialPortUnsupportedCommOperationException, - IOException
UnsupportedCommOperationException
java.io.IOException
public boolean setLowLatency()
throws UnsupportedCommOperationException
setLowLatency in class SerialPortUnsupportedCommOperationException
public boolean getLowLatency()
throws UnsupportedCommOperationException
getLowLatency in class SerialPortUnsupportedCommOperationException
public boolean setCallOutHangup(boolean NoHup)
throws UnsupportedCommOperationException
setCallOutHangup in class SerialPortUnsupportedCommOperationException
public boolean getCallOutHangup()
throws UnsupportedCommOperationException
getCallOutHangup in class SerialPortUnsupportedCommOperationException
public boolean clearCommInput()
throws UnsupportedCommOperationException
UnsupportedCommOperationException
|
Knopflerfish OSGi 5.2.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||