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 SerialPortcreateSerialPort(java.lang.String portName)Creates aSerialPortinstance out of the givenportName.<T extends SerialPort>
TcreateSerialPort(java.lang.String portName, java.lang.Class<T> expectedClass)Creates aSerialPortinstance 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 aSerialPortinstance 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- TheSerialPortclass that is expected to return.- Returns:
- The newly created and opened SerialPort.
- Throws:
PortInUseExceptionNoSuchPortExceptionUnsupportedCommOperationException
-
createSerialPort
SerialPort createSerialPort(java.lang.String portName) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException
Creates aSerialPortinstance 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:
PortInUseExceptionNoSuchPortExceptionUnsupportedCommOperationException
-
-