public static async Task <List <IcpDeviceModel> > ScanIcpDevicesAsync(ComReader comReader) { await TaskEx.Run(() => { List <IcpDeviceModel> icpDevices = new List <IcpDeviceModel>(); for (int i = 1; i < 10; i++) { if (!IcpDcom.PingDevice(i, comReader)) { continue; } IcpDeviceModel devInfo = GetFullInfo(comReader, i); icpDevices.Add(devInfo); } return(icpDevices); }); return(null); }
private bool PingIcpDevice(int addr) { return(IcpDcom.PingDevice(addr, ComReader)); }