X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2FDeluge%2FFlashVolumeManager%2FFlashVolumeManagerP.nc;fp=tos%2Flib%2Fnet%2FDeluge%2FFlashVolumeManager%2FFlashVolumeManagerP.nc;h=216c00d2f9685dfd93ac91b57d4ca6d3e117f12c;hb=2d422c11d7a829ca46b5440a7ba123ae2a5b94d9;hp=78cda769888c97aca3f55b72ba0abd8c036b6bee;hpb=eb498a4fbc5937d52f6dbfde1c3dd8eb0678cf81;p=tinyos-2.x.git diff --git a/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc b/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc index 78cda769..216c00d2 100644 --- a/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc +++ b/tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc @@ -29,7 +29,10 @@ generic module FlashVolumeManagerP() { #ifdef DELUGE - provides interface Notify; + provides { + interface Notify as DissNotify; + interface Notify as ReprogNotify; + } #endif uses { interface BlockRead[uint8_t img_num]; @@ -183,14 +186,18 @@ implementation (uint32_t)call DelugeStorage.getPhysicalAddress[img_num](0); sendReply(SUCCESS, sizeof(SerialReplyPacket) + 4); break; - case SERIALMSG_REPROG: // === Reboots and reprograms === + case SERIALMSG_REPROG_BS: // === Reprograms only the base station === state = S_REPROG; sendReply(SUCCESS, sizeof(SerialReplyPacket)); img_num_reboot = img_num; call Timer.startOneShot(1024); break; case SERIALMSG_DISS: // === Starts disseminating a volume === - signal Notify.notify(img_num); // Notifies Deluge to start disseminate + 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; #endif @@ -215,8 +222,10 @@ implementation call NetProg.programImgAndReboot(img_num_reboot); } - command error_t Notify.enable() { return SUCCESS; } - command error_t Notify.disable() { return SUCCESS; } + 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; } #endif