Exemplo n.º 1
0
 /// <summary>
 /// 接收字节数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Client_DatagramReceived(object sender, TcpDatagramReceivedEventArgs <byte[]> e)
 {
     //_master.UpdateDevceBData(Name, e.Datagram);
     if (CRCMethod.CheckCRC(e.Datagram))
     {
         Bdata      = e.Datagram;
         UpDateTime = DateTime.Now;
         log.LOG("R:" + CRCMethod.AllByteToString(e.Datagram));
     }
     else
     {
         log.LOG("RN:" + CRCMethod.AllByteToString(e.Datagram));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 接收文本数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Client_PlaintextReceived(object sender, TcpDatagramReceivedEventArgs <string> e)
 {
     //_master.UpdateDevceSData(Name, e.Datagram);
     Sdata      = e.Datagram;
     UpDateTime = DateTime.Now;
 }