1

Creating Introspection XML

asked 2015-07-08 04:33:43 -0700

khattak gravatar image

Hello Everyone,

I have recently started working on AllJoyn and I am currently working with Windows 10 platform and an AllJoyn enabled smartplug. To generate code for AllJoyn interfaces, I need to create the introspection XML file(s) for smartplug's interfaces. I have tried using the getajxml.exe tool for windows to dynamically create the introspection XML. Though the first step works, and it discovers the devices and their interfaces on the network, it fails with some error when I try creating the introspection XML in the second step by supplying the bus name, port and object path.

I was wondering how to go on from here? Are there any other tools that could help create the introspection XML when the interface, the bus and the port number is known? If not, is there any documentation which could hint how the introspection XML should look like for smartplugs?

Regards, Khattak

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-07-09 01:47:30 -0700

mayo gravatar image

In Java you can register an AboutListener to an existing BusAttachment and broadcast a "whoImplements" request to your network which will lead, in case your smartplug is in the same network, to an Invokation of the "announced" Method.

initial Code:

      mBus = new BusAttachment("Any name", BusAttachment.RemoteMessage.Receive);

      Status status = mBus.connect();
      if (status != Status.OK) {
          return;
      }
      mBus.registerAboutListener(this);

      String ifaces[] = {"your.interface.name"};
      status = mBus.whoImplements(ifaces);
      if (status != Status.OK) {
          return;
      }

A callback "announced" Method using the Introspectable interface :

    public void announced(String busName, int version, short port, 
    AboutObjectDescription[] objectDescriptions,Map<String, Variant> aboutData) {
                ProxyBusObject introSpecProx =  mBus.getProxyBusObject(
                   busName,
                   "/your/object/Path",
                   sessionId.value,
                   new Class<?>[] { Introspectable.class}
                );

                Introspectable introspecInterface = introSpecProx.getInterface(Introspectable.class);
                System.out.println(introspecInterface.Introspect());
     }

You can find out the interface name and objectPath information by running wireshark and filtering out the alljoyn messages that come from your smartplug device.

edit flag offensive delete publish link more
1

answered 2015-09-01 16:32:08 -0700

BrianDRockwell gravatar image

Recently we released AllJoyn Studio, an extension to Visual Studio that incorporates getajxml.exe functionality. We created this tool specifically for the purpose you described!

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-07-08 04:33:43 -0700

Seen: 386 times

Last updated: Sep 01 '15