|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISerialCommService
This is the primary control class for a SerialComm port. An instance of this class may be operated on by more than one thread. Settings will be those of the last thread to successfully change each particular setting.
Code written to use an ISerialCommSerivce object in a shared mode should make use of syncronization blocks where exclusive transactions are wanted. In most instances, both the OutputStream and the InputStream should be syncronized on, normally with the OutputStream being syncronized first.
Field Summary | |
---|---|
static java.lang.String |
SERVICE_NAME
Reports the class name representing this class. |
Method Summary | |
---|---|
int |
getBaudRate()
Gets the last baud rate set in the most recent setBaudRate() or setAllConfig(mode,baud,parity,stop,bitsPerByte) or setAllConfig(mode,baud,parity,stop,bitsPerByte,warmUp,warmDown). |
int |
getBitsPerByte()
Gets the word size set in the most recent setBitsPerByte() or setAllConfig(mode,baud,parity,stop,bitsPerByte) or setAllConfig(mode,baud,parity,stop,bitsPerByte,warmUp,warmDown). |
boolean |
getCts()
Gets the current state of the CTS signal. |
boolean |
getDcd()
Gets the current state of the DCD signal. |
boolean |
getDsr()
Gets the current state of the DSR signal. |
boolean |
getDtr()
Gets the current state of the DTR signal. |
SerialCommInputStream |
getInputStream()
Get the SerialCommInputStream, which extends the functionality of the standard InputStream. |
int |
getMode()
Gets the mode set in the most recent setMode() or setAllConfig(mode,baud,parity,stop,bitsPerByte) or setAllConfig(mode,baud,parity,stop,bitsPerByte,warmUp,warmDown). |
SerialCommOutputStream |
getOutputStream()
Get the SerialCommOutputSteam, which extends the functionality of the standard OutputStream. |
int |
getParity()
Gets the parity set in the most recent setParity() or setAllConfig(mode,baud,parity,stop,bitsPerByte) or setAllConfig(mode,baud,parity,stop,bitsPerByte,warmUp,warmDown). |
boolean |
getRi()
Gets the current state of the RI signal. |
boolean |
getRts()
Gets the current state of the RTS signal. |
int |
getStopBits()
Gets the stop bit count set in the most recent setStopBits() or setAllConfig(mode,baud,parity,stop,bitsPerByte) or setAllConfig(mode,baud,parity,stop,bitsPerByte,warmUp,warmDown). |
int |
getWarmDown()
Gets the warmDown time set in the most recent setMode(mode,warmUp,warmDown) or setAllConfig(mode,baud,parity,stop,bitsPerByte,warmUp,warmDown). |
int |
getWarmUp()
Gets the warmUp time set in the most recent setMode(mode,warmUp,warmDown) or setAllConfig(mode,baud,parity,stop,bitsPerByte,warmUp,warmDown). |
void |
setAllConfig(int mode,
int baud,
int parity,
int stop,
int bitsPerByte)
Validates the passed parameters, stores them and sets the port configuration accordingly. |
void |
setAllConfig(int mode,
int baud,
int parity,
int stop,
int bitsPerByte,
int warmUp,
int warmDown)
Validates the passed parameters, stores them and sets the port configuration accordingly. |
void |
setBaudRate(int baud)
Validates against the BaudRate and sets the baud rate if valid. |
void |
setBitsPerByte(int bits)
Validates against the BitsPerByte and sets the word size if valid. |
void |
setDtr(boolean state)
Sets the DTR pin to the selected state. |
void |
setMode(int mode)
Validates against the SerialMode and sets the selected mode if valid. |
void |
setMode(int mode,
int warmUp,
int warmDown)
Validates against the SerialMode and sets the selected mode if valid. |
void |
setParity(int parity)
Validates against the Parity and sets the parity if valid. |
void |
setRts(boolean state)
Sets the RTS pin to the selected state. |
void |
setStopBits(int stop)
Validates against the StopBits and sets the number of bits if valid. |
Field Detail |
---|
static final java.lang.String SERVICE_NAME
Method Detail |
---|
boolean getDsr()
boolean getDcd()
boolean getCts()
boolean getRi()
boolean getDtr()
boolean getRts()
void setDtr(boolean state)
state
- true sets DTR active, false inactivevoid setRts(boolean state)
Note In full handshake modes, RTS may be modified automatically irrespective of the settings attempted by setRts.
state
- true sets RTS active, false inactivevoid setBaudRate(int baud) throws ParameterInvalidException
baud
- validated against the fields in BaudRate class
ParameterInvalidException
- validation failedint getBaudRate()
void setParity(int parity) throws ParameterInvalidException
parity
- validated against the fields in Parity class
ParameterInvalidException
- validation failedint getParity()
void setBitsPerByte(int bits) throws ParameterInvalidException
bits
- validated against the fields in BitsPerByte class
ParameterInvalidException
- validation failedint getBitsPerByte()
void setStopBits(int stop) throws ParameterInvalidException
stop
- validated against the fields in StopBits class
ParameterInvalidException
- validation failedint getStopBits()
void setMode(int mode) throws ParameterInvalidException
mode
- validated against the fields in SerialMode class
ParameterInvalidException
- validation failedvoid setMode(int mode, int warmUp, int warmDown) throws ParameterInvalidException
Note This overloaded method should only be used when setting the HalfDuplexRtsExtended mode.
mode
- validated against the fields in SerialMode classwarmUp
- 0 or greater number of milliseconds to hold RTS active
before starting the transmission of data.warmDown
- 0 or greater number of milliseconds to hold RTS active
after finisning the data transmission.
ParameterInvalidException
- validation failedint getMode()
int getWarmUp()
int getWarmDown()
void setAllConfig(int mode, int baud, int parity, int stop, int bitsPerByte) throws ParameterInvalidException
For the HalfDuplexRtsExtend mode, the warmUp and warmDown values are set
to 0. The open(mode,baud,parity,stop,bitsPerByte,warmUp,WarmDown)
method should be used.
mode
- see setMode(mode)
or setMode(mode,warmUp,warmDown)
baud
- see setBaudRate(baud)
parity
- see setParity(parity)
stop
- see setStopBits(stop)
bitsPerByte
- see setBitsPerByte(bitsPerByte)
ParameterInvalidException
- thrown on the first invalid parameter encountered, parameter
indicated in the exceptionvoid setAllConfig(int mode, int baud, int parity, int stop, int bitsPerByte, int warmUp, int warmDown) throws ParameterInvalidException
mode
- see setMode(mode,warmUp,warmDown)
baud
- see setBaudRate(baud)
parity
- see setParity(parity)
stop
- see setStopBits(stop)
bitsPerByte
- see setBitsPerByte(bitsPerByte)
warmUp
- see setMode(mode,warmUp,warmDown)
warmDown
- see setMode(mode,warmUp,warmDown)
ParameterInvalidException
- thrown on the first invalid parameter encountered, parameter
indicated in the exceptionSerialCommInputStream getInputStream() throws java.io.IOException
java.io.IOException
- internal error aquiring base InputStreamSerialCommOutputStream getOutputStream() throws java.io.IOException
java.io.IOException
- internal error aquiring base InputStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |