public class DefaultSerialPortFactory extends Object implements SerialPortFactory
| 构造器和说明 |
|---|
DefaultSerialPortFactory()
Constructor
|
| 限定符和类型 | 方法和说明 |
|---|---|
SerialPort |
createSerialPort(String portName)
Creates a
SerialPort instance out of the given portName. |
<T extends SerialPort> |
createSerialPort(String portName,
Class<T> expectedClass)
Creates a
SerialPort instance out of the given portName. |
SerialPortRegistry |
getPortRegistry()
Gets the
SerialPortRegistry to register/unregister SerialPortCreators. |
public <T extends SerialPort> T createSerialPort(String portName, Class<T> expectedClass) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException
SerialPortFactorySerialPort instance out of the given portName.createSerialPort 在接口中 SerialPortFactoryportName - The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.expectedClass - The SerialPort class that is expected to return.PortInUseExceptionNoSuchPortExceptionUnsupportedCommOperationExceptionpublic SerialPort createSerialPort(String portName) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException
SerialPortFactorySerialPort instance out of the given portName.createSerialPort 在接口中 SerialPortFactoryportName - The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.PortInUseExceptionNoSuchPortExceptionUnsupportedCommOperationExceptionpublic SerialPortRegistry getPortRegistry()
SerialPortRegistry to register/unregister SerialPortCreators.Copyright © 2020. All rights reserved.