]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420/lowpan/CC2420TinyosNetworkC.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / chips / cc2420 / lowpan / CC2420TinyosNetworkC.nc
index 3581b120f0d91b0d4d8b1fc87ad2c13c2a2a3b64..62d063153cd7904ae11eabc79316f721bca40571 100644 (file)
  */
  
 #include "CC2420.h"
+#include "Ieee154.h"
 
 configuration CC2420TinyosNetworkC {
   provides {
+    interface Resource[uint8_t clientId];
     interface Send;
     interface Receive;
+
+    interface Send as ActiveSend;
+    interface Receive as ActiveReceive;
   }
   
   uses {
@@ -72,21 +77,27 @@ configuration CC2420TinyosNetworkC {
 
 implementation {
 
-#ifdef CC2420_IFRAME_TYPE
+  enum {
+    TINYOS_N_NETWORKS = uniqueCount(RADIO_SEND_RESOURCE),
+  };
+
+  components MainC;
   components CC2420TinyosNetworkP;
   components CC2420PacketC;
-  
-  CC2420TinyosNetworkP.Send = Send;
-  CC2420TinyosNetworkP.Receive = Receive;
+  components new FcfsResourceQueueC(TINYOS_N_NETWORKS);
+
+  CC2420TinyosNetworkP.BareSend = Send;
+  CC2420TinyosNetworkP.BareReceive = Receive;
   CC2420TinyosNetworkP.SubSend = SubSend;
   CC2420TinyosNetworkP.SubReceive = SubReceive;
-  
-  CC2420TinyosNetworkP.CC2420PacketBody -> CC2420PacketC;
+  CC2420TinyosNetworkP.Resource = Resource;
+  CC2420TinyosNetworkP.ActiveSend = ActiveSend;
+  CC2420TinyosNetworkP.ActiveReceive = ActiveReceive;
 
-#else
-  Send = SubSend;
-  Receive = SubReceive;
-#endif
+  CC2420TinyosNetworkP.CC2420Packet -> CC2420PacketC;
+  CC2420TinyosNetworkP.CC2420PacketBody -> CC2420PacketC;
+  CC2420TinyosNetworkP.Queue -> FcfsResourceQueueC;
 
+  MainC.SoftwareInit -> FcfsResourceQueueC;
 }