Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 private SerialPortWrapper GetPort(int id)
 {
     return(SerialPortList.GetPort(id));
 }