public MainWindow() { InitializeComponent(); _serialPortCommunicator = new SerialPortCommunicator(delegate(IEnumerable <byte> s) { this.Invoke((MethodInvoker)(delegate() { var s2 = string.Empty; foreach (var s1 in s) { s2 += (s1.ToString()); s2 += ' '; } if (!string.IsNullOrEmpty(s2)) { debugTextBox.AppendText(s2 + Environment.NewLine + Environment.NewLine); } InternalLogger.Log.Debug(s2); })); }); DynamicConfigComponents(); }
public UdpServer(SerialPortCommunicator spc) { server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); server.Bind(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 6001)); _spc = spc; }
public StrategyImp(string portName) { _commInstance = new SerialPortCommunicator(portName); _udpInstance = new UdpServices.UdpServer(_commInstance); }