Skip to content

Commit

Permalink
Add fallback for system without Oculus software
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey004 committed Jan 1, 2024
1 parent 0a7b052 commit 897ecc0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Quest2-VRC.Core/Services/Device_Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ public class Device_Management
{

private static readonly string DeviceName = "Oculus Composite ADB Interface";
private static readonly string FallbackName = "ADB Interface";
[SupportedOSPlatform("windows")]
public static bool CheckDevice()
{

bool deviceConnected = false;
ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_PnPEntity where Caption='Oculus Composite ADB Interface'");
ManagementObjectSearcher fallback = new ManagementObjectSearcher("select * from Win32_PnPEntity where Caption='ADB Interface'");

foreach (ManagementObject hmd in searcher.Get())
{
foreach (PropertyData prop in hmd.Properties)
Expand All @@ -24,6 +27,20 @@ public static bool CheckDevice()
deviceConnected = true;
break;
}

}

}
foreach (ManagementObject hmd in fallback.Get())
{
foreach (PropertyData prop in hmd.Properties)
{
if (Convert.ToString(prop.Value).Contains(FallbackName))
{
deviceConnected = true;
break;
}

}

}
Expand Down

0 comments on commit 897ecc0

Please sign in to comment.