Interface JSerialCommChannelConfig
- All Superinterfaces:
io.netty.channel.ChannelConfig
public interface JSerialCommChannelConfig
extends io.netty.channel.ChannelConfig
Configuration interface for jSerialComm device connections.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionintintintReturn the maximal time (in ms) to block and wait for something to be ready to read.intsetAllocator(io.netty.buffer.ByteBufAllocator allocator) setAutoRead(boolean autoRead) setBaudrate(int baudrate) Sets the baud rate (ie.setConnectTimeoutMillis(int connectTimeoutMillis) setDatabits(int databits) Sets the number of data bits to use to make up each character sent to the serial device.setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator) setParitybit(JSerialCommChannelConfig.Paritybit paritybit) Sets the type of parity bit to be used when communicating with the serial device.setReadTimeout(int readTimeout) Sets the maximal time (in ms) to block while try to read from the serial port.setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator) setStopbits(JSerialCommChannelConfig.Stopbits stopbits) Sets the number of stop bits to include at the end of every character to aid the serial device in synchronising with the data.setWaitTimeMillis(int waitTimeMillis) Sets the time to wait after opening the serial port and before sending it any configuration information or data.setWriteBufferHighWaterMark(int writeBufferHighWaterMark) setWriteBufferLowWaterMark(int writeBufferLowWaterMark) setWriteSpinCount(int writeSpinCount) Methods inherited from interface io.netty.channel.ChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getOption, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setAutoClose, setMaxMessagesPerRead, setOption, setOptions, setWriteBufferWaterMark
-
Method Details
-
setBaudrate
Sets the baud rate (ie. bits per second) for communication with the serial device. The baud rate will include bits for framing (in the form of stop bits and parity), such that the effective data rate will be lower than this value.- Parameters:
baudrate- The baud rate (in bits per second)
-
setStopbits
Sets the number of stop bits to include at the end of every character to aid the serial device in synchronising with the data.- Parameters:
stopbits- The number of stop bits to use
-
setDatabits
Sets the number of data bits to use to make up each character sent to the serial device.- Parameters:
databits- The number of data bits to use
-
setParitybit
Sets the type of parity bit to be used when communicating with the serial device.- Parameters:
paritybit- The type of parity bit to be used
-
getBaudrate
int getBaudrate()- Returns:
- The configured baud rate, defaulting to 115200 if unset
-
getStopbits
JSerialCommChannelConfig.Stopbits getStopbits()- Returns:
- The configured stop bits, defaulting to
JSerialCommChannelConfig.Stopbits.STOPBITS_1if unset
-
getDatabits
int getDatabits()- Returns:
- The configured data bits, defaulting to 8 if unset
-
getParitybit
JSerialCommChannelConfig.Paritybit getParitybit()- Returns:
- The configured parity bit, defaulting to
JSerialCommChannelConfig.Paritybit.NONEif unset
-
getWaitTimeMillis
int getWaitTimeMillis()- Returns:
- The number of milliseconds to wait between opening the serial port and initialising.
-
setWaitTimeMillis
Sets the time to wait after opening the serial port and before sending it any configuration information or data. A value of 0 indicates that no waiting should occur.- Parameters:
waitTimeMillis- The number of milliseconds to wait, defaulting to 0 (no wait) if unset- Throws:
IllegalArgumentException- if the supplied value is < 0
-
setReadTimeout
Sets the maximal time (in ms) to block while try to read from the serial port. Default is 1000ms -
getReadTimeout
int getReadTimeout()Return the maximal time (in ms) to block and wait for something to be ready to read. -
setConnectTimeoutMillis
- Specified by:
setConnectTimeoutMillisin interfaceio.netty.channel.ChannelConfig
-
setWriteSpinCount
- Specified by:
setWriteSpinCountin interfaceio.netty.channel.ChannelConfig
-
setAllocator
- Specified by:
setAllocatorin interfaceio.netty.channel.ChannelConfig
-
setRecvByteBufAllocator
- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.ChannelConfig
-
setAutoRead
- Specified by:
setAutoReadin interfaceio.netty.channel.ChannelConfig
-
setWriteBufferHighWaterMark
- Specified by:
setWriteBufferHighWaterMarkin interfaceio.netty.channel.ChannelConfig
-
setWriteBufferLowWaterMark
- Specified by:
setWriteBufferLowWaterMarkin interfaceio.netty.channel.ChannelConfig
-
setMessageSizeEstimator
- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.ChannelConfig
-