SunSPOT API V5.0


com.sun.spot.peripheral.radio
Class LowPanSpotRadioHelper

java.lang.Object
  extended by com.sun.spot.service.BasicService
      extended by com.sun.spot.peripheral.radio.LowPanSpotRadioHelper
All Implemented Interfaces:
RouteEventClient, IService, ISpotRadioHelper

public class LowPanSpotRadioHelper
extends BasicService
implements ISpotRadioHelper, RouteEventClient

A facade so OTA can access low-level radio features.

Author:
Ron

Field Summary
 
Fields inherited from interface com.sun.spot.service.IService
PAUSED, PAUSING, READY, RESUMING, RUNNING, STARTING, STOPPED, STOPPING
 
Constructor Summary
LowPanSpotRadioHelper()
           
 
Method Summary
 String getDatagramConnectionProtocol()
          Tell others the Datagram protocol name for use with GCF.
 int getLinkQuality(Datagram dg)
          Returns the link quality for the received datagram as a combination of RSSI and CORR.
 int getLinkStrength(Datagram dg)
          Returns the link strength for the received datagram.
 RouteInfo[] getRouteInfo()
          Return an array of the current route info to all known addresses.
 RouteInfo[] getRouteInfo(long address)
          Return information on the current route(s) to the specified destination address.
 String getRoutingManagerName()
          Return the name of the current Routing Manager.
 String getServiceName()
          Return the name of this service.
 String getStreamConnectionProtocol()
          Tell others the Stream protocol name for use with GCF.
 long getTimestamp(Datagram dg)
          Return the time that a Datagram packet was actually received/sent.
 boolean isBroadcast(Datagram dg)
          Tell if datagram was sent as a broadcast message.
 boolean isMutableRoutingManager()
          Check whether this Routing Manager allows writing to the Routing Table.
static void main(String[] args)
          Static method to register the LowPan radio stack with the base OTA code.
 void routeFound(RouteInfo info, Object uniqueKey)
          Callback for findRouteInfo().
 
Methods inherited from class com.sun.spot.service.BasicService
getEnabled, getStatus, isRunning, pause, resume, setEnabled, setServiceName, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.spot.service.IService
getEnabled, getStatus, isRunning, pause, resume, setEnabled, setServiceName, start, stop
 

Constructor Detail

LowPanSpotRadioHelper

public LowPanSpotRadioHelper()
Method Detail

main

public static void main(String[] args)
Static method to register the LowPan radio stack with the base OTA code.

Parameters:
args - ignored

getServiceName

public String getServiceName()
Description copied from interface: IService
Return the name of this service.

Specified by:
getServiceName in interface IService
Specified by:
getServiceName in class BasicService
Returns:
the name of this service

getDatagramConnectionProtocol

public String getDatagramConnectionProtocol()
Tell others the Datagram protocol name for use with GCF.

Specified by:
getDatagramConnectionProtocol in interface ISpotRadioHelper
Returns:
Datagram protocol name for use with GCF

getStreamConnectionProtocol

public String getStreamConnectionProtocol()
Tell others the Stream protocol name for use with GCF.

Specified by:
getStreamConnectionProtocol in interface ISpotRadioHelper
Returns:
Stream protocol name for use with GCF

getLinkQuality

public int getLinkQuality(Datagram dg)
Returns the link quality for the received datagram as a combination of RSSI and CORR. Values should range from 0 (unreadable) to 100 (perfect). If link quality does not apply to this connection return -1.

Specified by:
getLinkQuality in interface ISpotRadioHelper
Parameters:
dg - Datagram
Returns:
link quality or -1 if cannot compute link quality

getLinkStrength

public int getLinkStrength(Datagram dg)
Returns the link strength for the received datagram. Values should range from 0 (weak) to 100 (strong). If transport layer does not have a link strength metric then return -1.

Specified by:
getLinkStrength in interface ISpotRadioHelper
Parameters:
dg - Datagram
Returns:
link strength or -1

getTimestamp

public long getTimestamp(Datagram dg)
Return the time that a Datagram packet was actually received/sent.

Specified by:
getTimestamp in interface ISpotRadioHelper
Parameters:
dg - the Datagram to check
Returns:
time that the Datagram packet was actually received/sent

isBroadcast

public boolean isBroadcast(Datagram dg)
Tell if datagram was sent as a broadcast message.

Specified by:
isBroadcast in interface ISpotRadioHelper
Parameters:
dg - the Datagram to check
Returns:
true if the Datagram had been broadcast

getRoutingManagerName

public String getRoutingManagerName()
Return the name of the current Routing Manager.

Specified by:
getRoutingManagerName in interface ISpotRadioHelper
Returns:
the name of the current Routing Manager

getRouteInfo

public RouteInfo[] getRouteInfo(long address)
Return information on the current route(s) to the specified destination address.

Specified by:
getRouteInfo in interface ISpotRadioHelper
Parameters:
address - the specified destination address
Returns:
the current route(s) to the specified destination address

routeFound

public void routeFound(RouteInfo info,
                       Object uniqueKey)
Callback for findRouteInfo().

Specified by:
routeFound in interface RouteEventClient
Parameters:
info -
uniqueKey -

getRouteInfo

public RouteInfo[] getRouteInfo()
Return an array of the current route info to all known addresses.

Specified by:
getRouteInfo in interface ISpotRadioHelper
Returns:
the current route info to all known addresses

isMutableRoutingManager

public boolean isMutableRoutingManager()
Check whether this Routing Manager allows writing to the Routing Table.

Specified by:
isMutableRoutingManager in interface ISpotRadioHelper
Returns:
true if Routing Table is mutable

SunSPOT API V5.0


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