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

📄 frame_check.c

📁 开发的802.16e物理层上下行MAP解析
💻 C
字号:

#include "..\include\wib_phy_def.h"

int frame_check(
	DL_SUBFRAME_STRUCT      *p_dl_subframe_tx,
	DL_SUBFRAME_STRUCT      *p_dl_subframe_rx
	)

{
	/* Temporary variable definition*/
	UINT16 i,j,k,m;
	UINT16 num_zone;
	UINT16 num_burst;
	UINT16 num_blk;
	UINT16 num_cid;





	/*
	***************************************************************************************
	*                             function definition
	***************************************************************************************
	*/
	
	
	/* compare global frame parameters */
	if(p_dl_subframe_tx->frame_number != p_dl_subframe_rx->frame_number){              //frame number
		printf("Error: frame_number is different!\n");
		exit_phy(-499);
	}

	if(p_dl_subframe_tx->symbol_num != p_dl_subframe_rx->symbol_num){                  //OFDMA symbol number
		printf("Error: OFDMA symbol number is different!\n");
		exit_phy(-498);
	}

	if(p_dl_subframe_tx->number_of_zone != p_dl_subframe_rx->number_of_zone){          //number of zone
		printf("Error: number_of_zone is different!\n");
		exit_phy(-497);
	}

	num_zone = p_dl_subframe_tx->number_of_zone;

	/* compare zone parameters */
	for(i = 0; i < num_zone; i++){
		if(p_dl_subframe_tx->zone[i].start_symbol_offset != p_dl_subframe_rx->zone[i].start_symbol_offset){        //start symbol offset 
			printf("Error: zone start_symbol_offset is different!\n");
			exit_phy(-496);		
		}

		if(p_dl_subframe_tx->zone[i].end_symbol_offset != p_dl_subframe_rx->zone[i].end_symbol_offset){            //end symbol offset 
			printf("Error: zone end_symbol_offset is different!\n");
			exit_phy(-495);		
		}

		if(p_dl_subframe_tx->zone[i].number_of_burst != p_dl_subframe_rx->zone[i].number_of_burst){                //number of burst
			printf("Error: zone number_of_burst is different!\n");
			exit_phy(-494);		
		}

		num_burst = p_dl_subframe_tx->zone[i].number_of_burst;

		
		/* compare burst parameters */
		for(j = 0; j < num_burst; j++){
			if(p_dl_subframe_tx->zone[i].burst[j].fec_code_type != p_dl_subframe_rx->zone[i].burst[j].fec_code_type){            //fec code type
				printf("Error: burst fec_code_type is different!\n"); 
				exit_phy(-493);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].burst_data_len_byte != p_dl_subframe_rx->zone[i].burst[j].burst_data_len_byte){       //burst length in bytes
				printf("Error: burst_data_len_byte is different!\n");
				exit_phy(-492);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].ofdma_symbol_offset != p_dl_subframe_rx->zone[i].burst[j].ofdma_symbol_offset){       //ofdma symbol offset
				printf("Error: burst ofdma_symbol_offset is different!\n");
				exit_phy(-491);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].subchannel_offset != p_dl_subframe_rx->zone[i].burst[j].subchannel_offset){           //subchannel offset
				printf("Error: burst subchannel_offset is different!\n");
				exit_phy(-490);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].repetition_coding != p_dl_subframe_rx->zone[i].burst[j].repetition_coding){           //repetition coding
				printf("Error: burst repetition_coding is different!\n");
				exit_phy(-489);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].number_of_symbol != p_dl_subframe_rx->zone[i].burst[j].number_of_symbol){             //number of symbol
				printf("Error: burst number_of_symbol is different!\n");
				exit_phy(-488);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].number_of_subchannel != p_dl_subframe_rx->zone[i].burst[j].number_of_subchannel){     //number of subchannel
				printf("Error: burst number_of_subchannel is different!\n");
				exit_phy(-487);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].number_of_slot != p_dl_subframe_rx->zone[i].burst[j].number_of_slot){                 //number of slot
				printf("Error: burst number_of_slot is different!\n"); 
				exit_phy(-486);
			}

			if(p_dl_subframe_tx->zone[i].burst[j].number_of_slot_remain != p_dl_subframe_rx->zone[i].burst[j].number_of_slot_remain){   //number of slot remain
				printf("Error: burst number_of_slot_remain is different!\n");
				exit_phy(-485);
			}

			
			if(p_dl_subframe_tx->zone[i].burst[j].number_of_cid != p_dl_subframe_rx->zone[i].burst[j].number_of_cid){                   //number of cid
				printf("Error: burst number_of_cid is different!\n");
				exit_phy(-484);
			}

			num_cid = p_dl_subframe_tx->zone[i].burst[j].number_of_cid;

			for(k = 0; k < num_cid; k++){
				if(p_dl_subframe_tx->zone[i].burst[j].cid_burst[k] != p_dl_subframe_rx->zone[i].burst[j].cid_burst[k]){                 //cid
					printf("Error: cid_burst is different!\n");
					exit_phy(-483);
				}				
			}

			if(p_dl_subframe_tx->zone[i].burst[j].number_of_block != p_dl_subframe_rx->zone[i].burst[j].number_of_block){               //number of block
				printf("Error: burst number_of_block is different!\n");
				exit_phy(-482);
			}

			num_blk = p_dl_subframe_tx->zone[i].burst[j].number_of_block;

			
			/* compare block parameters */
			for(m = 0; m < num_blk; m++){ 
				if(p_dl_subframe_tx->zone[i].burst[j].block[m].block_len_uncoded != p_dl_subframe_rx->zone[i].burst[j].block[m].block_len_uncoded){        //uncoded block length
					printf("Error: block_len_uncoded is different!\n");
					exit_phy(-481);
				}
				
				if(p_dl_subframe_tx->zone[i].burst[j].block[m].block_len_coded != p_dl_subframe_rx->zone[i].burst[j].block[m].block_len_coded){            //coded block length
					printf("Error: block_len_coded is different!\n");
					exit_phy(-480);
				}

				if(p_dl_subframe_tx->zone[i].burst[j].block[m].number_of_slot != p_dl_subframe_rx->zone[i].burst[j].block[m].number_of_slot){              //number of slot of block
					printf("Error: block number_of_slot is different!\n");
					exit_phy(-479);
				}
			}
		}
	}


		return(0);
}


	

⌨️ 快捷键说明

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