@NonNullByDefault public interface SerialPortIdentifier
Interface of a serial port identifier.
- Markus Rathgeb - Initial contribution
Method SummaryModifier and TypeMethodDescription
@Nullable StringReturns a textual representation of the current owner of the port.
getName()Gets the name of the port.
booleanDetermines whether the associated port is in use by an application (including this application).Opens a serial port for communicating.
getNameString getName()Gets the name of the port.
- the port's name
openOpens a serial port for communicating.
owner- name of the owner that port should be assigned to
timeout- time in milliseconds to block waiting for opening the port
- a serial port
PortInUseException- thrown when the serial port is already in use
isCurrentlyOwnedboolean isCurrentlyOwned()Determines whether the associated port is in use by an application (including this application).
- true if an application is using the port, false if the port is not currently owned.
getCurrentOwner@Nullable String getCurrentOwner()Returns a textual representation of the current owner of the port. An owner is an application which is currently using the port (in the sense that it opened the port and has not closed it yet). To check if a port is owned use the
isCurrentlyOwnedmethod. Do not rely on this method to return null. It can't be guaranteed that owned ports have a non null owner.
- the port owner or null if the port is not currently owned