|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.spot.peripheral.radio.PortBasedProtocolManager
public class PortBasedProtocolManager
| Field Summary |
|---|
| Fields inherited from interface com.sun.spot.peripheral.radio.IPortBasedProtocolManager |
|---|
BROADCAST, CTRL_OFFSET, DATA_OFFSET, INPUT, OUTPUT, PORT_OFFSET, SEQ_OFFSET, SERVER |
| Constructor Summary | |
|---|---|
PortBasedProtocolManager(byte protocolNum,
String name)
Construct an instance to manage the given protocol number. |
|
PortBasedProtocolManager(byte protocolNum,
String name,
ILowPanPacketDispatcher lppd)
|
|
| 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 cidToClose)
Deregister a handler. |
String |
getName()
|
boolean |
packetsAvailable(ConnectionID connectionID)
Answer whether one or more radio packets have been received and are queued for the given ConnectionID. |
void |
processIncomingRadioPacket(RadioPacket rp)
Called whenever a RadioPacket is received that is addressed to this IProtocolManager. |
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PortBasedProtocolManager(byte protocolNum,
String name,
ILowPanPacketDispatcher lppd)
public PortBasedProtocolManager(byte protocolNum,
String name)
protocolNum - - the protocol number to be managed.| Method Detail |
|---|
public void closeConnection(ConnectionID cidToClose)
IPortBasedProtocolManager
closeConnection in interface IPortBasedProtocolManagercidToClose - - the ConnectionID to deregister
public void sendPacket(ConnectionID cid,
RadioPacket rp)
throws NoAckException,
ChannelBusyException
IPortBasedProtocolManager
sendPacket in interface IPortBasedProtocolManagercid - -- the ConnectionID to send the packet over.rp - -- the RadioPacket to send.
NoAckException
ChannelBusyExceptionpublic void processIncomingRadioPacket(RadioPacket rp)
IProtocolManagerIProtocolManager.
IProtocolManagers should do as little processing as possible inside this method,
to avoid blocking other IProtocolManagers from receiving their packets. Typically
an IProtocolManager will queue received packets for later dispatch to applications.
processIncomingRadioPacket in interface IProtocolManagerrp - -- a RadioPacket to be filled inpublic RadioPacket receivePacket(ConnectionID cid)
IPortBasedProtocolManager
receivePacket in interface IPortBasedProtocolManagercid - the ConnectionID over which to receive a packet
public RadioPacket receivePacket(ConnectionID cid,
long timeout)
IPortBasedProtocolManager
receivePacket in interface IPortBasedProtocolManagercid - the ConnectionID over which to receive a packettimeout - the maximum time to block in milliseconds
public boolean packetsAvailable(ConnectionID connectionID)
IPortBasedProtocolManager
packetsAvailable in interface IPortBasedProtocolManagerpublic String getName()
getName in interface IProtocolManager
public ConnectionID addOutputConnection(long macAddress,
byte portNo)
IPortBasedProtocolManager
addOutputConnection in interface IPortBasedProtocolManagermacAddress - - address of the other deviceportNo - - port number to communicate over
public ConnectionID addInputConnection(long macAddress,
byte portNo)
IPortBasedProtocolManager
addInputConnection in interface IPortBasedProtocolManagermacAddress - - address of the other deviceportNo - - port number to communicate over
public ConnectionID addServerConnection(byte portNo)
IPortBasedProtocolManager
addServerConnection in interface IPortBasedProtocolManagerportNo - - port number to communicate over
public ConnectionID addBroadcastConnection(byte portNo)
IPortBasedProtocolManager
addBroadcastConnection in interface IPortBasedProtocolManagerportNo - - port number to communicate over
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||