SunSPOT API V5.0


com.sun.spot.peripheral.radio
Class RadiostreamProtocolManager

java.lang.Object
  extended by com.sun.spot.peripheral.radio.RadioProtocolManager
      extended by com.sun.spot.peripheral.radio.RadiostreamProtocolManager
All Implemented Interfaces:
IProtocolManager, IRadioProtocolManager, IRadiostreamProtocolManager

public class RadiostreamProtocolManager
extends RadioProtocolManager
implements IProtocolManager, IRadiostreamProtocolManager


Field Summary
static String PROTOCOL_NAME
           
static byte PROTOCOL_NUMBER
           
 
Fields inherited from interface com.sun.spot.peripheral.radio.IRadiostreamProtocolManager
CTRL_OFFSET, DATA_OFFSET, SEQ_OFFSET
 
Fields inherited from interface com.sun.spot.peripheral.radio.IRadioProtocolManager
FIRST_USER_PORT, INPUT, OUTPUT, PORT_OFFSET
 
Constructor Summary
RadiostreamProtocolManager()
          Construct an instance to manage the given protocol number.
 
Method Summary
static IRadiostreamProtocolManager getInstance()
           
 String getName()
           
static void main(String[] args)
           
 void processIncomingData(byte[] payload, LowPanHeaderInfo headerInfo)
          Called whenever data is received that is addressed to this IProtocolManager.
 long send(ConnectionID cid, long toAddress, byte[] payload, int length)
          Send a byte array using a ConnectionID.
 void waitForAllAcks(ConnectionID outConnectionId)
           
 
Methods inherited from class com.sun.spot.peripheral.radio.RadioProtocolManager
addConnection, addInputConnection, addOutputConnection, closeConnection, getConnectionState, packetsAvailable, receivePacket, receivePacket
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.spot.peripheral.radio.IRadioProtocolManager
addInputConnection, addOutputConnection, closeConnection, packetsAvailable, receivePacket, receivePacket
 

Field Detail

PROTOCOL_NUMBER

public static final byte PROTOCOL_NUMBER
See Also:
Constant Field Values

PROTOCOL_NAME

public static final String PROTOCOL_NAME
See Also:
Constant Field Values
Constructor Detail

RadiostreamProtocolManager

public RadiostreamProtocolManager()
Construct an instance to manage the given protocol number.

Method Detail

main

public static void main(String[] args)

getInstance

public static IRadiostreamProtocolManager getInstance()

send

public long send(ConnectionID cid,
                 long toAddress,
                 byte[] payload,
                 int length)
          throws NoAckException,
                 ChannelBusyException,
                 NoRouteException,
                 NoMeshLayerAckException
Description copied from interface: IRadioProtocolManager
Send a byte array using a ConnectionID. The client code should leave IPortBasedProtocolManager.DATA_OFFSET bytes free at the front of their payload as these will be overwritten.

Specified by:
send in interface IRadioProtocolManager
Parameters:
cid - the ConnectionID to send the packet over.
payload - the data
length - number of bytes to send, starting with index 0
Returns:
the time at which the data was sent
Throws:
NoAckException
ChannelBusyException
NoRouteException
NoMeshLayerAckException

waitForAllAcks

public void waitForAllAcks(ConnectionID outConnectionId)
                    throws NoAckException,
                           ChannelBusyException,
                           NoMeshLayerAckException,
                           NoRouteException
Specified by:
waitForAllAcks in interface IRadiostreamProtocolManager
Throws:
NoAckException
ChannelBusyException
NoMeshLayerAckException
NoRouteException

processIncomingData

public void processIncomingData(byte[] payload,
                                LowPanHeaderInfo headerInfo)
Description copied from interface: IProtocolManager
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.

Specified by:
processIncomingData in interface IProtocolManager

getName

public String getName()
Specified by:
getName in class RadioProtocolManager

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.