|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSerialio.SerialConfig
Serial port configuration class. A SerialConfig object is passed to a SerialPort class when the SerialPort class in created.
| Field Summary | |
static int |
BR_110
|
static int |
BR_115200
|
static int |
BR_1200
|
static int |
BR_150
|
static int |
BR_19200
|
static int |
BR_230400
|
static int |
BR_2400
|
static int |
BR_300
|
static int |
BR_38400
|
static int |
BR_460800
|
static int |
BR_4800
|
static int |
BR_57600
|
static int |
BR_600
|
static int |
BR_921600
|
static int |
BR_9600
|
static int |
HS_CTSDTR
|
static int |
HS_CTSRTS
|
static int |
HS_DSRDTR
|
static int |
HS_HARD_IN
|
static int |
HS_HARD_OUT
|
static int |
HS_NONE
|
static int |
HS_SOFT_IN
|
static int |
HS_SOFT_OUT
|
static int |
HS_SPLIT_MASK
|
static int |
HS_XONXOFF
|
static int |
LN_5BITS
|
static int |
LN_6BITS
|
static int |
LN_7BITS
|
static int |
LN_8BITS
|
static int |
PWR_ACTIVE
|
static int |
PWR_STANDBY
|
static int |
PY_EVEN
|
static int |
PY_MARK
|
static int |
PY_NONE
|
static int |
PY_ODD
|
static int |
PY_SPACE
|
static int |
ST_1BITS
|
static int |
ST_2BITS
|
| Constructor Summary | |
SerialConfig()
Create a default SerialConfig object. |
|
SerialConfig(int serPort)
Deprecated. The preferred way to construct a SerialConfig object is 'by-name'   SerialConfig cfg = new SerialConfig("COM1");  SerialConfig cfg = new SerialConfig("/dev/ttyS0");  SerialConfig cfg = new SerialConfig("Modem Port"); |
|
SerialConfig(int serPort,
int txBufLen,
int rxBufLen)
Deprecated. The preferred way to construct a SerialConfig object is 'by-name'   SerialConfig cfg = new SerialConfig("COM1");  SerialConfig cfg = new SerialConfig("/dev/ttyS0");  SerialConfig cfg = new SerialConfig("Modem Port");Then set the buffer length(s) if setting them is supported Note: Buffer size control not supported on all platforms. |
|
SerialConfig(java.lang.String pName)
Create a SerialConfig object 'by-name' with default port parameters |
|
| Method Summary | |
SerialConfig |
copy()
Return a copy (clone) of this object. |
byte[] |
getBaseName()
Get the device base name |
int |
getBitRate()
Get the bit rate index |
int |
getBitRateIndex(int rate)
Get the bit rate as index value. |
int |
getBitRateNumber(int ndx)
Get the bit rate as a number |
int |
getDataBits()
Get the number of data bits for each character |
boolean |
getDisableActiveLink()
Get the state of the 'active link' control for EPOC This is EPOC specific |
int |
getHandshake()
Get the handshake protocol |
boolean |
getHardFlow()
Get the state of the 'manual' flow control setting This is Windows specific (to Fix Microsoft driver bugs) |
int |
getParity()
Get the parity |
int |
getPort()
Get the port number This number may be meaningless if the port was opened using a name. |
byte[] |
getPortName()
Get the port name |
java.lang.String |
getPortNameString()
Get the port name |
int |
getRxLen()
Get the receive buffer length |
java.lang.String |
getSettingsString()
Get a string representing the current port settings |
int |
getStopBits()
Get the number of stop bits for each character |
int |
getTxLen()
Get the transmit buffer length |
void |
setBaseName(java.lang.String devBaseName)
Set the base device name. |
void |
setBitRate(int newBitRate)
Set the bit rate |
void |
setDataBits(int newDataBits)
Set the number of data bits |
void |
setDisableActiveLink(boolean s)
Set the state of the 'active link' control for EPOC. |
void |
setHandshake(int newShake)
Set the handshake protocol |
void |
setHardFlow(boolean state)
Set the flag that controls if we do hardware flow control for the receive buffer. |
void |
setParity(int newParity)
Set the parity Note: MARK & SPACE parity may not be supported on all platforms |
void |
setPortName(java.lang.String pName)
Set the port name |
void |
setPortNum(int pNum)
Set the port number |
void |
setRxLen(int rxBufLen)
Set the value that *maybe* used by the driver to set the queue sizes when the port is opened. |
void |
setStopBits(int newStopBits)
Set the number of stop bits |
void |
setTxLen(int txBufLen)
Set the value that *maybe* used by the driver to set the queue sizes when the port is opened. |
protected boolean |
validBitRateIndex()
Checks for valid bit rate index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int HS_NONE
public static final int HS_XONXOFF
public static final int HS_CTSRTS
public static final int HS_CTSDTR
public static final int HS_DSRDTR
public static final int HS_HARD_IN
public static final int HS_HARD_OUT
public static final int HS_SOFT_IN
public static final int HS_SOFT_OUT
public static final int HS_SPLIT_MASK
public static final int BR_110
public static final int BR_150
public static final int BR_300
public static final int BR_600
public static final int BR_1200
public static final int BR_2400
public static final int BR_4800
public static final int BR_9600
public static final int BR_19200
public static final int BR_38400
public static final int BR_57600
public static final int BR_115200
public static final int BR_230400
public static final int BR_460800
public static final int BR_921600
public static final int PY_NONE
public static final int PY_ODD
public static final int PY_EVEN
public static final int PY_MARK
public static final int PY_SPACE
public static final int LN_5BITS
public static final int LN_6BITS
public static final int LN_7BITS
public static final int LN_8BITS
public static final int ST_1BITS
public static final int ST_2BITS
public static final int PWR_STANDBY
public static final int PWR_ACTIVE
| Constructor Detail |
public SerialConfig(int serPort)
SerialConfig cfg = new SerialConfig("COM1"); SerialConfig cfg = new SerialConfig("/dev/ttyS0"); SerialConfig cfg = new SerialConfig("Modem Port");
serPort - The serial port number e.g. use 1 for COM1
public SerialConfig(int serPort,
int txBufLen,
int rxBufLen)
SerialConfig cfg = new SerialConfig("COM1"); SerialConfig cfg = new SerialConfig("/dev/ttyS0"); SerialConfig cfg = new SerialConfig("Modem Port");
serPort - Serial port number e.g. use 1 for COM1txBufLen - Transmit buffer length (in bytes) for the portrxBufLen - Receive buffer length (in bytes) for the portpublic SerialConfig(java.lang.String pName)
pName - The port/device name for the serial port
example names: "COM1" or "/dev/ttyS0"
Only UTF8 strings are currently valid
When a device is opened by name it is assigned an index by the native
code that may not correlate to the port number. i.e. if you open COM5
and check the port number in SerialConfig or SerialPort it may not be 5.public SerialConfig()
| Method Detail |
public void setPortNum(int pNum)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if port number negative.public void setPortName(java.lang.String pName)
public void setBitRate(int newBitRate)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - If bit rate is out of range.protected boolean validBitRateIndex()
public void setParity(int newParity)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - If parity is out of range.
public void setDataBits(int newDataBits)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - If number of data bits is out of range.
public void setStopBits(int newStopBits)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - If number of stop bits is out of range.
public void setHandshake(int newShake)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - If handshake protocol is out of range.
public void setBaseName(java.lang.String devBaseName)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic void setHardFlow(boolean state)
public void setTxLen(int txBufLen)
public void setRxLen(int rxBufLen)
public int getPort()
public int getTxLen()
public int getRxLen()
public int getBitRate()
public int getBitRateNumber(int ndx)
public int getBitRateIndex(int rate)
public int getParity()
public int getDataBits()
public int getStopBits()
public int getHandshake()
public byte[] getPortName()
public java.lang.String getPortNameString()
public byte[] getBaseName()
public boolean getHardFlow()
public boolean getDisableActiveLink()
public void setDisableActiveLink(boolean s)
public java.lang.String getSettingsString()
public SerialConfig copy()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException - if super.clone fails
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||