public class CommPortIdentifier extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
PORT_PARALLEL
The constant PORT_PARALLEL.
|
static int |
PORT_SERIAL
The constant PORT_SERIAL.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addPortName(String portName,
int portType,
CommDriver driver)
This has not been tested at all
|
void |
addPortOwnershipListener(CommPortOwnershipListener listener)
Add port ownership listener.
|
boolean |
equals(Object x) |
String |
getCurrentOwner()
Gets current owner.
|
String |
getName()
Gets name.
|
static CommPortIdentifier |
getPortIdentifier(CommPort port)
Gets port identifier.
|
static CommPortIdentifier |
getPortIdentifier(String portName)
Gets port identifier.
|
static Enumeration |
getPortIdentifiers()
Gets port identifiers.
|
int |
getPortType()
Gets port type.
|
int |
hashCode() |
boolean |
isCurrentlyOwned()
Is currently owned boolean.
|
CommPort |
open(FileDescriptor fd)
Open comm port.
|
CommPort |
open(String appname,
int timeout)
Open comm port.
|
void |
removePortOwnershipListener(CommPortOwnershipListener listener)
Remove port ownership listener.
|
public static final int PORT_SERIAL
public static final int PORT_PARALLEL
public static void addPortName(String portName, int portType, CommDriver driver)
portName - the port nameportType - the port typedriver - the driverpublic static CommPortIdentifier getPortIdentifier(String portName) throws NoSuchPortException
portName - the port nameNoSuchPortException - the no such port exceptionpublic static CommPortIdentifier getPortIdentifier(CommPort port) throws NoSuchPortException
port - the portNoSuchPortException - the no such port exceptionpublic CommPort open(String appname, int timeout) throws PortInUseException
appname - the appnametimeout - the timeoutPortInUseException - the port in use exceptionpublic CommPort open(FileDescriptor fd) throws UnsupportedCommOperationException
fd - the fdUnsupportedCommOperationException - the unsupported comm operation exceptionpublic String getName()
public int getPortType()
public static Enumeration getPortIdentifiers()
public String getCurrentOwner()
public boolean isCurrentlyOwned()
public void addPortOwnershipListener(CommPortOwnershipListener listener)
listener - the listenerpublic void removePortOwnershipListener(CommPortOwnershipListener listener)
listener - the listenerCopyright © 2017. All rights reserved.