|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRadioProtocolManager
A general purpose IProtocolManager
designed to separate incoming radio packets into
separate queues based on a unique identifying port number in the range 0-255.
Currently underpins com.sun.squawk.io.j2me.radiogram.RadiogramConnection
and
com.sun.squawk.io.j2me.radio.RadioConnection
.
Field Summary | |
---|---|
static byte |
FIRST_USER_PORT
The first port free for user use |
static int |
INPUT
|
static int |
OUTPUT
|
static int |
PORT_OFFSET
|
Method Summary | |
---|---|
ConnectionID |
addInputConnection(long macAddress,
byte portNo)
Register a point-to-point connection on which packets can be received |
ConnectionID |
addOutputConnection(long macAddress,
byte portNo)
Register a point-to-point connection on which packets can be sent |
void |
closeConnection(ConnectionID cid)
Deregister a handler. |
boolean |
packetsAvailable(ConnectionID connectionID)
Answer whether one or more radio packets have been received and are queued for the given ConnectionID. |
IncomingData |
receivePacket(ConnectionID cid)
Receive incoming data over a Connection ID. |
IncomingData |
receivePacket(ConnectionID cid,
long timeout)
Receive incoming data over a Connection ID. |
long |
send(ConnectionID cid,
long toAddress,
byte[] payload,
int length)
Send a byte array using a ConnectionID. |
Field Detail |
---|
static final byte FIRST_USER_PORT
static final int OUTPUT
static final int INPUT
static final int PORT_OFFSET
Method Detail |
---|
void closeConnection(ConnectionID cid)
cid
- - the ConnectionID to deregisterConnectionID addOutputConnection(long macAddress, byte portNo)
macAddress
- - address of the other deviceportNo
- - port number to communicate over
ConnectionID addInputConnection(long macAddress, byte portNo)
macAddress
- - address of the other deviceportNo
- - port number to communicate over
long send(ConnectionID cid, long toAddress, byte[] payload, int length) throws NoAckException, ChannelBusyException, NoRouteException, NoMeshLayerAckException
cid
- the ConnectionID to send the packet over.payload
- the datalength
- number of bytes to send, starting with index 0
NoAckException
ChannelBusyException
NoRouteException
NoRouteException
NoMeshLayerAckException
IncomingData receivePacket(ConnectionID cid)
cid
- the ConnectionID over which to receive data
IncomingData receivePacket(ConnectionID cid, long timeout)
cid
- the ConnectionID over which to receive datatimeout
- the maximum time to block in milliseconds
boolean packetsAvailable(ConnectionID connectionID)
connectionID
-
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |