|
SunSPOT API V2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.peripheral.radio.LowPan
public class LowPan
Packet processing layer based on the low pan draft. Provides link layer fragmentation and mesh routing in cooperation with a routing manager.
| Field Summary |
|---|
| Fields inherited from interface com.sun.spot.peripheral.radio.ILowPan |
|---|
DEFAULT_HOPS, MAC_PAYLOAD_OFFSET, MAX_MAC_PAYLOAD_OFFSET |
| Constructor Summary | |
|---|---|
protected |
LowPan(long ourAddress,
IRoutingManager aodvManager,
IRadioPacketDispatcher radioPacketDispatcher)
protected constructor for the instantiation of the singleton |
| Method Summary | |
|---|---|
void |
deregisterDataEventListener(IDataEventListener listener)
Undo a previous call of registerDataEventListener() |
void |
deregisterProtocol(byte protocolNum)
Deregister a protocol. |
void |
deregisterProtocolFamily(byte protocolFamily)
Deregister a protocol family. |
void |
deregisterRouteEventListener(IRouteEventListener listener)
Undo a previous call of registerRouteEventListener() |
static ILowPan |
getInstance()
Get the instance of this singleton. |
IRoutingManager |
getRoutingManager()
Get the routing manager |
void |
receive(RadioPacket packet)
This method is called by the packet dispatcher this low pan layer is registered with. |
void |
registerDataEventListener(IDataEventListener dataListener)
Register to be notified as soon as the LowPan module forwards data. |
void |
registerMHEventListener(IMHEventListener mhListener)
Register to be notified when certain multihop routing events occur. |
void |
registerProtocol(byte protocolNum,
IProtocolManager protocolMan)
Register a protocol manager to send and receive packets |
void |
registerProtocolFamily(byte protocolFamily,
IProtocolManager protocolMan)
Register a protocol manager to send and receive packets |
void |
registerRouteEventListener(IRouteEventListener routeListener)
Register to be notified when certain routing events occur. |
void |
routeFound(RouteInfo info,
Object uniqueKey)
This method is called by the routing manager as soon as a route is available or if no route has been found within the defined period. |
long |
send(byte protocolFamily,
byte protocolNum,
long toAddress,
byte[] buffer,
int startOffset,
int endOffset)
Send a byte buffer on a given protocol. |
boolean |
send(byte protocolFamily,
byte protocolNum,
long toAddress,
byte[] buffer,
int startOffset,
int endOffset,
boolean failIfNotSingleHop)
Send a byte buffer on a given protocol. |
long |
sendBroadcast(byte protocolNum,
byte[] buffer,
int startOffset,
int endOffset,
int hops)
Broadcast a byte buffer on a given protocol, without any attempt at meshing (can be fragmented) |
void |
sendWithoutMeshingOrFragmentation(byte protocolNum,
long toAddress,
byte[] buffer,
int startOffset,
int endOffset)
Send a byte buffer on a given protocol, without any attempt at meshing or fragmentation |
void |
setOurAddress(long addr)
Method called by RadioPacketDispatcher on a host. |
IRoutingManager |
setRoutingManager(IRoutingManager newRoutingManager)
Replace the routing manager with a different implemenation |
protected boolean |
validateSeqNo(LowPanPacket lpp)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected LowPan(long ourAddress,
IRoutingManager aodvManager,
IRadioPacketDispatcher radioPacketDispatcher)
aodvManager - radioPacketDispatcher - | Method Detail |
|---|
public static ILowPan getInstance()
public IRoutingManager setRoutingManager(IRoutingManager newRoutingManager)
setRoutingManager in interface ILowPannewRoutingManager - a new routing manager
public void registerProtocolFamily(byte protocolFamily,
IProtocolManager protocolMan)
registerProtocolFamily in interface ILowPanprotocolFamily - protocol family this protocol is in (ie IPv6, SunSPOT, etc)protocolMan - the protocol manager to be registered
public void registerProtocol(byte protocolNum,
IProtocolManager protocolMan)
registerProtocol in interface ILowPanprotocolNum - number of protocol to be handledprotocolMan - the protocol manager to be registeredpublic void deregisterProtocol(byte protocolNum)
deregisterProtocol in interface ILowPanprotocolNum - identifier for the protocolpublic void deregisterProtocolFamily(byte protocolFamily)
deregisterProtocolFamily in interface ILowPanprotocolFamily - identifier for the protocolpublic void registerDataEventListener(IDataEventListener dataListener)
registerDataEventListener in interface ILowPandataListener - the class that wants to be called backpublic void registerRouteEventListener(IRouteEventListener routeListener)
registerRouteEventListener in interface ILowPanrouteListener - the class that wants to be called backpublic void registerMHEventListener(IMHEventListener mhListener)
registerMHEventListener in interface ILowPanmhListener - the class that wants to be called backpublic void deregisterDataEventListener(IDataEventListener listener)
deregisterDataEventListener in interface ILowPanlistener - the class that wants to be deregisteredpublic void deregisterRouteEventListener(IRouteEventListener listener)
listener - the class that wants to be deregistered
public void routeFound(RouteInfo info,
Object uniqueKey)
routeFound in interface RouteEventClient
public void receive(RadioPacket packet)
throws ChannelBusyException,
NoRouteException
receive in interface ILowPanpacket - packet that was received by the underlying radio
ChannelBusyException - channel was busy when access was attempted
NoRouteException - No route could be found to the destination
protected boolean validateSeqNo(LowPanPacket lpp)
throws ChannelBusyException,
NoRouteException
ChannelBusyException
NoRouteExceptionpublic IRoutingManager getRoutingManager()
ILowPan
getRoutingManager in interface ILowPan
public long send(byte protocolFamily,
byte protocolNum,
long toAddress,
byte[] buffer,
int startOffset,
int endOffset)
throws ChannelBusyException,
NoRouteException
ILowPan
send in interface ILowPanprotocolFamily - the protocol family associated with the outgoing packetprotocolNum - the protocol number associated with the outgoing packettoAddress - the destinationbuffer - byte array that holds the data to be sentstartOffset - offset within the byte array at which data should be readendOffset - offset within the byte array after which data
should not be read
ChannelBusyException - the radio channel could not be accessed
NoRouteException - a route to the destination could not be found
public boolean send(byte protocolFamily,
byte protocolNum,
long toAddress,
byte[] buffer,
int startOffset,
int endOffset,
boolean failIfNotSingleHop)
throws ChannelBusyException,
NoRouteException
ILowPan
send in interface ILowPanprotocolFamily - the protocol family associated with the outgoing packetprotocolNum - the protocol number associated with the outgoing packettoAddress - the destinationbuffer - byte array that holds the data to be sentstartOffset - offset within the byte array at which data should be readendOffset - offset within the byte array after which data
should not be readfailIfNotSingleHop - if true this method should not send if not single hop.
ChannelBusyException - the radio channel could not be accessed
NoRouteException - a route to the destination could not be found
public void sendWithoutMeshingOrFragmentation(byte protocolNum,
long toAddress,
byte[] buffer,
int startOffset,
int endOffset)
throws NoAckException,
ChannelBusyException
ILowPan
sendWithoutMeshingOrFragmentation in interface ILowPanprotocolNum - higher level protocol number (for port based protocol manager)toAddress - address of the remote device for radio packetbuffer - data buffer to be sentstartOffset - index of first byte of data to be sent from the bufferendOffset - index of the last byte of data to be sent
NoAckException - Ack was expected but not received
ChannelBusyException - radio channel was busy when send was attempted
public long sendBroadcast(byte protocolNum,
byte[] buffer,
int startOffset,
int endOffset,
int hops)
throws ChannelBusyException
ILowPan
sendBroadcast in interface ILowPanprotocolNum - higher level protocol number (for port based protocol manager)buffer - data buffer to be sentstartOffset - index of first byte of data to be sent from the bufferendOffset - index of the last byte of data to be senthops - number of mesh hops this broadcast should take
ChannelBusyException - radio channel was busy when send attemptedpublic void setOurAddress(long addr)
ILowPan
setOurAddress in interface ILowPanaddr - 64-bit value representing our IEEE address
|
SunSPOT API V2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||