|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.spot.peripheral.radio.LowPanHeader
public class LowPanHeader
LowPanHeader.java
Field Summary | |
---|---|
protected static byte |
BROADCAST_HEADER_LENGTH
Size of a Broadcast Header |
static byte |
DISPATCH_ESC
Denotes the following header field is not in the scope of the LowPan spec We use this next byte for our SPOT protocol number |
protected static byte |
DISPATCH_FRAG
Denotes what follows is a some part of a LowPan packet |
static byte |
DISPATCH_LOWPAN_BC0
Denotes this packet is a LowPan Mesh Broadcast packet |
static byte |
DISPATCH_LOWPAN_HC1
Denotes this packet contains part of an IPv6 packet that uses header compression |
static byte |
DISPATCH_LOWPAN_IPV6
Denotes this packet contains part of an IPv6 format packet at the higher level |
protected static byte |
DISPATCH_MESH
Denotes what follows is a LowPan Mesh header |
static byte |
DISPATCH_SPOT
Denotes the following header field is not in the scope of the LowPan spec We use this next byte for our SPOT protocol number |
static byte |
FAMILY_DEFINED_PROTO
Denotes the protocol number is handled within the protocol family. |
protected static byte |
FIRST_FRAGMENT
Marks a packet as a First Fragment |
protected static byte |
INTERIOR_FRAGMENT
Marks a packet as an Interior Fragment |
protected static byte |
LAST_FRAGMENT
Marks a packet as the last Fragment |
protected static byte |
MAX_FRAGMENTATION_HEADER_LENGTH
Maximum size of a fragmentation header. |
protected static byte |
MAX_MESH_HEADER_LENGTH
Maximum size of a Mesh Header |
protected static byte |
MAX_PROTOCOL_HEADER_LENGTH
Max length of the protocol header |
static byte |
MAX_UNFRAG_HEADER_LENGTH
Unfragmented header is 17B Mesh, 2B Broadcast, 2B protocol |
protected static byte |
UNFRAGMENTED
Marks a packet as unfragmented |
Constructor Summary | |
---|---|
LowPanHeader()
Creates a new instance of LowPanHeader |
Method Summary | |
---|---|
int |
getLength()
Calculates the number of bytes this LowPanHeader will take |
int |
getOutgoingBCastSeqNo()
return the number of hops a mesh broadcast with this header will make |
long |
getOutgoingDestinationAddress()
get the final destination from the mesh field of this header |
byte |
getOutgoingFragOffset()
get the fragmentation offset field of the header, based on its location in the orginal datagram |
int |
getOutgoingFragSize()
return the total size of the packet associated with this fragment |
int |
getOutgoingFragTag()
return the datagram tag associated with this fragment |
int |
getOutgoingFragType()
return the current fragment type (UNFRAGMENTED, FIRST_FRAGMENT, INTERIOR_FRAGMENT, LAST_FRAGMENT) |
int |
getOutgoingHops()
return the number of hops this header is set to take |
long |
getOutgoingOriginatorAddress()
get the originator from the mesh field of this header |
byte |
getProtocolFamily()
|
byte |
getProtocolNo()
get the protocol number from this header |
boolean |
isBCast()
check to see if this header contains mesh broadcast information |
boolean |
isExtendedProtocol()
Defines whether this header uses the extended protocol field |
boolean |
isFirstFrag()
Checks the header to see if this header belongs to a packet that is the first fragment of a series. |
boolean |
isFragged()
check whether this header contains a fragmentation field |
boolean |
isMeshed()
check whether this header contains a mesh field |
void |
setBCast(boolean bCast)
sets this packet to contain mesh broadcast information |
void |
setFragged(boolean fragged)
set the flag indicating this header contains fragmentation information |
void |
setMeshed(boolean meshed)
set the flag indicating there is a mesh field associated with this header |
void |
setOutgoingBCastSeqNo(int outgoingBCastSeqNo)
Sets the number of hops a mesh broadcast with this header will make |
void |
setOutgoingDestinationAddress(long outgoingDestinationAddress)
set the final destination field of the mesh header |
void |
setOutgoingFragOffset(int outgoingFragOffset)
set the offset in the fragmentation header for this header, based on where the associated packet belongs in the reassembled packet |
void |
setOutgoingFragSize(int outgoingFragSize)
sets the size field of this fragment header. |
void |
setOutgoingFragTag(int outgoingFragTag)
set the datagram tag for this header |
void |
setOutgoingFragType(int outgoingFragType)
set the type of this fragment |
void |
setOutgoingHops(int outgoingHops)
set the number of hops a packet associated with this header will make |
void |
setOutgoingOriginatorAddress(long outgoingOriginatorAddress)
set the originator field of the mesh header |
void |
setProtocolInfo(byte protocolFamily,
byte protocolNo)
set the protocol information in this header |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final byte UNFRAGMENTED
protected static final byte LAST_FRAGMENT
protected static final byte FIRST_FRAGMENT
protected static final byte INTERIOR_FRAGMENT
public static final byte DISPATCH_LOWPAN_IPV6
public static final byte DISPATCH_LOWPAN_HC1
public static final byte DISPATCH_LOWPAN_BC0
public static final byte DISPATCH_ESC
public static final byte DISPATCH_SPOT
public static final byte FAMILY_DEFINED_PROTO
protected static final byte DISPATCH_FRAG
protected static final byte DISPATCH_MESH
protected static final byte MAX_PROTOCOL_HEADER_LENGTH
protected static final byte BROADCAST_HEADER_LENGTH
protected static final byte MAX_FRAGMENTATION_HEADER_LENGTH
protected static final byte MAX_MESH_HEADER_LENGTH
public static final byte MAX_UNFRAG_HEADER_LENGTH
Constructor Detail |
---|
public LowPanHeader()
Method Detail |
---|
public int getLength()
public boolean isFirstFrag()
public boolean isExtendedProtocol()
public int getOutgoingHops()
public void setOutgoingHops(int outgoingHops)
outgoingHops
- the number of hops to set in this headerpublic int getOutgoingBCastSeqNo()
public void setOutgoingBCastSeqNo(int outgoingBCastSeqNo)
outgoingBCastSeqNo
- the number of hops a mesh broadcast with this header should makepublic int getOutgoingFragType()
public void setOutgoingFragType(int outgoingFragType)
outgoingFragType
- the type of fragment, (UNFRAGMENTED, FIRST_FRAGMENT, INTERIOR_FRAGMENT, LAST_FRAGMENT)public int getOutgoingFragTag()
public void setOutgoingFragTag(int outgoingFragTag)
outgoingFragTag
- the new datagram tag for this headerpublic int getOutgoingFragSize()
public void setOutgoingFragSize(int outgoingFragSize)
outgoingFragSize
- the total size of the datagram when reassembledpublic byte getOutgoingFragOffset()
public void setOutgoingFragOffset(int outgoingFragOffset)
outgoingFragOffset
- the place within the reassembled packet ththe packets associated with this
header belongspublic long getOutgoingOriginatorAddress()
public void setOutgoingOriginatorAddress(long outgoingOriginatorAddress)
outgoingOriginatorAddress
- the address of the originator of the packet associated with this mesh headerpublic long getOutgoingDestinationAddress()
public void setOutgoingDestinationAddress(long outgoingDestinationAddress)
outgoingDestinationAddress
- the address of the final destination of the packet associated with this mesh headerpublic byte getProtocolNo()
public boolean isMeshed()
public void setMeshed(boolean meshed)
meshed
- true if there is a mesh field to be set in this headerpublic boolean isFragged()
public void setFragged(boolean fragged)
fragged
- true if this header contains fragmentation informationpublic boolean isBCast()
public void setBCast(boolean bCast)
bCast
- true if this packet is to contain mesh broadcast header informationpublic byte getProtocolFamily()
public void setProtocolInfo(byte protocolFamily, byte protocolNo)
protocolFamily
- the family this protocol information relates to (IPv6, SPOT, etc.)protocolNo
- the protocol number of the packet associated with this header
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |