|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IPortBasedProtocolManager
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 int |
BROADCAST
|
static int |
CTRL_OFFSET
|
static int |
DATA_OFFSET
The offset into RadioPackets at which data starts. |
static int |
INPUT
|
static int |
OUTPUT
|
static int |
PORT_OFFSET
|
static int |
SEQ_OFFSET
|
static int |
SERVER
|
| Method Summary | |
|---|---|
ConnectionID |
addBroadcastConnection(byte portNo)
Register a broadcast connection |
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 |
ConnectionID |
addServerConnection(byte portNo)
Register a server connection |
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. |
RadioPacket |
receivePacket(ConnectionID cid)
Receive a radio packet over a Connection ID. |
RadioPacket |
receivePacket(ConnectionID cid,
long timeout)
Receive a radio packet over a Connection ID. |
void |
sendPacket(ConnectionID cid,
RadioPacket rp)
Send a radio packet using a ConnectionID. |
| Field Detail |
|---|
static final int OUTPUT
static final int INPUT
static final int SERVER
static final int BROADCAST
static final int PORT_OFFSET
static final int SEQ_OFFSET
static final int CTRL_OFFSET
static final int DATA_OFFSET
myRadioPacket.setMACPayloadAt(DATA_OFFSET, someValue);
| Method Detail |
|---|
void closeConnection(ConnectionID cid)
cid - - the ConnectionID to deregisterConnectionID addServerConnection(byte portNo)
portNo - - port number to communicate over
ConnectionID addBroadcastConnection(byte portNo)
portNo - - port number to communicate over
ConnectionID 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
void sendPacket(ConnectionID cid,
RadioPacket rp)
throws NoAckException,
ChannelBusyException
cid - -- the ConnectionID to send the packet over.rp - -- the RadioPacket to send.
NoAckException
ChannelBusyExceptionRadioPacket receivePacket(ConnectionID cid)
cid - the ConnectionID over which to receive a packet
RadioPacket receivePacket(ConnectionID cid,
long timeout)
cid - the ConnectionID over which to receive a packettimeout - the maximum time to block in milliseconds
boolean packetsAvailable(ConnectionID connectionID)
connectionID -
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||