⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mac.nc.svn-base

📁 802.15.4协议的实现
💻 SVN-BASE
字号:
/**
 * @author IPP HURRAY http://www.hurray.isep.ipp.pt/art-wise
 * @author Andre Cunha
 */
includes phy_const;
includes mac_const;
includes mac_enumerations;
includes phy_enumerations;
includes frame_format;
includes mac_func;
includes PrintfUART;

configuration Mac {
provides {
		  interface StdControl as Mac_control;
		  
		  
		//MLME  
		interface MLME_START;
		
		interface MLME_ASSOCIATE;
		interface MLME_DISASSOCIATE;
		
		interface MLME_SYNC;
		interface MLME_SYNC_LOSS;
		
		interface MLME_SCAN;
		interface MLME_RESET;
		
		interface MLME_BEACON_NOTIFY;
		
		interface MLME_COMM_STATUS;
		
		interface MLME_SET;
		interface MLME_GET;
		
		interface MLME_GTS;
		
		//MCPS
		interface MCPS_DATA;
		interface MCPS_PURGE;
		}


}
implementation
{
	components Main,
			 MacM,
			 Phy as Phy_control,
			 //TimerJiffyAsyncC,
			 TimerC,
			 LedsC,
			 RandomLFSR,
			 SimpleTime,
			 TimerAsyncC;
			
	
	/*StdControl*/
	Main.StdControl -> MacM;
	Mac_control = MacM;
	
	/*Physical Layer*/
	MacM.Phy_control ->Phy_control; 
	
	
	Main.StdControl ->SimpleTime;
	MacM.Time ->SimpleTime;
	
	MacM.Leds -> LedsC;
	
	MacM.Random -> RandomLFSR;
	
	/*****************************************************/
	/*				TIMERS          					 */
	/*****************************************************/ 
	Main.StdControl -> TimerC;
	
	MacM.T_scan_duration ->TimerC.Timer[unique("Timer")];
	
	MacM.T_ResponseWaitTime ->TimerC.Timer[unique("Timer")];

	MacM.T_ackwait -> TimerC.Timer[unique("Timer")];
	
	MacM.T_cca -> TimerC.Timer[unique("Timer")];
	
	MacM.TimerAsync ->TimerAsyncC;
	
	/*****************************************************/
	/*				INTERFACES         					 */
	/*****************************************************/  
	MacM.PD_DATA -> Phy_control.PD_DATA;
	
	//PLME-SAP
	MacM.PLME_ED ->Phy_control.PLME_ED;
	MacM.PLME_CCA ->Phy_control.PLME_CCA;
	MacM.PLME_SET ->Phy_control.PLME_SET;
	MacM.PLME_GET ->Phy_control.PLME_GET;
	MacM.PLME_SET_TRX_STATE ->Phy_control.PLME_SET_TRX_STATE;
	
	//MLME interfaces
	MLME_START=MacM;
	
	MLME_ASSOCIATE=MacM;
	MLME_DISASSOCIATE=MacM;
	
	MLME_SYNC=MacM;
	MLME_SYNC_LOSS=MacM;
	
	MLME_SCAN=MacM;
	MLME_RESET=MacM;
	
	MLME_BEACON_NOTIFY=MacM;
	
	MLME_COMM_STATUS=MacM;
	
	MLME_SET=MacM;
	MLME_GET=MacM;
	
	MLME_GTS=MacM;
	
	//MCPS interfaces
	MCPS_DATA=MacM;
	MCPS_PURGE=MacM;
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -