|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.system.DriverAdapter
com.sentilla.platform.tmote.Protocol
com.sentilla.platform.tmote.CollectionProtocol
public class CollectionProtocol
Collection protocol for receiving multi-hop messages from a mote network.
This is the mote version of the collection protocol. Mote applications will use this to send messages to the host server.
This protocol requires the presence of a host server to operate. The host server will send messages periodically, allowing the motes to build routes back to that server. These routes will then be used to send messages to the server. Note that only one host server is permitted to exist in a network. If two or more host servers are present, unpredictable routing behavior will result.
The time to receive a message from a mote will vary with the number of hops in the network. It can take up to 60 seconds per hop for a message to be successfully transmitted. Care should be taken to account for this delay when developing mote applications. In addition, the when using the CollectionProtocol, the Sender.send command can take up to 60 seconds to return. This command block until a transmission is succesful, which will include all retries and backoffs. Note that if a route is not available, this command will block indefinitely until a route is available.
The maximum payload size availabe when using the collection protocol is 58 bytes. The default number of message retries is 9, the default neighbor timeout is 5 mins, the default backoff interval is 2s, and the default ACK timeout is 1.6s.
The only valid address for the collection protocol is the BroadcastAddress.
Protocol
,
BroadcastAddress
,
Mac64Address
Nested Class Summary | |
---|---|
static class |
CollectionProtocol.CSender
Sender for the collection protocol. |
class |
CollectionProtocol.NeighborTable
Data structure containing the known neighbors of a mote. |
class |
CollectionProtocol.RTable
Table structure containing neighbor information. |
Field Summary | |
---|---|
static int |
ACK_TIMEOUT
Time to wait for an ACK before retransmiting. |
static int |
BACKOFF_INTERVAL
Backoff interval for randomizing retransmission times. |
static int |
BEACON_DELAY
Max delay when forwarding the host messages. |
static int |
COST_RATIO
Max cost ratio |
int |
curHostSeq
|
static int |
MAX_RETRIES
Number of times to retry sending a message. |
static int |
MAX_SENDERS
Max messages that can be forwarded at any time. |
static int |
MAX_TIMEOUT
Max timeout for neighbor table entries. |
static int |
MTU
Max serialized data size supported. |
short |
my_hash_id
|
long |
my_id
|
byte |
myHops
|
Fields inherited from class com.sentilla.system.DriverAdapter |
---|
m_nextDriver |
Constructor Summary | |
---|---|
CollectionProtocol()
Creates a new CollectionProtocol object. |
Method Summary | |
---|---|
short |
correlation(byte v)
Calculates the LQI correlation cost. |
boolean |
doesInstanceMatch(Object obj)
Returns true if the class of obj should be handled by this protocol. |
String |
getDriverName(int n)
Returns the string "collect". |
void |
getNeighborTable(CollectionProtocol.RTable[] t)
Copy the NeighborTable at this time into the input RTable array. |
Receiver |
newReceiver()
Returns a new CollectionProtocol receiver. |
Sender |
newSender()
Returns a new CollectionProtocol sender. |
void |
stackReceive(Receiver rcvr)
Called by the system receive thread when a CollectionProtocol message is received. |
void |
stackSend(Sender s)
Called by the system send thread when a message is sent with the CollectionProtocol. |
Methods inherited from class com.sentilla.system.DriverAdapter |
---|
getNextDriver, setNextDriver |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MTU
public static int MAX_RETRIES
public static int MAX_TIMEOUT
public static int BEACON_DELAY
public static int BACKOFF_INTERVAL
public static int ACK_TIMEOUT
public static int MAX_SENDERS
public static int COST_RATIO
public long my_id
public short my_hash_id
public int curHostSeq
public byte myHops
Constructor Detail |
---|
public CollectionProtocol()
Method Detail |
---|
public short correlation(byte v)
public void stackReceive(Receiver rcvr)
stackReceive
in class Protocol
rcvr
- the Receiver object containing the received data.Protocol
,
Receiver
public void stackSend(Sender s)
stackSend
in class Protocol
s
- the Sender object containing the data to be transmitted.Protocol
,
Sender
public Sender newSender()
newSender
in class Protocol
Sender
public Receiver newReceiver()
newReceiver
in class Protocol
Receiver
public boolean doesInstanceMatch(Object obj)
doesInstanceMatch
in class Protocol
obj
- object to be checked
Protocol
public String getDriverName(int n)
getDriverName
in interface Driver
getDriverName
in class DriverAdapter
n
- index of driver name
Drivers
public void getNeighborTable(CollectionProtocol.RTable[] t)
CollectionProtocol.RTable
,
TABLE_SIZE
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |