Ejemplo n.º 1
0
 void client_OnReceived(object sender, NetReceivedEventArgs<byte[]> e)
 {
     if (e.Data[0] != 0 && e.Data.Length==20)
     {
         serialPort.SendByteArray(e.Data);
         cpt = (cpt + 1) % 50;
         if (cpt == 0)
             messages = new StringBuilder();
         string cw = Strings.ToHex(e.Data);
         cw = cw.Substring(6,32).Trim();
         if (cw.StartsWith("0000000000000000"))
             messages.Append(@"\viewkind4\uc1\pard\f0\fs16\fs20\cf1 scrambled channel\par");
         else
             messages.Append(string.Format(@"\viewkind4\uc1\pard\f0\fs16\fs20\cf3 {0}\par", cw));
         DisplayMessage(messages.ToString());
     }
 }
Ejemplo n.º 2
0
 void onClientReceiveData(object sender, NetReceivedEventArgs<byte[]> e)
 {
     onReceiveData(e.Data);
 }
Ejemplo n.º 3
0
 static void client_OnReceived(object sender, NetReceivedEventArgs<NetObject> e)
 {
     Console.WriteLine("Client received - Name: " + e.Data.Name + " Message: " + e.Data.Object.ToString());
 }