]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/RadioControlP.nc
1) simplified the resource transfer: removed ResourceTransfer* interfaces and corresp...
[tinyos-2.x.git] / tos / lib / mac / tkn154 / RadioControlP.nc
index 08742945fabf323b0127c28eb4b1e6201d815c86..a9e9a2e3c486ec326e6a0bdeb0bcae934ca83e16 100644 (file)
@@ -42,11 +42,8 @@ configuration RadioControlP
     interface SlottedCsmaCa as SlottedCsmaCa[uint8_t client];
     interface UnslottedCsmaCa as UnslottedCsmaCa[uint8_t client];
     interface RadioOff as RadioOff[uint8_t client];
-    interface Resource as Token[uint8_t client];
-    interface ResourceRequested as TokenRequested[uint8_t client];
-    interface ResourceTransferControl as TokenTransferControl;
-    interface GetNow<bool> as IsResourceRequested;
-    interface Leds as LedsRadioClient;
+    interface TransferableResource[uint8_t id];
+    interface ResourceRequested[uint8_t id];
   } uses {
     interface RadioRx as PhyRx;
     interface RadioTx as PhyTx;
@@ -54,6 +51,7 @@ configuration RadioControlP
     interface UnslottedCsmaCa as PhyUnslottedCsmaCa;
     interface RadioOff as PhyRadioOff;
     interface Get<bool> as RadioPromiscuousMode;
+    interface ResourceConfigure[uint8_t id];
     interface Leds;
   }
 }
@@ -72,12 +70,17 @@ implementation
   PhyRadioOff = RadioControlImplP.PhyRadioOff;
   RadioPromiscuousMode = RadioControlImplP;
   Leds = RadioControlImplP;
-  LedsRadioClient = Leds;
 
-  components new SimpleRoundRobinTransferArbiterC(IEEE802154_RADIO_RESOURCE) as Arbiter;
-  Token = Arbiter;  
-  TokenRequested = Arbiter;
-  TokenTransferControl = Arbiter;
-  IsResourceRequested = Arbiter;
+  components MainC;
+  components new RoundRobinResourceQueueC(uniqueCount(IEEE802154_RADIO_RESOURCE)) as Queue;
+  components new SimpleTransferArbiterP() as Arbiter;
+
+  MainC.SoftwareInit -> Queue;
+
+  TransferableResource = Arbiter;
+  ResourceRequested = Arbiter;
   RadioControlImplP.ArbiterInfo -> Arbiter;
+  ResourceConfigure = Arbiter;
+
+  Arbiter.Queue -> Queue;
 }