T_WiFi_CFG_handle.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:7k
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * T_WiFi_CFG_handle.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Calibration WiFi CFG file handling source
- *
- * Author:
- * -------
- * Andy Ueng (mtk00490)
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision$
- * $Modtime$
- * $Log$
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #pragma hdrstop
- #ifndef _T_META_FACTORY_CALIBRATION_H_
- #include "T_META_factory_calibration.H"
- #endif
- #ifndef _WFT_COMMON_H_
- #include "wft_common.h"
- #endif
- #ifndef _MISC_WIFI_H_
- #include "misc_wifi.h"
- #endif
- //===========================================================================
- void __fastcall T_META_factory_calibration::Read_WiFi_Common_CFG( void )
- {
- cfg->get_WiFi_Support( m_asWiFi_Support );
- }
- //---------------------------------------------------------------------------
- void __fastcall T_META_factory_calibration::Read_WiFi_IQviewInit_CFG( void )
- {
- if( IQVIEW == m_pWft->device_type )
- {
- AnsiString IP_addr;
- cfg->getIQview_IP_Addr( IP_addr );
- strcpy( m_pWft->iqv.ip_addr.addr, IP_addr.c_str() );
- m_pWft->iqv.ip_addr.port = 0;
- cfg->getIQview_TimeOut( m_pWft->iqv.timeout );
- cfg->getIQview_2_4GCableLoss( m_pWft->iqv.d_2_4g_cl );
- cfg->getIQview_5GCableLoss( m_pWft->iqv.d_5g_cl );
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall T_META_factory_calibration::Read_WiFi_AgeN4010aInit_CFG( void )
- {
- if( N4010A == m_pWft->device_type )
- {
- cfg->getN4010A_VISA_Alias_Name( m_pWft->s_age_n4010a.as_VISA_Alias_Name );
- cfg->getN4010A_VISA_Address( m_pWft->s_age_n4010a.as_VISA_Address );
- cfg->getN4010A_TimeOut( m_pWft->s_age_n4010a.i_timeout );
- cfg->getN4010A_2_4GCableLoss( m_pWft->s_age_n4010a.d_2_4g_cl );
- cfg->getN4010A_5GCableLoss( m_pWft->s_age_n4010a.d_5g_cl );
- }
- }
- //-------------------------------------------------------------------------
- void __fastcall T_META_factory_calibration::Read_WiFi_TxPcl_CFG( void )
- {
- cfg->get_CCK_MAX_P( m_dCCK_MAX_P );
- cfg->get_CCK_WANTED_P( m_dCCK_WANTED_P );
- cfg->get_CCK_MIN_P( m_dCCK_MIN_P );
- cfg->get_CCK_Delta( m_dCCK_Delta );
- cfg->get_CCK_C( m_iCCK_C );
- cfg->get_802_11B_CAL_CHANNEL(m_as802_11B_CAL_CHANNEL);
- cfg->get_802_11B_CHECK_CHANNEL(m_as802_11B_CHECK_CHANNEL);
- cfg->get_CCK_CAL_RATE(m_dCCK_CAL_RATE);
- cfg->get_CCK_CHECK_RATE(m_dCCK_CHECK_RATE);
- if (!IsValidWiFiTxRate(WIFI_802_11B_IDX, m_dCCK_CAL_RATE) ||
- !IsValidWiFiTxRate(WIFI_802_11B_IDX, m_dCCK_CHECK_RATE)
- )
- {
- PostMessage(ctrl.hPostMsgDestHandle,
- WM_MF_WIFI_TX_RATE_802_11B_FAIL,
- 0,
- 0
- );
- }
- GetWiFiTxRate(m_dCCK_CAL_RATE, m_eCCK_CAL_RATE);
- GetWiFiTxRate(m_dCCK_CHECK_RATE, m_eCCK_CHECK_RATE);
- cfg->get_OFDM_MAX_P(m_dOFDM_MAX_P);
- cfg->get_OFDM_WANTED_P(m_dOFDM_WANTED_P);
- cfg->get_OFDM_MIN_P(m_dOFDM_MIN_P);
- cfg->get_OFDM_Delta(m_dOFDM_Delta);
- cfg->get_OFDM_C(m_iOFDM_C);
- cfg->get_802_11G_CAL_CHANNEL(m_as802_11G_CAL_CHANNEL);
- cfg->get_802_11G_CHECK_CHANNEL(m_as802_11G_CHECK_CHANNEL);
- cfg->get_OFDM_CAL_RATE(m_dOFDM_CAL_RATE);
- cfg->get_OFDM_CHECK_RATE(m_dOFDM_CHECK_RATE);
- if (!IsValidWiFiTxRate(WIFI_802_11G_IDX, m_dOFDM_CAL_RATE) ||
- !IsValidWiFiTxRate(WIFI_802_11G_IDX, m_dOFDM_CHECK_RATE) ||
- ((m_dOFDM_CAL_RATE != 48) && (m_dOFDM_CAL_RATE != 54)) ||
- ((m_dOFDM_CHECK_RATE != 48) && (m_dOFDM_CHECK_RATE != 54))
- )
- {
- PostMessage(ctrl.hPostMsgDestHandle,
- WM_MF_WIFI_TX_RATE_802_11AG_FAIL,
- 0,
- 0
- );
- }
- GetWiFiTxRate(m_dOFDM_CAL_RATE, m_eOFDM_CAL_RATE);
- GetWiFiTxRate(m_dOFDM_CHECK_RATE, m_eOFDM_CHECK_RATE);
-
- cfg->get_WiFiTxPRecursive_Times( m_iWiFiTxPRecursive_Times );
- }