|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILowPan
Interface that specifies the minimum functionality offered by a layer that implements the LowPan specification
Field Summary | |
---|---|
static byte |
DEFAULT_HOPS
default number of hops a routed packet should make |
static byte |
MAC_PAYLOAD_OFFSET
Minimum length of the LowPan header |
static byte |
MAX_MAC_PAYLOAD_OFFSET
normal length of a MESHED LowPan Packet, not counting broadcast or fragmentation |
Method Summary | |
---|---|
void |
deregisterDataEventListener(IDataEventListener listener)
Deregisters an application etc. that is called back when data is forwarded |
void |
deregisterProtocol(byte protocolNum)
Deregisters the protocol manager that handles the specifies protocol manager |
void |
deregisterProtocolFamily(byte protocolFamily)
Deregisters the protocol manager that handles the specifies protocol manager |
IRoutingManager |
getRoutingManager()
Get the routing manager |
void |
receive(RadioPacket packet)
Method called by INewpacketDispatcher when a packet is received |
void |
registerDataEventListener(IDataEventListener listener)
Registers an application etc. that is notified when this node is used to forward a data packet |
void |
registerMHEventListener(IMHEventListener listener)
Registers an application etc. that is notified when this node initiates/receives supported route events |
void |
registerProtocol(byte protocolNum,
IProtocolManager protocolMan)
Register protocol managers that send/receive data encoded using the specified protocol number, within the specified family. |
void |
registerProtocolFamily(byte protocolFamily,
IProtocolManager protocolMan)
Register protocol managers that send/receive data encoded for all protocols in a given family. |
void |
registerRouteEventListener(IRouteEventListener listener)
Registers an application etc. that is notified when this node initiates/receives supported route events |
long |
send(byte protocolFamily,
byte protocolNum,
long toAddress,
byte[] payload,
int startOffset,
int endOffset)
Send a byte buffer on a given protocol. |
boolean |
send(byte protocolFamily,
byte protocolNum,
long toAddress,
byte[] payload,
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 |
Field Detail |
---|
static final byte MAC_PAYLOAD_OFFSET
static final byte DEFAULT_HOPS
static final byte MAX_MAC_PAYLOAD_OFFSET
Method Detail |
---|
void registerProtocolFamily(byte protocolFamily, IProtocolManager protocolMan)
protocolFamily
- mily to which this protocol belongs. This should map to
a 6lowpan protocol dispatch such as IPv6, etc.protocolMan
- protocol manager that will handle messages encoded
using this protocol numbervoid registerProtocol(byte protocolNum, IProtocolManager protocolMan)
protocolNum
- unique number to identify the protocol (0...255).protocolMan
- protocol manager that will handle messages encoded
using this protocol numbervoid deregisterProtocolFamily(byte protocolFamily)
protocolFamily
- family to which this protocol belongs. This should map to
a 6lowpan protocol dispatch such as IPv6, etc.void deregisterProtocol(byte protocolNum)
protocolNum
- unique number to identify the protocol (0...255).void registerDataEventListener(IDataEventListener listener)
listener
- object that is notified when data is forwardedvoid registerRouteEventListener(IRouteEventListener listener)
listener
- object that is notified when route events occurvoid registerMHEventListener(IMHEventListener listener)
listener
- object that is notified when route events occurvoid deregisterDataEventListener(IDataEventListener listener)
listener
- object that is notified when data is forwardedboolean send(byte protocolFamily, byte protocolNum, long toAddress, byte[] payload, int startOffset, int endOffset, boolean failIfNotSingleHop) throws ChannelBusyException, NoRouteException
protocolFamily
- the protocol family associated with the outgoing packetprotocolNum
- the protocol number associated with the outgoing packettoAddress
- the destinationpayload
- 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 foundlong send(byte protocolFamily, byte protocolNum, long toAddress, byte[] payload, int startOffset, int endOffset) throws ChannelBusyException, NoRouteException
protocolFamily
- the protocol family associated with the outgoing packetprotocolNum
- the protocol number associated with the outgoing packettoAddress
- the destinationpayload
- 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 foundvoid sendWithoutMeshingOrFragmentation(byte protocolNum, long toAddress, byte[] buffer, int startOffset, int endOffset) throws NoAckException, ChannelBusyException
protocolNum
- 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 attemptedlong sendBroadcast(byte protocolNum, byte[] buffer, int startOffset, int endOffset, int hops) throws ChannelBusyException
protocolNum
- 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 attemptedvoid receive(RadioPacket packet) throws ChannelBusyException, NoRouteException
packet
- packet received over the radio
ChannelBusyException
- channel was busy when access was attempted
NoRouteException
- No route could be found to the destinationvoid setOurAddress(long addr)
addr
- 64-bit value representing our IEEE addressIRoutingManager getRoutingManager()
IRoutingManager setRoutingManager(IRoutingManager newRoutingManager)
newRoutingManager
- a new routing manager
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |