]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/TKN154BeaconEnabledP.nc
The beacon sequence number can now be modified by the next higher layer through a...
[tinyos-2.x.git] / tos / lib / mac / tkn154 / TKN154BeaconEnabledP.nc
index 2f718b0cab92f1a72062276353d05e2edab4a58c..87f7f6b21d18c3046293233b703683d7ac4315e3 100644 (file)
@@ -95,7 +95,6 @@ configuration TKN154BeaconEnabledP
     interface Alarm<TSymbolIEEE802154,uint32_t> as Alarm9;
     interface Alarm<TSymbolIEEE802154,uint32_t> as Alarm10;
     interface Alarm<TSymbolIEEE802154,uint32_t> as Alarm11;
-    interface Alarm<TSymbolIEEE802154,uint32_t> as Alarm12;
 
     interface Timer<TSymbolIEEE802154> as Timer1;
     interface Timer<TSymbolIEEE802154> as Timer2;
@@ -136,23 +135,23 @@ implementation
 
 #ifndef IEEE154_BEACON_SYNC_DISABLED
              BeaconSynchronizeP,
-             new FrameDispatchQueueP() as DeviceCapQueue,
-             new SlottedFrameDispatchP(INCOMING_SUPERFRAME) as DeviceCap,
+             new DispatchQueueP() as DeviceCapQueue,
+             new DispatchSlottedCsmaP(INCOMING_SUPERFRAME) as DeviceCap,
 #else
              NoBeaconSynchronizeP as BeaconSynchronizeP,
-             new NoFrameDispatchQueueP() as DeviceCapQueue,
-             new NoSlottedFrameDispatchP(INCOMING_SUPERFRAME) as DeviceCap,
+             new NoDispatchQueueP() as DeviceCapQueue,
+             new NoDispatchSlottedCsmaP(INCOMING_SUPERFRAME) as DeviceCap,
 #endif
              NoDeviceCfpP as DeviceCfp,
 
 #ifndef IEEE154_BEACON_TX_DISABLED
              BeaconTransmitP,
-             new FrameDispatchQueueP() as CoordCapQueue,
-             new SlottedFrameDispatchP(OUTGOING_SUPERFRAME) as CoordCap,
+             new DispatchQueueP() as CoordCapQueue,
+             new DispatchSlottedCsmaP(OUTGOING_SUPERFRAME) as CoordCap,
 #else
              NoBeaconTransmitP as BeaconTransmitP,
-             new NoFrameDispatchQueueP() as CoordCapQueue,
-             new NoSlottedFrameDispatchP(OUTGOING_SUPERFRAME) as CoordCap,
+             new NoDispatchQueueP() as CoordCapQueue,
+             new NoDispatchSlottedCsmaP(OUTGOING_SUPERFRAME) as CoordCap,
 #endif
              NoCoordCfpP as CoordCfp,
 
@@ -222,7 +221,7 @@ implementation
   
   /* ----------------------- Scanning (MLME-SCAN) ----------------------- */
 
-  components new RadioClientC() as ScanRadioClient;
+  components new RadioClientC(RADIO_CLIENT_SCAN) as ScanRadioClient;
   PibP.MacReset -> ScanP;
   ScanP.MLME_GET -> PibP;
   ScanP.MLME_SET -> PibP.MLME_SET;
@@ -235,13 +234,13 @@ implementation
   ScanP.ScanTimer = Timer1;
   ScanP.TxFramePool -> TxFramePoolP;
   ScanP.TxControlPool -> TxControlPoolP;
-  ScanP.Token -> ScanRadioClient;
+  ScanP.RadioToken -> ScanRadioClient;
   ScanP.Leds = Leds;
   ScanP.FrameUtility -> PibP;
 
   /* ----------------- Beacon Transmission (MLME-START) ----------------- */
   
-  components new RadioClientC() as BeaconTxRadioClient;
+  components new RadioClientC(RADIO_CLIENT_BEACONTRANSMIT) as BeaconTxRadioClient;
   PibP.MacReset -> BeaconTransmitP;
   BeaconTransmitP.PIBUpdate[IEEE154_macAssociationPermit] -> PibP.PIBUpdate[IEEE154_macAssociationPermit];
   BeaconTransmitP.PIBUpdate[IEEE154_macGTSPermit] -> PibP.PIBUpdate[IEEE154_macGTSPermit];
@@ -254,10 +253,7 @@ implementation
   BeaconTransmitP.SetMacSuperframeOrder -> PibP.SetMacSuperframeOrder;
   BeaconTransmitP.SetMacBeaconTxTime -> PibP.SetMacBeaconTxTime;
   BeaconTransmitP.SetMacPanCoordinator -> PibP.SetMacPanCoordinator;
-  BeaconTransmitP.Token -> BeaconTxRadioClient;
-  BeaconTransmitP.IsTokenRequested -> BeaconTxRadioClient;
-  BeaconTransmitP.TokenTransferred -> BeaconTxRadioClient;
-  BeaconTransmitP.TokenToBroadcast -> BeaconTxRadioClient;
+  BeaconTransmitP.RadioToken -> BeaconTxRadioClient;
   BeaconTransmitP.RealignmentBeaconEnabledTx -> CoordBroadcastP.RealignmentTx;
   BeaconTransmitP.RealignmentNonBeaconEnabledTx -> CoordCapQueue.FrameTx[unique(CAP_TX_CLIENT)];
   BeaconTransmitP.BeaconRequestRx -> CoordCap.FrameRx[FC1_FRAMETYPE_CMD + CMD_FRAME_BEACON_REQUEST];
@@ -270,12 +266,12 @@ implementation
   BeaconTransmitP.GetSetRealignmentFrame -> CoordRealignmentP;
   BeaconTransmitP.IsBroadcastReady -> CoordBroadcastP.IsBroadcastReady;
   BeaconTransmitP.TimeCalc -> PibP;
+  BeaconTransmitP.Random = Random;
   BeaconTransmitP.Leds = Leds;
-  BeaconTxRadioClient.TransferTo -> CoordBroadcastRadioClient.TransferFrom;
 
   /* ------------------ Beacon Tracking (MLME-SYNC) ------------------ */
 
-  components new RadioClientC() as SyncRadioClient;
+  components new RadioClientC(RADIO_CLIENT_BEACONSYNCHRONIZE) as SyncRadioClient;
   PibP.MacReset -> BeaconSynchronizeP;
   BeaconSynchronizeP.MLME_SET -> PibP.MLME_SET;
   BeaconSynchronizeP.MLME_GET -> PibP;
@@ -286,14 +282,10 @@ implementation
   BeaconSynchronizeP.BeaconRx -> SyncRadioClient;
   BeaconSynchronizeP.RadioOff -> SyncRadioClient;
   BeaconSynchronizeP.DataRequest -> PollP.DataRequest[SYNC_POLL_CLIENT];
-  BeaconSynchronizeP.Token -> SyncRadioClient;
-  BeaconSynchronizeP.IsTokenRequested -> SyncRadioClient;
-  BeaconSynchronizeP.TokenTransferred -> SyncRadioClient;
-  BeaconSynchronizeP.TokenToCap -> SyncRadioClient;
+  BeaconSynchronizeP.RadioToken -> SyncRadioClient;
   BeaconSynchronizeP.TimeCalc -> PibP;
   BeaconSynchronizeP.CoordRealignmentRx -> DeviceCap.FrameRx[FC1_FRAMETYPE_CMD + CMD_FRAME_COORDINATOR_REALIGNMENT];
   BeaconSynchronizeP.Leds = Leds;
-  SyncRadioClient.TransferTo -> DeviceCapRadioClient.TransferFrom;
 
   /* -------------------- Association (MLME-ASSOCIATE) -------------------- */
 
@@ -327,13 +319,13 @@ implementation
   DisassociateP.TxFramePool -> TxFramePoolP;
   DisassociateP.TxControlPool -> TxControlPoolP;
   DisassociateP.MLME_GET -> PibP;
+  DisassociateP.MLME_SET -> PibP;
   DisassociateP.FrameUtility -> PibP;
   DisassociateP.Frame -> PibP;
   DisassociateP.LocalExtendedAddress -> PibP.GetLocalExtendedAddress;
 
   /* ------------------ Data Transmission (MCPS-DATA) ------------------- */
 
-  DataP.IsSendingBeacons -> BeaconTransmitP.IsSendingBeacons;
   DataP.CoordCapRx -> CoordCap.FrameRx[FC1_FRAMETYPE_DATA]; 
   DataP.DeviceCapTx -> DeviceCapQueue.FrameTx[unique(CAP_TX_CLIENT)];
   DataP.CoordCapTx -> CoordCapQueue.FrameTx[unique(CAP_TX_CLIENT)];
@@ -371,7 +363,7 @@ implementation
   IndirectTxP.CoordCapTx -> CoordCapQueue.FrameTx[unique(CAP_TX_CLIENT)];
   IndirectTxP.DataRequestRx -> CoordCap.FrameRx[FC1_FRAMETYPE_CMD + CMD_FRAME_DATA_REQUEST];
   IndirectTxP.MLME_GET -> PibP;
-  IndirectTxP.FrameUtility -> PibP;
+  IndirectTxP.IEEE154Frame -> PibP;
   IndirectTxP.IndirectTxTimeout = Timer4;
   IndirectTxP.TimeCalc -> PibP;
   IndirectTxP.Leds = Leds;
@@ -390,41 +382,39 @@ implementation
 
   /* ---------------------------- Broadcasts ---------------------------- */
 
-  components new RadioClientC() as CoordBroadcastRadioClient;
+  components new RadioClientC(RADIO_CLIENT_COORDBROADCAST) as CoordBroadcastRadioClient;
   PibP.MacReset -> CoordBroadcastP;
-  CoordBroadcastP.TokenTransferred -> CoordBroadcastRadioClient;
-  CoordBroadcastP.TokenToCap -> CoordBroadcastRadioClient;
-  CoordBroadcastRadioClient.TransferTo -> CoordCapRadioClient.TransferFrom;
+  CoordBroadcastP.RadioToken -> CoordBroadcastRadioClient;
   CoordBroadcastP.OutgoingSF -> BeaconTransmitP.OutgoingSF;
   CoordBroadcastP.CapTransmitNow -> CoordCap.BroadcastTx;
   CoordBroadcastP.Queue -> BroadcastQueueC;
-  CoordBroadcastP.Leds = Leds;
 
   /* --------------------- CAP (incoming superframe) -------------------- */
 
-  PibP.FrameDispatchQueueReset -> DeviceCapQueue;
+  PibP.DispatchQueueReset -> DeviceCapQueue;
   DeviceCapQueue.Queue -> DeviceCapQueueC;
   DeviceCapQueue.FrameTxCsma -> DeviceCap;
 
-  PibP.FrameDispatchQueueReset -> CoordCapQueue;
+  PibP.DispatchQueueReset -> CoordCapQueue;
   CoordCapQueue.Queue -> CoordCapQueueC;
   CoordCapQueue.FrameTxCsma -> CoordCap;
   
-  components new RadioClientC() as DeviceCapRadioClient;
-  PibP.FrameDispatchReset -> DeviceCap;
+  components new RadioClientC(RADIO_CLIENT_DEVICECAP) as DeviceCapRadioClient;
+  PibP.DispatchReset -> DeviceCap;
   DeviceCap.CapEndAlarm = Alarm3;
   DeviceCap.BLEAlarm = Alarm4;
-  DeviceCap.IndirectTxWaitAlarm = Alarm5;
-  DeviceCap.BroadcastAlarm = Alarm6;
-  DeviceCap.Token -> DeviceCapRadioClient;
-  DeviceCap.IsTokenRequested -> DeviceCapRadioClient;
-  DeviceCap.TokenToCfp -> DeviceCapRadioClient;
-  DeviceCap.TokenTransferred -> DeviceCapRadioClient;
+  DeviceCap.RxWaitAlarm = Alarm5;
+  DeviceCap.RadioToken -> DeviceCapRadioClient;
+  DeviceCap.RadioTokenRequested -> DeviceCapRadioClient;
   DeviceCap.SuperframeStructure -> BeaconSynchronizeP.IncomingSF;
   DeviceCap.IsRxEnableActive -> RxEnableP.IsRxEnableActive;
