Skip to content

Support Hololens 2 in DevicePortalPlatforms #300

Description

@chris03

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");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions