SunSPOT API V6.0


com.sun.spot.ipv6
Class LowPanUncompressed

java.lang.Object
  extended by com.sun.spot.resources.Resource
      extended by com.sun.spot.service.BasicService
          extended by com.sun.spot.ipv6.LowPanUncompressed
All Implemented Interfaces:
IIPNetworkInterface, IProtocolManager, IResource, IService

public class LowPanUncompressed
extends BasicService
implements IIPNetworkInterface, IProtocolManager

An implementation of RFC4944 without header compression

Author:
Pete St. Pierre

Field Summary
static boolean debug
           
 byte[] myLocalSolicited
           
 
Fields inherited from interface com.sun.spot.service.IService
PAUSED, PAUSING, READY, RESUMING, RUNNING, STARTING, STOPPED, STOPPING
 
Method Summary
 int getDefaultHops()
          Returns the number of lowpan hops an IP broadcast packet is allowed to traverse
 byte[] getGlobalAddress()
          Return the IPv6 address associated with this interface
static LowPanUncompressed getInstance()
          Return this LowPanUncompressed singleton
 String getInterfaceName()
          returns the name associated with this interface
 byte[] getLinkLayerAddress()
          returns the media specific link layer address
 byte[] getLinkLocalAddress()
          Return the IPv6 link address associated with this interface
 byte[] getLocalSolicitedAddress()
           
 NeighborManager getNeighborManager()
          returns the neighbor manager associated with this interface
 String getServiceName()
          Gets the name of this service
 byte[] getSubnetPrefix()
          Returns a byte array representation of the IPv6 subnet prefix for this interface
 int getSubnetSize()
           
 void processIncomingData(byte[] payload, LowPanHeaderInfo headerInfo)
          Called whenever data is received that is addressed to this IProtocolManager.
 void sendPacket(IPv6Packet p)
          Send a packet via this interface to a node we expect to be on this link
 void sendPacket(IPv6Packet p, IPRouteEntry re)
          Send an IP packet using this interface
 void setDefaultHops(int hops)
          Sets the number of mesh hops the low pan packet will be allowed to traverse
 void setSubnetPrefix(byte[] prefix, int size)
          Sets the IPv6 subnet information for this link
protected  void start(IP stack)
           
 
Methods inherited from class com.sun.spot.service.BasicService
getEnabled, getStatus, isRunning, pause, resume, setEnabled, setServiceName, start, stop
 
Methods inherited from class com.sun.spot.resources.Resource
addTag, getTags, getTagValue, hasTag, removeTag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 

Field Detail

debug

public static final boolean debug

myLocalSolicited

public byte[] myLocalSolicited
Method Detail

start

protected void start(IP stack)

getInstance

public static LowPanUncompressed getInstance()
Return this LowPanUncompressed singleton

Returns:
the LowPanUncompressed singleton

getDefaultHops

public int getDefaultHops()
Returns the number of lowpan hops an IP broadcast packet is allowed to traverse

Returns:
the number of mesh hops a broadcast will traverse

setDefaultHops

public void setDefaultHops(int hops)
Sets the number of mesh hops the low pan packet will be allowed to traverse

Parameters:
hops - the number of allowable mesh hops for IP broadcast packets

setSubnetPrefix

public void setSubnetPrefix(byte[] prefix,
                            int size)
Sets the IPv6 subnet information for this link

Specified by:
setSubnetPrefix in interface IIPNetworkInterface
Parameters:
prefix - The IPv6 prefix associated with the interafce
size - The number of bits in the network portion (netmask bits)

getInterfaceName

public String getInterfaceName()
returns the name associated with this interface

Specified by:
getInterfaceName in interface IIPNetworkInterface
Returns:

sendPacket

public void sendPacket(IPv6Packet p)
                throws NetworkException
Send a packet via this interface to a node we expect to be on this link

Specified by:
sendPacket in interface IIPNetworkInterface
Parameters:
p - A properly formatted IPv6 packet
Throws:
NetworkException

sendPacket

public void sendPacket(IPv6Packet p,
                       IPRouteEntry re)
                throws NetworkException
Send an IP packet using this interface

Specified by:
sendPacket in interface IIPNetworkInterface
Parameters:
p - A properly formated IPv6 packet to send
re - A route entry that contains the next hop information
Throws:
NetworkException

getGlobalAddress

public byte[] getGlobalAddress()
Description copied from interface: IIPNetworkInterface
Return the IPv6 address associated with this interface

Specified by:
getGlobalAddress in interface IIPNetworkInterface
Returns:
The global IPv6 address associated with this interface

getSubnetSize

public int getSubnetSize()
Specified by:
getSubnetSize in interface IIPNetworkInterface

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

getLinkLocalAddress

public byte[] getLinkLocalAddress()
Description copied from interface: IIPNetworkInterface
Return the IPv6 link address associated with this interface

Specified by:
getLinkLocalAddress in interface IIPNetworkInterface
Returns:
The IPv6 link address associated with this interface

getLocalSolicitedAddress

public byte[] getLocalSolicitedAddress()
Specified by:
getLocalSolicitedAddress in interface IIPNetworkInterface

getLinkLayerAddress

public byte[] getLinkLayerAddress()
Description copied from interface: IIPNetworkInterface
returns the media specific link layer address

Specified by:
getLinkLayerAddress in interface IIPNetworkInterface
Returns:
a byte array in network byte order, with the link layer address

getSubnetPrefix

public byte[] getSubnetPrefix()
Returns a byte array representation of the IPv6 subnet prefix for this interface

Specified by:
getSubnetPrefix in interface IIPNetworkInterface
Returns:
The IPv6 prefix for this interface

getNeighborManager

public NeighborManager getNeighborManager()
returns the neighbor manager associated with this interface

Specified by:
getNeighborManager in interface IIPNetworkInterface
Returns:
The NeighborManager for this interface

getServiceName

public String getServiceName()
Gets the name of this service

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

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.