WindowsDevicePortalWrapper icon indicating copy to clipboard operation
WindowsDevicePortalWrapper copied to clipboard

Support Hololens 2 in DevicePortalPlatforms

Open chris03 opened this issue 6 years ago • 0 comments

With the Hololens 2, the api call: http://localhost:10080/api/os/info returns:

{
"ComputerName": "Hololens",
"Language": "en-US",
"OsEdition": "Holographic",
"OsEditionId": 136,
"OsVersion": "REDACTED",
"Platform": "HoloLens 2"
}

The issue is that DevicePortal.DevicePortalPlatforms is Unknown which causes Utilities.IsHoloLens(this.Platform, this.DeviceFamily) to return false and methods that should work (like TakeMrcPhotoAsync) will throw an Exception.

Could someone please add support for the Hololens 2 ?

Thanks

Edit:

As workaround I override the PlatformName:

var connection = new DefaultDevicePortalConnection("http://localhost:10080", "user", "pass");
var devicePortal = new DevicePortal(connection);

await devicePortal.ConnectAsync();

connection.OsInfo.GetType()
    .GetProperty("PlatformName")
    .SetValue(connection.OsInfo, "HoloLens");

chris03 avatar Oct 08 '19 18:10 chris03