]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/RadioControlP.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / lib / mac / tkn154 / RadioControlP.nc
index ad9d541bf18308746b8172e68ec34ce3277ad260..a9e9a2e3c486ec326e6a0bdeb0bcae934ca83e16 100644 (file)
@@ -39,19 +39,20 @@ configuration RadioControlP
   {
     interface RadioRx as RadioRx[uint8_t client];
     interface RadioTx as RadioTx[uint8_t client];
+    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;
+    interface SlottedCsmaCa as PhySlottedCsmaCa;
+    interface UnslottedCsmaCa as PhyUnslottedCsmaCa;
     interface RadioOff as PhyRadioOff;
     interface Get<bool> as RadioPromiscuousMode;
+    interface ResourceConfigure[uint8_t id];
     interface Leds;
-    interface Ieee802154Debug as Debug;
   }
 }
 implementation
@@ -59,19 +60,27 @@ implementation
   components RadioControlImplP;
   RadioRx = RadioControlImplP.MacRx;
   RadioTx = RadioControlImplP.MacTx;
+  SlottedCsmaCa = RadioControlImplP.SlottedCsmaCa;
+  UnslottedCsmaCa = RadioControlImplP.UnslottedCsmaCa;
   RadioOff = RadioControlImplP.MacRadioOff;
   PhyRx = RadioControlImplP.PhyRx;
   PhyTx = RadioControlImplP.PhyTx;
+  PhySlottedCsmaCa = RadioControlImplP.PhySlottedCsmaCa;
+  PhyUnslottedCsmaCa = RadioControlImplP.PhyUnslottedCsmaCa;
   PhyRadioOff = RadioControlImplP.PhyRadioOff;
   RadioPromiscuousMode = RadioControlImplP;
   Leds = RadioControlImplP;
-  Debug = 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;
 }