Class SerialPortBeanParameters
java.lang.Object
net.solarnetwork.node.service.support.SerialPortBean
net.solarnetwork.node.service.support.SerialPortBeanParameters
- All Implemented Interfaces:
Cloneable
Parameters to configure a serial port with.
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the serial port user-defined name.static List<net.solarnetwork.settings.SettingSpecifier> getDefaultSettingSpecifiers(String prefix) Get a list of setting specifiers for this bean.static List<net.solarnetwork.settings.SettingSpecifier> getDefaultSettingSpecifiers(SerialPortBeanParameters defaults, String prefix) Get a list of setting specifiers for this bean.longGet the maximum wait, in milliseconds.Get the name of the serial port to use.voidsetCommPortAppName(String commPortAppName) Set a user-defined name to associate with the serial port.voidsetMaxWait(long maxWait) Set a maximum number of milliseconds to wait for the serial port to return data, before giving up.voidsetSerialPort(String serialPort) Set the name of the serial port to use.Methods inherited from class net.solarnetwork.node.service.support.SerialPortBean
clone, getBaud, getDataBits, getDefaultSettingSpecifiers, getDtrFlag, getFlowControl, getParity, getParityString, getReceiveFraming, getReceiveThreshold, getReceiveTimeout, getRtsFlag, getStopBits, isDtr, isRts, setBaud, setDataBits, setDtr, setDtrFlag, setFlowControl, setParity, setParityString, setReceiveFraming, setReceiveThreshold, setReceiveTimeout, setRts, setRtsFlag, setStopBits
-
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 useprefix- 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
receiveTimeoutsetting 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
Get the name of the serial port to use.- Returns:
- the serial port name
-
setSerialPort
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
Get the serial port user-defined name.- Returns:
- the app name
-
setCommPortAppName
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
-