/// <summary>
        /// 通过I2C获取温度,Vcc,Bias,TxPower
        /// </summary>
        void GetParas()
        {
            //AOH 读取SN
            //A2H
            double      temp, vcc, txPower, bais;
            short       cache  = 0;
            ushort      ucache = 0;
            List <byte> data   = TranBase.MyI2C_ReadA2HByte(SerBuf, Port, 96, 10);

            //Temp 96,97
            cache            = DigitTransform(data[0], data[1]);
            temp             = (double)cache / 256;
            Temp             = temp;
            TestingPara.Temp = Temp.ToString();
            //Vcc 98,99
            ucache          = UDigitTransform(data[2], data[3]);
            vcc             = (double)ucache / 10000; //V
            Vcc             = vcc;
            TestingPara.Vcc = Vcc.ToString();

            //Bais 100,101
            ucache           = UDigitTransform(data[4], data[5]);
            bais             = (double)ucache / 500;
            Bias             = bais;
            TestingPara.Bias = Bias.ToString();
            //TxPower 102,103
            ucache  = UDigitTransform(data[6], data[7]);
            txPower = (double)ucache / 10000; //mW
            //取两位有效数字
            TxPower             = Math.Round((Math.Log10(txPower) * 10), 2);
            TestingPara.TxPower = TxPower.ToString();
        }
Beispiel #2
0
        public string WriteBlock()
        {
            string info_str = Manufacturer + "\n" + Model + "\n" + TxPower.ToString();

            for (int i = 0; i < 3; i++)
            {
                info_str += "\n" + _protocols[i];
            }
            return(info_str);

            //throw new System.NotImplementedException();
        }
Beispiel #3
0
 public void SetTxLevel(TxPower tx_power)
 {
 }