/// <summary>
        /// 任务流
        /// </summary>
        /// <returns></returns>
        private int TestTaskFlow()
        {
            int ret = -1;

            //string pattern = null;
            //eidRead = "NULL";
            frmMain.DisplayLog("已检测到按键,测试中...\r\n");

            if (!readWriteIdHandle.CheckUart())
            {
                return(ret);
            }

            readWriteIdHandle.CheckModuleIsOk();
            //do
            //{

            //    frmMain.DisplayLog("正在发送...\r\n");


            //    //frmMain.DisplayLog(string.Format("已获取模块EID:{0}\r\n", eidRead));
            //    //frmMain.SetText(AllForms.EnumControlWidget.txtEid.ToString(), eidRead, false);



            //} while (false);


            //两种情况进入此处:1、超时跳出了do while,2、获取想要到 value
            if (readWriteIdHandle.IsTimeOut)
            {
                frmMain.DisplayLog("测试超时\r\n");
                return(ret);
            }

            ProductionInfo.SystemType systemType = ProductionInfo.Type;

            //使用do..while(false)的原因,是为了当测试流程为fail时,使用break跳出该结构,仍然执行结果上报
            ret = 0;
            return(ret);
        }
예제 #2
0
        /// <summary>
        /// 任务流
        /// </summary>
        /// <returns></returns>
        private int TestTaskFlow()
        {
            int ret = -1;

            //string pattern = null;
            //eidRead = "NULL";

            //两种情况进入此处:1、超时跳出了do while,2、按了空格确认上电
            if (readWriteIdHandle.IsTimeOut)
            {
                frmMain.DisplayLog("测试超时\r\n");
                return(ret);
            }

            do
            {
                frmMain.DisplayLog("测试中...\r\n");
                CmdProcess cmdProcess = new CmdProcess();   //cmd类
                tool = new ThirdPartyTool()
                {
                    ToolDirectory = "Microsoft Azure Sphere SDK",
                    ToolName      = "InitializeCommandPrompt",
                    Cmd           = "azsphere device wifi show-status"
                };

                string strRet;
                #region //获取OS版本
                //strRet = cmdProcess.ExeCommand("", "azsphere device show-ota-status");//"azsphere device wifi show-status"
                //if (strRet.Contains("error: Could not connect to the device."))
                //{
                //    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}
                //if (strRet.Contains("is not a valid value"))
                //{
                //    frmMain.DisplayLog(string.Format("未claim设备 获取OS版本失败 FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}
                #endregion
                //对比模块MAC地址-标签MAC地址
                strRet = cmdProcess.ExeCommand("", "azsphere device wifi show-status");//"azsphere device wifi show-status"
                if (strRet.Contains("error: Could not connect to the device."))
                {
                    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                //ret = DeviceCheck(tool, out strRet);
                //if (ret!=0)
                //{
                //    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}
                string mouduleMac = cmdProcess.GetValueByKeyword(strRet, "MAC Address");
                if (mouduleMac != labelSn)
                {
                    frmMain.DisplayLog(string.Format("MAC检查:模块{0},标签{1} 对比不一致  FAIL\r\n", mouduleMac, labelSn));
                    break;
                }
                frmMain.DisplayLog(string.Format("MAC检查:模块{0},标签{1} 对比一致  PASS\r\n", mouduleMac, labelSn));

                //检查是否有测试程序

                //azsphere device sideload show-status
                //azsphere device sideload delete
                //azsphere device sideload deploy -p mt_app.img


                //删除当前程序
                frmMain.DisplayLog("当前程序删除中...\r\n");
                strRet = cmdProcess.ExeCommand("", "azsphere device sideload delete");//"azsphere device wifi show-status"
                if (strRet.Contains("error: Could not connect to the device."))
                {
                    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                if (!strRet.Contains("Command completed successfully"))
                {
                    frmMain.DisplayLog(string.Format("当前程序删除: 失败  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                frmMain.DisplayLog("当前程序删除:成功 PASS\r\n");
                Thread.Sleep(500);

                //Side load(加载测试固件)
                frmMain.DisplayLog("测试固件加载中...\r\n");
                strRet = cmdProcess.ExeCommand("", string.Format("azsphere device sideload deploy -p ../app/{0}", TestAppName));//"azsphere device wifi show-status"
                if (strRet.Contains("error: Could not connect to the device."))
                {
                    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }

                //tool.Cmd = "azsphere device sideload deploy -p mt_app.img";

                //ret = DeviceCheck(tool, out strRet);
                //if (ret != 0)
                //{
                //    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}
                if (!strRet.Contains("Command completed successfully"))
                {
                    frmMain.DisplayLog(string.Format("加载测试固件:失败  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                frmMain.DisplayLog(string.Format("加载测试固件:成功 PASS\r\n", strRet));


                string pinTestRetinfo;
                //Socket复位
                frmMain.DisplayLog("复位测试中...\r\n");          //成功 为有效信息
                bool pinTestRet = PinTestBySocket("reset_tests", out pinTestRetinfo);
                frmMain.DisplayLog(pinTestRetinfo + "\r\n"); //失败 为错误信息
                if (!pinTestRet)
                {
                    frmMain.DisplayLog("复位测试:失败 FAIL\r\n");//失败 为错误信息
                    break;
                }
                frmMain.DisplayLog("复位测试:合格 PASS\r\n");//成功 为有效信息

                //Socket GPIO检查
                frmMain.DisplayLog("GPIO测试中...\r\n");
                pinTestRet = PinTestBySocket("get_gpios", out pinTestRetinfo);
                frmMain.DisplayLog(pinTestRetinfo + "\r\n");//失败 为错误信息

                if (!pinTestRet)
                {
                    frmMain.DisplayLog("GPIO测试:测试失败 FAIL\r\n");//失败 为错误信息
                    break;
                }
                string errorStr;
                bool   gpioRet = GetGIPOResultBySocketRet(pinTestRetinfo, out errorStr);
                //展示返回的GPIO数据
                //strRet = strRet.Replace("P", "PASS").Replace("F", "FAIL") + "\r\n";
                //frmMain.DisplayLog(strRet);
                //GPIO结果显示
                if (!gpioRet)
                {
                    frmMain.DisplayLog("GPIO测试: 不合格  FAIL \r\n");
                    break;
                }
                frmMain.DisplayLog("GPIO测试:合格 PASS\r\n");//成功 为有效信息

                #region 串口测试 复位和GPIO
                ////串口发送Reset System\r\n
                //strRet = readWriteIdHandle.Read(ATReadCmd.ReadIdType.Reset);
                //if (string.IsNullOrEmpty(strRet))
                //{
                //    frmMain.DisplayLog(string.Format("复位命令未得到回应 串口失败  FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}
                ////if (!strRet.Contains("Get RST command"))
                ////{
                ////    frmMain.DisplayLog(string.Format("复位未得到回应 串口失败  FAIL\r\n详细:{0}  \r\n", strRet));
                ////    break;
                ////}
                ////复位命令得到回应
                //frmMain.DisplayLog(string.Format("复位中... \r\n"));
                ////跳出循环说明复位成功
                //readWriteIdHandle.ReadRestInfo("init completed");
                //frmMain.DisplayLog(string.Format("复位成功  PASS\r\n"));


                ////GPIO测试
                ////串口发送Reset System\r\n
                //Thread.Sleep(1000);
                //strRet = readWriteIdHandle.Read(ATReadCmd.ReadIdType.GPIOTest);
                //if (string.IsNullOrEmpty(strRet))
                //{
                //    frmMain.DisplayLog("GPIO测试命令未得到回应 串口失败  FAIL\r\n");
                //    break;
                //}
                ////GPIO测试命令得到回应
                ////frmMain.DisplayLog("GPIO测试中... \r\n");
                ////string errorInfo;
                ////bool gpioRet = checkGIPOResult(strRet, out errorInfo);
                //////展示返回的GPIO数据
                ////strRet = strRet.Replace("P", "PASS").Replace("F", "FAIL") + "\r\n";
                ////frmMain.DisplayLog(strRet);
                //////GPIO结果显示
                ////if (!gpioRet)
                ////{
                ////    frmMain.DisplayLog(string.Format("GPIO测试:失败  FAIL \r\n详细:{0}\r\n", errorInfo));
                ////    break;
                ////}
                ////frmMain.DisplayLog("GPIO测试:成功  PASS\r\n");
                #endregion
                //删除APPtest
                frmMain.DisplayLog("测试固件删除中...\r\n");
                strRet = cmdProcess.ExeCommand("", "azsphere device sideload delete");//"azsphere device wifi show-status"
                if (strRet.Contains("error: Could not connect to the device."))
                {
                    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                //tool.Cmd = "azsphere device sideload deploy -p mt_app.img";

                //ret = DeviceCheck(tool, out strRet);
                //if (ret != 0)
                //{
                //    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}
                if (!strRet.Contains("Command completed successfully"))
                {
                    frmMain.DisplayLog(string.Format("测试固件删除:失败  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                frmMain.DisplayLog("测试固件删除:成功 PASS\r\n");

                frmMain.DisplayLog("Wifi列表网络检查中...\r\n");
                //检查网络 wifi表
                strRet = cmdProcess.ExeCommand("", "azsphere device wifi list");//"azsphere device wifi show-status"
                if (strRet.Contains("error: Could not connect to the device."))
                {
                    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                if (!strRet.Contains("No networks found") && strRet.Contains("ID"))
                {
                    //Get ID
                    string[] wifiIdList = cmdProcess.GetListByKeyword(strRet, "ID").ToArray();

                    foreach (var item in wifiIdList)
                    {
                        frmMain.DisplayLog("WIFI列表检查:含有WIFI列表ID,删除中...\r\n");
                        //不为空
                        if (!string.IsNullOrEmpty(item))
                        {
                            //删除ID
                            strRet = cmdProcess.ExeCommand("", string.Format("azsphere device wifi delete –i {0}", item));//"azsphere device wifi show-status"
                            if (strRet.Contains("error: Could not connect to the device."))
                            {
                                frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                                return(ret);
                            }
                            //不包含成功信息且不包含
                            if (!strRet.Contains("Successfully removed network") && !strRet.Contains("Command completed successfully"))
                            {
                                frmMain.DisplayLog(string.Format("WIFI列表ID删除:失败  FAIL\r\n详细:{0}  \r\n", strRet));
                                return(ret);
                            }
                        }
                    }
                }
                frmMain.DisplayLog("WIFI列表检查:PASS\r\n");
                //性能测试
                frmMain.DisplayLog("capabilties测试中...\r\n");
Capability:
                strRet = cmdProcess.ExeCommand("", "azsphere device capability show-attached");//"azsphere device wifi show-status"
                if (strRet.Contains("error: Could not connect to the device."))
                {
                    frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                if (!strRet.Contains("Command completed successfully"))
                {
                    frmMain.DisplayLog(string.Format("capabilties测试:失败  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                List <string> capabilitiesList = cmdProcess.GetListCapabilitiesKeyword(strRet, "Enable");
                if (capabilitiesList.Count > 0)
                {
                    //manufacture set complete status,只能设置一次,设置后就不能够RF测试和校准了,测试阶段不要轻易尝试。
                    #region
                    if (IsManufactureComplete == 1)
                    {
                        strRet = cmdProcess.ExeCommand("", "manufacture set complete status");//"azsphere device wifi show-status"
                        if (strRet.Contains("error: Could not connect to the device."))
                        {
                            frmMain.DisplayLog(string.Format("未上电连接上设备,请检查连接或驱动  FAIL\r\n详细:{0}  \r\n", strRet));
                            break;
                        }
                        frmMain.DisplayLog(string.Format("已设置制作完成状态,继续测试capabilties中...  \r\n详细:{0}  \r\n", strRet));
                        goto Capability;
                    }
                    #endregion
                    frmMain.DisplayLog(string.Format("capabilties测试:失败  FAIL\r\n详细:{0}  \r\n", strRet));
                    break;
                }
                frmMain.DisplayLog("capabilties测试:PASS\r\n");

                //E-fuse测试
                tool = new ThirdPartyTool()
                {
                    ToolDirectory = "RFToolCli",
                    Cmd           = string.Format("RfSettingsTool check --expected ../bin/{0}", EfuseBin)
                };
                //strRet = cmdProcess.ExeCommand(tool);//"azsphere device wifi show-status"
                //if (strRet.Contains("error"))
                //{
                //    frmMain.DisplayLog(string.Format("E-fuse测试:失败  FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}

                //python
                //tool.Cmd = "python RunHeaderTest.py ";//reset_system
                //tool.ToolDirectory = "PC";
                //strRet = cmdProcess.ExeCommand(tool, "");
                //if (strRet.Contains("error"))
                //{
                //    frmMain.DisplayLog(string.Format("E-fuse测试:失败  FAIL\r\n详细:{0}  \r\n", strRet));
                //    break;
                //}
                //E-fuse具体测试内容
                frmMain.DisplayLog("e-fuse测试中...\r\n");
                strRet = cmdProcess.ExeCommand(tool, "");
                string hasReadFlag = "Comparing configurations.";
                string startFlag   = "Reading configuration data from device.";

                string erroInfo = StringHelp.SubCentre(strRet, startFlag, "\r\n\r\n");

                if (!strRet.Contains(hasReadFlag))
                {
                    frmMain.DisplayLog(string.Format("E-fuse测试:命令失败 \r\n详细:{0}  \r\n", erroInfo));
                    break;
                }

                strRet = StringHelp.SubCentre(strRet, hasReadFlag, "\r\n\r\n");
                frmMain.DisplayLog(strRet + "\r\n");
                if (strRet.Contains("ERROR") || strRet.Contains("异常"))
                {
                    frmMain.DisplayLog("E-fuse测试结果: FAIL \r\n");
                    break;
                }

                frmMain.DisplayLog("E-fuse测试:PASS\r\n");
                ret = 0;



                //cd RFToolCli

                //List<string> listValue = readWriteIdHandle.ReadId();
                //if (listValue.Count <= 3)
                //{
                //    break;
                //}
                ////多组:1,1,01,01,,,40,0*61
                //int sum = 0;
                //string[] arryData;
                //try
                //{
                //    foreach (string strData in listValue)
                //    {
                //        arryData = strData.Split(',');
                //        应滤除其他可视卫星
                //        int cn0Value = int.Parse(arryData[6]);
                //        sum += cn0Value;
                //    }
                //}
                //catch (Exception ex)
                //{
                //    frmMain.DisplayLog(string.Format("数据解析错误:{0}\r\n", ex.Message));
                //    break;
                //}
                //int argVale = sum / listValue.Count;
                //frmMain.DisplayLog(string.Format("获取C/N0值:{0}\r\n", argVale));
                //if (argVale < StandardCN01)
                //{
                //    frmMain.DisplayLog(string.Format("C/N0值:{0},小于设定范围{1}  FAIL\r\n", argVale, StandardCN01));
                //    break;
                //}
                //frmMain.DisplayLog(string.Format("C/N0值:{0},大于设定范围{1}   PASS\r\n", argVale,StandardCN01));
                //ret = 0;

                ////从芯片获取eid
                ////eidRead = "081603FFFFF35293" + eidlast.ToString("X").PadLeft(4,'0');
                //eidRead = readWriteIdHandle.ReadId(ATReadCmd.ReadIdType.EidRead);
                //pattern = @"[0-9A-Z]{20}";
                //if (string.IsNullOrEmpty(eidRead) || !Regex.IsMatch(eidRead, pattern))
                //{
                //    frmMain.DisplayLog("EID读取失败\r\n");
                //    break;
                //}
                //frmMain.DisplayLog(string.Format("已获取模块EID:{0}\r\n", eidRead));
                //frmMain.SetText(AllForms.EnumControlWidget.txtEid.ToString(), eidRead, false);
            } while (false);



            ProductionInfo.SystemType systemType = ProductionInfo.Type;

            //使用do..while(false)的原因,是为了当测试流程为fail时,使用break跳出该结构,仍然执行结果上报

            return(ret);
        }
예제 #3
0
        /// <summary>
        /// 任务流
        /// </summary>
        /// <returns></returns>
        private int TestTaskFlow()
        {
            int    ret     = -1;
            string pattern = null;

            eidRead = "NULL";

            if (readWriteIdHandle.IsTimeOut)
            {
                frmMain.DisplayLog("测试超时\r\n");
                return(ret);
            }

            ProductionInfo.SystemType systemType = ProductionInfo.Type;

            //使用do..while(false)的原因,是为了当测试流程为fail时,使用break跳出该结构,仍然执行结果上报
            do
            {
                //从芯片获取eid
                //eidRead = "081603FFFFF35293" + eidlast.ToString("X").PadLeft(4,'0');
                //int readRet = 1;
                eidRead = readWriteIdHandle.ReadId(ATReadCmd.ReadIdType.EidRead);
                pattern = @"[0-9A-Z]{20}";
                if (string.IsNullOrEmpty(eidRead) || !Regex.IsMatch(eidRead, pattern))
                {
                    frmMain.DisplayLog("EID读取失败\r\n");
                    break;
                }
                frmMain.DisplayLog(string.Format("已获取模块EID:{0}\r\n", eidRead));
                frmMain.SetText(AllForms.EnumControlWidget.txtEid.ToString(), eidRead, false);


                //从芯片读出SN
                snRead  = readWriteIdHandle.ReadId(ATReadCmd.ReadIdType.SnRead);
                pattern = @"^[0-9A-Z]{16}$";
                if (string.IsNullOrEmpty(snRead))
                {
                    frmMain.DisplayLog("SN为空读取失败\r\n");
                    break;
                }
                if (!Regex.IsMatch(snRead, pattern))
                {
                    frmMain.DisplayLog("SN合法性检查:SN不合法败\r\n");
                    break;
                }
                frmMain.DisplayLog(string.Format("已获取模块合法SN:{0}\r\n", snRead));
                frmMain.SetText(AllForms.EnumControlWidget.txtSn.ToString(), snRead, false);

                //从芯片读出IMEI
                imeiRead = readWriteIdHandle.ReadId(ATReadCmd.ReadIdType.ImeiRead);
                pattern  = @"\d{15}";
                if (string.IsNullOrEmpty(imeiRead) || !Regex.IsMatch(imeiRead, pattern))
                {
                    frmMain.DisplayLog("IMEI读取失败\r\n");
                    break;
                }
                frmMain.DisplayLog(string.Format("已获取模块IMEI:{0}\r\n", imeiRead));
                frmMain.SetText(AllForms.EnumControlWidget.txtImei.ToString(), imeiRead, false);


                //从芯片获取iccid
                iccidRead = readWriteIdHandle.ReadId(ATReadCmd.ReadIdType.IccidRead);
                pattern   = @"[0-9A-Z]{20}";
                if (string.IsNullOrEmpty(iccidRead) || !Regex.IsMatch(iccidRead, pattern))
                {
                    frmMain.DisplayLog("ICCID读取失败\r\n");
                    break;
                }
                frmMain.DisplayLog(string.Format("已获取模块ICCID:{0}\r\n", iccidRead));
                frmMain.SetText(AllForms.EnumControlWidget.txtIccid.ToString(), iccidRead, false);


                //从芯片获取Verson
                versonRead = readWriteIdHandle.ReadId(ATReadCmd.ReadIdType.VersonRead);
                if (string.IsNullOrEmpty(iccidRead))
                {
                    frmMain.DisplayLog("版本号读取失败 FAIL\r\n");
                    break;
                }
                frmMain.DisplayLog(string.Format("已获取版本号:{0}\r\n", versonRead));
                if (versonRead != VersonIni.ToUpper())
                {
                    frmMain.DisplayLog(string.Format("读出的版本号:{0} 与 配置的版本号:{1} 不一致 FAIL\r\n", versonRead, VersonIni));
                    break;
                    //ret = -1;
                    //return ret;
                }
                else
                {
                    frmMain.DisplayLog(string.Format("读出的版本号:{0} 与 配置的版本号:{1} 一致 PASS\r\n", versonRead, VersonIni));
                }


                //判断IMEI与标签IMEI是否一致
                if (labelImei == imeiRead)
                {
                    frmMain.DisplayLog(string.Format("标签IMEI:{0}与模块IMEI:{1}对比一致 PASS\r\n", labelImei, imeiRead));
                }
                else
                {
                    frmMain.DisplayLog(string.Format("标签IMEI:{0}与模块IMEI:{1}对比不一致 FAIL\r\n", labelImei, imeiRead));
                    break;
                }

                //eid与iccid的后6位对比
                if (CompareEidIccid == 1)//要对比
                {
                    string lastSixIccid = iccidRead.Substring(iccidRead.Length - 6);
                    string lastSixEid   = eidRead.Substring(eidRead.Length - 6);
                    if (JudgeStandard == 0)
                    {
                        //一样 FAIL
                        if (lastSixIccid == lastSixEid)
                        {
                            frmMain.DisplayLog(string.Format("空中写号检查:未做。详细:后6位的eid:{0} 与 iccid:{1} 完全一致 FAIL\r\n", lastSixEid, lastSixIccid));
                            break;
                            //ret = -1;
                            //return ret;
                        }
                        else
                        {
                            frmMain.DisplayLog(string.Format("空中写号检查:通过。详细:后6位的eid:{0} 与 iccid:{1}不一致 PASS\r\n", lastSixEid, lastSixIccid));
                        }
                    }
                    else if (JudgeStandard == 1)
                    {
                        //一样 PASS
                        if (lastSixIccid != lastSixEid)
                        {
                            frmMain.DisplayLog(string.Format("空中写号检查:未做。详细:后6位的eid:{0} 与 iccid:{1} 不一致 FAIL\r\n", lastSixEid, lastSixIccid));
                            break;
                            //ret = -1;
                            //return ret;
                        }
                        else
                        {
                            frmMain.DisplayLog(string.Format("空中写号检查:通过。详细:后6位的eid:{0} 与 iccid:{1}完全一致 PASS\r\n", lastSixEid, lastSixIccid));
                        }
                    }
                }
                //离线查重IMEI
                if (ProductionInfo.Type == ProductionInfo.SystemType.Offline)
                {
                    JiaHao.ExcelHelp.ExcelHelper excel = JiaHao.ExcelHelp.ExcelHelper.GetExcelHelperInstance();
                    ret = excel.SearchImei(imeiRead);
                    if (ret != 0)
                    {
                        frmMain.DisplayLog(string.Format("IMEI查重: {0} 重复 FAIL\r\n", imeiRead));
                        return(ret);
                    }
                    else
                    {
                        frmMain.DisplayLog(string.Format("IMEI查重: {0} 本机查重 PASS\r\n", imeiRead));
                    }
                }

                #region
                if (systemType == ProductionInfo.SystemType.iMES)
                {
                    //调用打印接口下拉eid相关信息rep,为了生成Log作准备
                    Production.Server.NewHttpImeiPrint.ResponseInfo rep;
                    string errorInfo;
                    ret = ToImesInterface.ImeiPrint(out rep, imeiRead, out errorInfo);
                    //ImeiPrint(out rep);
                    if (ret != 0)
                    {
                        //显示结果:下拉失败,并改变颜色
                        frmMain.DisplayLog("从IMES下拉信息失败" + errorInfo + "\r\n");
                        break;
                    }
                    frmMain.DisplayLog("从IMES下拉信息成功\r\n");
                    //模组读出的和IMES下拉的是否相同
                    //IMEI,PUBLICSN,ICCID,IMSI,EID,IMEIBINDINGSN,DATE
                    //"sn":123456789012345,AI18082202000001,,,,,8822
                    string[] idNumber = rep.sn.ToUpper().Split(',');
                    #region 比对
                    #region IMEI
                    if (idNumber[0] == "")
                    {
                        frmMain.DisplayLog(string.Format("服务器IMEI获取为空 FAIL\r\n"));
                        ret = -1;
                        break;
                    }
                    if (idNumber[0] != imeiRead.ToUpper())
                    {
                        frmMain.DisplayLog(string.Format("服务器IMEI:{0} 与 模块IMEI:{1} 不一致 FAIL\r\n", idNumber[0], imeiRead));
                        ret = -1;
                        break;
                    }
                    else
                    {
                        frmMain.DisplayLog(string.Format("服务器IMEI:{0} 与 模块IMEI:{1} 一致 PASS\r\n", idNumber[0], imeiRead));
                    }
                    #endregion
                    #region SN
                    if (idNumber[1] != snRead.ToUpper())
                    {
                        frmMain.DisplayLog(string.Format("服务器SN:{0} 与 模块SN:{1} 不一致 FAIL\r\n", idNumber[1], snRead));
                        ret = -1;
                        break;
                    }
                    else
                    {
                        frmMain.DisplayLog(string.Format("服务器SN:{0} 与 模块SN:{1} 一致 PASS\r\n", idNumber[1], snRead));
                    }
                    #endregion

                    #region ICCID
                    if (idNumber[2] != iccidRead.ToUpper())
                    {
                        frmMain.DisplayLog(string.Format("服务器ICCID:{0} 与 模块ICCID:{1} 不一致 FAIL\r\n", idNumber[2], iccidRead));
                        ret = -1;
                        break;
                    }
                    else
                    {
                        frmMain.DisplayLog(string.Format("服务器ICCID:{0} 与 模块ICCID:{1} 一致 PASS\r\n", idNumber[2], iccidRead));
                    }
                    #endregion

                    #region EID
                    if (idNumber[4] != eidRead.ToUpper())
                    {
                        frmMain.DisplayLog(string.Format("服务器EID:{0} 与 模块EID:{1} 不一致 FAIL\r\n", idNumber[4], eidRead));
                        ret = -1;
                        break;
                    }
                    else
                    {
                        frmMain.DisplayLog(string.Format("服务器EID:{0} 与 模块EID:{1} 一致 PASS\r\n", idNumber[4], eidRead));
                    }
                    #endregion

                    #endregion
                }

                if (systemType == ProductionInfo.SystemType.GSMMES)
                {
                    //EID合法性检查
                    ret = EidVerify();
                    if (ret != 0)
                    {
                        break;
                    }
                }
                #endregion

                if (systemType == ProductionInfo.SystemType.GSMMES)
                {
                    //EID合法性检查
                    ret = CheckAllNumber();
                    if (ret != 0)//失败就直接上报测试结果
                    {
                        break;
                    }
                }
            } while (false);

            if (systemType == ProductionInfo.SystemType.GSMMES)
            {
                frmMain.DisplayLog("测试数据上报服务器\r\n");
                //EID/IMEI/SN上报服务器
                int    resultUpload = ret == 0 ? 1 : 2;
                string testDada     = string.Empty;
                string log          = frmMain.ReadLog();

                ret = EidUpload(resultUpload, log);
                if (ret != 0)
                {
                    frmMain.DisplayLog("过站失败\r\n");
                    return(ret);
                }
            }
            #region 离线 记录到Excel
            if (ProductionInfo.Type == ProductionInfo.SystemType.Offline)
            {
                if (ret == 0)
                {
                    JiaHao.ExcelHelp.ExcelHelper excel = JiaHao.ExcelHelp.ExcelHelper.GetExcelHelperInstance();
                    excel.ExportExcelOneByOne(new JiaHao.ExcelHelp.ExcelHelper.TrayInfoInExcel()
                    {
                        num          = 1,
                        sn           = snRead,
                        imei         = imeiRead,
                        eid          = eidRead,
                        iccid        = iccidRead,
                        cuatomerName = "中移物联"
                    });
                    frmMain.DisplayLog("写入Excel成功\r\n");
                }
            }
            #endregion
            return(ret);
        }