[Tinyos-beta-commits] CVS: tinyos-1.x/beta/SystemCore/MgmtQuery
MgmtQueryC.nc, 1.12, 1.13 MgmtQueryM.nc, 1.16, 1.17
Gilman Tolle
gtolle at users.sourceforge.net
Thu Oct 14 21:57:17 PDT 2004
Update of /cvsroot/tinyos/tinyos-1.x/beta/SystemCore/MgmtQuery
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9909
Modified Files:
MgmtQueryC.nc MgmtQueryM.nc
Log Message:
Queries are now sized according to the number of keys they contain
Index: MgmtQueryC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/SystemCore/MgmtQuery/MgmtQueryC.nc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** MgmtQueryC.nc 23 Aug 2004 23:19:49 -0000 1.12
--- MgmtQueryC.nc 15 Oct 2004 04:57:14 -0000 1.13
***************
*** 18,22 ****
TimerC,
RandomLFSR,
! NoLeds as Leds;
StdControl = MgmtQueryM;
--- 18,22 ----
TimerC,
RandomLFSR,
! LedsC as Leds;
StdControl = MgmtQueryM;
Index: MgmtQueryM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/SystemCore/MgmtQuery/MgmtQueryM.nc,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** MgmtQueryM.nc 26 Aug 2004 02:04:55 -0000 1.16
--- MgmtQueryM.nc 15 Oct 2004 04:57:14 -0000 1.17
***************
*** 40,46 ****
bool dripRebroadcasting;
- /*
- TOS_Msg msgBuf;
- */
bool msgBufBusy;
--- 40,43 ----
***************
*** 88,92 ****
query[qid].numAttrs = qBuf->numAttrs;
memcpy(&query[qid].attrs, qBuf->attrList,
! MAX_QUERY_ATTRS * sizeof(MgmtAttrID));
query[qid].epochCounter = call Random.rand() % qBuf->epochLength;
query[qid].seqno = 0;
--- 85,90 ----
query[qid].numAttrs = qBuf->numAttrs;
memcpy(&query[qid].attrs, qBuf->attrList,
! (qBuf->numAttrs <= MAX_QUERY_ATTRS ?
! qBuf->numAttrs : MAX_QUERY_ATTRS ) * sizeof(MgmtAttrID));
query[qid].epochCounter = call Random.rand() % qBuf->epochLength;
query[qid].seqno = 0;
***************
*** 102,106 ****
dripQuery->numAttrs = query[dripQueryID].numAttrs;
memcpy(&dripQuery->attrList, &query[dripQueryID].attrs,
! MAX_QUERY_ATTRS * sizeof(MgmtAttrID));
switch(dripQueryID) {
--- 100,106 ----
dripQuery->numAttrs = query[dripQueryID].numAttrs;
memcpy(&dripQuery->attrList, &query[dripQueryID].attrs,
! (dripQuery->numAttrs <= MAX_QUERY_ATTRS
! ? dripQuery->numAttrs : MAX_QUERY_ATTRS )
! * sizeof(MgmtAttrID));
switch(dripQueryID) {
***************
*** 109,113 ****
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! MAX_QUERY_ATTRS * sizeof(MgmtAttrID));
break;
case 1:
--- 109,115 ----
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! (dripQuery->numAttrs <= MAX_QUERY_ATTRS
! ? dripQuery->numAttrs : MAX_QUERY_ATTRS )
! * sizeof(MgmtAttrID));
break;
case 1:
***************
*** 115,119 ****
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! MAX_QUERY_ATTRS * sizeof(MgmtAttrID));
break;
case 2:
--- 117,123 ----
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! (dripQuery->numAttrs <= MAX_QUERY_ATTRS
! ? dripQuery->numAttrs : MAX_QUERY_ATTRS )
! * sizeof(MgmtAttrID));
break;
case 2:
***************
*** 121,125 ****
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! MAX_QUERY_ATTRS * sizeof(MgmtAttrID));
break;
case 3:
--- 125,131 ----
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! (dripQuery->numAttrs <= MAX_QUERY_ATTRS
! ? dripQuery->numAttrs : MAX_QUERY_ATTRS )
! * sizeof(MgmtAttrID));
break;
case 3:
***************
*** 127,131 ****
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! MAX_QUERY_ATTRS * sizeof(MgmtAttrID));
break;
}
--- 133,139 ----
(uint8_t *)dripQuery,
offsetof(MgmtQueryMsg, attrList) +
! (dripQuery->numAttrs <= MAX_QUERY_ATTRS
! ? dripQuery->numAttrs : MAX_QUERY_ATTRS )
! * sizeof(MgmtAttrID));
break;
}
***************
*** 226,230 ****
return SUCCESS;
msgBufBusy = TRUE;
!
response->qid = qid+1;
response->seqno = curQuery->seqno;
--- 234,240 ----
return SUCCESS;
msgBufBusy = TRUE;
!
! call Leds.redOn();
!
response->qid = qid+1;
response->seqno = curQuery->seqno;
***************
*** 287,293 ****
uint8_t *resultBuf) {
/*
! This is where I should figure out which query is currently active,
! unset the lock bit for the attribute, see if they are all cleared, and then
! send it.
Fill the buffer quickly, please. Other queries may be waiting.
--- 297,303 ----
uint8_t *resultBuf) {
/*
! This is where I should figure out which query is currently
! active, unset the lock bit for the attribute, see if they are
! all cleared, and then send it.
Fill the buffer quickly, please. Other queries may be waiting.
***************
*** 338,341 ****
--- 348,352 ----
call SharedMsgBuf.unlock();
msgBufBusy = FALSE;
+ call Leds.redOff();
}
return SUCCESS;
More information about the Tinyos-beta-commits
mailing list