private void NetworkTestClicked(object sender, EventArgs e) { serialAttached = false; ip = text.Text; Thread t = new Thread(x => tcpCommunication()); t.Start(); udp = new UDPCommunication(ip, 4815); mc.start(); }
private void StartBotClicked(object sender, EventArgs e) { serialAttached = true; manager = (UsbManager)GetSystemService(Context.UsbService); driver = UsbSerialProber.DefaultProber.FindAllDrivers(manager)[0]; port = driver.Ports[0]; var connection = manager.OpenDevice(driver.Device); port.Open(connection); port.SetParameters(9600, 8, StopBits.One, Parity.None); ip = text.Text; Thread t = new Thread(x => tcpCommunication()); t.Start(); udp = new UDPCommunication(ip, 4815); mc.start(); }