[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/Deluge/FlashVolumeManager FlashVolumeManager.h, 1.1, 1.2 FlashVolumeManagerC.nc, 1.3, 1.4 FlashVolumeManagerP.nc, 1.3, 1.4

Razvan Musaloiu-E. razvanm at users.sourceforge.net
Mon Jul 9 18:17:42 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/Deluge/FlashVolumeManager
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26582/tos/lib/net/Deluge/FlashVolumeManager

Modified Files:
	FlashVolumeManager.h FlashVolumeManagerC.nc 
	FlashVolumeManagerP.nc 
Log Message:
This commit from Chieh-Jan (Mike) Liang fixes the following issues:
- Add a new command to reprogram the network (instead of motes automatically reprogram after they receive an image).
- Update the documentation to reflect the new command.
- Add README.txt files for the examples.


Index: FlashVolumeManager.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManager.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FlashVolumeManager.h	22 May 2007 20:34:23 -0000	1.1
--- FlashVolumeManager.h	10 Jul 2007 01:17:40 -0000	1.2
***************
*** 28,38 ****
  #define FLASHVOLUMEMANAGER_H
  
! #define SERIALMSG_ERASE  0
! #define SERIALMSG_WRITE  1
! #define SERIALMSG_READ   2
! #define SERIALMSG_CRC    3
! #define SERIALMSG_ADDR   4
! #define SERIALMSG_REPROG 5
! #define SERIALMSG_DISS   6
  
  typedef nx_struct SerialReqPacket {
--- 28,39 ----
  #define FLASHVOLUMEMANAGER_H
  
! #define SERIALMSG_ERASE     0
! #define SERIALMSG_WRITE     1
! #define SERIALMSG_READ      2
! #define SERIALMSG_CRC       3
! #define SERIALMSG_ADDR      4
! #define SERIALMSG_REPROG    5
! #define SERIALMSG_DISS      6
! #define SERIALMSG_REPROG_BS 7
  
  typedef nx_struct SerialReqPacket {

Index: FlashVolumeManagerC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerC.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FlashVolumeManagerC.nc	27 Jun 2007 20:04:57 -0000	1.3
--- FlashVolumeManagerC.nc	10 Jul 2007 01:17:40 -0000	1.4
***************
*** 31,35 ****
  {
  #ifdef DELUGE  
!   provides interface Notify<uint8_t>;
  #endif
    uses {
--- 31,36 ----
  {
  #ifdef DELUGE  
!   provides interface Notify<uint8_t> as DissNotify;
!   provides interface Notify<uint8_t> as ReprogNotify;
  #endif
    uses {
***************
*** 64,68 ****
    FlashVolumeManagerP.DelugeStorage[VOLUME_DELUGE0] = DelugeStorage[VOLUME_DELUGE0];
    FlashVolumeManagerP.DelugeStorage[VOLUME_DELUGE1] = DelugeStorage[VOLUME_DELUGE1];
!   Notify = FlashVolumeManagerP.Notify;
  #endif
  }
--- 65,70 ----
    FlashVolumeManagerP.DelugeStorage[VOLUME_DELUGE0] = DelugeStorage[VOLUME_DELUGE0];
    FlashVolumeManagerP.DelugeStorage[VOLUME_DELUGE1] = DelugeStorage[VOLUME_DELUGE1];
!   DissNotify = FlashVolumeManagerP.DissNotify;
!   ReprogNotify = FlashVolumeManagerP.ReprogNotify;
  #endif
  }

Index: FlashVolumeManagerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FlashVolumeManagerP.nc	27 Jun 2007 20:04:57 -0000	1.3
--- FlashVolumeManagerP.nc	10 Jul 2007 01:17:40 -0000	1.4
***************
*** 30,34 ****
  {
  #ifdef DELUGE
!   provides interface Notify<uint8_t>;
  #endif
    uses {
--- 30,37 ----
  {
  #ifdef DELUGE
!   provides {
!     interface Notify<uint8_t> as DissNotify;
!     interface Notify<uint8_t> as ReprogNotify;
!   }
  #endif
    uses {
***************
*** 184,188 ****
            sendReply(SUCCESS, sizeof(SerialReplyPacket) + 4);
            break;
!         case SERIALMSG_REPROG:   // === Reboots and reprograms ===
            state = S_REPROG;
            sendReply(SUCCESS, sizeof(SerialReplyPacket));
--- 187,191 ----
            sendReply(SUCCESS, sizeof(SerialReplyPacket) + 4);
            break;
!         case SERIALMSG_REPROG_BS:   // === Reprograms only the base station ===
            state = S_REPROG;
            sendReply(SUCCESS, sizeof(SerialReplyPacket));
***************
*** 191,195 ****
            break;
          case SERIALMSG_DISS:     // === Starts disseminating a volume ===
!           signal Notify.notify(img_num);   // Notifies Deluge to start disseminate
            sendReply(SUCCESS, sizeof(SerialReplyPacket));
            break;
--- 194,202 ----
            break;
          case SERIALMSG_DISS:     // === Starts disseminating a volume ===
!           signal DissNotify.notify(img_num);   // Notifies Deluge to start disseminate
!           sendReply(SUCCESS, sizeof(SerialReplyPacket));
!           break;
!         case SERIALMSG_REPROG:   // === Reprograms the network (except the base station) ===
!           signal ReprogNotify.notify(img_num);
            sendReply(SUCCESS, sizeof(SerialReplyPacket));
            break;
***************
*** 216,221 ****
    }
    
!   command error_t Notify.enable() { return SUCCESS; }
!   command error_t Notify.disable() { return SUCCESS; }
    
    default command storage_addr_t DelugeStorage.getPhysicalAddress[uint8_t img_num](storage_addr_t addr) { return 0; }
--- 223,230 ----
    }
    
!   command error_t DissNotify.enable() { return SUCCESS; }
!   command error_t DissNotify.disable() { return SUCCESS; }
!   command error_t ReprogNotify.enable() { return SUCCESS; }
!   command error_t ReprogNotify.disable() { return SUCCESS; }
    
    default command storage_addr_t DelugeStorage.getPhysicalAddress[uint8_t img_num](storage_addr_t addr) { return 0; }



More information about the Tinyos-2-commits mailing list