Exemple #1
0
 public static string tryFindDevicePort()
 {
     Console.WriteLine("No port specified. Attempting to find device 04D8:FFEE (IceWerx)...");
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         return(Win32SerialInfo.tryFind());
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
     {
         return(OsxSerialInfo.tryFind());
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
     {
         return(LinuxSerialInfo.tryFind());
     }
     else
     {
         Console.WriteLine("Platform not supported.");
     }
     return(null);
 }