[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Drip Drip.h, 1.6,
1.7 Drip.nc, 1.3, 1.4 DripM.nc, 1.9, 1.10 DripState.nc, 1.3,
1.4 DripStateM.nc, 1.7, 1.8
Kamin Whitehouse
kaminw at users.sourceforge.net
Wed Oct 26 19:08:24 PDT 2005
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/teps/txt tep106.txt, 1.12,
1.13 tep110.txt, 1.3, 1.4 tep111.txt, 1.1, 1.2 tep112.txt, 1.4, 1.5
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/teps/txt tep1.txt, 1.5,
1.6 tep101.txt, 1.16, 1.17 tep102.txt, 1.16, 1.17 tep106.txt,
1.13, 1.14 tep107.txt, 1.7, 1.8 tep108.txt, 1.6,
1.7 tep109.txt, 1.6, 1.7 tep110.txt, 1.4, 1.5 tep111.txt, 1.2,
1.3 tep112.txt, 1.5, 1.6 tep113.txt, 1.1, 1.2 tep3.txt, 1.11, 1.12
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/beta/Drip
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31345
Modified Files:
Drip.h Drip.nc DripM.nc DripState.nc DripStateM.nc
Log Message:
changed the drip seqNo to 16 bits to reduce the chances of infinite seqNo loops.
Index: Drip.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/Drip.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Drip.h 19 Aug 2005 06:22:44 -0000 1.6
--- Drip.h 27 Oct 2005 02:08:22 -0000 1.7
***************
*** 51,55 ****
typedef struct DripMetadata {
uint8_t id;
! uint8_t seqno;
} DripMetadata;
--- 51,56 ----
typedef struct DripMetadata {
uint8_t id;
! uint8_t dummyAlignmentByte; //this byte can go away if you maintain alignment
! uint16_t seqno;
} DripMetadata;
***************
*** 62,66 ****
DRIP_INVALID_KEY = 0,
DRIP_CACHE_ENTRIES = uniqueCount("DripState"),
! DRIP_SEQNO_OLDEST = 0xfe, // not ff, because both oldest and newest should have the least significant bit unset.
DRIP_SEQNO_NEWEST = 0,
--- 63,67 ----
DRIP_INVALID_KEY = 0,
DRIP_CACHE_ENTRIES = uniqueCount("DripState"),
! DRIP_SEQNO_OLDEST = 0xfffe, // not ffff, because both oldest and newest should have the least significant bit unset.
DRIP_SEQNO_NEWEST = 0,
Index: Drip.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/Drip.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Drip.nc 14 Jun 2005 18:19:35 -0000 1.3
--- Drip.nc 27 Oct 2005 02:08:22 -0000 1.4
***************
*** 53,57 ****
* copy.
*/
! command result_t setSeqno(uint8_t seqno);
/**
--- 53,57 ----
* copy.
*/
! command result_t setSeqno(uint16_t seqno);
/**
Index: DripM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/DripM.nc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DripM.nc 27 Aug 2005 01:29:23 -0000 1.9
--- DripM.nc 27 Oct 2005 02:08:22 -0000 1.10
***************
*** 81,85 ****
}
! command result_t Drip.setSeqno[uint8_t id](uint8_t seqno) {
return call DripState.setSeqno[id](seqno);
}
--- 81,85 ----
}
! command result_t Drip.setSeqno[uint8_t id](uint16_t seqno) {
return call DripState.setSeqno[id](seqno);
}
***************
*** 181,186 ****
DripMsg *dripMsg = (DripMsg*) pMsg->data;
! // dbg(DBG_USR1, "Received msg(id=%d, seqno=%d)\n",
! // dripMsg->metadata.id, dripMsg->metadata.seqno);
if (call DripState.newMsg[dripMsg->metadata.id](dripMsg->metadata)) {
--- 181,186 ----
DripMsg *dripMsg = (DripMsg*) pMsg->data;
! dbg(DBG_USR1, "Received msg(id=%d, seqno=%d)\n",
! dripMsg->metadata.id, dripMsg->metadata.seqno);
if (call DripState.newMsg[dripMsg->metadata.id](dripMsg->metadata)) {
***************
*** 211,219 ****
}
! default command uint8_t DripState.getSeqno[uint8_t localKey]() {
return DRIP_SEQNO_OLDEST;
}
! default command uint8_t DripState.incrementSeqno[uint8_t localKey]() {
return FAIL;
}
--- 211,219 ----
}
! default command uint16_t DripState.getSeqno[uint8_t localKey]() {
return DRIP_SEQNO_OLDEST;
}
! default command result_t DripState.incrementSeqno[uint8_t localKey]() {
return FAIL;
}
Index: DripState.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/DripState.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DripState.nc 14 Jun 2005 18:19:35 -0000 1.3
--- DripState.nc 27 Oct 2005 02:08:22 -0000 1.4
***************
*** 43,48 ****
command result_t init(uint8_t globalKey);
! command uint8_t getSeqno();
! command result_t setSeqno(uint8_t seqno);
command result_t incrementSeqno();
--- 43,48 ----
command result_t init(uint8_t globalKey);
! command uint16_t getSeqno();
! command result_t setSeqno(uint16_t seqno);
command result_t incrementSeqno();
Index: DripStateM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/DripStateM.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DripStateM.nc 19 Aug 2005 06:22:45 -0000 1.7
--- DripStateM.nc 27 Oct 2005 02:08:22 -0000 1.8
***************
*** 74,78 ****
}
! command uint8_t DripState.getSeqno[uint8_t localKey]() {
DripCacheEntry *dripEntry = &dripCache[localKey];
--- 74,78 ----
}
! command uint16_t DripState.getSeqno[uint8_t localKey]() {
DripCacheEntry *dripEntry = &dripCache[localKey];
***************
*** 80,87 ****
}
! command result_t DripState.setSeqno[uint8_t localKey](uint8_t seqno) {
DripCacheEntry *dripEntry = &dripCache[localKey];
! uint8_t trueSeqno = seqno & ~DRIP_WAKEUP_BIT;
if (trueSeqno != DRIP_SEQNO_OLDEST && trueSeqno != DRIP_SEQNO_NEWEST) {
--- 80,87 ----
}
! command result_t DripState.setSeqno[uint8_t localKey](uint16_t seqno) {
DripCacheEntry *dripEntry = &dripCache[localKey];
! uint16_t trueSeqno = seqno & ~DRIP_WAKEUP_BIT;
if (trueSeqno != DRIP_SEQNO_OLDEST && trueSeqno != DRIP_SEQNO_NEWEST) {
***************
*** 133,139 ****
DripCacheEntry *dripEntry = &dripCache[localKey];
! uint8_t incomingSeqno = incomingMetadata.seqno & ~DRIP_WAKEUP_BIT;
! uint8_t currentSeqno = dripEntry->metadata.seqno & ~DRIP_WAKEUP_BIT;
if ((currentSeqno == DRIP_SEQNO_UNKNOWN &&
incomingSeqno != DRIP_SEQNO_UNKNOWN &&
--- 133,141 ----
DripCacheEntry *dripEntry = &dripCache[localKey];
! uint16_t incomingSeqno = incomingMetadata.seqno & ~DRIP_WAKEUP_BIT;
! uint16_t currentSeqno = dripEntry->metadata.seqno & ~DRIP_WAKEUP_BIT;
+ dbg(DBG_USR1,"DripState received: currentSeqNo=%d, incomingSeqNo=%d\n",currentSeqno, incomingSeqno);
+
if ((currentSeqno == DRIP_SEQNO_UNKNOWN &&
incomingSeqno != DRIP_SEQNO_UNKNOWN &&
***************
*** 142,150 ****
incomingSeqno != DRIP_SEQNO_UNKNOWN &&
incomingSeqno != DRIP_SEQNO_OLDEST &&
! ((int8_t)(incomingSeqno - currentSeqno) > 0 ||
incomingSeqno == DRIP_SEQNO_NEWEST))) {
!
/* my entry is older. save new data. */
!
if (incomingSeqno == DRIP_SEQNO_NEWEST) {
/* It's coming in from outside, and does not know the seqno.
--- 144,152 ----
incomingSeqno != DRIP_SEQNO_UNKNOWN &&
incomingSeqno != DRIP_SEQNO_OLDEST &&
! ((int16_t)(incomingSeqno - currentSeqno) > 0 ||
incomingSeqno == DRIP_SEQNO_NEWEST))) {
!
/* my entry is older. save new data. */
!
if (incomingSeqno == DRIP_SEQNO_NEWEST) {
/* It's coming in from outside, and does not know the seqno.
***************
*** 171,175 ****
return TRUE;
! } else if (((int8_t)(incomingSeqno - currentSeqno) == 0) &&
incomingSeqno != DRIP_SEQNO_OLDEST) {
--- 173,177 ----
return TRUE;
! } else if (((int16_t)(incomingSeqno - currentSeqno) == 0) &&
incomingSeqno != DRIP_SEQNO_OLDEST) {
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/teps/txt tep106.txt, 1.12,
1.13 tep110.txt, 1.3, 1.4 tep111.txt, 1.1, 1.2 tep112.txt, 1.4, 1.5
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/teps/txt tep1.txt, 1.5,
1.6 tep101.txt, 1.16, 1.17 tep102.txt, 1.16, 1.17 tep106.txt,
1.13, 1.14 tep107.txt, 1.7, 1.8 tep108.txt, 1.6,
1.7 tep109.txt, 1.6, 1.7 tep110.txt, 1.4, 1.5 tep111.txt, 1.2,
1.3 tep112.txt, 1.5, 1.6 tep113.txt, 1.1, 1.2 tep3.txt, 1.11, 1.12
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-beta-commits
mailing list