示例#1
0
 private void __AsynCommunicatErrorRecived(CommunicatePackage sender, ComunicateExcetion ex)
 {
     if (null != this.AsynCommunicatErrorRecived)
     {
         this.AsynCommunicatErrorRecived(sender, ex);
     }
 }
示例#2
0
        private void CallBack_Received(CommunicatePackage sender, AsynReplyCommunicatePackage evtAr)
        {
            byte[][] receivedDetails = new byte[evtAr.RemotDeviceReplyPackage.ParamDefalutValues.Values.Count][];
            evtAr.RemotDeviceReplyPackage.ParamDefalutValues.Values.CopyTo(receivedDetails, 0);
            string log = "";

            log = "From device: " + sender.TargetDevice.Detail + "\n" + "CommunicationName" + sender.CommunicationName + "\n" + "ReplyState: " +
                  evtAr.RemotDeviceReplyPackage.ReplyState.ToString() + "\n" + "Message: " +
                  Encoding.UTF8.GetString(receivedDetails[0]);

            this.richTextBox1.Text = log;
        }