Package io.netty.channel.rxtx
Interface RxtxChannelConfig
-
- All Superinterfaces:
ChannelConfig
@Deprecated public interface RxtxChannelConfig extends ChannelConfig
Deprecated.this transport will be removed in the next major version.A configuration class for RXTX device connections.Available options
In addition to the options provided byChannelConfig
,DefaultRxtxChannelConfig
allows the following options in the option map:
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RxtxChannelConfig.Databits
Deprecated.static class
RxtxChannelConfig.Paritybit
Deprecated.static class
RxtxChannelConfig.Stopbits
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description int
getBaudrate()
Deprecated.RxtxChannelConfig.Databits
getDatabits()
Deprecated.RxtxChannelConfig.Paritybit
getParitybit()
Deprecated.int
getReadTimeout()
Deprecated.Return the maximal time (in ms) to block and wait for something to be ready to read.RxtxChannelConfig.Stopbits
getStopbits()
Deprecated.int
getWaitTimeMillis()
Deprecated.boolean
isDtr()
Deprecated.boolean
isRts()
Deprecated.RxtxChannelConfig
setAllocator(ByteBufAllocator allocator)
Deprecated.Set theByteBufAllocator
which is used for the channel to allocate buffers.RxtxChannelConfig
setAutoClose(boolean autoClose)
Deprecated.Sets whether theChannel
should be closed automatically and immediately on write failure.RxtxChannelConfig
setAutoRead(boolean autoRead)
Deprecated.Sets ifChannelHandlerContext.read()
will be invoked automatically so that a user application doesn't need to call it at all.RxtxChannelConfig
setBaudrate(int baudrate)
Deprecated.Sets the baud rate (ie. bits per second) for communication with the serial device.RxtxChannelConfig
setConnectTimeoutMillis(int connectTimeoutMillis)
Deprecated.Sets the connect timeout of the channel in milliseconds.RxtxChannelConfig
setDatabits(RxtxChannelConfig.Databits databits)
Deprecated.Sets the number of data bits to use to make up each character sent to the serial device.RxtxChannelConfig
setDtr(boolean dtr)
Deprecated.Sets whether the serial device supports the Data Terminal Ready signal, used for flow controlRxtxChannelConfig
setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.RxtxChannelConfig
setMessageSizeEstimator(MessageSizeEstimator estimator)
Deprecated.Set theMessageSizeEstimator
which is used for the channel to detect the size of a message.RxtxChannelConfig
setParitybit(RxtxChannelConfig.Paritybit paritybit)
Deprecated.Sets the type of parity bit to be used when communicating with the serial device.RxtxChannelConfig
setReadTimeout(int readTimeout)
Deprecated.Sets the maximal time (in ms) to block while try to read from the serial port.RxtxChannelConfig
setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Deprecated.Set theRecvByteBufAllocator
which is used for the channel to allocate receive buffers.RxtxChannelConfig
setRts(boolean rts)
Deprecated.Sets whether the serial device supports the Request To Send signal, used for flow controlRxtxChannelConfig
setStopbits(RxtxChannelConfig.Stopbits stopbits)
Deprecated.Sets the number of stop bits to include at the end of every character to aid the serial device in synchronising with the data.RxtxChannelConfig
setWaitTimeMillis(int waitTimeMillis)
Deprecated.Sets the time to wait after opening the serial port and before sending it any configuration information or data.RxtxChannelConfig
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.Sets the high water mark of the write buffer.RxtxChannelConfig
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.Sets the low water mark of the write buffer.RxtxChannelConfig
setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Deprecated.Set theWriteBufferWaterMark
which is used for setting the high and low water mark of the write buffer.RxtxChannelConfig
setWriteSpinCount(int writeSpinCount)
Deprecated.Sets the maximum loop count for a write operation untilWritableByteChannel.write(ByteBuffer)
returns a non-zero value.-
Methods inherited from interface io.netty.channel.ChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getOption, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOption, setOptions
-
-
-
-
Method Detail
-
setBaudrate
RxtxChannelConfig setBaudrate(int baudrate)
Deprecated.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
RxtxChannelConfig setStopbits(RxtxChannelConfig.Stopbits stopbits)
Deprecated.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
RxtxChannelConfig setDatabits(RxtxChannelConfig.Databits databits)
Deprecated.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
RxtxChannelConfig setParitybit(RxtxChannelConfig.Paritybit paritybit)
Deprecated.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()
Deprecated.- Returns:
- The configured baud rate, defaulting to 115200 if unset
-
getStopbits
RxtxChannelConfig.Stopbits getStopbits()
Deprecated.- Returns:
- The configured stop bits, defaulting to
RxtxChannelConfig.Stopbits.STOPBITS_1
if unset
-
getDatabits
RxtxChannelConfig.Databits getDatabits()
Deprecated.- Returns:
- The configured data bits, defaulting to
RxtxChannelConfig.Databits.DATABITS_8
if unset
-
getParitybit
RxtxChannelConfig.Paritybit getParitybit()
Deprecated.- Returns:
- The configured parity bit, defaulting to
RxtxChannelConfig.Paritybit.NONE
if unset
-
isDtr
boolean isDtr()
Deprecated.- Returns:
- true if the serial device should support the Data Terminal Ready signal
-
setDtr
RxtxChannelConfig setDtr(boolean dtr)
Deprecated.Sets whether the serial device supports the Data Terminal Ready signal, used for flow control- Parameters:
dtr
- true if DTR is supported, false otherwise
-
isRts
boolean isRts()
Deprecated.- Returns:
- true if the serial device should support the Ready to Send signal
-
setRts
RxtxChannelConfig setRts(boolean rts)
Deprecated.Sets whether the serial device supports the Request To Send signal, used for flow control- Parameters:
rts
- true if RTS is supported, false otherwise
-
getWaitTimeMillis
int getWaitTimeMillis()
Deprecated.- Returns:
- The number of milliseconds to wait between opening the serial port and initialising.
-
setWaitTimeMillis
RxtxChannelConfig setWaitTimeMillis(int waitTimeMillis)
Deprecated.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:
java.lang.IllegalArgumentException
- if the supplied value is < 0
-
setReadTimeout
RxtxChannelConfig setReadTimeout(int readTimeout)
Deprecated.Sets the maximal time (in ms) to block while try to read from the serial port. Default is 1000ms
-
getReadTimeout
int getReadTimeout()
Deprecated.Return the maximal time (in ms) to block and wait for something to be ready to read.
-
setConnectTimeoutMillis
RxtxChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
Deprecated.Description copied from interface:ChannelConfig
Sets the connect timeout of the channel in milliseconds. If theChannel
does not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
setConnectTimeoutMillis
in interfaceChannelConfig
- Parameters:
connectTimeoutMillis
- the connect timeout in milliseconds.0
to disable.
-
setMaxMessagesPerRead
@Deprecated RxtxChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.- Specified by:
setMaxMessagesPerRead
in interfaceChannelConfig
-
setWriteSpinCount
RxtxChannelConfig setWriteSpinCount(int writeSpinCount)
Deprecated.Description copied from interface:ChannelConfig
Sets the maximum loop count for a write operation untilWritableByteChannel.write(ByteBuffer)
returns a non-zero value. It is similar to what a spin lock is used for in concurrency programming. It improves memory utilization and write throughput depending on the platform that JVM runs on. The default value is16
.- Specified by:
setWriteSpinCount
in interfaceChannelConfig
-
setAllocator
RxtxChannelConfig setAllocator(ByteBufAllocator allocator)
Deprecated.Description copied from interface:ChannelConfig
Set theByteBufAllocator
which is used for the channel to allocate buffers.- Specified by:
setAllocator
in interfaceChannelConfig
-
setRecvByteBufAllocator
RxtxChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Deprecated.Description copied from interface:ChannelConfig
Set theRecvByteBufAllocator
which is used for the channel to allocate receive buffers.- Specified by:
setRecvByteBufAllocator
in interfaceChannelConfig
-
setAutoRead
RxtxChannelConfig setAutoRead(boolean autoRead)
Deprecated.Description copied from interface:ChannelConfig
Sets ifChannelHandlerContext.read()
will be invoked automatically so that a user application doesn't need to call it at all. The default value istrue
.- Specified by:
setAutoRead
in interfaceChannelConfig
-
setAutoClose
RxtxChannelConfig setAutoClose(boolean autoClose)
Deprecated.Description copied from interface:ChannelConfig
Sets whether theChannel
should be closed automatically and immediately on write failure. The default istrue
.- Specified by:
setAutoClose
in interfaceChannelConfig
-
setWriteBufferHighWaterMark
RxtxChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.Description copied from interface:ChannelConfig
Sets the high water mark of the write buffer. If the number of bytes queued in the write buffer exceeds this value,
Channel.isWritable()
will start to returnfalse
.- Specified by:
setWriteBufferHighWaterMark
in interfaceChannelConfig
-
setWriteBufferLowWaterMark
RxtxChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.Description copied from interface:ChannelConfig
Sets the low water mark of the write buffer. Once the number of bytes queued in the write buffer exceeded the high water mark and then dropped down below this value,
Channel.isWritable()
will start to returntrue
again.- Specified by:
setWriteBufferLowWaterMark
in interfaceChannelConfig
-
setWriteBufferWaterMark
RxtxChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Deprecated.Description copied from interface:ChannelConfig
Set theWriteBufferWaterMark
which is used for setting the high and low water mark of the write buffer.- Specified by:
setWriteBufferWaterMark
in interfaceChannelConfig
-
setMessageSizeEstimator
RxtxChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
Deprecated.Description copied from interface:ChannelConfig
Set theMessageSizeEstimator
which is used for the channel to detect the size of a message.- Specified by:
setMessageSizeEstimator
in interfaceChannelConfig
-
-