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

📄 cal_com.c

📁 atheros ar5001 5002 driver
💻 C
📖 第 1 页 / 共 5 页
字号:
            if(!sscanf(pLine, "%lf", &CalSetup.targetPowerToleranceUpper)) {
                uiPrintf("Unable to read the TARGET_POWER_TOLERANCE_UPPER from %s\n", CALSETUP_FILE);
            } 
        }
        else if(strnicmp("TARGET_POWER_TOLERANCE_LOWER", pLine, strlen("TARGET_POWER_TOLERANCE_LOWER")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.targetPowerToleranceLower)) {
                uiPrintf("Unable to read the TARGET_POWER_TOLERANCE_LOWER from %s\n", CALSETUP_FILE);
            } 
        }
 
// 11b test setup
        else if(strnicmp("11b_TEST_SPEC_MASK", pLine, strlen("11b_TEST_SPEC_MASK")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the 11b_TEST_SPEC_MASK from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.testSpecMask_2p4[MODE_11b] = (testVal) ? TRUE : FALSE;
            }
        }
        else if(strnicmp("11b_TEST_TXPER", pLine, strlen("11b_TEST_TXPER")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the 11b_TEST_TXPER from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.testTXPER_2p4[MODE_11b] = (testVal) ? TRUE : FALSE;
            }
        }
        else if(strnicmp("11b_TEST_RXSEN", pLine, strlen("11b_TEST_RXSEN")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the 11b_TEST_RXSEN from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.testRXSEN_2p4[MODE_11b] = (testVal) ? TRUE : FALSE;
            }
        }

// ofdm@2p4 test setup
        else if(strnicmp("11g_TEST_SPEC_MASK", pLine, strlen("11g_TEST_SPEC_MASK")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the 11g_TEST_SPEC_MASK from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.testSpecMask_2p4[MODE_11g] = (testVal) ? TRUE : FALSE;
            }
        }
        else if(strnicmp("11g_TEST_TXPER", pLine, strlen("11g_TEST_TXPER")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the 11g_TEST_TXPER from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.testTXPER_2p4[MODE_11g] = (testVal) ? TRUE : FALSE;
            }
        }
        else if(strnicmp("11g_TEST_RXSEN", pLine, strlen("11g_TEST_RXSEN")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the 11g_TEST_RXSEN from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.testRXSEN_2p4[MODE_11g] = (testVal) ? TRUE : FALSE;
            }
        }
        else if(strnicmp("SUB_VENDOR_ID", pLine, strlen("SUB_VENDOR_ID")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%x", &CalSetup.subVendorID)) {
                uiPrintf("Unable to read the SUB_VENDOR_ID from %s\n", CALSETUP_FILE);
            }
        }
        else if(strnicmp("GOLDEN_PPM", pLine, strlen("GOLDEN_PPM")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%ld", &CalSetup.goldenPPM)) {
                uiPrintf("Unable to read the GOLDEN_PPM from %s\n", CALSETUP_FILE);
            }
        }
