// $Id$
-
/* Copyright (c) 2007 Stanford University.
* All rights reserved.
*
if (call SubSend.send(call AMPacket.destination(msg),
msg,
call SubPacket.payloadLength(msg)) == SUCCESS) {
+ call CollectionDebug.logEventMsg(NET_C_DBG_1,
+ call CollectionPacket.getSequenceNumber(msg),
+ call CollectionPacket.getOrigin(msg),
+ call AMPacket.destination(msg));
dbg("LQI", "%s: Send to %hu success.\n", __FUNCTION__, call AMPacket.destination(msg));
}
fwdbusy = TRUE;
payload += sizeof(lqi_header_t);
len -= sizeof(lqi_header_t);
+ call CollectionDebug.logEventMsg(NET_C_FE_RCV_MSG,
+ call CollectionPacket.getSequenceNumber(msg),
+ call CollectionPacket.getOrigin(msg),
+ call AMPacket.destination(msg));
if (call RootControl.isRoot()) {
dbg("LQI,LQIDeliver", "LQI Root is receiving packet from node %hu @%s\n", getHeader(msg)->originaddr, sim_time_string());
return signal Receive.receive[id](msg, payload, len);
}
+ else if (call AMPacket.destination(msg) != call AMPacket.address()) {
+ return msg;
+ }
else if (signal Intercept.forward[id](msg, payload, len)) {
dbg("LQI,LQIDeliver", "LQI fwd is forwarding packet from node %hu @%s\n", getHeader(msg)->originaddr, sim_time_string());
return mForward(msg);
message_t* nextMsg() {
int i;
- int inc = call Random.rand16();
+ uint16_t inc = call Random.rand16() & 0xfff;
for (i = 0; i < FWD_QUEUE_SIZE; i++) {
int pindex = (i + inc) % FWD_QUEUE_SIZE;
if (FwdBufBusy[pindex]) {
lqi_header_t* hdr = getHeader(msg);
hdr->originseqno = seqno;
}
+
+
default event void Send.sendDone(message_t* pMsg, error_t success) {}
default event message_t* Snoop.receive[collection_id_t id](message_t* pMsg, void* payload, uint8_t len) {return pMsg;}