|
Nokia Extensions for JSR-257 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The LLCPConnection
provides an interface for communicating
with an application on a remote LLCP device using a logical channel -
a LLCP connection. The connection can use either Type 1 or Type 2 transport.
Both ends of the connection use the same protocol identifier.
Field Summary | |
static int |
MAX_DATA_LEN
Maximum amount of bytes that can be sent or received in one call. |
static byte |
MAX_PID
Maximum valid protocol identifier value. |
static byte |
MIN_PID
Minimum valid protocol identifier value. |
static byte |
TYPE_1
Type identifier for Type 1 transport. |
static byte |
TYPE_2
Type identifier for Type 2 transport. |
Method Summary | |
byte |
getProtocolId()
Returns the protocol identifier of the connection. |
byte |
getTransportType()
Returns the transport type of the connection. |
java.lang.String |
getUID()
Returns the remote device identifier. |
byte[] |
receive()
Receives data from the remote device. |
void |
send(byte[] data)
Sends data to the remote device. |
void |
send(byte[] data,
int offset,
int len)
Sends data to the remote device. |
Field Detail |
public static final byte MIN_PID
public static final byte MAX_PID
public static final int MAX_DATA_LEN
public static final byte TYPE_1
public static final byte TYPE_2
Method Detail |
public byte getTransportType()
TYPE_1
and TYPE_2
.
public java.lang.String getUID()
public byte getProtocolId()
public void send(byte[] data, int offset, int len) throws java.io.IOException
Sends data to the remote device. Bytes from offset
to
offset + len - 1
will be sent.
The maximum len
value is defined by
MAX_DATA_LEN
.
data
- the array containing the data to send.offset
- index of the first byte to send.len
- number of bytes to read from the byte array.
java.lang.NullPointerException
- if data
is null
.
java.lang.IllegalArgumentException
- if the parameters offset
and
len
define an invalid range of bytes.
java.io.IOException
- if the connection has been closed or a communication error occurs.public void send(byte[] data) throws java.io.IOException
Sends data to the remote device. All bytes from the specified byte array will be sent. This method blocks until the data has been received by the remote device.
The maximum array length is defined by MAX_DATA_LEN
.
data
- the array containing the data to send.
java.lang.NullPointerException
- if data
is null
.
java.io.IOException
- if the connection has been closed or a communication error occurs.public byte[] receive() throws java.io.IOException
Receives data from the remote device. If no data is available this method will block until the remote device sends data. Data will be buffered in case the application isn't calling this method to receive data.
The maximum amount of data that can be received in one call is defined
by MAX_DATA_LEN
.
java.io.IOException
- if the connection has been closed or a communication error occurs.
|
Nokia Extensions for JSR-257 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |