public void TestMethod1() { ComReader comReader = new ComReader("COM1"); comReader.Close(); Thread.Sleep(200); comReader.Close(); Thread.Sleep(200); if (comReader.Open()) { string resp = comReader.SendCommand("$02M"); resp = comReader.SendCommand("$02C"); resp = comReader.SendCommand("$03C"); resp = comReader.SendCommand("$03M"); resp = comReader.SendCommand("$03L0"); resp = comReader.SendCommand("$02L0"); resp = comReader.SendCommand("$@03"); resp = comReader.SendCommand("$@02"); } }
//[TestMethod] public async Task TestMethod1Async() { ComReader comReader = new ComReader("COM1"); if (comReader.Open()) { IcpDeviceManager icpDeviceManager = new IcpDeviceManager(comReader); var devices = await icpDeviceManager.ScanIcpDevicesAsync(); foreach (var item in devices) { Debug.WriteLine($"-- {item.Name}"); } } comReader.Close(); }