gnu.io
Class RXTXPort

java.lang.Object
  extended bygnu.io.CommPort
      extended bygnu.io.SerialPort
          extended bygnu.io.RXTXPort

public final class RXTXPort
extends SerialPort

An extension of gnu.io.SerialPort

See Also:
SerialPort

Nested Class Summary
(package private)  class RXTXPort.MonitorThread
           
(package private)  class RXTXPort.SerialInputStream
          Inner class for SerialInputStream
(package private)  class RXTXPort.SerialOutputStream
          Inner class for SerialOutputStream
 
Field Summary
(package private)  boolean closeLock
           
private  int dataBits
          Data bits port parameter
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
           
(package private) static boolean dsrFlag
          DSR flag
(package private)  int eis
          a pointer to the event info structure used to share information between threads so write threads can send output buffer empty from a pthread if need be.
private  int fd
          File descriptor
private  int flowmode
          Flow control
private  RXTXPort.SerialInputStream 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...
(package private)  int IOLocked
           
(package private)  boolean MonitorThreadAlive
           
(package private)  boolean MonitorThreadCloseLock
           
(package private)  boolean MonitorThreadLock
          Add an event listener
private  RXTXPort.MonitorThread monThread
          Thread to monitor data
(package private)  boolean monThreadisInterrupted
           
private  RXTXPort.SerialOutputStream out
          Output stream
private  int OutputBuffer
           
private  int parity
          Parity port parameter
(package private)  int pid
          pid for lock files
private  int speed
          Line speed in bits-per-second
private  SerialPortEventListener SPEventListener
          Serial Port Event listener
private  int stopBits
          Stop bits port parameter
private  int threshold
          Receive threshold control
private  int timeout
          Receive timeout control
private static Zystem z
           
 
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()
           
 void close()
           
 void disableReceiveFraming()
           
 void disableReceiveThreshold()
           
 void disableReceiveTimeout()
           
 void enableReceiveFraming(int f)
          Receive framing control
 void enableReceiveThreshold(int thresh)
           
 void enableReceiveTimeout(int time)
           
(package private)  void eventLoop()
          Process SerialPortEvents
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.
private static void Initialize()
          Initialize the native library
private  void interruptEventLoop()
           
 boolean isCD()
           
 boolean isCTS()
           
 boolean isDSR()
           
 boolean isDTR()
           
 boolean isReceiveFramingEnabled()
           
 boolean isReceiveThresholdEnabled()
           
 boolean isReceiveTimeoutEnabled()
           
 boolean isRI()
           
 boolean isRTS()
           
protected  int nativeavailable()
          RXTXPort read methods
private  void nativeClose(java.lang.String name)
          Close the port
protected  boolean nativeDrain(boolean i)
           
private  void NativeEnableReceiveTimeoutThreshold(int time, int threshold, int InputBuffer)
           
private  int nativeGetBaudBase()
           
private  boolean nativeGetCallOutHangup()
           
private  int nativeGetDivisor()
           
private  byte nativeGetEndOfInputChar()
           
private  int nativeGetFlowControlMode(int fd)
           
private  boolean nativeGetLowLatency()
           
private  int nativeGetParity(int fd)
          Set the SerialPort parameters 1.5 stop bits requires 5 databits
private  byte nativeGetParityErrorChar()
           
 int NativegetReceiveTimeout()
           
(package private)  java.lang.String nativeGetUartType()
           
private  boolean NativeisReceiveTimeoutEnabled()
           
private  boolean nativeSetBaudBase(int BaudBase)
           
private  boolean nativeSetCallOutHangup(boolean NoHup)
           
private  boolean nativeSetDivisor(int Divisor)
           
private  boolean nativeSetEndOfInputChar(byte b)
           
private  void nativeSetEventFlag(int fd, int event, boolean flag)
           
private  boolean nativeSetLowLatency()
           
private  boolean nativeSetParityErrorChar(byte b)
           
private  boolean nativeSetSerialPortParams(int speed, int dataBits, int stopBits, int parity)
          Set the native serial port parameters If speed is not a predifined speed it is assumed to be the actual speed desired.
private  boolean nativeSetUartType(java.lang.String type, boolean test)
           
private static int nativeStaticGetBaudRate(java.lang.String port)
           
private static int nativeStaticGetDataBits(java.lang.String port)
           
private static int nativeStaticGetParity(java.lang.String port)
           
