NativegetReceiveTimeout
public int NativegetReceiveTimeout()
addEventListener
public void addEventListener(SerialPortEventListener lsnr)
throws TooManyListenersException
checkMonitorThread
public boolean checkMonitorThread()
clearCommInput
public boolean clearCommInput()
throws UnsupportedCommOperationException
Extension to CommAPI
returns boolean true on success
disableReceiveFraming
public void disableReceiveFraming()
disableReceiveThreshold
public void disableReceiveThreshold()
disableReceiveTimeout
public void disableReceiveTimeout()
enableReceiveFraming
public void enableReceiveFraming(int f)
throws UnsupportedCommOperationException
Receive framing control
enableReceiveThreshold
public void enableReceiveThreshold(int thresh)
enableReceiveTimeout
public void enableReceiveTimeout(int time)
finalize
protected void finalize()
Finalize the port
getBaudBase
public int getBaudBase()
throws UnsupportedCommOperationException,
IOException
Extension to CommAPI
getBaudRate
public int getBaudRate()
- int representing the baudrate
This will not behave as expected with custom speeds
getCallOutHangup
public boolean getCallOutHangup()
throws UnsupportedCommOperationException
Extension to CommAPI
returns boolean true on success
getDataBits
public int getDataBits()
- int representing the databits
getDivisor
public int getDivisor()
throws UnsupportedCommOperationException,
IOException
Extension to CommAPI
getEndOfInputChar
public byte getEndOfInputChar()
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
- int the End of Input Character
getFlowControlMode
public int getFlowControlMode()
- int representing the flowmode
getInputBufferSize
public int getInputBufferSize()
getInputStream
public InputStream getInputStream()
get the InputStream
getLowLatency
public boolean getLowLatency()
throws UnsupportedCommOperationException
Extension to CommAPI
returns boolean true on success
getOutputBufferSize
public int getOutputBufferSize()
- in the output buffer size
getOutputStream
public OutputStream getOutputStream()
get the OutputStream
getParity
public int getParity()
- int representing the parity
getParityErrorChar
public byte getParityErrorChar()
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
- int the Parity Error Character
getReceiveFramingByte
public int getReceiveFramingByte()
- int representing the framing byte
getReceiveThreshold
public int getReceiveThreshold()
- int the recieve threshold
getReceiveTimeout
public int getReceiveTimeout()
getStopBits
public int getStopBits()
- int representing the stopbits
getUARTType
public String getUARTType()
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
- type String representation of the UART type which mayb
be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2"
or "16750".
isCD
public boolean isCD()
- boolean true if CD is set
isCTS
public boolean isCTS()
- boolean true if CTS is set
isDSR
public boolean isDSR()
- boolean true if DSR is set
isDTR
public boolean isDTR()
isRI
public boolean isRI()
- boolean true if RI is set
isRTS
public boolean isRTS()
- boolean true if RTS is set
isReceiveFramingEnabled
public boolean isReceiveFramingEnabled()
- true if framing is enabled
isReceiveThresholdEnabled
public boolean isReceiveThresholdEnabled()
- boolean true if receive threshold is enabled
isReceiveTimeoutEnabled
public boolean isReceiveTimeoutEnabled()
- boolean true if recieve timeout is enabled
nativeDrain
protected boolean nativeDrain(boolean i)
throws IOException
nativeavailable
protected int nativeavailable()
throws IOException
RXTXPort read methods
notifyOnBreakInterrupt
public void notifyOnBreakInterrupt(boolean enable)
notifyOnCTS
public void notifyOnCTS(boolean enable)
notifyOnCarrierDetect
public void notifyOnCarrierDetect(boolean enable)
notifyOnDSR
public void notifyOnDSR(boolean enable)
notifyOnDataAvailable
public void notifyOnDataAvailable(boolean enable)
notifyOnFramingError
public void notifyOnFramingError(boolean enable)
notifyOnOutputEmpty
public void notifyOnOutputEmpty(boolean enable)
notifyOnOverrunError
public void notifyOnOverrunError(boolean enable)
notifyOnParityError
public void notifyOnParityError(boolean enable)
notifyOnRingIndicator
public void notifyOnRingIndicator(boolean enable)
readArray
protected int readArray(b[] ,
int off,
int len)
throws IOException
readByte
protected int readByte()
throws IOException
readTerminatedArray
protected int readTerminatedArray(b[] ,
int off,
int len,
t[] )
throws IOException
removeEventListener
public void removeEventListener()
Remove the serial port event listener
sendBreak
public void sendBreak(int duration)
Write to the port
sendEvent
public boolean sendEvent(int event,
boolean state)
- boolean true if the port is closing
setBaudBase
public boolean setBaudBase(int BaudBase)
throws UnsupportedCommOperationException,
IOException
Extension to CommAPI. Set Baud Base to 38600 on Linux and W32
before using.
BaudBase
- The clock frequency divided by 16. Default
BaudBase is 115200.
setCallOutHangup
public boolean setCallOutHangup(boolean NoHup)
throws UnsupportedCommOperationException
Extension to CommAPI
returns boolean true on success
setDTR
public void setDTR(boolean state)
setDivisor
public boolean setDivisor(int Divisor)
throws UnsupportedCommOperationException,
IOException
Extension to CommAPI. Set Baud Base to 38600 on Linux and W32
before using.
setEndOfInputChar
public boolean setEndOfInputChar(byte b)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
b
- End Of Input Character
setFlowControlMode
public void setFlowControlMode(int flowcontrol)
flowcontrol
- FLOWCONTROL_NONE is default
setInputBufferSize
public void setInputBufferSize(int size)
setLowLatency
public boolean setLowLatency()
throws UnsupportedCommOperationException
Extension to CommAPI
returns boolean true on success
setOutputBufferSize
public void setOutputBufferSize(int size)
setParityErrorChar
public boolean setParityErrorChar(byte b)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
b
- Parity Error Character
setRTS
public void setRTS(boolean state)
setRcvFifoTrigger
public void setRcvFifoTrigger(int trigger)
deprecated but used in Kaffe
A dummy method added so RXTX compiles on Kaffee
setSerialPortParams
public void setSerialPortParams(int b,
int d,
int s,
int p)
throws UnsupportedCommOperationException
setUARTType
public boolean setUARTType(String type,
boolean test)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
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.
staticGetBaudRate
public static int staticGetBaudRate(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
This is only accurate up to 38600 baud currently.
port
- the name of the port thats been preopened
staticGetDataBits
public static int staticGetDataBits(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
port
- the name of the port thats been preopened
staticGetParity
public static int staticGetParity(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
port
- the name of the port thats been preopened
staticGetStopBits
public static int staticGetStopBits(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
port
- the name of the port thats been preopened
staticIsCD
public static boolean staticIsCD(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
find the fd and return CD without using a Java open() call
staticIsCTS
public static boolean staticIsCTS(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
find the fd and return CTS without using a Java open() call
staticIsDSR
public static boolean staticIsDSR(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
find the fd and return DSR without using a Java open() call
staticIsDTR
public static boolean staticIsDTR(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
find the fd and return DTR without using a Java open() call
staticIsRI
public static boolean staticIsRI(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
find the fd and return RI without using a Java open() call
staticIsRTS
public static boolean staticIsRTS(String port)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
find the fd and return RTS without using a Java open() call
staticSetDSR
public static boolean staticSetDSR(String port,
boolean flag)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
Open the port and set DSR. remove lockfile and do not close
This is so some software can appear to set the DSR before 'opening'
the port a second time later on.
staticSetDTR
public static boolean staticSetDTR(String port,
boolean flag)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
Open the port and set DTR. remove lockfile and do not close
This is so some software can appear to set the DTR before 'opening'
the port a second time later on.
staticSetRTS
public static boolean staticSetRTS(String port,
boolean flag)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
Open the port and set RTS. remove lockfile and do not close
This is so some software can appear to set the RTS before 'opening'
the port a second time later on.
staticSetSerialPortParams
public static void staticSetSerialPortParams(String f,
int b,
int d,
int s,
int p)
throws UnsupportedCommOperationException
Extension to CommAPI
This is an extension to CommAPI. It may not be supported on
all operating systems.
Set the SerialPort parameters
1.5 stop bits requires 5 databits
f
- filenameb
- baudrated
- databitss
- stopbitsp
- parity
waitForTheNativeCodeSilly
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.
This is important for applications that flicker the Monitor
thread while keeping the port open.
In worst case test cases this loops once or twice every time.
writeArray
protected void writeArray(b[] ,
int off,
int len,
boolean i)
throws IOException
writeByte
protected void writeByte(int b,
boolean i)
throws IOException