Package gnu.io.factory
Interface SerialPortFactory
-
- All Known Implementing Classes:
DefaultSerialPortFactory
public interface SerialPortFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SerialPort
createSerialPort(java.lang.String portName)
Creates aSerialPort
instance out of the givenportName
.<T extends SerialPort>
TcreateSerialPort(java.lang.String portName, java.lang.Class<T> expectedClass)
Creates aSerialPort
instance out of the givenportName
.
-
-
-
Method Detail
-
createSerialPort
<T extends SerialPort> T createSerialPort(java.lang.String portName, java.lang.Class<T> expectedClass) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException
Creates aSerialPort
instance out of the givenportName
.- Parameters:
portName
- The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.expectedClass
- TheSerialPort
class that is expected to return.- Returns:
- The newly created and opened SerialPort.
- Throws:
PortInUseException
NoSuchPortException
UnsupportedCommOperationException
-
createSerialPort
SerialPort createSerialPort(java.lang.String portName) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException
Creates aSerialPort
instance out of the givenportName
.- Parameters:
portName
- The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.- Returns:
- The newly created and opened SerialPort.
- Throws:
PortInUseException
NoSuchPortException
UnsupportedCommOperationException
-
-