[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/collection
ForwardingEngineP.nc, 1.1.2.45, 1.1.2.46
Rodrigo Fonseca
rfonseca76 at users.sourceforge.net
Tue Jun 27 13:44:16 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11896
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
ForwardingEngineP.nc
Log Message:
Added default CollectionDebug calls.
Changed logEventRoute to logEventMsg.
Index: ForwardingEngineP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/ForwardingEngineP.nc,v
retrieving revision 1.1.2.45
retrieving revision 1.1.2.46
diff -C2 -d -r1.1.2.45 -r1.1.2.46
*** ForwardingEngineP.nc 26 Jun 2006 22:55:33 -0000 1.1.2.45
--- ForwardingEngineP.nc 27 Jun 2006 20:44:14 -0000 1.1.2.46
***************
*** 494,498 ****
// Immediate retransmission is the worst thing to do.
dbg("Forwarder", "%s: send failed\n", __FUNCTION__);
! call CollectionDebug.logEventRoute(NET_C_FE_SENDDONE_FAIL,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
--- 494,498 ----
// Immediate retransmission is the worst thing to do.
dbg("Forwarder", "%s: send failed\n", __FUNCTION__);
! call CollectionDebug.logEventMsg(NET_C_FE_SENDDONE_FAIL,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
***************
*** 504,508 ****
if (--qe->retries) {
dbg("Forwarder", "%s: not acked\n", __FUNCTION__);
! call CollectionDebug.logEventRoute(NET_C_FE_SENDDONE_WAITACK,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
--- 504,508 ----
if (--qe->retries) {
dbg("Forwarder", "%s: not acked\n", __FUNCTION__);
! call CollectionDebug.logEventMsg(NET_C_FE_SENDDONE_WAITACK,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
***************
*** 514,518 ****
clientPtrs[qe->client] = qe;
signal Send.sendDone[qe->client](msg, FAIL);
! call CollectionDebug.logEventRoute(NET_C_FE_SENDDONE_FAIL_ACK_SEND,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
--- 514,518 ----
clientPtrs[qe->client] = qe;
signal Send.sendDone[qe->client](msg, FAIL);
! call CollectionDebug.logEventMsg(NET_C_FE_SENDDONE_FAIL_ACK_SEND,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
***************
*** 523,527 ****
if (call QEntryPool.put(qe) != SUCCESS)
call CollectionDebug.logEvent(NET_C_FE_PUT_QEPOOL_ERR);
! call CollectionDebug.logEventRoute(NET_C_FE_SENDDONE_FAIL_ACK_FWD,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
--- 523,527 ----
if (call QEntryPool.put(qe) != SUCCESS)
call CollectionDebug.logEvent(NET_C_FE_PUT_QEPOOL_ERR);
! call CollectionDebug.logEventMsg(NET_C_FE_SENDDONE_FAIL_ACK_FWD,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
***************
*** 538,542 ****
dbg("Forwarder", "%s: our packet for client %hhu, remove %p from queue\n",
__FUNCTION__, client, qe);
! call CollectionDebug.logEventRoute(NET_C_FE_SENT_MSG,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
--- 538,542 ----
dbg("Forwarder", "%s: our packet for client %hhu, remove %p from queue\n",
__FUNCTION__, client, qe);
! call CollectionDebug.logEventMsg(NET_C_FE_SENT_MSG,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
***************
*** 552,556 ****
// A successfully forwarded packet.
dbg("Forwarder,Route", "%s: successfully forwarded packet (client: %hhu), message pool is %hhu/%hhu.\n", __FUNCTION__, qe->client, call MessagePool.size(), call MessagePool.maxSize());
! call CollectionDebug.logEventRoute(NET_C_FE_FWD_MSG,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
--- 552,556 ----
// A successfully forwarded packet.
dbg("Forwarder,Route", "%s: successfully forwarded packet (client: %hhu), message pool is %hhu/%hhu.\n", __FUNCTION__, qe->client, call MessagePool.size(), call MessagePool.maxSize());
! call CollectionDebug.logEventMsg(NET_C_FE_FWD_MSG,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
***************
*** 679,683 ****
collectid = hdr->collectid;
! call CollectionDebug.logEventRoute(NET_C_FE_RCV_MSG,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
--- 679,683 ----
collectid = hdr->collectid;
! call CollectionDebug.logEventMsg(NET_C_FE_RCV_MSG,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
***************
*** 858,860 ****
--- 858,881 ----
dbg("Forwarder", "started rexmit timer in %hu ms\n", r);
}
+
+ /* 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 metric) {
+ return SUCCESS;
+ }
+
}
More information about the Tinyos-2-commits
mailing list