net.rim.device.api.system
Interface IOPortListener

All Known Subinterfaces:
SerialPortListener, USBPortListener

public interface IOPortListener

The listener interface for receiving I/O port events.


Field Summary
static int ERROR_FRAMING
          Port framing error.
static int ERROR_OVERRUN
          Port overrun error.
static int ERROR_PARITY
          Port parity error.
 
Method Summary
 void connected()
          Invoked when the port is connected.
 void dataReceived(int length)
          Invoked when the port's receive queue has changed from empty to not empty.
 void dataSent()
          Invoked when the port's transmit queue becomes completely empty.
 void disconnected()
          Invoked when the port is disconnected.
 void patternReceived(byte[] pattern)
          Invoked when a registered pattern is received.
 void receiveError(int error)
          Invoked when a communication error has occurred.
 



Field Detail

ERROR_PARITY

static final int ERROR_PARITY
Port parity error.

See Also:
Constant Field Values

ERROR_FRAMING

static final int ERROR_FRAMING
Port framing error.

See Also:
Constant Field Values

ERROR_OVERRUN

static final int ERROR_OVERRUN
Port overrun error.

See Also:
Constant Field Values


Method Detail

connected

void connected()
Invoked when the port is connected.

On devices with a serial port, this occurs when the DTR line goes high.


disconnected

void disconnected()
Invoked when the port is disconnected.

On devices with a serial port, this occurs when the DTR line goes low.


receiveError

void receiveError(int error)
Invoked when a communication error has occurred.

Parameters:
error - Error type (see this interface's fields).

dataReceived

void dataReceived(int length)
Invoked when the port's receive queue has changed from empty to not empty.

Parameters:
length - Length of data received, or -1 if the length is not available.

dataSent

void dataSent()
Invoked when the port's transmit queue becomes completely empty.


patternReceived

void patternReceived(byte[] pattern)
Invoked when a registered pattern is received.

Applications can register a pattern to notice with IOPort.registerNotifyPattern(byte[]). When no application has the port open, and the system notices this pattern on the port, it invokes this method on implementing applications.

Parameters:
pattern - Pattern detected.





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.