private static int nativeStaticGetStopBits(java.lang.String port)
           
private static boolean nativeStaticIsCD(java.lang.String port)
           
private static boolean nativeStaticIsCTS(java.lang.String port)
           
private static boolean nativeStaticIsDSR(java.lang.String port)
           
private static boolean nativeStaticIsDTR(java.lang.String port)
           
private static boolean nativeStaticIsRI(java.lang.String port)
           
private static boolean nativeStaticIsRTS(java.lang.String port)
           
private static boolean nativeStaticSetDSR(java.lang.String port, boolean flag)
           
private static boolean nativeStaticSetDTR(java.lang.String port, boolean flag)
           
private static boolean nativeStaticSetRTS(java.lang.String port, boolean flag)
           
private static void nativeStaticSetSerialPortParams(java.lang.String f, int b, int d, int s, int p)
           
 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)
           
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
private  void setDSR(boolean state)
           
 void setDTR(boolean state)
           
 boolean setEndOfInputChar(byte b)
          Extension to CommAPI This is an extension to CommAPI.
(package private)  void setflowcontrol(int flowcontrol)
           
 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

debug

protected static final boolean debug
See Also:
Constant Field Values

debug_read

protected static final boolean debug_read
See Also:
Constant Field Values

debug_read_results

protected static final boolean debug_read_results
See Also:
Constant Field Values

debug_write

protected static final boolean debug_write
See Also:
Constant Field Values

debug_events

protected static final boolean debug_events
See Also:
Constant Field Values

debug_verbose

protected static final boolean debug_verbose
See Also:
Constant Field Values

z

private static Zystem z

MonitorThreadAlive

boolean MonitorThreadAlive

IOLocked

int IOLocked

fd

private int fd
File descriptor


eis

int eis
a pointer to the event info structure used to share information between threads so write threads can send output buffer empty from a pthread if need be.


pid

int pid
pid for lock files


dsrFlag

static boolean dsrFlag
DSR flag


out

private final RXTXPort.SerialOutputStream out
Output stream


in

private final RXTXPort.SerialInputStream in
Input stream


speed

private int speed
Line speed in bits-per-second


dataBits

private int dataBits
Data bits port parameter


stopBits

private int stopBits
Stop bits port parameter


parity

private int parity
Parity port parameter


flowmode

private int flowmode
Flow control


timeout

private int timeout
Receive timeout control


threshold

private int threshold
Receive threshold control


InputBuffer

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...


OutputBuffer

private int OutputBuffer

SPEventListener

private SerialPortEventListener SPEventListener
Serial Port Event listener


monThread

private RXTXPort.MonitorThread monThread
Thread to monitor data


monThreadisInterrupted

boolean monThreadisInterrupted

MonitorThreadLock

boolean MonitorThreadLock
Add an event listener


MonitorThreadCloseLock

boolean MonitorThreadCloseLock

closeLock

boolean closeLock
Constructor Detail

RXTXPort

public RXTXPort(java.lang.String name)
         throws PortInUseException
Open the named port

Parameters:
name - the name of the device to open
Throws:
PortInUseException
See Also:
SerialPort
Method Detail

Initialize

private static void Initialize()
Initialize the native library


open

private int open(java.lang.String name)
          throws PortInUseException
Throws:
PortInUseException

getOutputStream

public java.io.OutputStream getOutputStream()
get the OutputStream

Specified by:
getOutputStream in class CommPort
Returns:
OutputStream

getInputStream

public java.io.InputStream getInputStream()
get the InputStream

Specified by:
getInputStream in class CommPort
Returns:
InputStream
See Also:
InputStream

nativeGetParity

private int nativeGetParity(int fd)
Set the SerialPort parameters 1.5 stop bits requires 5 databits

Throws:
UnsupportedCommOperationException
See Also:
If speed is not a predifined speed it is assumed to be the actual speed desired.

nativeGetFlowControlMode

private int nativeGetFlowControlMode(int fd)

setSerialPortParams

public void setSerialPortParams(int b,
                                int d,
                                int s,
                                int p)
                         throws UnsupportedCommOperationException
Specified by:
setSerialPortParams in class SerialPort
Throws:
UnsupportedCommOperationException

nativeSetSerialPortParams

private boolean nativeSetSerialPortParams(int speed,
                                          int dataBits,
                                          int stopBits,
                                          int parity)
                                   throws UnsupportedCommOperationException
