private async Task <SerialPortWrapper> GetPort(int id) { var port = SerialPortList.GetPort(id); if (port == null) { // rescan SerialPortList.Refresh(); port = SerialPortList.GetPort(id); } return(await Task.FromResult(port)); }
private SerialPortWrapper GetPort(int id) { return(SerialPortList.GetPort(id)); }