|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IProtocolManager
Implementors of this interface handle traffic relating to a particular protocol.
The separate class LowPan
multiplexes
traffic for up to 255 protocols over the radio connection between two Spots or
between a host application and a Spot. For more information about the overall
framework for implementing protocols, see that class.
To handle incoming traffic for a protocol you need an object that implements
IProtocolManager
. This object can
be registered to receive traffic:
...
LowPan.getInstance().registerProtocol(MY_PROTOCOL_NUMBER, pm, ..., ,...);
...
and similarly deregistered
...
LowPan.getInstance().deregisterProtocol(MY_PROTOCOL_NUMBER);
...
There should only be one registered protocol manager for each unique protocol
number.
RadiogramProtocolManager
is an example
implementation. Note that although these protocols are implemented
as Protocols in the sense implied by the GCF framework, this is not required.
The word protocol in "IProtocolManager" has a different meaning to that
in "GCF Protocol".
Method Summary | |
---|---|
void |
processIncomingData(byte[] payload,
LowPanHeaderInfo headerInfo)
Called whenever data is received that is addressed to this IProtocolManager . |
Method Detail |
---|
void processIncomingData(byte[] payload, LowPanHeaderInfo headerInfo)
IProtocolManager
.
IProtocolManagers should do as little processing as possible inside
this method, to avoid blocking other INewProtocolManagers from receiving
their packets. Typically an IProtocolManager will queue received
packets for later dispatch to applications.
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |