Пример #1
0
 /// <summary>
 /// 处理接收数据完成
 /// </summary>
 void CallEndResult()
 {
     byte[] result = CopyBuffer(true);
     if (result != null && result.Length > 0)
     {
         if (SerialPortResult != null)
         {
             //异步通知接收完成
             AsyncCallResult call = new AsyncCallResult(CalResult);
             call.BeginInvoke(result, null, null);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// 结束接收
 /// </summary>
 void EndReceive(byte[] bs)
 {
     //设置最后接收时间
     m_lastReceiveTime = DateTime.Now;
     m_isReceiving     = false;
     if (OnSerialPortReceived != null &&
         bs != null &&
         bs.Length != 0)
     {
         AsyncCallResult call = new AsyncCallResult(CalReceived);
         call.BeginInvoke(bs, null, null);
     }
 }
Пример #3
0
 //处理接手数据完成
 void CallEndResult()
 {
     byte[] result = CopyBuffer(true);
     if (result != null && result.Length > 0)
     {
         if (SerialPortResult != null)
         {
             //异步通知接收完成
             AsyncCallResult call = new AsyncCallResult(CalResult);
             call.BeginInvoke(result, null, null);
         }
     }
     result = null;
     //GC.Collect();
     //GC.WaitForPendingFinalizers();
 }