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

📄 frm_end enter execs

📁 opnet网络仿真
💻
字号:
/** The purpose of this state is to determine the next unforced	**/
/** state after completing transmission.					    **/
 
/** 3 cases											     		**/
/** 1. If just transmitted RTS or DATA frame then wait for 	 	**/
/** response with expected_frame_type variable set and change   **/
/** the states to Wait for Response otherwise just DEFER for 	**/
/** next transmission											**/
/** 2. If expected frame is rcvd then check to see what is the	**/
/** next frame to transmit and set appropriate deference timer	**/
/** 2a. If all the data fragments are transmitted then check	**/
/** whether the queue is empty or not                           **/
/** If not then based on threshold fragment the packet 	 		**/
/** and based on threshold decide whether to send RTS or not   	**/
/** If there is a data to be transmitted then wait for DIFS		**/
/**	duration before contending for the channel					**/
/** If nothing to transmit then go to IDLE state          		**/
/** and wait for the packet arrival from higher or lower layer	**/
/** 3. If expected frame is not rcvd then infer collision, 		**/
/** set backoff flag, if retry limit is not reached       		**/
/** retransmit the frame by contending for the channel  	 	**/

/* If there is no frame expected then check to see if there		*/
/* is any other frame to transmit.								*/


// assigns the unique state name and writes the sleep staus to the sleep statistic handeler for graphing purposes
state= WSN_FRM_END;

#ifndef OPD_NO_DEBUG
printf("Node <%d> in From End at time %e \n", my_address, op_sim_time());
#endif
	
if (expected_frame_type == WlanC_None) 
	{
	/* If the frame needs to be retransmitted or there is   	*/
	/* something in the fragmentation buffer to transmit or the	*/
	/* station needs to respond to a frame then schedule		*/
	/* deference.												*/
	if (FRAME_TO_TRANSMIT)
		{
		/* Schedule deference before frame transmission.		*/
		wlan_schedule_deference ();
		}
	}
else
	{
	/* The station needs to wait for the expected frame type	*/
	/* So it will set the frame timeout interrupt which will be	*/
    /* executed if no frame is received in the set duration.   	*/
	
	/* Compute the timer duration. It is PIFS if we are an AP	*/
	/* and currently in CFP. For all other cases, the timer		*/
	/* duration is equal to "EIFS - DIFS", which is SIFS + ACK	*/
 	/* transmission time with PLCP header.						*/
	if (wlan_flags->pcf_active)
		timer_duration = pifs_time;
	else
		timer_duration = eifs_time - difs_time;
	
	/* Schedule the timeout interrupt.							*/
	frame_timeout_evh = op_intrpt_schedule_self (current_time + timer_duration, WlanC_Frame_Timeout);
	}

⌨️ 快捷键说明

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