public interface SerialPortSocket extends Closeable
Modifier and Type | Interface and Description |
---|---|
static class |
SerialPortSocket.SerialPortSocketFactory |
Modifier and Type | Field and Description |
---|---|
static SerialPortSocket.SerialPortSocketFactory |
FACTORY |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close port.
|
Baudrate |
getBaudrate() |
DataBits |
getDatatBits() |
Set<FlowControl> |
getFlowControl() |
int |
getInBufferBytesCount()
Get bytes count in in buffer of port
|
InputStream |
getInputStream() |
int |
getOutBufferBytesCount()
Get bytes count out inbuffer of port
|
OutputStream |
getOutputStream() |
Parity |
getParity() |
String |
getPortName()
Getting port name under operation
|
StopBits |
getStopBits() |
char |
getXOFFChar() |
char |
getXONChar() |
boolean |
isClosed() |
boolean |
isCTS() |
boolean |
isDSR() |
boolean |
isIncommingRI() |
boolean |
isOpen()
Getting port state
|
void |
openAsIs()
Port opening
Note: If port busy TYPE_PORT_BUSY exception will be thrown. |
void |
openModem() |
void |
openRaw() |
void |
openRaw(Baudrate baudRate,
DataBits dataBits,
StopBits stopBits,
Parity parity,
Set<FlowControl> flowControls)
Setting the parameters of port
|
void |
openTerminal() |
void |
sendXOFF() |
void |
sendXON() |
void |
setBaudrate(Baudrate baudrate) |
void |
setBreak(boolean value)
Set Break singnal
|
void |
setDataBits(DataBits dataBits) |
void |
setDTR(boolean value)
Change DTR line state
|
void |
setFlowControl(Set<FlowControl> flowControls) |
void |
setParity(Parity parity) |
void |
setRTS(boolean value)
Change RTS line state
|
void |
setStopBits(StopBits stopBits) |
void |
setXOFFChar(char c) |
void |
setXONChar(char c) |
static final SerialPortSocket.SerialPortSocketFactory FACTORY
boolean isClosed()
boolean isCTS()
boolean isDSR()
boolean isIncommingRI()
InputStream getInputStream() throws IOException
IOException
OutputStream getOutputStream() throws IOException
IOException
String getPortName()
boolean isOpen()
void openAsIs() throws IOException
SerialPortException
IOException
void openRaw() throws IOException
IOException
void openTerminal() throws IOException
IOException
void openModem() throws IOException
IOException
void openRaw(Baudrate baudRate, DataBits dataBits, StopBits stopBits, Parity parity, Set<FlowControl> flowControls) throws IOException
baudRate
- data transfer ratedataBits
- number of data bitsstopBits
- number of stop bitsparity
- parityflowControls
- IOException
void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
void setRTS(boolean value) throws IOException
value
- true - ON, false - OFFIOException
void setDTR(boolean value) throws IOException
value
- true - ON, false - OFFIOException
void setXONChar(char c) throws IOException
IOException
void setXOFFChar(char c) throws IOException
IOException
char getXONChar() throws IOException
IOException
char getXOFFChar() throws IOException
IOException
void sendXON() throws IOException
IOException
void sendXOFF() throws IOException
IOException
int getInBufferBytesCount() throws IOException
IOException
int getOutBufferBytesCount() throws IOException
IOException
void setBreak(boolean value) throws IOException
value
- the valueIOException
void setFlowControl(Set<FlowControl> flowControls) throws IOException
IOException
void setBaudrate(Baudrate baudrate) throws IOException
IOException
void setDataBits(DataBits dataBits) throws IOException
IOException
void setStopBits(StopBits stopBits) throws IOException
IOException
void setParity(Parity parity) throws IOException
IOException
Baudrate getBaudrate() throws IOException
IOException
DataBits getDatatBits() throws IOException
IOException
StopBits getStopBits() throws IOException
IOException
Parity getParity() throws IOException
IOException
Set<FlowControl> getFlowControl() throws IOException
IOException
Copyright © 2009–2015 atmodem4j. All rights reserved.