How to implement the org.alljoyn.about interface?

asked 2015-07-14 17:04:03 -0700

boxwood gravatar image

updated 2015-07-14 17:04:14 -0700

How do you implement the org.alljoyn.about interface? Or make calls with GetAboutData (what do you call it on even)?

Maybe I am just not getting the big picture. I looked at the sample applications called About but it didn't make it clear. I'm trying to extract information on the devices using GetAboutData but I have no idea where to call it.

Thanks for taking the time to read and/or answer. I do appreciate it.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2015-07-14 22:38:55 -0700

julianbros gravatar image

The AboutData is announced to the network. First of all you have to add a AboutObj() to the bus, this may looks like (Java):

AboutObj aboutObj = new AboutObj(bus);
    status = aboutObj.announce(contactPort.value, new MyAboutData());
    if (status != Status.OK) {
        System.out.println("Announce failed: " + status.toString());

This is the part for the client side. The client sends the AboutData, containing device information, to the network.

On the server side you have to make sure to have an AboutListener attached to receive the AboutData of the supported devices. Create a class implementing 'AboutListener'. You'll see a method called "public void announced(...)" this method is fired automatically, if the announcement is seen.

Just take another look at the samples, I'm sure you'll get the information you need. I've figured it out on my own and it works!

edit flag offensive delete publish link more


Im confused. I'm looking at the JavaSDKDocAboutService example. This code contains the AboutListener code. Yet you say the server side should have it. Meanwhile, when I look at the sample JavaSDKDocAboutService it has the AboutObj code which you say should be in the client side. Which is backward?

boxwood ( 2015-07-15 11:18:45 -0700 )edit

The server/service announces its About information. The client needs to implement a so called AboutListener to get "announced" by the server. The Code above is part of the server/service.

mayo ( 2015-07-16 05:37:44 -0700 )edit

You're right I made a mistake, sorry for this issue. In my project it was just the other way around. I've got a server which is implementing a AboutListener and waits for clients to join the network. It simply depends on what you wan't to achieve. The clients are sending their announcement data.

julianbros ( 2015-07-16 05:49:43 -0700 )edit

So I actually have those pieces in place then. The AboutListener is there and so if the AboutObj code. That part seems to work. But now I'm at the point where I want to get device information from those running the client. How do I actually use (or call?) GetAboutData?

boxwood ( 2015-07-16 08:26:36 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-07-14 17:04:03 -0700

Seen: 297 times

Last updated: Jul 14 '15