[Tinyos-commits] CVS: tinyos-1.x/tos/lib/Deluge DelugeM.nc, 1.53,
1.54 DelugePageTransferM.nc, 1.30, 1.31
Jonathan Hui
jwhui at users.sourceforge.net
Wed Aug 17 16:36:37 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/Deluge
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19153
Modified Files:
DelugeM.nc DelugePageTransferM.nc
Log Message:
- Don't accept messages with image number greater than what is
supported. Comes up when running nodes with different number of
images.
Index: DelugeM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/Deluge/DelugeM.nc,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** DelugeM.nc 28 Jul 2005 19:06:56 -0000 1.53
--- DelugeM.nc 17 Aug 2005 23:36:34 -0000 1.54
***************
*** 65,68 ****
--- 65,69 ----
uint8_t rebootDelay;
uint8_t curImage;
+ bool imagesLoaded;
DelugeAdvTimer advTimers[DELUGE_NUM_TIMERS];
***************
*** 187,190 ****
--- 188,192 ----
if ( state == S_STARTED )
realStart();
+ imagesLoaded = TRUE;
return SUCCESS;
}
***************
*** 203,207 ****
pMsg->sourceAddr = TOS_LOCAL_ADDRESS;
pMsg->version = DELUGE_VERSION;
! pMsg->type = (state == S_STARTED) ? DELUGE_ADV_NORMAL : DELUGE_ADV_ERROR;
memcpy(&pMsg->nodeDesc, &nodeDesc, sizeof(DelugeNodeDesc));
memcpy(&pMsg->imgDesc, imgDesc, sizeof(DelugeImgDesc));
--- 205,209 ----
pMsg->sourceAddr = TOS_LOCAL_ADDRESS;
pMsg->version = DELUGE_VERSION;
! pMsg->type = (imagesLoaded) ? DELUGE_ADV_NORMAL : DELUGE_ADV_ERROR;
memcpy(&pMsg->nodeDesc, &nodeDesc, sizeof(DelugeNodeDesc));
memcpy(&pMsg->imgDesc, imgDesc, sizeof(DelugeImgDesc));
***************
*** 266,270 ****
if ( rxAdvMsg->version != DELUGE_VERSION
! || !isNodeDescValid(&rxAdvMsg->nodeDesc) )
return pMsg;
--- 268,273 ----
if ( rxAdvMsg->version != DELUGE_VERSION
! || !isNodeDescValid(&rxAdvMsg->nodeDesc)
! || imgNum >= DELUGE_NUM_IMAGES )
return pMsg;
Index: DelugePageTransferM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tos/lib/Deluge/DelugePageTransferM.nc,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** DelugePageTransferM.nc 22 Jul 2005 17:40:07 -0000 1.30
--- DelugePageTransferM.nc 17 Aug 2005 23:36:34 -0000 1.31
***************
*** 217,221 ****
DelugeDataMsg* rxDataMsg = (DelugeDataMsg*)pMsg->data;
! if (state == S_DISABLED)
return pMsg;
--- 217,222 ----
DelugeDataMsg* rxDataMsg = (DelugeDataMsg*)pMsg->data;
! if ( state == S_DISABLED
! || rxDataMsg->imgNum >= DELUGE_NUM_IMAGES )
return pMsg;
***************
*** 301,305 ****
rxReqMsg->dest, rxReqMsg->vNum, rxReqMsg->imgNum, rxReqMsg->pgNum, rxReqMsg->requestedPkts[0]);
! if (state == S_DISABLED)
return pMsg;
--- 302,307 ----
rxReqMsg->dest, rxReqMsg->vNum, rxReqMsg->imgNum, rxReqMsg->pgNum, rxReqMsg->requestedPkts[0]);
! if ( state == S_DISABLED
! || rxReqMsg->imgNum >= DELUGE_NUM_IMAGES )
return pMsg;
More information about the Tinyos-commits
mailing list