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

Send Custom Messages from a Java App

Hey Guys,

does anyone know how to send a custom message from a java application using the sharing services.
I've already build the sharing services and wrote a receiver class in unity (based on custom messages). Everything works fine when Im sending from a HoloLens to another HoloLens. But now Im trying to send a message from my java application (based on the Java TestApp).

The HoloLens receives the message but I then the following Exceptions spawns:
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2<HoloToolkit.Sharing.Tests.CustomMessages/TestMessageID, HoloToolkit.Sharing.Tests.CustomMessages/MessageCallback>.get_Item

This is the code snippet in Java where I`m sending the message:

    NetworkConnection 
    sessionConnection=_currentSession.GetSessionNetworkConnection();
    //MessageID.SessionControl.swigValue()
    NetworkOutMessage msg = sessionConnection.CreateMessage((byte)186); //The HoloLens is receiving on 186 
    msg.Write(10);
    sessionConnection.Broadcast(msg, 
            MessagePriority.Immediate, 
            MessageReliability.UnreliableSequenced,
            MessageChannel.Avatar);
    sessionConnection.Broadcast(msg);

I really dont know wheres my error and I hope you can help me!
thanking you in anticipation

Answers

  • Options

    I am using MQTT to communicate with external devices. There is a unity asset for that, which we tweaked to work with HoloLens (actually, UWP). From the communication with the developer of that I am expecting a compatible version of the asset soon. ALso you could use the underlying M2Mqtt library as well.

  • Options

    @herbutant how did you run mqtt together with the hololens? I still have some trouble to build my project. Can you send me the link to the version of mqtt, that you have used?

    thanks

Sign In or Register to comment.