Set the native serial port parameters If speed is not a predifined speed it is assumed to be the actual speed desired.

Throws:
UnsupportedCommOperationException

getBaudRate

public int getBaudRate()
Specified by:
getBaudRate in class SerialPort
Returns:
int representing the baudrate This will not behave as expected with custom speeds

getDataBits

public int getDataBits()
Specified by:
getDataBits in class SerialPort
Returns:
int representing the databits

getStopBits

public int getStopBits()
Specified by:
getStopBits in class SerialPort
Returns:
int representing the stopbits

getParity

public int getParity()
Specified by:
getParity in class SerialPort
Returns:
int representing the parity

setFlowControlMode

public void setFlowControlMode(int flowcontrol)
Specified by:
setFlowControlMode in class SerialPort
Parameters:
flowcontrol - FLOWCONTROL_NONE is default
See Also:
SerialPort.FLOWCONTROL_NONE

getFlowControlMode

public int getFlowControlMode()
Specified by:
getFlowControlMode in class SerialPort
Returns:
int representing the flowmode

setflowcontrol

void setflowcontrol(int flowcontrol)
              throws java.io.IOException
Throws:
java.io.IOException

enableReceiveFraming

public void enableReceiveFraming(int f)
                          throws UnsupportedCommOperationException
Receive framing control

Specified by:
enableReceiveFraming in class CommPort
Parameters:
f - framming
Throws:
UnsupportedCommOperationException

disableReceiveFraming

public void disableReceiveFraming()
Specified by:
disableReceiveFraming in class CommPort

isReceiveFramingEnabled

public boolean isReceiveFramingEnabled()
Specified by:
isReceiveFramingEnabled in class CommPort

getReceiveFramingByte

public int getReceiveFramingByte()
Specified by:
getReceiveFramingByte in class CommPort
Returns:
int representing the framing byte

NativegetReceiveTimeout

public int NativegetReceiveTimeout()
Returns:
int the timeout

NativeisReceiveTimeoutEnabled

private boolean NativeisReceiveTimeoutEnabled()
Returns:
bloolean true if recieve timeout is enabled

NativeEnableReceiveTimeoutThreshold

private void NativeEnableReceiveTimeoutThreshold(int time,
                                                 int threshold,
                                                 int InputBuffer)
Parameters:
time -
threshold -
InputBuffer -

disableReceiveTimeout

public void disableReceiveTimeout()
Specified by:
disableReceiveTimeout in class CommPort

enableReceiveTimeout

public void enableReceiveTimeout(int time)
Specified by:
enableReceiveTimeout in class CommPort
Parameters:
time -

isReceiveTimeoutEnabled

public boolean isReceiveTimeoutEnabled()
Specified by:
isReceiveTimeoutEnabled in class CommPort
Returns:
boolean true if recieve timeout is enabled

getReceiveTimeout

public int getReceiveTimeout()
Specified by:
getReceiveTimeout in class CommPort
Returns:
int the timeout

enableReceiveThreshold

public void enableReceiveThreshold(int thresh)
Specified by:
enableReceiveThreshold in class CommPort
Parameters:
thresh - threshold

disableReceiveThreshold

public void disableReceiveThreshold()
Specified by:
disableReceiveThreshold in class CommPort

getReceiveThreshold

public int getReceiveThreshold()
Specified by:
getReceiveThreshold in class CommPort
Returns:
int the recieve threshold

isReceiveThresholdEnabled

public boolean isReceiveThresholdEnabled()
Specified by:
isReceiveThresholdEnabled in class CommPort
Returns:
boolean true if receive threshold is enabled

setInputBufferSize

public void setInputBufferSize(int size)
Specified by:
setInputBufferSize in class CommPort
Parameters:
size -

getInputBufferSize

public int getInputBufferSize()
Specified by:
getInputBufferSize in class CommPort

setOutputBufferSize

public void setOutputBufferSize(int size)
Specified by:
setOutputBufferSize in class CommPort
Parameters:
size -

getOutputBufferSize

public int getOutputBufferSize()
Specified by:
getOutputBufferSize in class CommPort
Returns:
in the output buffer size

isDTR

public boolean isDTR()
Specified by:
isDTR in class SerialPort

setDTR

public void setDTR(boolean state)
Specified by:
setDTR in class SerialPort
Parameters:
state -

