uint8_t gLastHeard;
int16_t gCurrentSeqNo;
-
+ int16_t gOriginSeqNo;
+
uint16_t gUpdateInterval;
uint8_t gRecentIndex;
bMsg->cost = 0;
bMsg->originaddr = TOS_NODE_ID;
bMsg->hopcount = 0;
- bMsg->originseqno = gCurrentSeqNo;
bMsg->seqno = gCurrentSeqNo++;
}
else {
bMsg->cost = gbCurrentParentCost + gbCurrentLinkEst;
bMsg->originaddr = TOS_NODE_ID;
bMsg->hopcount = gbCurrentHopCount;
- bMsg->originseqno = gCurrentSeqNo;
bMsg->seqno = gCurrentSeqNo++;
}
gbCurrentHopCount = ROUTE_INVALID;
gbCurrentCost = 0xfffe;
+ gOriginSeqNo = 0;
gCurrentSeqNo = 0;
gUpdateInterval = BEACON_PERIOD;
msgBufBusy = FALSE;
lqi_header_t* header = (lqi_header_t*)call Packet.getPayload(msg, NULL);
header->originaddr = TOS_NODE_ID;
- header->originseqno = gCurrentSeqNo;
+ header->originseqno = gOriginSeqNo++;
header->seqno = gCurrentSeqNo;
if (isRoot) {
event void AMSend.sendDone(message_t* msg, error_t success) {
msgBufBusy = FALSE;
}
+
+ /* Default implementations for CollectionDebug calls.
+ * These allow CollectionDebug not to be wired to anything if debugging
+ * is not desired. */
+
+ default command error_t CollectionDebug.logEvent(uint8_t type) {
+ return SUCCESS;
+ }
+ default command error_t CollectionDebug.logEventSimple(uint8_t type, uint16_t arg) {
+ return SUCCESS;
+ }
+ default command error_t CollectionDebug.logEventDbg(uint8_t type, uint16_t arg1, uint16_t arg2, uint16_t arg3) {
+ return SUCCESS;
+ }
+ default command error_t CollectionDebug.logEventMsg(uint8_t type, uint16_t msg, am_addr_t origin, am_addr_t node) {
+ return SUCCESS;
+ }
+ default command error_t CollectionDebug.logEventRoute(uint8_t type, am_addr_t parent, uint8_t hopcount, uint16_t etx) {
+ return SUCCESS;
+ }
}