[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/lqi
LqiForwardingEngineP.nc, 1.12, 1.13 MultiHopLqiP.nc, 1.3, 1.4
Phil Levis
scipio at users.sourceforge.net
Tue Feb 19 11:50:23 PST 2008
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestMultihopLqi
CC2420ActiveMessageC.nc, 1.2, 1.3 Makefile, 1.1,
1.2 MultihopOscilloscope.h, 1.2,
1.3 MultihopOscilloscopeAppC.nc, 1.2,
1.3 MultihopOscilloscopeC.nc, 1.3, 1.4 script.py, 1.2, 1.3
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim
TossimPacketModelC.nc, 1.7, 1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/lqi
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31900
Modified Files:
LqiForwardingEngineP.nc MultiHopLqiP.nc
Log Message:
Make LQI monitor AM power state and properly recover
from being turned off.
Index: LqiForwardingEngineP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/lqi/LqiForwardingEngineP.nc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** LqiForwardingEngineP.nc 9 Feb 2008 05:45:10 -0000 1.12
--- LqiForwardingEngineP.nc 19 Feb 2008 19:50:21 -0000 1.13
***************
*** 93,96 ****
--- 93,97 ----
}
uses {
+ interface SplitControl;
interface Receive as SubReceive;
interface AMSend as SubSend;
***************
*** 124,129 ****
uint8_t fwd_fail_count = 0;
uint8_t my_fail_count = 0;
! int fwdbusy = 0;
!
lqi_header_t* getHeader(message_t* msg) {
return (lqi_header_t*) call SubPacket.getPayload(msg, sizeof(lqi_header_t));
--- 125,131 ----
uint8_t fwd_fail_count = 0;
uint8_t my_fail_count = 0;
! bool fwdbusy = FALSE;
! bool running = FALSE;
!
lqi_header_t* getHeader(message_t* msg) {
return (lqi_header_t*) call SubPacket.getPayload(msg, sizeof(lqi_header_t));
***************
*** 151,156 ****
--- 153,177 ----
return SUCCESS;
}
+
+ message_t* nextMsg();
+ static void forward(message_t* msg);
+
+ event void SplitControl.startDone(error_t err) {
+ message_t* nextToSend;
+ if (err != SUCCESS) {return;}
+ nextToSend = nextMsg();
+ running = TRUE;
+ fwdbusy = FALSE;
+
+ if (nextToSend != NULL) {
+ forward(nextToSend);
+ }
+ }
+ event void SplitControl.stopDone(error_t err) {
+ if (err != SUCCESS) {return;}
+ running = FALSE;
+ }
/***********************************************************************
* Commands and events
***************
*** 164,167 ****
--- 185,191 ----
return FAIL;
}
+ if (running == FALSE) {
+ return EOFF;
+ }
call RouteSelect.initializeFields(pMsg);
***************
*** 242,247 ****
// Failures at the send level do not cause the seq. number space to be
// rolled back properly. This is somewhat broken.
! if (fwdbusy) {
! dbg("LQI", "%s forwarding busy, wait for later.\n", __FUNCTION__);
return;
}
--- 266,271 ----
// Failures at the send level do not cause the seq. number space to be
// rolled back properly. This is somewhat broken.
! if (fwdbusy || running == FALSE) {
! dbg("LQI", "%s forwarding busy or off, wait for later.\n", __FUNCTION__);
return;
}
***************
*** 256,261 ****
call AMPacket.destination(msg));
dbg("LQI", "%s: Send to %hu success.\n", __FUNCTION__, call AMPacket.destination(msg));
}
- fwdbusy = TRUE;
}
}
--- 280,285 ----
call AMPacket.destination(msg));
dbg("LQI", "%s: Send to %hu success.\n", __FUNCTION__, call AMPacket.destination(msg));
+ fwdbusy = TRUE;
}
}
}
***************
*** 366,370 ****
msg,
call SubPacket.payloadLength(msg)) == SUCCESS) {
! dbg("LQI", "Packet not acked, retransmit (%hhu) @%s:\n\t%s\n", my_fail_count, sim_time_string(), fields(msg));
call CollectionDebug.logEventMsg(NET_C_FE_SENDDONE_WAITACK,
call CollectionPacket.getSequenceNumber(msg),
--- 390,394 ----
msg,
call SubPacket.payloadLength(msg)) == SUCCESS) {
! dbg("LQI", "Local packet not acked, retransmit (%hhu) @%s:\n\t%s\n", my_fail_count, sim_time_string(), fields(msg));
call CollectionDebug.logEventMsg(NET_C_FE_SENDDONE_WAITACK,
call CollectionPacket.getSequenceNumber(msg),
***************
*** 378,383 ****
call CollectionPacket.getOrigin(msg),
call AMPacket.destination(msg));
! dbg("LQI", "Packet not acked, retransmit fail @%s:\n\t%s\n", sim_time_string(), fields(msg));
sendFailures++;
return;
}
--- 402,408 ----
call CollectionPacket.getOrigin(msg),
call AMPacket.destination(msg));
! dbg("LQI", "Local packet not acked, retransmit fail @%s:\n\t%s\n", sim_time_string(), fields(msg));
sendFailures++;
+ signal Send.sendDone(msg, FAIL);
return;
}
***************
*** 388,395 ****
call CollectionPacket.getOrigin(msg),
call AMPacket.destination(msg));
! dbg("LQI", "Packet failed:\t%s\n", fields(msg));
}
else if (call PacketAcknowledgements.wasAcked(msg)) {
! dbg("LQI", "Packet acked:\t%s\n", fields(msg));
call CollectionDebug.logEventMsg(NET_C_FE_SENT_MSG,
call CollectionPacket.getSequenceNumber(msg),
--- 413,420 ----
call CollectionPacket.getOrigin(msg),
call AMPacket.destination(msg));
! dbg("LQI", "Local packet failed:\t%s\n", fields(msg));
}
else if (call PacketAcknowledgements.wasAcked(msg)) {
! dbg("LQI", "Local packet acked:\t%s\n", fields(msg));
call CollectionDebug.logEventMsg(NET_C_FE_SENT_MSG,
call CollectionPacket.getSequenceNumber(msg),
***************
*** 399,402 ****
--- 424,428 ----
my_fail_count = 0;
+ dbg("LQI", "Local send done with success %d\n", success);
signal Send.sendDone(msg, success);
}
Index: MultiHopLqiP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/lqi/MultiHopLqiP.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MultiHopLqiP.nc 13 Apr 2007 00:10:48 -0000 1.3
--- MultiHopLqiP.nc 19 Feb 2008 19:50:21 -0000 1.4
***************
*** 114,120 ****
CollectionPacket = Forwarder;
RootControl = Router;
-
//CC2420.SubPacket -> DataSender;
Forwarder.RouteSelectCntl -> Router.RouteControl;
Forwarder.RouteSelect -> Router;
--- 114,120 ----
CollectionPacket = Forwarder;
RootControl = Router;
//CC2420.SubPacket -> DataSender;
+ Forwarder.SplitControl -> ActiveMessageC;
Forwarder.RouteSelectCntl -> Router.RouteControl;
Forwarder.RouteSelect -> Router;
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestMultihopLqi
CC2420ActiveMessageC.nc, 1.2, 1.3 Makefile, 1.1,
1.2 MultihopOscilloscope.h, 1.2,
1.3 MultihopOscilloscopeAppC.nc, 1.2,
1.3 MultihopOscilloscopeC.nc, 1.3, 1.4 script.py, 1.2, 1.3
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim
TossimPacketModelC.nc, 1.7, 1.8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list