Class SerialPortBeanParameters

java.lang.Object
net.solarnetwork.node.service.support.SerialPortBean
net.solarnetwork.node.service.support.SerialPortBeanParameters
All Implemented Interfaces:
Cloneable

public class SerialPortBeanParameters extends SerialPortBean
Parameters to configure a serial port with.
Version:
1.0
Author:
matt
  • Constructor Details

    • SerialPortBeanParameters

      public SerialPortBeanParameters()
      Default constructor.
  • Method Details

    • getDefaultSettingSpecifiers

      public static List<net.solarnetwork.settings.SettingSpecifier> getDefaultSettingSpecifiers(String prefix)
      Get a list of setting specifiers for this bean.
      Parameters:
      prefix - the bean prefix to use
      Returns:
      setting specifiers
    • getDefaultSettingSpecifiers

      public static List<net.solarnetwork.settings.SettingSpecifier> getDefaultSettingSpecifiers(SerialPortBeanParameters defaults, String prefix)
      Get a list of setting specifiers for this bean.
      Parameters:
      defaults - the default values to use
      prefix - the bean prefix to use
      Returns:
      setting specifiers
    • getMaxWait

      public long getMaxWait()
      Get the maximum wait, in milliseconds.
      Returns:
      the maximum wait, or 0 for no limit
    • setMaxWait

      public void setMaxWait(long maxWait)
      Set a maximum number of milliseconds to wait for the serial port to return data, before giving up.

      This differs from the receiveTimeout setting in that this timeout is not set on the port itself, but is managed by the application.

      Parameters:
      maxWait - the maximum wait time, in milliseconds, or 0 for no limit
    • getSerialPort

      public String getSerialPort()
      Get the name of the serial port to use.
      Returns:
      the serial port name
    • setSerialPort

      public void setSerialPort(String serialPort)
      Set the name of the serial port to use.

      This is OS-specific, for example /dev/ttyUSB0 or COM1.

      Parameters:
      serialPort - the name of the serial port to use
    • getCommPortAppName

      public String getCommPortAppName()
      Get the serial port user-defined name.
      Returns:
      the app name
    • setCommPortAppName

      public void setCommPortAppName(String commPortAppName)
      Set a user-defined name to associate with the serial port.

      The serial port can only be used by one application at a time.

      Parameters:
      commPortAppName - the app name