+  DeviceCap.IsRadioTokenRequested -> PibP.IsRadioTokenRequested; // fan out...
+  DeviceCap.IsRadioTokenRequested -> PromiscuousModeP.IsRadioTokenRequested;
+  DeviceCap.IsRadioTokenRequested -> ScanP.IsRadioTokenRequested;
   DeviceCap.GetIndirectTxFrame -> IndirectTxP;
   DeviceCap.RxEnableStateChange -> RxEnableP.RxEnableStateChange;  
   DeviceCap.IsTrackingBeacons -> BeaconSynchronizeP.IsTrackingBeacons;  
+  DeviceCap.PIBUpdateMacRxOnWhenIdle -> PibP.PIBUpdate[IEEE154_macRxOnWhenIdle];
   DeviceCap.FrameUtility -> PibP;
   DeviceCap.SlottedCsmaCa -> DeviceCapRadioClient;
   DeviceCap.RadioRx -> DeviceCapRadioClient;
@@ -434,24 +424,26 @@ implementation
   DeviceCap.TimeCalc -> PibP;
   DeviceCap.Leds = Leds;
   DeviceCap.TrackSingleBeacon -> BeaconSynchronizeP.TrackSingleBeacon;
-  DeviceCapRadioClient.TransferTo -> DeviceCfpRadioClient.TransferFrom;
+  DeviceCap.MLME_SYNC_LOSS -> BeaconSynchronizeP;
 
   /* ---------------------- CAP (outgoing superframe) ------------------- */
 
-  components new RadioClientC() as CoordCapRadioClient, 
+  components new RadioClientC(RADIO_CLIENT_COORDCAP) as CoordCapRadioClient, 
              new BackupP(ieee154_cap_frame_backup_t);
-  PibP.FrameDispatchReset -> CoordCap;
-  CoordCap.CapEndAlarm = Alarm7;
-  CoordCap.BLEAlarm = Alarm8;
-  CoordCap.Token -> CoordCapRadioClient;
-  CoordCap.TokenToCfp -> CoordCapRadioClient;
-  CoordCap.TokenTransferred -> CoordCapRadioClient;
-  CoordCap.IsTokenRequested -> CoordCapRadioClient;
+  PibP.DispatchReset -> CoordCap;
+  CoordCap.CapEndAlarm = Alarm6;
+  CoordCap.BLEAlarm = Alarm7;
+  CoordCap.RadioToken -> CoordCapRadioClient;
+  CoordCap.RadioTokenRequested -> CoordCapRadioClient;
   CoordCap.SuperframeStructure -> BeaconTransmitP.OutgoingSF;
   CoordCap.IsRxEnableActive -> RxEnableP.IsRxEnableActive;
+  CoordCap.IsRadioTokenRequested -> PibP.IsRadioTokenRequested; // fan out...
+  CoordCap.IsRadioTokenRequested -> PromiscuousModeP.IsRadioTokenRequested;
+  CoordCap.IsRadioTokenRequested -> ScanP.IsRadioTokenRequested;
   CoordCap.GetIndirectTxFrame -> IndirectTxP;
   CoordCap.RxEnableStateChange -> RxEnableP.RxEnableStateChange;  
   CoordCap.IsTrackingBeacons -> BeaconSynchronizeP.IsTrackingBeacons;  
+  CoordCap.PIBUpdateMacRxOnWhenIdle -> PibP.PIBUpdate[IEEE154_macRxOnWhenIdle];
   CoordCap.FrameUtility -> PibP;
   CoordCap.SlottedCsmaCa -> CoordCapRadioClient;
   CoordCap.RadioRx -> CoordCapRadioClient;
@@ -460,49 +452,42 @@ implementation
   CoordCap.MLME_SET -> PibP.MLME_SET;
   CoordCap.TimeCalc -> PibP;
   CoordCap.Leds = Leds;
-  CoordCapRadioClient.TransferTo -> CoordCfpRadioClient.TransferFrom;
   CoordCap.FrameBackup -> BackupP;
   CoordCap.FrameRestore -> BackupP;
 
   /* -------------------- GTS (incoming superframe) --------------------- */
 
-  components new RadioClientC() as DeviceCfpRadioClient;
+  components new RadioClientC(RADIO_CLIENT_DEVICECFP) as DeviceCfpRadioClient;
   PibP.MacReset -> DeviceCfp;
