Exemple #1
0
 public bool connectDevice()
 {
     if (Code == 11)
     {
         return(false);
     }
     try
     {
         string comname = SerialHelper.GetOneCom();
         ReadDone = false;
         if (comname.Length > 0)
         {
             SerialPortFixer.Execute(comname);
             spt = new SerialPortTran(comname, false);
             return(true);
         }
         else
         {
             //throw new Exception("can not found any device connected");
             _tracing.Error("can not found any device connected");
             return(false);
         }
     }
     catch {
         return(false);
     }
 }