gnu.io
Interface CommPortIdentifierInterface

All Known Implementing Classes:
CommPortIdentifier

public interface CommPortIdentifierInterface

User: lyon Date: Jul 30, 2006 Time: 5:40:20 AM Copyright DocJava, Inc. 2005.


Field Summary
static int PORT_I2C
           
static int PORT_PARALLEL
          IEEE 1284 parallel port.
static int PORT_RAW
           
static int PORT_RS485
           
static int PORT_SERIAL
          RS-232 serial port.
 
Method Summary
 void addPortOwnershipListener(CommPortOwnershipListener listener)
          Adds the specified listener to the list of ownership listeners for this port.
 java.lang.String getCurrentOwner()
           
 java.lang.String getName()
           
 int getPortType()
           
 boolean isCurrentlyOwned()
           
 CommPortInterface open(java.io.FileDescriptor fd)
           
 CommPortInterface open(java.lang.String appName, int timeout)
           
 void removePortOwnershipListener(CommPortOwnershipListener listener)
          Removes the specified listener from the list of ownership listeners for this port.
 

Field Detail

PORT_I2C

static final int PORT_I2C
See Also:
Constant Field Values

PORT_RS485

static final int PORT_RS485
See Also:
Constant Field Values

PORT_RAW

static final int PORT_RAW
See Also:
Constant Field Values

PORT_SERIAL

static final int PORT_SERIAL
RS-232 serial port.

See Also:
Constant Field Values

PORT_PARALLEL

static final int PORT_PARALLEL
IEEE 1284 parallel port.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns:
the port name, typically an OS-dependent hardware label.

getPortType

int getPortType()
Returns:
the port type, PORT_SERIAL or PORT_PARALLEL.

getCurrentOwner

java.lang.String getCurrentOwner()
Returns:
the current owner of this port.

isCurrentlyOwned

boolean isCurrentlyOwned()
Returns:
true if this port is currently owned.

open

CommPortInterface open(java.lang.String appName,
                       int timeout)
                       throws PortInUseException
Parameters:
appName - the name of the application requesting the port
timeout - number of miliseconds to wait for the port to open
Returns:
communications port. If the port is in use by another application, it will be notified with a PORT_OWNERSHIP_REQUESTED event. If the current owner closes the port, then this method will succeed. Otherwise a PortInUseException will be thrown.
Throws:
PortInUseException

open

CommPortInterface open(java.io.FileDescriptor fd)
                       throws UnsupportedCommOperationException
Parameters:
fd - the file descriptor
Returns:
a port using a file descriptor.
Throws:
UnsupportedCommOperationException - if the platform does not support this functionality

addPortOwnershipListener

void addPortOwnershipListener(CommPortOwnershipListener listener)
Adds the specified listener to the list of ownership listeners for this port.

Parameters:
listener - the ownership listener to add

removePortOwnershipListener

void removePortOwnershipListener(CommPortOwnershipListener listener)
Removes the specified listener from the list of ownership listeners for this port.

Parameters:
listener - the ownership listener to remove