Package gnu.io.factory
Class RxTxPortCreator
- java.lang.Object
-
- gnu.io.factory.RxTxPortCreator
-
- All Implemented Interfaces:
SerialPortCreator<RXTXPort>
public class RxTxPortCreator extends java.lang.Object implements SerialPortCreator<RXTXPort>
-
-
Field Summary
-
Fields inherited from interface gnu.io.factory.SerialPortCreator
LOCAL
-
-
Constructor Summary
Constructors Constructor Description RxTxPortCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RXTXPort
createPort(java.lang.String port)
Creates theSerialPort
and opens it for communication.java.lang.String
getProtocol()
Gets the protocol type of the Port to create.boolean
isApplicable(java.lang.String portName, java.lang.Class<RXTXPort> expectedClass)
Gets whether thisSerialPortCreator
is applicable to create and open the given port.
-
-
-
Method Detail
-
isApplicable
public boolean isApplicable(java.lang.String portName, java.lang.Class<RXTXPort> expectedClass)
Description copied from interface:SerialPortCreator
Gets whether thisSerialPortCreator
is applicable to create and open the given port.- Specified by:
isApplicable
in interfaceSerialPortCreator<RXTXPort>
- Parameters:
portName
- The ports name.- Returns:
- Whether the port can be created and opened by this creator.
-
createPort
public RXTXPort createPort(java.lang.String port) throws NoSuchPortException, UnsupportedCommOperationException, PortInUseException
Description copied from interface:SerialPortCreator
Creates theSerialPort
and opens it for communication.- Specified by:
createPort
in interfaceSerialPortCreator<RXTXPort>
- Parameters:
port
- The ports name.- Returns:
- The created
SerialPort
. - Throws:
NoSuchPortException
- If the serial port does not exist.UnsupportedCommOperationException
PortInUseException
-
getProtocol
public java.lang.String getProtocol()
Description copied from interface:SerialPortCreator
Gets the protocol type of the Port to create.- Specified by:
getProtocol
in interfaceSerialPortCreator<RXTXPort>
- Returns:
- The protocol type.
-
-