misc.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:42k
- /*****************************************************************************
- * 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:
- * ---------
- * misc.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Misc. function 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 _FT_UTILS_H_
- #include "ft_utils.h"
- #endif
- #ifndef META_DLL_H
- #include "meta.h"
- #endif
- #ifndef _RF_COMMON_H_
- #include "rf_common.h"
- #endif
- #ifndef _RF_APC_H_
- #include "rf_apc.h"
- #endif
- #ifndef _RF_APC_8PSK_H_
- #include "rf_apc_8psk.h"
- #endif
- #ifndef _RF_AFC_H_
- #include "rf_afc.h"
- #endif
- #ifndef _MAN_ERROR_H_
- #include "man_error.h"
- #endif
- //------------------------------------------------------------------------------
- extern bool isBootTarget;
- //---------------------------------------------------------------------------
- static const short ARFCN_RANGE[][4] =
- {
- { 0, 124, 975, 1023 }, /* GSM900 */
- { 512, 885, 512, 885 }, /* DCS1800 */
- { 512, 810, 512, 810 }, /* PCS1900 */
- { 128, 251, 128, 251 }, /* GSM850 */
- { 259, 293, 259, 293 } /* GSM450 */
- };
- static const int APC_LOWEST_POWER_RANGE[][2] =
- {
- { 0, 36 }, /* GSM900 */
- { 0, 33 }, /* DCS1800 */
- { 0, 33 }, /* PCS1900 */
- { 0, 36 }, /* GSM850 */
- { 0, 36 } /* GSM450 */
- };
- // convert
- //---------------------------------------------------------------------------
- bool IsValidDelay(AnsiString ansi_str, int &delay)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, delay), RANGE_ERR_DELAY);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidARFCN(AnsiString ansi_str, E_BANDSEL band, short &arfcn)
- {
- bool invalid = true;
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, arfcn), RANGE_ERR_ARFCN);
- if (((arfcn>=ARFCN_RANGE[band][0])&&(arfcn<=ARFCN_RANGE[band][1]))||
- ((arfcn>=ARFCN_RANGE[band][2])&&(arfcn<=ARFCN_RANGE[band][3])) )
- {
- invalid = false;
- }
- RANGE_CHECK_ERROR(invalid, RANGE_ERR_ARFCN);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidARFCN2(AnsiString ansi_str, E_BANDSEL band, short &arfcn)
- {
- bool invalid = true;
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, arfcn), RANGE_ERR_ARFCN2);
- if ((-1 == arfcn)||
- ((arfcn>=ARFCN_RANGE[band][0])&&(arfcn<=ARFCN_RANGE[band][1]))||
- ((arfcn>=ARFCN_RANGE[band][2])&&(arfcn<=ARFCN_RANGE[band][3]))
- )
- {
- invalid = false;
- }
- RANGE_CHECK_ERROR(invalid, RANGE_ERR_ARFCN);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidARFCNStep(AnsiString ansi_str, short &arfcn_step)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, arfcn_step), RANGE_ERR_ARFCN_STEP);
- RANGE_CHECK_ERROR(arfcn_step <= 0 , RANGE_ERR_ARFCN_STEP);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidApcLowestPower(AnsiString ansi_str, int band, int &apc_lowest_power)
- {
- bool invalid = true;
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, apc_lowest_power), RANGE_ERR_APC_LOWEST_POWER);
- if ((apc_lowest_power >= APC_LOWEST_POWER_RANGE[band][0]) && (apc_lowest_power<=APC_LOWEST_POWER_RANGE[band][1]))
- {
- invalid = false;
- }
- RANGE_CHECK_ERROR(invalid, RANGE_ERR_APC_LOWEST_POWER);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidPMCount(AnsiString ansi_str, unsigned int &pmcount)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedInteger(ansi_str, pmcount, 1, 2147483647), RANGE_ERR_PM_COUNT);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidAFCCount(AnsiString ansi_str, short &count)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, count, 1, 32767), RANGE_ERR_AFC_COUNT);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidGain(AnsiString ansi_str, int &gain)
- {
- float f_gain;
- RANGE_CHECK_ERROR(!AnsiString_To_Float(ansi_str, f_gain), RANGE_ERR_GAIN);
- gain = (int) (f_gain*8);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidPathLoss(AnsiString ansi_str, float &path_loss)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Float(ansi_str, path_loss), RANGE_ERR_PATH_LOSS);
- return true;
- }
- //----------------------------------------------------------------------------
- bool IsValidRegBit(AnsiString ansi_str, unsigned char &bit)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, bit, 0, 1), RANGE_ERR_REG_BIT);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidMeasurementCount(AnsiString ansi_str, unsigned int &measuremnt_count)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedInteger(ansi_str, measuremnt_count, 1, 4294967295), RANGE_ERR_MEASUREMENT_COUNT);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidPeriod(AnsiString ansi_str, unsigned int &period)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedInteger(ansi_str, period, 1000, 4294967295), RANGE_ERR_PERIOD);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidRefDetSlopeSkew(AnsiString ansi_str, unsigned char &skew)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, skew, 0, 255), RANGE_ERR_REFDET_SLOPE_SKEW);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidAmFbDac(AnsiString ansi_str, unsigned char &dac)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, dac, 0, 255), RANGE_ERR_AM_FB_DAC);
- return true;
- }
- //---------------------------------------------------------------------------
- extern bool IsValidAmFbDac(AnsiString ansi_str, unsigned char &dac);
- //---------------------------------------------------------------------------
- bool IsValidPCL(AnsiString ansi_str, int band, int &pcl)
- {
- static const int PCL_RANGE[][2] =
- {
- {4, 31}, /* GSM900 */
- {0, 28}, /* DCS1800 */
- {0, 15}, /* PCS1900 */
- {4, 31} /* GSM850 */
- };
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, pcl), RANGE_ERR_PCL);
- if (pcl != -1)
- {
- RANGE_CHECK_ERROR((pcl<PCL_RANGE[band][0])||(pcl>PCL_RANGE[band][1]) , RANGE_ERR_PCL );
- }
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGPCL(AnsiString ansi_str, int band, int &pcl)
- {
- static const int PCL_RANGE[][2] =
- {
- {4, 31}, /* GSM400 */
- {4, 31}, /* GSM850 */
- {4, 31}, /* GSM900 */
- {0, 28}, /* DCS1800 */
- {0, 15}, /* PCS1900 */
- };
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, pcl) , RANGE_ERR_CFG_PCL);
- RANGE_CHECK_ERROR((pcl<PCL_RANGE[band][0]) || (pcl>PCL_RANGE[band][1]) , RANGE_ERR_CFG_PCL);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGMAX_P(AnsiString ansi_str, double &d_max_p)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, d_max_p), RANGE_ERR_CFG_MAX_P);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGWANTED_P(AnsiString ansi_str, double &d_wanted_p)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, d_wanted_p), RANGE_ERR_CFG_WANTED_P);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGMIN_P(AnsiString ansi_str, double &d_min_p)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, d_min_p), RANGE_ERR_CFG_MIN_P);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGC(AnsiString ansi_str, double &d_c)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, d_c), RANGE_ERR_CFG_C);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGCORRECTION(AnsiString ansi_str, double &d_correction)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, d_correction), RANGE_ERR_CFG_CORRECTION);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGRecursiveTimes(AnsiString ansi_str, int &i_RecursiveTimes)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_RecursiveTimes), RANGE_ERR_RECURSIVE_TIMES);
- RANGE_CHECK_ERROR(i_RecursiveTimes<=-1 , RANGE_ERR_RECURSIVE_TIMES);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGTSC(AnsiString ansi_str, char &c_TSC)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_char(ansi_str, c_TSC, 0, 7), RANGE_ERR_CFG_TSC);
- RANGE_CHECK_ERROR(c_TSC<=-1 , RANGE_ERR_CFG_TSC);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGAPCDelta(AnsiString ansi_str, double &d_APCDelta)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, d_APCDelta), RANGE_ERR_CFG_APC_DELTA);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidPCLDac(AnsiString ansi_str, unsigned short &pcl_dac)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedShort(ansi_str, pcl_dac, 0, 1023) , RANGE_ERR_PCL_DAC);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidVbias(unsigned int ui_rf_id, AnsiString ansi_str, unsigned char &vbias)
- {
- if (RF_ID_AERO2E != ui_rf_id)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, vbias, MIN_PA_VBIAS, MAX_PA_VBIAS_MT6140), RANGE_ERR_VBIAS);
- }
- else
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, vbias, MIN_PA_VBIAS, MAX_PA_VBIAS_AERO2E), RANGE_ERR_VBIAS);
- }
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidAFC(AnsiString ansi_str, short &afc)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, afc, 0, 8191) , RANGE_ERR_AFC);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidFreqErr(AnsiString ansi_str, double &freq_err)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, freq_err), RANGE_ERR_FREQERR);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBand(AnsiString &band)
- {
- AnsiString BAND_NAME[] =
- {
- "GSM",
- "DCS",
- "PCS",
- "GSM850"
- };
- for (int i=0; i<sizeof(BAND_NAME)/sizeof(BAND_NAME[0]); i++)
- {
- if (BAND_NAME[i].AnsiCompareIC(band) == 0)
- {
- return true;
- }
- }
- return false;
- }
- //---------------------------------------------------------------------------
- bool IsValidCAPID63(AnsiString ansi_str, int &cap_id)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, cap_id, 0, 63) , RANGE_ERR_CAPID);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCAPID127(AnsiString ansi_str, int &cap_id)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, cap_id, 0, 127), RANGE_ERR_CAPID);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCAPID511(AnsiString ansi_str, int &cap_id)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, cap_id, 0, 511), RANGE_ERR_CAPID);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidTA(AnsiString ansi_str, int &ta)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, ta, 0, 63), RANGE_ERR_TA);
- return true;
- }
- //---------------------------------------------------------------------------
- ////////////////////////////// IP2 ////////////////////////////////
- //---------------------------------------------------------------------------
- bool IsValidSky74045Icorrection(AnsiString ansi_str, signed char &i_corr)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, i_corr, -127, 127), RANGE_ERR_ICORRECTION);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidSky74045Qcorrection(AnsiString ansi_str, signed char &q_corr)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, q_corr, -127, 127), RANGE_ERR_QCORRECTION);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidSky74117Icorrection(AnsiString ansi_str, signed char &i_corr)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, i_corr, -63, 63), RANGE_ERR_ICORRECTION);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidSky74117Qcorrection(AnsiString ansi_str, signed char &q_corr)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, q_corr, -63, 63), RANGE_ERR_QCORRECTION);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidAcode(AnsiString ansi_str, unsigned char &acode)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, acode, 0, 63), RANGE_ERR_ACODE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidAmcode(AnsiString ansi_str, unsigned char &amcode)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, amcode, 0, 255), RANGE_ERR_AMCODE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidAmcode127(AnsiString ansi_str, unsigned char &amcode)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, amcode, 0, 127), RANGE_ERR_AMCODE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBcode(AnsiString ansi_str, unsigned char &bcode)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, bcode, 0, 127), RANGE_ERR_BCODE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCcode(AnsiString ansi_str, unsigned char &ccode)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, ccode, 0, 127), RANGE_ERR_CCODE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidMultiSlotTxPattern(AnsiString ansi_str, unsigned short &pattern)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedBinary(ansi_str, pattern, 0, 65535), RANGE_ERR_MUTLISLOT_TX_PATTERN);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCTPattern(AnsiString ansi_str, unsigned short &pattern)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedBinary(ansi_str, pattern, 0, 65535), RANGE_ERR_CT_PATTERN);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidC3TA(AnsiString ansi_str, unsigned char &ta)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, ta, 0, 7), RANGE_ERR_C3TA);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidC3TB(AnsiString ansi_str, unsigned char &tb)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, tb, 0, 3), RANGE_ERR_C3TB);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidC3TC(AnsiString ansi_str, unsigned char &tc)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, tc, 0, 3), RANGE_ERR_C3TC);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidC3TN(AnsiString ansi_str, unsigned char &tn)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, tn, 0, 63), RANGE_ERR_C3TN);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidC3TO(AnsiString ansi_str, unsigned char &to)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, to, 0, 15), RANGE_ERR_C3TO);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidC3PM(AnsiString ansi_str, unsigned char &pm)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, pm, 0, 15), RANGE_ERR_C3PM);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidAFCSlope(AnsiString ansi_str, int &slope)
- {
- float f_gain;
- RANGE_CHECK_ERROR(!AnsiString_To_Float(ansi_str, f_gain), RANGE_ERR_AFC_SLOPE);
- if (0.0 == f_gain)
- {
- f_gain=0.00000001;
- }
- slope = (int)(AFC_SLOPE_SCALE/f_gain);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValid2GAFCSlope(AnsiString ansi_str, double &slope)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, slope), RANGE_ERR_AFC_SLOPE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGAFCSlope(AnsiString ansi_str, double &slope)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, slope), RANGE_ERR_CFG_AFC_SLOPE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGFrequencyErrorPPM(AnsiString ansi_str, double &ppm)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, ppm), RANGE_ERR_CFG_FREQUENCY_ERROR_PPM);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCFGFrequencyError(AnsiString ansi_str, double &freq_err)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, freq_err), RANGE_ERR_CFG_FREQUENCY_ERROR);
- return true;
- }
- //==============================================================================
- ////////////////////////////// BB TX Parameters //////////////////////////////
- //==============================================================================
- //---------------------------------------------------------------------------
- bool IsValidTrimIQ(AnsiString ansi_str, signed char &trim_iq)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, trim_iq, -8, 7) , RANGE_ERR_TRIM_IQ);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidTrimIQStep(AnsiString ansi_str, char &trim_iq_step)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_char(ansi_str, trim_iq_step, 1, 15) , RANGE_ERR_TRIM_IQ_STEP);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidOffsetIQ(E_BBTXCFG_VER_T eBbTxCfgVer, AnsiString ansi_str, signed char &offiq)
- {
- if (eBbTxCfgVer < BBTXCFG_VER4)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, offiq, MIN_OFFSET_IQ_OLD, MAX_OFFSET_IQ_OLD), RANGE_ERR_OFFSET_IQ);
- }
- else
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, offiq, MIN_OFFSET_IQ_NEW, MAX_OFFSET_IQ_NEW), RANGE_ERR_OFFSET_IQ);
- }
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBBTXCalibratedFlag(AnsiString ansi_str, unsigned char &cal_flag)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, cal_flag, 0, 255), RANGE_ERR_BB_TX_CAL_FLAG );
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidOffsetIQStep(AnsiString ansi_str, char &off_iq_step)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_char(ansi_str, off_iq_step, 1, 63), RANGE_ERR_OFFSET_IQ_STEP);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidTxCalbias(E_BBTXCFG_VER_T eBbTxCfgVer, AnsiString ansi_str, signed char &calbias)
- {
- if (BBTXCFG_VER2 == eBbTxCfgVer)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, calbias, MIN_CALBIAS_OLD, MAX_CALBIAS_OLD), RANGE_ERR_TX_CALBIAS);
- }
- else
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, calbias, MIN_CALBIAS_NEW, MAX_CALBIAS_NEW), RANGE_ERR_TX_CALBIAS);
- }
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidTxIQSwap(AnsiString ansi_str, char &iq_swap)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_char(ansi_str, iq_swap, 0, 1), RANGE_ERR_TX_IQSWAP);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBBTXCommonModeVoltage(AnsiString ansi_str, signed char &voltage)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, voltage, -4, 3), RANGE_ERR_BB_TX_COMMON_MODE_VOLTAGE);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidBBTXGain(AnsiString ansi_str, signed char &gain)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, gain, -4, 3), RANGE_ERR_BB_TX_GAIN);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidBBTXCalrcsel(AnsiString ansi_str, signed char &Calrcsel)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, Calrcsel, -4, 3), RANGE_ERR_CALRCSEL);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidBBTXPhasesel(E_BBTXCFG_VER_T eBbTxCfgVer, AnsiString ansi_str, signed char &Phasesel)
- {
- if (eBbTxCfgVer <= BBTXCFG_VER4)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, Phasesel, MIN_PHASESEL_OLD, MAX_PHASESEL_OLD), RANGE_ERR_PHASESEL);
- }
- else
- {
- RANGE_CHECK_ERROR(!AnsiString_To_signedchar(ansi_str, Phasesel, MIN_PHASESEL_NEW, MAX_PHASESEL_NEW), RANGE_ERR_PHASESEL);
- }
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidBBTXPhaseselStep(AnsiString ansi_str, char &Phasesel_step)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_char(ansi_str, Phasesel_step, 1, 11), RANGE_ERR_PHASESEL_STEP);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidAPCBatLowVoltage(AnsiString ansi_str, double &voltage)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, voltage, 0, 10.0), RANGE_ERR_APC_BAT_LOW_VOLTAGE);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidAPCBatHighVoltage(AnsiString ansi_str, double &voltage)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, voltage, 0, 10.0), RANGE_ERR_APC_BAT_HIGH_VOLTAGE);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidAPCBatLowTemperature(AnsiString ansi_str, double &temperature)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, temperature, -50.0, 100.0), RANGE_ERR_APC_BAT_LOW_TEMPERATURE);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidAPCBatHighTemperature(AnsiString ansi_str, double &temperature)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, temperature, -50.0, 100.0), RANGE_ERR_APC_BAT_HIGH_TEMPERATURE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidRamp(AnsiString ansi_str, unsigned char &ramp)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, ramp, 0, 255), RANGE_ERR_RAMP);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidWeight(AnsiString ansi_str, unsigned int rf_id, unsigned short &weight)
- {
- if (RF_ID_A60111A != rf_id)
- {
- float f_weight;
- RANGE_CHECK_ERROR(!AnsiString_To_Float(ansi_str, f_weight, 0.0, 3.99), RANGE_ERR_WEIGHT);
- weight = (unsigned short)(f_weight*WEIGHT_SCALE);
- }
- else
- {
- short s_weight;
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, s_weight, -4, 4), RANGE_ERR_WEIGHT);
- weight = (unsigned short) (s_weight + A60111A_WEIGHT_OFFSET);
- }
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCSlope(AnsiString ansi_str, int &slope)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, slope), RANGE_ERR_ADC_SLOPE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCOffset(AnsiString ansi_str, int &dcoffset)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, dcoffset), RANGE_ERR_ADC_OFFSET);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCInput(AnsiString ansi_str, int &adc_input)
- {
- float fdata;
- RANGE_CHECK_ERROR(!AnsiString_To_Float(ansi_str, fdata), RANGE_ERR_ADC_INPUT);
- fdata *= 1000;
- fdata += (fdata>=0) ? 0.5 : -0.5 ;
- adc_input = (int)fdata;
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCVoltage(AnsiString ansi_str, int &adc_voltage)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, adc_voltage), RANGE_ERR_ADC_VOLTAGE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCurrentLimit(AnsiString ansi_str, int ¤t_limit)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, current_limit), RANGE_ERR_CURRENT_LIMIT);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCChannel(AnsiString ansi_str, int &adc_channel)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, adc_channel), RANGE_ERR_ADC_CHANNEL);
- RANGE_CHECK_ERROR(adc_channel <= -1 , RANGE_ERR_ADC_CHANNEL);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCResistance(AnsiString ansi_str, double &adc_resistance)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, adc_resistance), RANGE_ERR_ADC_RESISTANCE);
- RANGE_CHECK_ERROR(adc_resistance <= 0 , RANGE_ERR_ADC_RESISTANCE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCMaxVoltageDifference(AnsiString ansi_str, double &adc_max_voltage_difference)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, adc_max_voltage_difference), RANGE_ERR_ADC_MAX_VOLTAGE_DIFFERENCE);
- RANGE_CHECK_ERROR(adc_max_voltage_difference <= 0 , RANGE_ERR_ADC_MAX_VOLTAGE_DIFFERENCE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCMaxCurrentDifference(AnsiString ansi_str, double &adc_max_current_difference)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, adc_max_current_difference), RANGE_ERR_ADC_MAX_CURRENT_DIFFERENCE);
- RANGE_CHECK_ERROR(adc_max_current_difference <= 0 , RANGE_ERR_ADC_MAX_CURRENT_DIFFERENCE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidADCMeasurementCount(AnsiString ansi_str, int &adc_measurement_count)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, adc_measurement_count), RANGE_ERR_ADC_MEASUREMENT_COUNT);
- RANGE_CHECK_ERROR(adc_measurement_count<=0 , RANGE_ERR_ADC_MEASUREMENT_COUNT);
- return true;
- }
- //==============================================================================
- bool IsValidGPIBAddr(AnsiString ansi_str, int &GPIB_addr)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, GPIB_addr) , RANGE_ERR_GPIB_ADDR);
- RANGE_CHECK_ERROR(GPIB_addr<=-1 , RANGE_ERR_GPIB_ADDR);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidTimeout(AnsiString ansi_str, int &timeout )
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, timeout), RANGE_ERR_TIMEOUT);
- RANGE_CHECK_ERROR(timeout<=-1 , RANGE_ERR_TIMEOUT);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidCableLoss(AnsiString ansi_str, double &cable_loss)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, cable_loss), RANGE_ERR_CABLE_LOSS);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidPower(AnsiString ansi_str, double &power)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, power), RANGE_ERR_POWER);
- return true;
- }
- //==============================================================================
- ////////////////////////////// RX path loss CFG ///////////////////////////////
- //==============================================================================
- bool IsValidCFGPMCount(AnsiString ansi_str, char m_pm, short &n_pm)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, n_pm), RANGE_ERR_CFG_PMCOUNT);
- if (n_pm * m_pm > 2000)
- {
- return false;
- }
- return true;
- }
- //==============================================================================
- //////////////////////////// phase error CFG //////////////////////////////////
- //==============================================================================
- bool IsValidPhaseError(AnsiString ansi_str, double &d_ph_err)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Double(ansi_str, d_ph_err), RANGE_ERR_PHASE_ERROR);
- return true;
- }
- //===========================================================================
- static const int pcl2power_table[][32] =
- { // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- { 39,39,39,37,35,33,31,29,27,25,23,21,19,17,15,13,11, 9, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, // GSM900
- { 30,28,26,24,22,20,18,16,14,12,10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,36,34,32 }, // DCS1800
- { 30,28,26,24,22,20,18,16,14,12,10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0,33,33,33,33,33,33,33,33,33,32 }, // PCS1900
- { 39,39,39,37,35,33,31,29,27,25,23,21,19,17,15,13,11, 9, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, // GSM850
- };
- //---------------------------------------------------------------------------
- int PCL2POWER(int band, int pcl)
- {
- if (pcl<0) pcl=0;
- if (pcl>31) pcl = 31;
- int power=pcl2power_table[band][pcl];
- return(power);
- }
- //---------------------------------------------------------------------------
- static const int power2pcl_table[][32] =
- { // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
- { 19,18,17,16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 2 }, // GSM900
- { 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,31,30,29 }, // DCS1800
- { 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,31,30,29 }, // PCS1900
- { 19,18,17,16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 2 }, // GSM850
- };
- //---------------------------------------------------------------------------
- int POWER2PCL(int band, int power)
- {
- if(band == BANDSEL_GSM900 || band==BANDSEL_GSM850) power -= 5;
- power/=2;
- if(power<0) power = 0;
- if(power>31) power = 31;
- int pcl = power2pcl_table[band][power];
- return(pcl);
- }
- //==============================================================================
- bool IsValidRepeats(AnsiString ansi_str, int &repeats)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, repeats, 0, 255), RANGE_ERR_REPEATS);
- return true;
- }
- //==============================================================================
- bool IsValidSpeakerVolume(AnsiString ansi_str, int &SpeakerVolume)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, SpeakerVolume, 0, 6), RANGE_ERR_SPEAKERVOLUME);
- return true;
- }
- //==============================================================================
- bool IsValidBuzzerVolume(AnsiString ansi_str, int &BuzzerVolume)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, BuzzerVolume, 0, 7), RANGE_ERR_BUZZERVOLUME);
- return true;
- }
- //==============================================================================
- bool IsValidVolume(AnsiString ansi_str, int &Volume)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, Volume, 0, 6), RANGE_ERR_VOLUME);
- return true;
- }
- //==============================================================================
- bool IsValidInstrument(AnsiString ansi_str, int &Instrument)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, Instrument, 1, 128), RANGE_ERR_INSTRUMENT);
- return true;
- }
- //==============================================================================
- bool getGPIBAddrNumFromStr(AnsiString as_str, int &i_gpib_addr_num)
- {
- AnsiString as_gpib_addr_2;
- int iLD = as_str.AnsiPos("::");
- if (iLD <= 0)
- return false;
- as_gpib_addr_2 = as_str.SubString( iLD+2, as_str.Length() );
- iLD = as_gpib_addr_2.LastDelimiter("::");
- as_gpib_addr_2 = as_gpib_addr_2.SubString( 1, iLD-2 );
- i_gpib_addr_num = as_gpib_addr_2.ToInt();
- return true;
- }
- //==============================================================================
- bool IsValidBatteryCompensate(AnsiString ansi_str, unsigned short &battery_compensate)
- {
- float f_battery_compensate;
- RANGE_CHECK_ERROR( !AnsiString_To_Float( ansi_str, f_battery_compensate, 0.1, 1.9) , RANGE_ERR_BATTERY_COMPENSATE );
- battery_compensate = (unsigned short)(f_battery_compensate*BATTERY_COMPENSATE_SCALE);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidTxAfcOffset(AnsiString ansi_str, short &tx_afc_offset)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Short(ansi_str, tx_afc_offset, -65536, 65535), RANGE_ERR_TX_AFC_OFFSET);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidInterslotLowestDAC(AnsiString ansi_str, unsigned char &dac)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedChar(ansi_str, dac, 0, 255), RANGE_ERR_INTERSLOT_LOWEST_DAC);
- return true;
- }
- //---------------------------------------------------------------------------
- //////////////////////////// BV //////////////////////////////////
- //---------------------------------------------------------------------------
- bool IsValidBVAP(AnsiString ansi_str, int &i_ap)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_ap, 0, 7), RANGE_ERR_BV_AP);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVAS(AnsiString ansi_str, int &i_as)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_as, 0, 7), RANGE_ERR_BV_AS);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVAO(AnsiString ansi_str, int &i_ao)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_ao, 0, 63), RANGE_ERR_BV_AO);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVBD(AnsiString ansi_str, int &i_bd)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_bd, 0, 31), RANGE_ERR_BV_BD);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVKAG(AnsiString ansi_str, int &i_kag)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_kag, 0, 31), RANGE_ERR_BV_KAG);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVKSG(AnsiString ansi_str, int &i_ksg)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_ksg, 0, 15), RANGE_ERR_BV_KSG);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVKAD(AnsiString ansi_str, int &i_kad)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_kad, 0, 31), RANGE_ERR_BV_KAD);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVKSD(AnsiString ansi_str, int &i_ksd)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_ksd, 0, 15), RANGE_ERR_BV_KSD);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVVRE(AnsiString ansi_str, int &i_vre)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_vre, 0, 1), RANGE_ERR_BV_VRE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVVOF(AnsiString ansi_str, int &i_vof)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_vof, 0, 127), RANGE_ERR_BV_VOF);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVARE(AnsiString ansi_str, int &i_are)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_are, 0, 1), RANGE_ERR_BV_ARE);
- return true;
- }
- //---------------------------------------------------------------------------
- bool IsValidBVAOF(AnsiString ansi_str, int &i_aof)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Integer(ansi_str, i_aof, 0, 127), RANGE_ERR_BV_AOF);
- return true;
- }
- //==============================================================================
- ////////////////////////////////// CTS /////////////////////////////////////
- //==============================================================================
- //------------------------------------------------------------------------------
- bool IsValidCTSTemperature(AnsiString ansi_str, float &temperature)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Float(ansi_str, temperature, -20.0, 70.0), RANGE_ERR_CTS_TEMPERATURE);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidCTSTemperatureStep(AnsiString ansi_str, float &temperature_step)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_Float(ansi_str, temperature_step, 0.1, 90.0), RANGE_ERR_CTS_TEMPERATURE_STEP);
- return true;
- }
- //==============================================================================
- /////////////////////////////// register ///////////////////////////////////
- //==============================================================================
- bool IsValidHexBsiAddr(AnsiString ansi_str, unsigned int &bsi_addr)
- {
- RANGE_CHECK_ERROR(!AnsiString_Hex_To_UnsignedInt(ansi_str, bsi_addr), RANGE_ERR_REG_ADDR);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidDecBsiAddr(AnsiString ansi_str, unsigned int &bsi_addr)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedInteger(ansi_str, bsi_addr, 1, 4294967295), RANGE_ERR_REG_ADDR);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidHexBsiData(AnsiString ansi_str, unsigned int &bsi_data)
- {
- RANGE_CHECK_ERROR(!AnsiString_Hex_To_UnsignedInt(ansi_str, bsi_data), RANGE_ERR_REG_VALUE);
- return true;
- }
- //------------------------------------------------------------------------------
- bool IsValidDecBsiData(AnsiString ansi_str, unsigned int &bsi_data)
- {
- RANGE_CHECK_ERROR(!AnsiString_To_UnsignedInteger(ansi_str, bsi_data, 1, 4294967295), RANGE_ERR_REG_VALUE);
- return true;
- }