]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/Deluge/DelugeC.nc
Merge of the latest Deluge T2.
[tinyos-2.x.git] / tos / lib / net / Deluge / DelugeC.nc
index caea53054376d40f23b2df9519fb0a9057243e01..78d550fce9bde4113299c034013b2b70ba12c285 100644 (file)
 #include "Deluge.h"
 #include "StorageVolumes.h"
 
-configuration DelugeC {}
+configuration DelugeC {
+  uses interface Leds;
+}
 
 implementation
 {
-  components DelugeStorageC;
-  
-#ifdef DELUGE_BASESTATION
-  components SerialStarterC;
-  components new FlashVolumeManagerC(0xAB);
+  components ObjectTransferC;
   
-  DelugeP.ReprogNotify -> FlashVolumeManagerC;
-  FlashVolumeManagerC.BlockRead[VOLUME_DELUGE0] -> DelugeStorageC.BlockRead[VOLUME_DELUGE0];
-  FlashVolumeManagerC.BlockWrite[VOLUME_DELUGE0] -> DelugeStorageC.BlockWrite[VOLUME_DELUGE0];
-  FlashVolumeManagerC.DelugeStorage[VOLUME_DELUGE0] -> DelugeStorageC.DelugeStorage[VOLUME_DELUGE0];
-  FlashVolumeManagerC.BlockRead[VOLUME_DELUGE1] -> DelugeStorageC.BlockRead[VOLUME_DELUGE1];
-  FlashVolumeManagerC.BlockWrite[VOLUME_DELUGE1] -> DelugeStorageC.BlockWrite[VOLUME_DELUGE1];
-  FlashVolumeManagerC.DelugeStorage[VOLUME_DELUGE1] -> DelugeStorageC.DelugeStorage[VOLUME_DELUGE1];
-#endif
+  components new BlockReaderC(VOLUME_DELUGE1) as BlockReaderDeluge1;
+  components new BlockReaderC(VOLUME_DELUGE2) as BlockReaderDeluge2;
+  components new BlockReaderC(VOLUME_DELUGE3) as BlockReaderDeluge3;
+
+  components new BlockWriterC(VOLUME_DELUGE1) as BlockWriterDeluge1;
+  components new BlockWriterC(VOLUME_DELUGE2) as BlockWriterDeluge2;
+  components new BlockWriterC(VOLUME_DELUGE3) as BlockWriterDeluge3;
   
-  components ObjectTransferC;
-  ObjectTransferC.BlockRead[VOLUME_DELUGE0] -> DelugeStorageC.BlockRead[VOLUME_DELUGE0];
-  ObjectTransferC.BlockWrite[VOLUME_DELUGE0] -> DelugeStorageC.BlockWrite[VOLUME_DELUGE0];
-  ObjectTransferC.BlockRead[VOLUME_DELUGE1] -> DelugeStorageC.BlockRead[VOLUME_DELUGE1];
-  ObjectTransferC.BlockWrite[VOLUME_DELUGE1] -> DelugeStorageC.BlockWrite[VOLUME_DELUGE1];
+  ObjectTransferC.BlockRead[VOLUME_DELUGE1]  -> BlockReaderDeluge1;
+  ObjectTransferC.BlockRead[VOLUME_DELUGE2]  -> BlockReaderDeluge2;
+  ObjectTransferC.BlockRead[VOLUME_DELUGE3]  -> BlockReaderDeluge3;
+
+  ObjectTransferC.BlockWrite[VOLUME_DELUGE1] ->  BlockWriterDeluge1;
+  ObjectTransferC.BlockWrite[VOLUME_DELUGE2] ->  BlockWriterDeluge2;
+  ObjectTransferC.BlockWrite[VOLUME_DELUGE3] ->  BlockWriterDeluge3;
+
+  ObjectTransferC.Leds = Leds;
   
-  components new DisseminatorC(DelugeDissemination, 0xDE00), DisseminationC;
+  components new DisseminatorC(DelugeCmd, DELUGE_KEY);
+  components DisseminationC;
   components ActiveMessageC;
   components NetProgC, DelugeP;
   components new TimerMilliC() as Timer;
-  components LedsC, NoLedsC;
-  DelugeP.Leds -> LedsC;  
+  components BlockStorageManagerC;
+  components DelugeMetadataC;
+  components new DelugeMetadataClientC();
+  components new DelugeVolumeManagerClientC();
+  components new BlockStorageLockClientC();
+  components MainC;
+
+  DelugeP.Boot -> MainC;
+  DelugeP.Leds = Leds;  
+#ifndef DELUGE_BASESTATION
   DelugeP.DisseminationValue -> DisseminatorC;
-  DelugeP.DisseminationUpdate -> DisseminatorC;
-  DelugeP.StdControlDissemination -> DisseminationC;
+#endif
+  DelugeP.DisseminationStdControl -> DisseminationC;
   DelugeP.ObjectTransfer -> ObjectTransferC;
   DelugeP.NetProg -> NetProgC;
-  DelugeP.StorageReadyNotify -> DelugeStorageC;
-  DelugeP.DelugeMetadata -> DelugeStorageC;
   DelugeP.RadioSplitControl -> ActiveMessageC;
-  
-  components InternalFlashC as IFlash;
-  DelugeP.IFlash -> IFlash;
+  DelugeP.StorageMap -> BlockStorageManagerC;
+  DelugeP.DelugeMetadata -> DelugeMetadataClientC;
+  DelugeP.storageReady <- DelugeMetadataC;
+  DelugeP.DelugeVolumeManager -> DelugeVolumeManagerClientC;
+  DelugeP.Resource -> BlockStorageLockClientC;
+
+#if defined(DELUGE_BASESTATION) || defined(DELUGE_LIGHT_BASESTATION)
+  components SerialStarterC;
+  components new FlashVolumeManagerC(DELUGE_AM_FLASH_VOL_MANAGER);
+#endif
+
+#ifdef DELUGE_BASESTATION
+  components new DelugeManagerC(DELUGE_AM_DELUGE_MANAGER);
+
+  DelugeManagerC.DisseminationUpdate -> DisseminatorC;
+#endif
+
 }