Exemple #1
0
 /// <summary>
 /// 串口接收事件响应
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
 {
     System.Threading.Thread.Sleep(20);
     try
     {
         lock (m_dataLocker)
         {
             m_stringBuilder.Append(SerialDevice.ReadExisting());
         }
     }
     catch (Exception ex)
     {
         ExceptionProcess(ex);
     }
 }