SunSPOT API V3.0


com.sun.spot.peripheral.radio
Interface IProtocolManager

All Known Implementing Classes:
RadiogramProtocolManager, RadiostreamProtocolManager, Receiver

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".

Version:
2.0
Author:
Allen Ajit George, Jochen Furthmueller, Pete St. Pierre

Method Summary
 void processIncomingData(byte[] payload, LowPanHeaderInfo headerInfo)
          Called whenever data is received that is addressed to this IProtocolManager.
 

Method Detail

processIncomingData

void processIncomingData(byte[] payload,
                         LowPanHeaderInfo headerInfo)
Called whenever data is received that is addressed to this 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


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.