setRTS

public void setRTS(boolean state)
Specified by:
setRTS in class SerialPort
Parameters:
state -

setDSR

private void setDSR(boolean state)

isCTS

public boolean isCTS()
Specified by:
isCTS in class SerialPort
Returns:
boolean true if CTS is set

isDSR

public boolean isDSR()
Specified by:
isDSR in class SerialPort
Returns:
boolean true if DSR is set

isCD

public boolean isCD()
Specified by:
isCD in class SerialPort
Returns:
boolean true if CD is set

isRI

public boolean isRI()
Specified by:
isRI in class SerialPort
Returns:
boolean true if RI is set

isRTS

public boolean isRTS()
Specified by:
isRTS in class SerialPort
Returns:
boolean true if RTS is set

sendBreak

public void sendBreak(int duration)
Write to the port

Specified by:
sendBreak in class SerialPort
Parameters:
duration -

writeByte

protected void writeByte(int b,
                         boolean i)
                  throws java.io.IOException
Throws:
java.io.IOException

writeArray

protected void writeArray(byte[] b,
                          int off,
                          int len,
                          boolean i)
                   throws java.io.IOException
Throws:
java.io.IOException

nativeDrain

protected boolean nativeDrain(boolean i)
                       throws java.io.IOException
Throws:
java.io.IOException

nativeavailable

protected int nativeavailable()
                       throws java.io.IOException
RXTXPort read methods

Throws:
java.io.IOException

readByte

protected int readByte()
                throws java.io.IOException
Throws:
java.io.IOException

readArray