-  DeviceCfp.TokenTransferred -> DeviceCfpRadioClient;
-  DeviceCfp.TokenRequested -> DeviceCfpRadioClient;
-  DeviceCfp.TokenToBeaconSync -> DeviceCfpRadioClient;
+  DeviceCfp.RadioToken -> DeviceCfpRadioClient;
   DeviceCfp.IncomingSF -> BeaconSynchronizeP.IncomingSF; 
-  DeviceCfp.CfpSlotAlarm = Alarm9;
-  DeviceCfp.CfpEndAlarm = Alarm10;
+  DeviceCfp.CfpSlotAlarm = Alarm8;
+  DeviceCfp.CfpEndAlarm = Alarm9;
   DeviceCfp.RadioTx -> DeviceCfpRadioClient;
   DeviceCfp.RadioRx -> DeviceCfpRadioClient;
   DeviceCfp.RadioOff -> DeviceCfpRadioClient;
   DeviceCfp.MLME_GET -> PibP;
   DeviceCfp.MLME_SET -> PibP.MLME_SET; 
-  DeviceCfpRadioClient.TransferTo -> SyncRadioClient.TransferFrom;
 
   /* -------------------- GTS (outgoing superframe) --------------------- */
 
-  components new RadioClientC() as CoordCfpRadioClient;
+  components new RadioClientC(RADIO_CLIENT_COORDCFP) as CoordCfpRadioClient;
   PibP.MacReset -> CoordCfp;
-  CoordCfp.TokenTransferred -> CoordCfpRadioClient;
-  CoordCfp.TokenRequested -> CoordCfpRadioClient;
-  CoordCfp.TokenToBeaconTransmit -> CoordCfpRadioClient;
+  CoordCfp.RadioToken -> CoordCfpRadioClient;
   CoordCfp.OutgoingSF -> BeaconTransmitP.OutgoingSF; 
-  CoordCfp.CfpSlotAlarm = Alarm11;
-  CoordCfp.CfpEndAlarm = Alarm12;
+  CoordCfp.CfpSlotAlarm = Alarm10;
+  CoordCfp.CfpEndAlarm = Alarm11;
   CoordCfp.RadioTx -> CoordCfpRadioClient;
   CoordCfp.RadioRx -> CoordCfpRadioClient;
   CoordCfp.RadioOff -> CoordCfpRadioClient;
   CoordCfp.MLME_GET -> PibP;
   CoordCfp.MLME_SET -> PibP.MLME_SET;
-  CoordCfpRadioClient.TransferTo -> BeaconTxRadioClient.TransferFrom;
 
   /* -------------------------- promiscuous mode ------------------------ */
 
-  components new RadioClientC() as PromiscuousModeRadioClient;
+  components new RadioClientC(RADIO_CLIENT_PROMISCUOUSMODE) as PromiscuousModeRadioClient;
   PibP.MacReset -> PromiscuousModeP;
-  PromiscuousModeP.Token -> PromiscuousModeRadioClient;
+  PromiscuousModeP.RadioToken -> PromiscuousModeRadioClient;
   PromiscuousModeP.PromiscuousRx -> PromiscuousModeRadioClient;
   PromiscuousModeP.RadioOff -> PromiscuousModeRadioClient;
   PromiscuousModeP.RadioPromiscuousMode = RadioPromiscuousMode;
@@ -521,14 +506,14 @@ implementation
 
   /* ------------------------------- PIB -------------------------------- */
 
-  components new RadioClientC() as PibRadioClient;
+  components new RadioClientC(RADIO_CLIENT_PIB) as PibRadioClient;
   PIBUpdate = PibP;
   MainC.SoftwareInit -> PibP.LocalInit;
   PibP.RadioControl = PhySplitControl;
   PibP.Random = Random; 
   PibP.PromiscuousModeGet -> PromiscuousModeP; 
   PibP.LocalTime = LocalTime;
-  PibP.Token -> PibRadioClient;
+  PibP.RadioToken -> PibRadioClient;
   PibP.RadioOff -> PibRadioClient;
 
   /* ------------------------- Radio Control ---------------------------- */