Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Connecting to the HoloLens using the Windows Device Portal Wrapper in Unity?

I am currently working on a project in which it is required to view the MRC video stream from the HoloLens on a separate device (i.e. a tablet). I am attempting to do so using the Windows Device Portal Wrapper, since accessing the HoloLens via the Windows Device Portal seems to produce the most functionality. This being said, connection to my HoloLens using the provided SampleWdpClient Project works properly - however using the same methodology and doing so through Unity does not properly connect to the HoloLens... Any ideas? My code is found below:

string address, username, password;
private DevicePortal portal;
private string thumbprint;

private string myAddress = "...";
private string myUsername = "...";
private string myPassword = "...";

private void Start()
{
    ConnectToHololens();
}

private void ConnectToHololens()
{
    portal = new DevicePortal(
        new DefaultDevicePortalConnection(
            myAddress, 
            myUsername, 
            myPassword));

    portal.UnvalidatedCert += DoCertValidation;

    Task connectTask = new Task(
        async () =>
        {
            print("Connecting....");

            portal.ConnectionStatus += (portal, connectArgs) =>
            {
                if (connectArgs.Status == DeviceConnectionStatus.Connected)
                {
                    print("Connected");
                }

                else if (connectArgs.Status == DeviceConnectionStatus.Failed)
                {
                    print(connectArgs.Message);
                }
            };
            await portal.ConnectAsync();
        });

    print("Starting Task");
    connectTask.Start();
}

private bool DoCertValidation(DevicePortal sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
    X509Certificate2 cert = new X509Certificate2(certificate);
    print(certificate.GetCertHashString());
    print(sslPolicyErrors.ToString());
    print(chain.ChainStatus.ToString());

    print(cert.Issuer);

        return true;
}
Sign In or Register to comment.