SunSPOT API V3.0


com.sun.spot.peripheral.radio
Class RadioPacketDispatcher

java.lang.Object
  extended by com.sun.spot.peripheral.radio.RadioPacketDispatcher
All Implemented Interfaces:
IRadioPacketDispatcher

public class RadioPacketDispatcher
extends Object
implements IRadioPacketDispatcher

Implements IRadioPacketDispatcher for the Spot environment.

Author:
Pete St. Pierre, refactored from original LowPanPacketDispatcher by Jochen Furthmueller.

Method Summary
 void deregisterPacketQualityListener(IPacketQualityListener listener)
          Undo a previous call of registerPacketListener()
static IRadioPacketDispatcher getInstance()
          Return the singleton instance of RadioPacketDispatcher.
 void initialize(ILowPan lowPanLayer)
          Called by LowPan to initialize the dispatcher.
 void registerPacketQualityListener(IPacketQualityListener packetListener)
          Register to be notified with Link Quality information.
 void sendBroadcast(RadioPacket rp)
          Broadcast a packet.
 void sendPacket(RadioPacket rp)
          Send a packet.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IRadioPacketDispatcher getInstance()
Return the singleton instance of RadioPacketDispatcher.

Returns:
the instance

registerPacketQualityListener

public void registerPacketQualityListener(IPacketQualityListener packetListener)
Register to be notified with Link Quality information.

Specified by:
registerPacketQualityListener in interface IRadioPacketDispatcher
Parameters:
packetListener - the class that wants to be called back

deregisterPacketQualityListener

public void deregisterPacketQualityListener(IPacketQualityListener listener)
Undo a previous call of registerPacketListener()

Specified by:
deregisterPacketQualityListener in interface IRadioPacketDispatcher
Parameters:
listener - the class that wants to be deregistered

sendBroadcast

public void sendBroadcast(RadioPacket rp)
                   throws NoAckException,
                          ChannelBusyException
Broadcast a packet. Called from sendPacket if destination is a broadcast or unknown

Parameters:
rp -
Throws:
NoAckException
ChannelBusyException

sendPacket

public void sendPacket(RadioPacket rp)
                throws NoAckException,
                       ChannelBusyException
Send a packet. Is called by the low pan layer

Specified by:
sendPacket in interface IRadioPacketDispatcher
Parameters:
rp -
Throws:
NoAckException
ChannelBusyException

initialize

public void initialize(ILowPan lowPanLayer)
Called by LowPan to initialize the dispatcher. Note: This is only called after LowPan is completely started up. This method is there to prevent cycles in the initialization process

Specified by:
initialize in interface IRadioPacketDispatcher
Parameters:
lowPanLayer - reference to the fully started LowPan instance

SunSPOT API V3.0


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