Using the AllJoyn ® Studio Extension

Sign in to queue

The Discussion

  • User profile image
    ppatierno

    Hi Brian,

    nice article ... let me to add other two useful links for XML introspection :

    https://wiki.allseenalliance.org/irb/extended_introspection_xml

    https://allseenalliance.org/schemas/introspect.xsd

    Thanks,

    Paolo.

  • User profile image
    Brian​DRockwell

    Thanks for adding those links, Paolo.  We also just put out a follow-up blogpost detailing exactly how to create your own XML.

  • User profile image
    Andreas​Dietrich

    HI brian,

     

    great article - it is the extension I've waited for for not creating the alljoyn project on my own.

    Have I overseen something?

    In the case the introspection xml is changed, the source for creating the interface dlls are not rebuild automatically, and I haven't seen a way to rerun the alljoyncodegenerator.exe to get new interface dlls.

    In case you want to create several consumer/producers you have to extend/modify the .xml file several time to meet the requirements.
    but e, currently, it seems that the project has to be rebuild  in case the xml receives a modification.

    Even using menu item alljoyn - add/remove interface and reselect the same interface, will not recreate the interface files.

    if you have more than a single <interface name="a.b.c"> in  the .xml you may switch to another and switch back to the original one to get the new  interface dlls.

    any idea to make this more simple?

    regards
    andy

  • User profile image
    Brian​DRockwell

    Thanks for the questions, Andy.  If you have modified your XML and would like to re-generate the code, currently you will need to use the Add/Remove interfaces menu to take the "Remove" action (as shown in the blogpost).  This will remove the generated code from the project; re-launch the Add/Remove interfaces menu to Browse for your modified XML file, which will generate code with your new changes.

    Keep in mind that you may use the Browse menu to add several XML files.  Say you have three interfaces that you would like to use: com.contoso.Foo, com.contoso.Bar, and com.contoso.Baz.  These may all be in the same XML file "interfaces.xml" or separate files (e.g., foo.xml, bar.xml, and baz.xml).  Later, you could add a fourth, com.contoso.Qux, by creating a qux.xml file and adding it through the Add/Remove interfaces menu or by adding it to the interfaces.xml file and using the Browse button to re-select the interfaces.xml file.

    This is true even for "child" interfaces in a hierarchy; e.g., com.contoso.Foo.Norf.  The definition for com.contoso.Foo.Norf can be in its own norf.xml file or combined with the foo.xml file.  Regardless, AllJoyn Studio will generate a separate C++ project for each interface that you Add to the project, allowing you to modify, add, and remove interfaces in isolation.

    As a final note, remember to build the C++ projects after code generation to enable IntelliSense to function correctly.

  • User profile image
    Andreas​Dietrich

    Hi Brian,

    thanks for answering on how to update the code if the introspection format .xml changes.

    Do you know whether there will be project settings in the future for creating command line based application which can be run in the background (e.g. controlled by a service instance),
    or as a service itself.
    I would be interested in C++ and C# command line based applications for controlling a lot of test machines from a central point.

    thanks in advance
    andy

  • User profile image
    oniono

     

    Hi Brian,

    I felt your article is pretty helpful and impressive to me but  faced an error "The path is not a legal form" while adding interfaces with toaster.xml suggested in this article.

    How can I figure out this problem to move on to the next step?

  • User profile image
    Michel

    Hello Brian,

    I have a problem with signals and multiple producers and while searching for an solution i found this article and hope you can help me.

    I have two producers (that have one signal exposed) and my "watcher_added" event is fired twice. I have wrapped the consumer object in a object "device" and in this object i register to the signal event. The problem is that the same signal event is triggered for both producers.

    I can't figure out what the problem is and can't find an example on the internet with multiple producers and signals.

    Do you have any thoughts or do you know of there is an example somewhere?

    Regards,
    Michel


  • User profile image
    Brian​DRockwell

    @AndreasDietrich: - we built AllJoyn Studio for the creation of Universal Windows Apps.  Depending on the need, in the future we may expand on our code generation solution to include Classic Windows Apps.  We appreciate the feedback about this use-case!

    @oniono: we have been unable to reproduce this locally.  Could you describe your setup? (Windows version, VS version, XML description, area path, etc)

    @Michel: This is likely due to our use of multipoint sessions.  However, each object on the AllJoyn Bus presents a unique identifier, so you can always determine exactly which producer emitted a signal.  For multiple producers, using a Dictionary for your consumers might be beneficial:

    Dictionary<string, ToasterConsumer> toasterDictionary;

    Here the Key will be equal to the unique identifier for the producer.

    Then in the "Added" event:

    ToasterConsumer toasterConsumer = toasterJoinSessionResult.Consumer;
    toasterConsumer.DarknessLevelChanged += ToasterConsumer_DarknessLevelChanged;
    toasterConsumer.Signals.ToastBurntReceived += Signals_ToastBurntReceived;
    toasterDictionary.Add(args.UniqueName, toasterConsumer);
    

    Finally, in the signal callback use the following to filter to the consumer you want to update/use.

    toasterDictionary[args.MessageInfo.SenderUniqueName]

  • User profile image
    MichaelFery

    @oniono: I had the same behavior even when I tried to load a well formatted xml file. The problem was with Visual Studio not capable of accessing folder or create files. I tried to launch Visual Studio as administrator and could create my Windows Runtime Component correctly (and then came back to the safe mode). Does it fix your problem ?

     

    Thanks a lot Brian for these extension and tutorial. It's really helpfull.

  • User profile image
    jasperhb

    @BrianDRockwell I read your response to @Michel but it's still no clear to me how to do the following:

     I have a multiple devices that each have multiple produceres. For instance multiple thermostats that each have multiple produceres such as:

    1. Battery level

    2. Setpoint

    3. Current Temperature

    ...

    Each thermostat also have a Name, a Manufactorer name, a Node Id etc.

    How do I recreate this data structure in an App? 

     AllJoyn Explorer seems to do this just fine, but I'm struggling to replicate. In fact, I can't even find the name and manufactorer for each node.

    Any hint will be valued. Thanks.

  • User profile image
    MathieuC

    Hi Brian,

    Thanks for your article. I also assisted to your session during the Allseen summit.
    I bought two Lifx light bulbs for testing purposes and used your article to create a simple Universal App to control both lights.
    Everything went fine to control the first light, but If I modify the code to manage several lights, I get an 0x9040 error in return of the JoinSessionAsync method meaning ER_BUS_OBJ_ALREADY_EXISTS when I try to establish the session to the second Light. Is there something I miss?

    Regards,
    Mathieu

  • User profile image
    MarkWH1963

    Thanks for the article.

    How do you deal with strings that can contain a null value? In our scenario a null value is important, however I can't "emit a property changed" or "get" a value that is null.

            public IAsyncOperation<MCPCGetGameInfoResult> GetGameInfoAsync(AllJoynMessageInfo info)
            {
                Task<MCPCGetGameInfoResult> task = new Task<MCPCGetGameInfoResult>(() =>
                {
                    var result = MCPCGetGameInfoResult.CreateSuccessResult(Source.GameInfo);
                    return result;
                });
     
                task.Start();
                return task.AsAsyncOperation();
            }
     
    Thanks
    Mark
  • User profile image
    Berney Villers

    Are there any code generation templates or utilities available to generate the introspection XML from a class?

    This introspection XML feels redundant. Ideally, we could markup our classes with attributes or generate the XML from classes.

  • User profile image
    bvillersjr

    For the particular product I'm working on, and I suspect any product I may ever want to create using this technology, I need the flexibility to distribute a group of services across one or more PC's and devices.

    Ideally I would architect one UI that pulls together all of these services and a common code base that ran on all the devices. This works nicely except in the case of the "one" in "one or more devices".

    As people just get started with our product line I need a service running on the local PC and the UI to manage it. From what I read, I'm not permitted to develop such a solution with the exception of testing in which case I can enable a loopback exception.

    Why is Windows enforcing this policy of disallowing multiple portions of a distributed app to exist on the same PC?

    Is there some method of architecting such a solution that I've overlooked?

     

Add Your 2 Cents