Skip to content

Support Hololens 2 in DevicePortalPlatforms #300

@chris03

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

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