Interface SerialPortProvider
@NonNullByDefault
public interface SerialPortProvider
Provides a concrete SerialPort which can handle remote (e.g. via rfc2217) or local ports.
- Author:
- Matthias Steigenberger - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionGets all protocol types which this provider is able to create.@Nullable SerialPortIdentifier
getPortIdentifier
(URI portName) Gets theSerialPortIdentifier
if it is available or null otherwise.Gets all the availableSerialPortIdentifier
s for thisSerialPortProvider
.
-
Method Details
-
getPortIdentifier
Gets theSerialPortIdentifier
if it is available or null otherwise.- Parameters:
portName
- The ports name.- Returns:
- The created
SerialPort
ornull
if the serial port does not exist. - Throws:
UnsupportedCommOperationException
PortInUseException
-
getAcceptedProtocols
Stream<ProtocolType> getAcceptedProtocols()Gets all protocol types which this provider is able to create.- Returns:
- The protocol type.
-
getSerialPortIdentifiers
Stream<SerialPortIdentifier> getSerialPortIdentifiers()Gets all the availableSerialPortIdentifier
s for thisSerialPortProvider
. Please note: Discovery is not available necessarily, hence thegetPortIdentifier(URI)
must be used in this case.- Returns:
- The available ports
-