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_FRAMING

public static final int ERROR_FRAMING
Port framing error.

ERROR_OVERRUN

public static final int ERROR_OVERRUN
Port overrun error.

ERROR_PARITY

public static final int ERROR_PARITY
Port parity error.
Method Detail

connected

public void connected()
Invoked when the port is connected.

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


dataReceived

public 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

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


disconnected

public void disconnected()
Invoked when the port is disconnected.

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


patternReceived

public 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.

receiveError

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

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



Copyright 1999-2008 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.