Interface JSerialCommChannelConfig

All Superinterfaces:
io.netty.channel.ChannelConfig

public interface JSerialCommChannelConfig extends io.netty.channel.ChannelConfig
Configuration interface for jSerialComm device connections.
  • Method Details

    • setBaudrate

      JSerialCommChannelConfig setBaudrate(int baudrate)
      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

      JSerialCommChannelConfig setDatabits(int databits)
      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

      Returns:
      The configured stop bits, defaulting to JSerialCommChannelConfig.Stopbits.STOPBITS_1 if unset
    • getDatabits

      int getDatabits()
      Returns:
      The configured data bits, defaulting to 8 if unset
    • getParitybit

      Returns:
      The configured parity bit, defaulting to JSerialCommChannelConfig.Paritybit.NONE if unset
    • getWaitTimeMillis

      int getWaitTimeMillis()
      Returns:
      The number of milliseconds to wait between opening the serial port and initialising.
    • setWaitTimeMillis

      JSerialCommChannelConfig setWaitTimeMillis(int waitTimeMillis)
      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

      JSerialCommChannelConfig setReadTimeout(int readTimeout)
      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

      JSerialCommChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
      Specified by:
      setConnectTimeoutMillis in interface io.netty.channel.ChannelConfig
    • setWriteSpinCount

      JSerialCommChannelConfig setWriteSpinCount(int writeSpinCount)
      Specified by:
      setWriteSpinCount in interface io.netty.channel.ChannelConfig
    • setAllocator

      JSerialCommChannelConfig setAllocator(io.netty.buffer.ByteBufAllocator allocator)
      Specified by:
      setAllocator in interface io.netty.channel.ChannelConfig
    • setRecvByteBufAllocator

      JSerialCommChannelConfig setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)
      Specified by:
      setRecvByteBufAllocator in interface io.netty.channel.ChannelConfig
    • setAutoRead

      JSerialCommChannelConfig setAutoRead(boolean autoRead)
      Specified by:
      setAutoRead in interface io.netty.channel.ChannelConfig
    • setWriteBufferHighWaterMark

      JSerialCommChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
      Specified by:
      setWriteBufferHighWaterMark in interface io.netty.channel.ChannelConfig
    • setWriteBufferLowWaterMark

      JSerialCommChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
      Specified by:
      setWriteBufferLowWaterMark in interface io.netty.channel.ChannelConfig
    • setMessageSizeEstimator

      JSerialCommChannelConfig setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)
      Specified by:
      setMessageSizeEstimator in interface io.netty.channel.ChannelConfig