Beispiel #1
0
        public static bool DeviceExists(UInt16 vid, UInt16 pid)
        {
            var fel = new Fel();

            try
            {
                fel.Open(vid, pid);
                return(true);
            }
            catch
            {
                return(false);
            }
            finally
            {
                fel.Close();
            }
        }
Beispiel #2
0
        public static bool DeviceExists(UInt16 vid, UInt16 pid)
        {
            var fel = new Fel();

            try
            {
                fel.Open(vid, pid);
                Debug.WriteLine("Device detection successful");
                return(true);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Device detection error: " + ex.Message + ex.StackTrace);
                return(false);
            }
            finally
            {
                fel.Close();
            }
        }
Beispiel #3
0
 public static bool DeviceExists(UInt16 vid, UInt16 pid)
 {
     var fel = new Fel();
     try
     {
         if (fel.Open(vid, pid))
         {
             Debug.WriteLine("Device detection successful");
             return true;
         }
         else
         {
             return false;
         }
     }
     finally
     {
         fel.Close();
     }
 }