]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/RadioClientC.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / lib / mac / tkn154 / RadioClientC.nc
index 53b6e9b78f4ad834e01eecc0c936a48c967cb338..a9fd02cf81f144a4fe16d94eba9a9d00dd1303c1 100644 (file)
  * @author Jan Hauer <hauer@tkn.tu-berlin.de>
  * ========================================================================
  */
+
 #include "TKN154_MAC.h"
-generic configuration RadioClientC() 
+generic configuration RadioClientC(uint8_t clientID
 {
   provides
   {
+    interface RadioOff;
     interface RadioRx;
     interface RadioTx;
-    interface RadioOff;
-    interface Resource as Token;
-    interface ResourceRequested as TokenRequested;
-    interface ResourceTransfer;
-    interface ResourceTransferred;
-    interface ResourceTransferConnector as TransferFrom;
-    interface GetNow<bool> as IsResourceRequested;
-  } uses {
-    interface ResourceTransferConnector as TransferTo;
+    interface SlottedCsmaCa;
+    interface UnslottedCsmaCa;
+    interface TransferableResource as RadioToken;
+    interface ResourceRequested as RadioTokenRequested;
   }
 }
 implementation
 {
-  enum {
-    CLIENT = unique(IEEE802154_RADIO_RESOURCE),
-  };
-
-  components FrameDispatchP;
-  RadioRx = FrameDispatchP.RadioRx[CLIENT];
-  RadioTx = FrameDispatchP.RadioTx[CLIENT];
-  RadioOff = FrameDispatchP.RadioOff[CLIENT];
-  Token = FrameDispatchP.Token[CLIENT];
-  IsResourceRequested = FrameDispatchP.IsResourceRequested;
-  TokenRequested = FrameDispatchP.TokenRequested[CLIENT];
-
-  components new TransferClientP(CLIENT);
-  ResourceTransfer = TransferClientP;
-  ResourceTransferred = TransferClientP;
-  TransferTo = TransferClientP;
-  TransferFrom = TransferClientP;
-  TransferClientP.ResourceTransferControl -> FrameDispatchP;
-  TransferClientP.Leds -> FrameDispatchP;
+  components RadioControlP;
+  RadioRx = RadioControlP.RadioRx[clientID];
+  RadioTx = RadioControlP.RadioTx[clientID];
+  RadioOff = RadioControlP.RadioOff[clientID];
+  SlottedCsmaCa = RadioControlP.SlottedCsmaCa[clientID];
+  UnslottedCsmaCa = RadioControlP.UnslottedCsmaCa[clientID];
+  RadioToken = RadioControlP.TransferableResource[clientID];
+  RadioTokenRequested = RadioControlP.ResourceRequested[clientID];
 }