[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/collection
ForwardingEngineP.nc, 1.1.2.17, 1.1.2.18 TreeCollectionC.nc,
1.1.2.15, 1.1.2.16 TreeRoutingEngineP.nc, 1.1.2.10, 1.1.2.11
Rodrigo Fonseca
rfonseca76 at users.sourceforge.net
Wed Jun 14 14:52:58 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5468
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
ForwardingEngineP.nc TreeCollectionC.nc TreeRoutingEngineP.nc
Log Message:
Changes to Uart Logging.
Index: ForwardingEngineP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/ForwardingEngineP.nc,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -C2 -d -r1.1.2.17 -r1.1.2.18
*** ForwardingEngineP.nc 14 Jun 2006 18:57:44 -0000 1.1.2.17
--- ForwardingEngineP.nc 14 Jun 2006 21:52:56 -0000 1.1.2.18
***************
*** 44,52 ****
uses {
interface AMSend as SubSend;
- interface AMSend as DebugSend;
interface Receive as SubReceive;
interface Receive as SubSnoop;
interface Packet as SubPacket;
- interface Packet as DebugPacket;
interface UnicastNameFreeRouting;
interface SplitControl as RadioControl;
--- 44,50 ----
***************
*** 60,63 ****
--- 58,62 ----
interface CollectionId[uint8_t client];
interface AMPacket;
+ interface CollectionDebug;
}
}
***************
*** 83,87 ****
/* Keeps track of whether we are currently sending to the UART a
* debug message. */
- bool debugSendBusy = FALSE;
enum {
--- 82,85 ----
***************
*** 95,101 ****
message_t* loopbackMsgPtr;
- message_t debugMsg;
- CollectionDebugMsg *cdb; // pointer to the payload of the debug msg
-
command error_t Init.init() {
int i;
--- 93,96 ----
***************
*** 105,109 ****
}
loopbackMsgPtr = &loopbackMsg;
- cdb = (CollectionDebugMsg *)call DebugPacket.getPayload(&debugMsg, NULL);
return SUCCESS;
}
--- 100,103 ----
***************
*** 185,194 ****
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_SEND_QUEUE_FULL;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
// Return the pool entry, as it's not for me...
--- 179,183 ----
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_SEND_QUEUE_FULL);
// Return the pool entry, as it's not for me...
***************
*** 228,237 ****
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_NO_ROUTE;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
return;
--- 217,221 ----
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_NO_ROUTE);
return;
***************
*** 278,287 ****
dbg("Forwarder", "%s: subsend failed from EOFF.\n", __FUNCTION__);
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_SUBSEND_OFF;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
}
else if (eval == EBUSY) {
--- 262,266 ----
dbg("Forwarder", "%s: subsend failed from EOFF.\n", __FUNCTION__);
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_SUBSEND_OFF);
}
else if (eval == EBUSY) {
***************
*** 293,302 ****
dbg("Forwarder", "%s: subsend failed from EBUSY.\n", __FUNCTION__);
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_SUBSEND_BUSY;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
}
}
--- 272,276 ----
dbg("Forwarder", "%s: subsend failed from EBUSY.\n", __FUNCTION__);
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_SUBSEND_BUSY);
}
}
***************
*** 305,318 ****
void sendDoneBug() {
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_BAD_SENDDONE;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
! }
!
! event void DebugSend.sendDone(message_t *msg, error_t error) {
! debugSendBusy = FALSE;
}
--- 279,283 ----
void sendDoneBug() {
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_BAD_SENDDONE);
}
***************
*** 378,387 ****
dbg("Route", "%s cannot forward, message pool empty.\n", __FUNCTION__);
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_MSG_POOL_EMPTY;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
}
else if (call QEntryPool.empty()) {
--- 343,347 ----
dbg("Route", "%s cannot forward, message pool empty.\n", __FUNCTION__);
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_MSG_POOL_EMPTY);
}
else if (call QEntryPool.empty()) {
***************
*** 389,398 ****
__FUNCTION__);
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_QENTRY_POOL_EMPTY;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
}
else {
--- 349,353 ----
__FUNCTION__);
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_QENTRY_POOL_EMPTY);
}
else {
***************
*** 419,428 ****
// send a debug message to the uart
! if (!debugSendBusy) {
! memset(cdb, 0, sizeof(CollectionDebugMsg));
! cdb->type = NET_C_FE_SEND_QUEUE_FULL;
! debugSendBusy = (call DebugSend.send(0xffff, &debugMsg,
! sizeof(CollectionDebugMsg)) == SUCCESS);
! }
// We'll have to drop the packet on the floor: not enough
--- 374,378 ----
// send a debug message to the uart
! call CollectionDebug.logEvent(NET_C_FE_SEND_QUEUE_FULL);
// We'll have to drop the packet on the floor: not enough
Index: TreeCollectionC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/TreeCollectionC.nc,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -C2 -d -r1.1.2.15 -r1.1.2.16
*** TreeCollectionC.nc 14 Jun 2006 20:53:16 -0000 1.1.2.15
--- TreeCollectionC.nc 14 Jun 2006 21:52:56 -0000 1.1.2.16
***************
*** 55,59 ****
components new AMSenderC(AM_COLLECTION_DATA);
- components new SerialAMSenderC(AM_COLLECTION_DEBUG);
components new AMReceiverC(AM_COLLECTION_DATA);
components new AMSnooperC(AM_COLLECTION_DATA);
--- 55,58 ----
***************
*** 72,75 ****
--- 71,75 ----
Router.BeaconTimer -> RoutingBeaconTimer;
Router.CollectionDebug = CollectionDebug;
+ Forwarder.CollectionDebug = CollectionDebug;
TreeRoutingInspect = Router;
***************
*** 83,91 ****
MainC.SoftwareInit -> Forwarder;
Forwarder.SubSend -> AMSenderC;
- Forwarder.DebugSend -> SerialAMSenderC;
Forwarder.SubReceive -> AMReceiverC;
Forwarder.SubSnoop -> AMSnooperC;
Forwarder.SubPacket -> AMSenderC;
- Forwarder.DebugPacket -> SerialAMSenderC;
Forwarder.RootControl -> Router;
Forwarder.UnicastNameFreeRouting -> Router.Routing;
--- 83,89 ----
Index: TreeRoutingEngineP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/TreeRoutingEngineP.nc,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** TreeRoutingEngineP.nc 14 Jun 2006 20:53:16 -0000 1.1.2.10
--- TreeRoutingEngineP.nc 14 Jun 2006 21:52:56 -0000 1.1.2.11
***************
*** 297,301 ****
nextInt = call Random.rand16() % BEACON_INTERVAL;
nextInt += BEACON_INTERVAL >> 1;
- call CollectionDebug.logEvent(NET_C_TREE_ROUTE_INFO);
call BeaconTimer.startOneShot(nextInt);
post updateRouteTask();
--- 297,300 ----
More information about the Tinyos-2-commits
mailing list