protected override void CommingPackage(NetworkPackageCompress pack) { base.CommingPackage(pack); var ip = pack.targetIPs[0]; var port = pack.targetPorts[0]; byte pulse = 0; if (pack.GetFromBin <byte>("#", out pulse)) { AddFriend(ip, port); parameters.MarkAllChanged(); } var friend = GetFriend(ip, port) as RobotAgent; if (friend == null) { AddFriend(ip, port); parameters.MarkAllChanged(); return; } friend.parameters.ReceivePackage(pack); }
public void ReceivePackage(NetworkPackageCompress pack) { lock (locker) { List <float> dat = new List <float>(); if (pack.GetFromBin("c_Movement", out dat)) { v_Movement = dat; } List <float> dat2 = new List <float>(); if (pack.GetFromBin("c_DisSensor", out dat2)) { v_DisSensor = dat2; } string str; if (pack.GetFromBin("c_Name", out str)) { v_name = str; } } }
protected override void CommingPackage(NetworkPackageCompress pack) { base.CommingPackage(pack); byte pulse = 0; if (pack.GetFromBin <byte>("#", out pulse)) { var ip = pack.targetIPs[0]; var port = pack.targetPorts[0]; AddFriend(ip, port); SetEvent(DSEvent.Receive, "Pulse " + pulse.ToString() + " < " + ip + ":" + port.ToString()); } }