//snoop: take it out. debug only.     
		else if(strnicmp("VERIFY_DATA_PACKET_LEN", pLine, strlen("VERIFY_DATA_PACKET_LEN")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &VERIFY_DATA_PACKET_LEN)) {
                uiPrintf("Unable to read the VERIFY_DATA_PACKET_LEN from %s\n", CALSETUP_FILE);
            }
        }
        else if(strnicmp("GOLDEN_TX_POWER", pLine, strlen("GOLDEN_TX_POWER")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.goldenTXPower)) {
                uiPrintf("Unable to read the GOLDEN_TX_POWER from %s\n", CALSETUP_FILE);
            }
        }
        else if(strnicmp("11b_GOLDEN_TX_POWER", pLine, strlen("11b_GOLDEN_TX_POWER")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.goldenTXPower_2p4[MODE_11b])) {
                uiPrintf("Unable to read the 11b_GOLDEN_TX_POWER from %s\n", CALSETUP_FILE);
            } 
        }
        else if(strnicmp("11g_GOLDEN_TX_POWER", pLine, strlen("11g_GOLDEN_TX_POWER")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.goldenTXPower_2p4[MODE_11g])) {
                uiPrintf("Unable to read the 11g_GOLDEN_TX_POWER from %s\n", CALSETUP_FILE);
            }
        }
		else if((strnicmp("PM_MODEL", pLine, strlen("PM_MODEL")) == 0) &&
				((pLine[strlen("PM_MODEL")] == ' ') || 
				 (pLine[strlen("PM_MODEL")] == '\t') ) ){

				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);
				pLine = strtok(pLine," ;#");
				if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the PM_MODEL from %s\n", CALSETUP_FILE);
				}
				switch (testVal) {
				case 1:
					CalSetup.pmModel = PM_436A;
					break;
				case 2:
					CalSetup.pmModel= PM_E4416A;
					break;
				case 3:
					CalSetup.pmModel = PM_4531;
					break;
				default:
					uiPrintf("ERROR parsing PM_MODEL:\nIllegal value %d. Choose from 1, 2 or 3\n", testVal);
					uiPrintf("Using the default power meter model HP436A\n");
					CalSetup.pmModel = PM_436A;
				}			
		}			        
        else if(strnicmp("PM_GPIB_ADDR", pLine, strlen("PM_GPIB_ADDR")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &CalSetup.pmGPIBaddr)) {
                uiPrintf("Unable to read the PM_GPIB_ADDR from %s\n", CALSETUP_FILE);
            }
        }
        else if(strnicmp("SA_GPIB_ADDR", pLine, strlen("SA_GPIB_ADDR")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &CalSetup.saGPIBaddr)) {
                uiPrintf("Unable to read the SA_GPIB_ADDR from %s\n", CALSETUP_FILE);
            }
        }
        else if(strnicmp("ATT_GPIB_ADDR", pLine, strlen("ATT_GPIB_ADDR")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &CalSetup.attGPIBaddr)) {
                uiPrintf("Unable to read the ATT_GPIB_ADDR from %s\n", CALSETUP_FILE);
            }
        }
       else if(strnicmp("ATTEN_DUT_PM", pLine, strlen("ATTEN_DUT_PM")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.attenDutPM)) {
                uiPrintf("Unable to read the ATTEN_DUT_PM from %s\n", CALSETUP_FILE);
            }
        }
       else if(strnicmp("ATTEN_DUT_SA", pLine, strlen("ATTEN_DUT_SA")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.attenDutSA)) {
                uiPrintf("Unable to read the ATTEN_DUT_SA from %s\n", CALSETUP_FILE);
            }
        }
       else if(strnicmp("ATTEN_FIXED_DUT_GOLDEN", pLine, strlen("ATTEN_FIXED_DUT_GOLDEN")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.attenDutGolden)) {
                uiPrintf("Unable to read the ATTEN_FIXED_DUT_GOLDEN from %s\n", CALSETUP_FILE);
            }
        }
       else if(strnicmp("11b_ATTEN_DUT_PM", pLine, strlen("11b_ATTEN_DUT_PM")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.attenDutPM_2p4[MODE_11b])) {
                uiPrintf("Unable to read the 11b_ATTEN_DUT_PM from %s\n", CALSETUP_FILE);
            } else
			{
				CalSetup.attenDutPM_2p4[MODE_11g] = CalSetup.attenDutPM_2p4[MODE_11b];
			}	
        }
       else if(strnicmp("11b_ATTEN_DUT_SA", pLine, strlen("11b_ATTEN_DUT_SA")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.attenDutSA_2p4[MODE_11b])) {
                uiPrintf("Unable to read the 11b_ATTEN_DUT_SA from %s\n", CALSETUP_FILE);
            }else
			{
				CalSetup.attenDutSA_2p4[MODE_11g] = CalSetup.attenDutSA_2p4[MODE_11b];
			}	
        }
       else if(strnicmp("11b_ATTEN_FIXED_DUT_GOLDEN", pLine, strlen("11b_ATTEN_FIXED_DUT_GOLDEN")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.attenDutGolden_2p4[MODE_11b])) {
                uiPrintf("Unable to read the 11b_ATTEN_FIXED_DUT_GOLDEN from %s\n", CALSETUP_FILE);
            }else
			{
				CalSetup.attenDutGolden_2p4[MODE_11g] = CalSetup.attenDutGolden_2p4[MODE_11b];
				//uiPrintf("CalSetup.goldenTXPower_2p4 = %d, %f\n",CalSetup.attenDutGolden_2p4[MODE_11g], CalSetup.attenDutGolden_2p4[MODE_11b]);
			}	
        }
       else if(strnicmp("11b_MAX_POWER_CAP", pLine, strlen("11b_MAX_POWER_CAP")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.maxPowerCap[MODE_11b])) {
                uiPrintf("Unable to read the 11b_MAX_POWER_CAP from %s\n", CALSETUP_FILE);
            }	
        }
       else if(strnicmp("MAX_POWER_CAP", pLine, strlen("MAX_POWER_CAP")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.maxPowerCap[MODE_11a])) {
                uiPrintf("Unable to read the MAX_POWER_CAP from %s\n", CALSETUP_FILE);
            }	
        }
       else if(strnicmp("11g_MAX_POWER_CAP", pLine, strlen("11g_MAX_POWER_CAP")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%lf", &CalSetup.maxPowerCap[MODE_11g])) {
                uiPrintf("Unable to read the 11g_MAX_POWER_CAP from %s\n", CALSETUP_FILE);
            }	
        }
	   else if(strnicmp("11b_NUM_SENS_PACKETS", pLine, strlen("11b_NUM_SENS_PACKETS")) == 0) {			
				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);		
				if(!sscanf(pLine, "%d", &CalSetup.numSensPackets[MODE_11b])) {
				uiPrintf("Unable to read the 11b_NUM_SENS_PACKETS from %s\n", CALSETUP_FILE);
				}
		}			        
	   else if(strnicmp("11g_NUM_SENS_PACKETS", pLine, strlen("11g_NUM_SENS_PACKETS")) == 0) {			
				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);		
				if(!sscanf(pLine, "%d", &CalSetup.numSensPackets[MODE_11g])) {
				uiPrintf("Unable to read the 11g_NUM_SENS_PACKETS from %s\n", CALSETUP_FILE);
				}
		}			        
	   else if(strnicmp("NUM_SENS_PACKETS", pLine, strlen("NUM_SENS_PACKETS")) == 0) {			
				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);		
				if(!sscanf(pLine, "%d", &CalSetup.numSensPackets[MODE_11a])) {
				uiPrintf("Unable to read the NUM_SENS_PACKETS from %s\n", CALSETUP_FILE);
				}
		}			        
	   else if(strnicmp("TXPER_BACKOFF_ATTEN", pLine, strlen("TXPER_BACKOFF_ATTEN")) == 0) {			
				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);		
				if(!sscanf(pLine, "%d", &CalSetup.txperBackoff)) {
				uiPrintf("Unable to read the TXPER_BACKOFF_ATTEN from %s\n", CALSETUP_FILE);
				}
		}			        
	   else if(strnicmp("11b_CAL_FIXED_GAIN", pLine, strlen("11b_CAL_FIXED_GAIN")) == 0) {			
				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);		
				if(!sscanf(pLine, "%d", &CalSetup.cal_fixed_gain[MODE_11b])) {
				uiPrintf("Unable to read the 11b_CAL_FIXED_GAIN from %s\n", CALSETUP_FILE);
				}
		}			        
	   else if(strnicmp("11g_CAL_FIXED_GAIN", pLine, strlen("11g_CAL_FIXED_GAIN")) == 0) {			
				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);		
				if(!sscanf(pLine, "%d", &CalSetup.cal_fixed_gain[MODE_11g])) {
				uiPrintf("Unable to read the 11g_CAL_FIXED_GAIN from %s\n", CALSETUP_FILE);
				} 
		}			        
	   else if(strnicmp("CAL_FIXED_GAIN", pLine, strlen("CAL_FIXED_GAIN")) == 0) {			
				pLine = strchr(pLine, '=');
				pLine = strtok(pLine, delimiters);		
				if(!sscanf(pLine, "%d", &CalSetup.cal_fixed_gain[MODE_11a])) {
				uiPrintf("Unable to read the CAL_FIXED_GAIN from %s\n", CALSETUP_FILE);
				}
		}			        
	   else if(strnicmp("DO_IQ_CAL", pLine, strlen("DO_IQ_CAL")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the DO_IQ_CAL from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.do_iq_cal = (testVal) ? TRUE : FALSE;
            }
        }
	   else if(strnicmp("CUSTOMER_DEBUG", pLine, strlen("CUSTOMER_DEBUG")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &testVal)) {
                uiPrintf("Unable to read the CUSTOMER_DEBUG from %s\n", CALSETUP_FILE);
            }
            else {
                CalSetup.customerDebug = (testVal) ? TRUE : FALSE;
            }
        }
	   else if(strnicmp("MAX_RETEST_NUM", pLine, strlen("MAX_RETEST_NUM")) == 0) {
            pLine = strchr(pLine, '=');
            pLine = strtok(pLine, delimiters);
            if(!sscanf(pLine, "%d", &CalSetup.maxRetestIters)) {
                uiPrintf("Unable to read the MAX_RETEST_NUM from %s\n", CALSETUP_FILE);
            }
			if (CalSetup.maxRetestIters < 1) {
				CalSetup.maxRetestIters = 1;
			}

⌨️ 快捷键说明

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