]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/TKN154NonBeaconEnabledP.nc
Indirect Tx:
[tinyos-2.x.git] / tos / lib / mac / tkn154 / TKN154NonBeaconEnabledP.nc
index c294df78326f43e1daf6caaab3aace8c177d51ed..f553f715031bbc03d8708d74e0e160b20f95a45b 100644 (file)
@@ -39,8 +39,6 @@
 
 #define IEEE154_BEACON_ENABLED_PAN FALSE
 
-// TODO: check the wiring!!
-
 configuration TKN154NonBeaconEnabledP
 {
   provides
@@ -67,6 +65,7 @@ configuration TKN154NonBeaconEnabledP
     interface Notify<const void*> as PIBUpdate[uint8_t attributeID];
     interface IEEE154Frame;
     interface IEEE154BeaconFrame;
+    interface IEEE154TxBeaconPayload;
     interface SplitControl as PromiscuousMode;
     interface Get<uint64_t> as GetLocalExtendedAddress;
     interface TimeCalc;
@@ -100,6 +99,7 @@ implementation
              RadioControlP,
              IndirectTxP,
              PollP,
+             BeaconRequestRxP,
 
 #ifndef IEEE154_SCAN_DISABLED
              ScanP,
@@ -166,12 +166,13 @@ implementation
   MLME_SET = PibP;
   IEEE154Frame = PibP;
   IEEE154BeaconFrame = PibP;
+  IEEE154TxBeaconPayload = BeaconRequestRxP;
   PromiscuousMode = PromiscuousModeP;
   GetLocalExtendedAddress = PibP.GetLocalExtendedAddress;
   Packet = PibP; 
   TimeCalc = PibP;
   FrameUtility = PibP;
-  
+
   /* ----------------------- Scanning (MLME-SCAN) ----------------------- */
 
   components new RadioClientC(RADIO_CLIENT_SCAN) as ScanRadioClient;
@@ -191,6 +192,15 @@ implementation
   ScanP.Leds = Leds;
   ScanP.FrameUtility -> PibP;
 
+  /* -------------------- Responding to Active Scans  --------------------- */
+
+  PibP.MacReset -> BeaconRequestRxP;
+  BeaconRequestRxP.BeaconRequestRx -> DispatchP.FrameRx[FC1_FRAMETYPE_CMD + CMD_FRAME_BEACON_REQUEST];
+  BeaconRequestRxP.BeaconRequestResponseTx -> DispatchQueueP.FrameTx[unique(CAP_TX_CLIENT)];
+  BeaconRequestRxP.MLME_GET -> PibP;
+  BeaconRequestRxP.FrameUtility -> PibP;
+  BeaconRequestRxP.Frame -> PibP;
+
   /* -------------------- Association (MLME-ASSOCIATE) -------------------- */
 
   PibP.MacReset -> AssociateP;
@@ -231,6 +241,7 @@ implementation
   DataP.CoordCapTx -> DispatchQueueP.FrameTx[unique(CAP_TX_CLIENT)];
   DataP.DeviceCapRx -> PollP.DataRx;                          
   DataP.DeviceCapRx -> PromiscuousModeP.FrameRx;              
+  DataP.DeviceCapRx -> DispatchP.FrameRx[FC1_FRAMETYPE_DATA]; 
   DataP.TxFramePool -> TxFramePoolP;
   DataP.IndirectTx -> IndirectTxP.FrameTx[unique(INDIRECT_TX_CLIENT)];
   DataP.FrameUtility -> PibP;
@@ -258,7 +269,7 @@ implementation
   IndirectTxP.CoordCapTx -> DispatchQueueP.FrameTx[unique(CAP_TX_CLIENT)];
   IndirectTxP.DataRequestRx -> DispatchP.FrameRx[FC1_FRAMETYPE_CMD + CMD_FRAME_DATA_REQUEST];
   IndirectTxP.MLME_GET -> PibP;
-  IndirectTxP.FrameUtility -> PibP;
+  IndirectTxP.IEEE154Frame -> PibP;
   IndirectTxP.IndirectTxTimeout = Timer3;
   IndirectTxP.TimeCalc -> PibP;
   IndirectTxP.Leds = Leds;
@@ -289,11 +300,13 @@ implementation
   DispatchP.SetMacSuperframeOrder -> PibP.SetMacSuperframeOrder;
   DispatchP.SetMacPanCoordinator -> PibP.SetMacPanCoordinator;
   DispatchP.IsRxEnableActive -> RxEnableP.IsRxEnableActive;
+  DispatchP.RadioTokenRequested -> DispatchRadioClient;
   DispatchP.IsRadioTokenRequested -> PibP.IsRadioTokenRequested; // fan out...
   DispatchP.IsRadioTokenRequested -> PromiscuousModeP.IsRadioTokenRequested;
   DispatchP.IsRadioTokenRequested -> ScanP.IsRadioTokenRequested;
   DispatchP.GetIndirectTxFrame -> IndirectTxP;
   DispatchP.RxEnableStateChange -> RxEnableP.RxEnableStateChange;  
+  DispatchP.PIBUpdateMacRxOnWhenIdle -> PibP.PIBUpdate[IEEE154_macRxOnWhenIdle];
   DispatchP.FrameUtility -> PibP;
   DispatchP.UnslottedCsmaCa -> DispatchRadioClient;
   DispatchP.RadioRx -> DispatchRadioClient;