protected int readArray(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
Throws:
java.io.IOException

readTerminatedArray

protected int readTerminatedArray(byte[] b,
                                  int off,
                                  int len,
                                  byte[] t)
                           throws java.io.IOException
Throws:
java.io.IOException

eventLoop

void eventLoop()
Process SerialPortEvents


interruptEventLoop

private void interruptEventLoop()

checkMonitorThread

public boolean checkMonitorThread()

sendEvent

public boolean sendEvent(int event,
                         boolean state)
Parameters:
event -
state -
Returns:
boolean true if the port is closing

addEventListener

public void addEventListener(SerialPortEventListener lsnr)
                      throws java.util.TooManyListenersException
Specified by:
addEventListener in class SerialPort
Throws:
java.util.TooManyListenersException

removeEventListener

public void removeEventListener()
Remove the serial port event listener

Specified by:
removeEventListener in class SerialPort

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.


nativeSetEventFlag

private void nativeSetEventFlag(int fd,
                                int event,
                                boolean flag)

notifyOnDataAvailable

public void notifyOnDataAvailable(boolean enable)
Specified by:
notifyOnDataAvailable in class SerialPort

notifyOnOutputEmpty

public void notifyOnOutputEmpty(boolean enable)
Specified by:
notifyOnOutputEmpty in class SerialPort
Parameters:
enable -

notifyOnCTS

public void notifyOnCTS(boolean enable)
Specified by:
notifyOnCTS in class SerialPort
Parameters:
enable -

notifyOnDSR

public void notifyOnDSR(boolean enable)
Specified by:
notifyOnDSR in class SerialPort
Parameters:
enable -

notifyOnRingIndicator

public void notifyOnRingIndicator(boolean enable)
Specified by:
notifyOnRingIndicator in class SerialPort
Parameters:
enable -

notifyOnCarrierDetect

public void notifyOnCarrierDetect(boolean enable)
Specified by:
notifyOnCarrierDetect in class SerialPort
Parameters:
enable -

notifyOnOverrunError

public void notifyOnOverrunError(boolean enable)
Specified by:
notifyOnOverrunError in class SerialPort
Parameters:
enable -

notifyOnParityError

public void notifyOnParityError(boolean enable)
Specified by:
notifyOnParityError in class SerialPort
Parameters:
enable -

notifyOnFramingError

public void notifyOnFramingError(boolean enable)
Specified by:
notifyOnFramingError in class SerialPort
Parameters:
enable -

notifyOnBreakInterrupt

public void notifyOnBreakInterrupt(boolean enable)
Specified by:
notifyOnBreakInterrupt in class SerialPort
Parameters:
enable -

nativeClose

private void nativeClose(java.lang.String name)
Close the port


close

public void close()
Overrides:
close in class CommPort

finalize

protected void finalize()
Finalize the port


setRcvFifoTrigger

public void setRcvFifoTrigger(int trigger)
Deprecated. deprecated but used in Kaffe

A dummy method added so RXTX compiles on Kaffee


nativeStaticSetSerialPortParams

private static void nativeStaticSetSerialPortParams(java.lang.String f,
                                                    int b,
                                                    int d,
                                                    int s,
                                                    int p)
                                             throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticSetDSR

private static boolean nativeStaticSetDSR(java.lang.String port,
                                          boolean flag)
                                   throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticSetDTR

private static boolean nativeStaticSetDTR(java.lang.String port,
                                          boolean flag)
                                   throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticSetRTS

private static boolean nativeStaticSetRTS(java.lang.String port,
                                          boolean flag)
                                   throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticIsDSR

private static boolean nativeStaticIsDSR(java.lang.String port)
                                  throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticIsDTR

private static boolean nativeStaticIsDTR(java.lang.String port)
                                  throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticIsRTS

private static boolean nativeStaticIsRTS(java.lang.String port)
                                  throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticIsCTS

private static boolean nativeStaticIsCTS(java.lang.String port)
                                  throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticIsCD

private static boolean nativeStaticIsCD(java.lang.String port)
                                 throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticIsRI

private static boolean nativeStaticIsRI(java.lang.String port)
                                 throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticGetBaudRate

private static int nativeStaticGetBaudRate(java.lang.String port)
                                    throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticGetDataBits

private static int nativeStaticGetDataBits(java.lang.String port)
                                    throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticGetParity

private static int nativeStaticGetParity(java.lang.String port)
                                  throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeStaticGetStopBits

private static int nativeStaticGetStopBits(java.lang.String port)
                                    throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeGetParityErrorChar

private byte nativeGetParityErrorChar()
                               throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeSetParityErrorChar

private boolean nativeSetParityErrorChar(byte b)
                                  throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeGetEndOfInputChar

private byte nativeGetEndOfInputChar()
                              throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeSetEndOfInputChar

private boolean nativeSetEndOfInputChar(byte b)
                                 throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeSetUartType

private boolean nativeSetUartType(java.lang.String type,
                                  boolean test)
                           throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeGetUartType

java.lang.String nativeGetUartType()
                             throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeSetBaudBase

private boolean nativeSetBaudBase(int BaudBase)
                           throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeGetBaudBase

private int nativeGetBaudBase()
                       throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeSetDivisor

private boolean nativeSetDivisor(int Divisor)
                          throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeGetDivisor

private int nativeGetDivisor()
                      throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeSetLowLatency

private boolean nativeSetLowLatency()
                             throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeGetLowLatency

private boolean nativeGetLowLatency()
                             throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeSetCallOutHangup

private boolean nativeSetCallOutHangup(boolean NoHup)
                                throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

nativeGetCallOutHangup

private boolean nativeGetCallOutHangup()
                                throws UnsupportedCommOperationException
Throws:
UnsupportedCommOperationException

staticGetBaudRate

public static int staticGetBaudRate(java.lang.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.

Parameters:
port - the name of the port thats been preopened
Returns:
BaudRate on success
Throws:
UnsupportedCommOperationException; - This will not behave as expected with custom speeds
UnsupportedCommOperationException

staticGetDataBits

public static int staticGetDataBits(java.lang.String port)
                             throws UnsupportedCommOperationException
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems.

Parameters:
port - the name of the port thats been preopened
Returns:
DataBits on success
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticGetParity

public static int staticGetParity(java.lang.String port)
                           throws UnsupportedCommOperationException
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems.

Parameters:
port - the name of the port thats been preopened
Returns:
Parity on success
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticGetStopBits

public static int staticGetStopBits(java.lang.String port)
                             throws UnsupportedCommOperationException
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems.

Parameters:
port - the name of the port thats been preopened
Returns:
StopBits on success
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticSetSerialPortParams

public static void staticSetSerialPortParams(java.lang.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

Parameters:
f - filename
b - baudrate
d - databits
s - stopbits
p - parity
Throws:
UnsupportedCommOperationException
See Also:
UnsupportedCommOperationException

staticSetDSR

public static boolean staticSetDSR(java.lang.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.

Returns:
true on success
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticSetDTR

public static boolean staticSetDTR(java.lang.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.

Returns:
true on success
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticSetRTS

public static boolean staticSetRTS(java.lang.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.

Returns:
none
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticIsRTS

public static boolean staticIsRTS(java.lang.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

Returns:
boolean true if asserted
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticIsCD

public static boolean staticIsCD(java.lang.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

Returns:
boolean true if asserted
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticIsCTS

public static boolean staticIsCTS(java.lang.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

Returns:
boolean true if asserted
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticIsDSR

public static boolean staticIsDSR(java.lang.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

Returns:
boolean true if asserted
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticIsDTR

public static boolean staticIsDTR(java.lang.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

Returns:
boolean true if asserted
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

staticIsRI

public static boolean staticIsRI(java.lang.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

Returns:
boolean true if asserted
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

getParityErrorChar

public byte getParityErrorChar()
                        throws UnsupportedCommOperationException
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems.

Specified by:
getParityErrorChar in class SerialPort
Returns:
int the Parity Error Character
Throws:
UnsupportedCommOperationException; - Anyone know how to do this in Unix?
UnsupportedCommOperationException

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.

Specified by:
setParityErrorChar in class SerialPort
Parameters:
b - Parity Error Character
Returns:
boolean true on success
Throws:
UnsupportedCommOperationException; - Anyone know how to do this in Unix?
UnsupportedCommOperationException

getEndOfInputChar

public byte getEndOfInputChar()
                       throws UnsupportedCommOperationException
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems.

Specified by:
getEndOfInputChar in class SerialPort
Returns:
int the End of Input Character
Throws:
UnsupportedCommOperationException; - Anyone know how to do this in Unix?
UnsupportedCommOperationException

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.

Specified by:
setEndOfInputChar in class SerialPort
Parameters:
b - End Of Input Character
Returns:
boolean true on success
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

setUARTType

public boolean setUARTType(java.lang.String type,
                           boolean test)
                    throws UnsupportedCommOperationException
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems.

Specified by:
setUARTType in class SerialPort
Parameters:
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.
Returns:
boolean true on success
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

getUARTType

public java.lang.String getUARTType()
                             throws UnsupportedCommOperationException
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems.

Specified by:
getUARTType in class SerialPort
Returns:
type String representation of the UART type which mayb be "none", "8250", "16450", "16550", "16550A", "16650", "16550V2" or "16750".
Throws:
UnsupportedCommOperationException;
UnsupportedCommOperationException

setBaudBase

public boolean setBaudBase(int BaudBase)
                    throws UnsupportedCommOperationException
Extension to CommAPI

Specified by:
setBaudBase in class SerialPort
Returns:
boolean true on success
Throws:
UnsupportedCommOperationException

getBaudBase

public int getBaudBase()
                throws UnsupportedCommOperationException
Extension to CommAPI

Specified by:
getBaudBase in class SerialPort
Returns:
int BaudBase
Throws:
UnsupportedCommOperationException

setDivisor

public boolean setDivisor(int Divisor)
                   throws UnsupportedCommOperationException
Extension to CommAPI

Specified by:
setDivisor in class SerialPort
Throws:
UnsupportedCommOperationException

getDivisor

public int getDivisor()
               throws UnsupportedCommOperationException
Extension to CommAPI

Specified by:
getDivisor in class SerialPort
Throws:
UnsupportedCommOperationException

setLowLatency

public boolean setLowLatency()
                      throws UnsupportedCommOperationException
Extension to CommAPI returns boolean true on success

Specified by:
setLowLatency in class SerialPort
Throws:
UnsupportedCommOperationException

getLowLatency

public boolean getLowLatency()
                      throws UnsupportedCommOperationException
Extension to CommAPI returns boolean true on success

Specified by:
getLowLatency in class SerialPort
Throws:
UnsupportedCommOperationException

setCallOutHangup

public boolean setCallOutHangup(boolean NoHup)
                         throws UnsupportedCommOperationException
Extension to CommAPI returns boolean true on success

Specified by:
setCallOutHangup in class SerialPort
Throws:
UnsupportedCommOperationException

getCallOutHangup

public boolean getCallOutHangup()
                         throws UnsupportedCommOperationException
Extension to CommAPI returns boolean true on success

Specified by:
getCallOutHangup in class SerialPort
Throws:
UnsupportedCommOperationException