public interface RxtxChannelConfig extends ChannelConfig
ChannelConfig
,
DefaultRxtxChannelConfig
allows the following options in the option map:
Modifier and Type | Interface and Description |
---|---|
static class |
RxtxChannelConfig.Databits |
static class |
RxtxChannelConfig.Paritybit |
static class |
RxtxChannelConfig.Stopbits |
ChannelConfig.ChannelHandlerByteBufType
Modifier and Type | Method and Description |
---|---|
int |
getBaudrate() |
RxtxChannelConfig.Databits |
getDatabits() |
RxtxChannelConfig.Paritybit |
getParitybit() |
RxtxChannelConfig.Stopbits |
getStopbits() |
int |
getWaitTimeMillis() |
boolean |
isDtr() |
boolean |
isRts() |
RxtxChannelConfig |
setAllocator(ByteBufAllocator allocator)
Set the
ByteBufAllocator which is used for the channel
to allocate buffers. |
RxtxChannelConfig |
setAutoRead(boolean autoRead)
Sets if
ChannelOutboundInvoker.read() will be invoked automatically so that a user application doesn't
need to call it at all. |
RxtxChannelConfig |
setBaudrate(int baudrate)
Sets the baud rate (ie. bits per second) for communication with the serial device.
|
RxtxChannelConfig |
setConnectTimeoutMillis(int connectTimeoutMillis)
Sets the connect timeout of the channel in milliseconds.
|
RxtxChannelConfig |
setDatabits(RxtxChannelConfig.Databits databits)
Sets the number of data bits to use to make up each character sent to the serial
device.
|
RxtxChannelConfig |
setDefaultHandlerByteBufType(ChannelConfig.ChannelHandlerByteBufType type)
Sets the
ChannelConfig.ChannelHandlerByteBufType which is used to determine what kind of ByteBuf will
be created by the ChannelInboundByteHandler.newInboundBuffer(ChannelHandlerContext) and
ChannelOutboundByteHandler.newOutboundBuffer(ChannelHandlerContext) methods. |
RxtxChannelConfig |
setDtr(boolean dtr)
Sets whether the serial device supports the Data Terminal Ready signal, used for
flow control
|
RxtxChannelConfig |
setParitybit(RxtxChannelConfig.Paritybit paritybit)
Sets the type of parity bit to be used when communicating with the serial device.
|
RxtxChannelConfig |
setRts(boolean rts)
Sets whether the serial device supports the Request To Send signal, used for flow
control
|
RxtxChannelConfig |
setStopbits(RxtxChannelConfig.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.
|
RxtxChannelConfig |
setWaitTimeMillis(int waitTimeMillis)
Sets the time to wait after opening the serial port and before sending it any
configuration information or data.
|
RxtxChannelConfig |
setWriteSpinCount(int writeSpinCount)
Sets the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value. |
getAllocator, getConnectTimeoutMillis, getDefaultHandlerByteBufType, getOption, getOptions, getWriteSpinCount, isAutoRead, setOption, setOptions
RxtxChannelConfig setBaudrate(int baudrate)
baudrate
- The baud rate (in bits per second)RxtxChannelConfig setStopbits(RxtxChannelConfig.Stopbits stopbits)
stopbits
- The number of stop bits to useRxtxChannelConfig setDatabits(RxtxChannelConfig.Databits databits)
databits
- The number of data bits to useRxtxChannelConfig setParitybit(RxtxChannelConfig.Paritybit paritybit)
paritybit
- The type of parity bit to be usedint getBaudrate()
RxtxChannelConfig.Stopbits getStopbits()
RxtxChannelConfig.Stopbits.STOPBITS_1
if unsetRxtxChannelConfig.Databits getDatabits()
RxtxChannelConfig.Databits.DATABITS_8
if unsetRxtxChannelConfig.Paritybit getParitybit()
RxtxChannelConfig.Paritybit.NONE
if unsetboolean isDtr()
RxtxChannelConfig setDtr(boolean dtr)
dtr
- true if DTR is supported, false otherwiseboolean isRts()
RxtxChannelConfig setRts(boolean rts)
rts
- true if RTS is supported, false otherwiseint getWaitTimeMillis()
RxtxChannelConfig setWaitTimeMillis(int waitTimeMillis)
waitTimeMillis
- The number of milliseconds to wait, defaulting to 0 (no
wait) if unsetIllegalArgumentException
- if the supplied value is < 0RxtxChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
ChannelConfig
Channel
does not support connect operation, this property is not
used at all, and therefore will be ignored.setConnectTimeoutMillis
in interface ChannelConfig
connectTimeoutMillis
- the connect timeout in milliseconds.
0
to disable.RxtxChannelConfig setWriteSpinCount(int writeSpinCount)
ChannelConfig
WritableByteChannel.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 is 16
.setWriteSpinCount
in interface ChannelConfig
RxtxChannelConfig setAllocator(ByteBufAllocator allocator)
ChannelConfig
ByteBufAllocator
which is used for the channel
to allocate buffers.setAllocator
in interface ChannelConfig
RxtxChannelConfig setAutoRead(boolean autoRead)
ChannelConfig
ChannelOutboundInvoker.read()
will be invoked automatically so that a user application doesn't
need to call it at all. The default value is true
.setAutoRead
in interface ChannelConfig
RxtxChannelConfig setDefaultHandlerByteBufType(ChannelConfig.ChannelHandlerByteBufType type)
ChannelConfig
ChannelConfig.ChannelHandlerByteBufType
which is used to determine what kind of ByteBuf
will
be created by the ChannelInboundByteHandler.newInboundBuffer(ChannelHandlerContext)
and
ChannelOutboundByteHandler.newOutboundBuffer(ChannelHandlerContext)
methods.setDefaultHandlerByteBufType
in interface ChannelConfig
Copyright © 2008-2013 The Netty Project. All Rights Reserved.