[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/collection Cache.nc,
1.1.2.1, 1.1.2.2 CacheC.nc, 1.1.2.1, 1.1.2.2 CacheP.nc,
1.1.2.1, 1.1.2.2 ForwardingEngineP.nc, 1.1.2.32,
1.1.2.33 QueueC.nc, 1.1.2.6, 1.1.2.7 TreeCollectionC.nc,
1.1.2.18, 1.1.2.19
Rodrigo Fonseca
rfonseca76 at users.sourceforge.net
Thu Jun 22 07:09:49 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31607
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
Cache.nc CacheC.nc CacheP.nc ForwardingEngineP.nc QueueC.nc
TreeCollectionC.nc
Log Message:
Changes compile
Index: Cache.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/Cache.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Cache.nc 22 Jun 2006 13:45:39 -0000 1.1.2.1
--- Cache.nc 22 Jun 2006 14:09:47 -0000 1.1.2.2
***************
*** 9,13 ****
/* Returns true if item is in the cache, false otherwise */
command bool lookup(t item);
! command errot_t remove(t item);
}
--- 9,13 ----
/* Returns true if item is in the cache, false otherwise */
command bool lookup(t item);
! command error_t remove(t item);
}
Index: CacheC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/CacheC.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** CacheC.nc 22 Jun 2006 13:45:39 -0000 1.1.2.1
--- CacheC.nc 22 Jun 2006 14:09:47 -0000 1.1.2.2
***************
*** 1,8 ****
! generic configuration CacheC(typedef key_t, uint8_t CACHE_SIZE) {
provides interface Cache<key_t>;
}
implementation {
components MainC, new CacheP(key_t, CACHE_SIZE);
!
MainC.SoftwareInit -> CacheP;
}
--- 1,9 ----
! generic configuration CacheC(typedef key_t @integer(), uint8_t CACHE_SIZE) {
provides interface Cache<key_t>;
}
implementation {
components MainC, new CacheP(key_t, CACHE_SIZE);
!
! Cache = CacheP;
MainC.SoftwareInit -> CacheP;
}
Index: CacheP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/CacheP.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** CacheP.nc 22 Jun 2006 13:45:39 -0000 1.1.2.1
--- CacheP.nc 22 Jun 2006 14:09:47 -0000 1.1.2.2
***************
*** 3,10 ****
* Insert on an element already in the cache will refresh its age.
*/
! generic module CacheP(typedef key_t, uint8_t size) {
provides {
interface Init;
! interface Cache<key_t>
}
}
--- 3,10 ----
* Insert on an element already in the cache will refresh its age.
*/
! generic module CacheP(typedef key_t @integer(), uint8_t size) {
provides {
interface Init;
! interface Cache<key_t>;
}
}
***************
*** 36,41 ****
uint8_t lookup(key_t key) {
uint8_t i;
for (i = 0; i < count; i++) {
! if (cache[(i + first) % size] == key)
break;
}
--- 36,43 ----
uint8_t lookup(key_t key) {
uint8_t i;
+ key_t k;
for (i = 0; i < count; i++) {
! k = cache[(i + first) % size];
! if (k == key)
break;
}
Index: ForwardingEngineP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/ForwardingEngineP.nc,v
retrieving revision 1.1.2.32
retrieving revision 1.1.2.33
diff -C2 -d -r1.1.2.32 -r1.1.2.33
*** ForwardingEngineP.nc 22 Jun 2006 13:43:28 -0000 1.1.2.32
--- ForwardingEngineP.nc 22 Jun 2006 14:09:47 -0000 1.1.2.33
***************
*** 372,376 ****
call CollectionDebug.logEventRoute(NET_C_FE_FWD_MSG, error, TOS_NODE_ID,
call AMPacket.destination(msg));
! call SentCache.insert(CollectionPacket.getPacketID(qe->msg));
call SendQueue.dequeue();
call MessagePool.put(qe->msg);
--- 372,376 ----
call CollectionDebug.logEventRoute(NET_C_FE_FWD_MSG, error, TOS_NODE_ID,
call AMPacket.destination(msg));
! call SentCache.insert(call CollectionPacket.getPacketID(qe->msg));
call SendQueue.dequeue();
call MessagePool.put(qe->msg);
***************
*** 437,443 ****
bool duplicate = FALSE;
fe_queue_entry_t* qe;
! msg_uid = CollectionPacket.getPacketID(msg);
collectid = hdr->collectid;
--- 437,444 ----
bool duplicate = FALSE;
fe_queue_entry_t* qe;
+ uint8_t i;
! msg_uid = call CollectionPacket.getPacketID(msg);
collectid = hdr->collectid;
***************
*** 454,459 ****
}
//... and in the queue for duplicates
! for (i = call Queue.size(); --i ;) {
! qe = call Queue.element(i);
if (call CollectionPacket.getPacketID(qe->msg) == msg_uid) {
duplicate = TRUE;
--- 455,460 ----
}
//... and in the queue for duplicates
! for (i = call SendQueue.size(); --i ;) {
! qe = call SendQueue.element(i);
if (call CollectionPacket.getPacketID(qe->msg) == msg_uid) {
duplicate = TRUE;
***************
*** 562,571 ****
}
! command uint8_t getSequenceNumber(message_t* msg) {
return getHeader(msg)->seqno;
}
! command void setSequenceNumber(message_t* msg, uint8_t seqno) {
! getHeader(msg)->seqno = seqno;
}
--- 563,572 ----
}
! command uint8_t CollectionPacket.getSequenceNumber(message_t* msg) {
return getHeader(msg)->seqno;
}
! command void CollectionPacket.setSequenceNumber(message_t* msg, uint8_t _seqno) {
! getHeader(msg)->seqno = _seqno;
}
Index: QueueC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/QueueC.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** QueueC.nc 22 Jun 2006 13:43:28 -0000 1.1.2.6
--- QueueC.nc 22 Jun 2006 14:09:47 -0000 1.1.2.7
***************
*** 99,103 ****
}
! command t Queue.element(uint8_t index) {
index += head;
index %= QUEUE_SIZE;
--- 99,103 ----
}
! command queue_t Queue.element(uint8_t index) {
index += head;
index %= QUEUE_SIZE;
Index: TreeCollectionC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/collection/Attic/TreeCollectionC.nc,v
retrieving revision 1.1.2.18
retrieving revision 1.1.2.19
diff -C2 -d -r1.1.2.18 -r1.1.2.19
*** TreeCollectionC.nc 20 Jun 2006 21:16:28 -0000 1.1.2.18
--- TreeCollectionC.nc 22 Jun 2006 14:09:47 -0000 1.1.2.19
***************
*** 28,31 ****
--- 28,32 ----
TREE_ROUTING_TABLE_SIZE = 10,
QUEUE_SIZE = CLIENT_COUNT + FORWARD_COUNT,
+ CACHE_SIZE = 4,
};
***************
*** 51,54 ****
--- 52,58 ----
Forwarder.SendQueue -> SendQueueP;
+ components new CacheC(uint32_t, CACHE_SIZE) as SentCacheP;
+ Forwarder.SentCache -> SentCacheP;
+
components new TimerMilliC() as RoutingBeaconTimer;
components LinkEstimatorP as Estimator;
More information about the Tinyos-2-commits
mailing list