|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.system.IOPort
public abstract class IOPort
Provides low-level access to the device's I/O port.
IOPortListener
Constructor Summary | ||
---|---|---|
protected |
IOPort()
Constructs a new IOPort instance. |
Method Summary | ||
---|---|---|
abstract void |
close()
Closes the I/O port. |
|
abstract int |
read()
Reads single data byte from the receive buffer. |
|
abstract int |
read(byte[] data)
Reads data bytes from the receive buffer. |
|
abstract int |
read(byte[] data,
int offset,
int length)
Reads some data bytes from the receive buffer. |
|
static void |
registerNotifyPattern(byte[] pattern)
Deprecated. Please use SerialPort.registerNotifyPattern(byte[]) instead. |
|
abstract int |
write(byte[] data)
Places bytes to send into the transmit buffer. |
|
abstract int |
write(byte[] data,
int offset,
int length)
Places some bytes to send into the transmit buffer. |
|
abstract int |
write(int b)
Places a single byte to send into the transmit buffer. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected IOPort()
IOPort
instance.
Method Detail |
---|
public abstract void close()
public abstract int write(byte[] data) throws IOException
data
- Bytes of data to send.
IOException
- If the port is not currently open.public abstract int write(byte[] data, int offset, int length) throws IOException
Use this method to place only a portion of a byte array into the transmit buffer.
data
- Bytes array containing data to send.offset
- First data byte from array to send.length
- Number of data bytes to send.
IOException
- If the port is not currently open.public abstract int write(int b) throws IOException
b
- Byte of data to send.
IOException
- If the port is not currently open.public abstract int read(byte[] data) throws IOException
data
- Buffer to contain the received bytes; to flush the
receive buffer, pass null.
IOException
- If the port is not currently open.public abstract int read(byte[] data, int offset, int length) throws IOException
Invoke this method to stuff only a portion of your data buffer with bytes from the receive buffer.
data
- Buffer to contain the received bytes; to flush the receive
buffer, pass null.offset
- Position from the start of the buffer to begin stuffing
bytes from the receive buffer.length
- Maximum number of bytes to read.
IOException
- If the port is not currently open.public abstract int read() throws IOException
IOException
- If the port is not currently open.public static void registerNotifyPattern(byte[] pattern)
SerialPort.registerNotifyPattern(byte[])
instead.
For serial ports:
While DTR is active, the port is monitored at 9600 baud 8N1. If the
specified pattern occurs, the system sends a pattern notify event to the
applications (which must implement IOPortListener.patternReceived(byte[])
to handle).
pattern
- Pattern to look for; the first byte must be non-zero, and
the pattern must be four bytes in length.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.