Get a list of service interface's available methods

asked 2015-09-04 14:35:30 -0700

EricC gravatar image

Hi all,

I've been writing a service in C++ built off of the basic_service sample provided with the SDK, and I have been correspondingly using the basic_client to test my added methods. However, I've noticed that the basic_client example pretty much has a copy of the service interface methods which are used when CreateInterface() is called, and each of them are added to the Client interface using testIntf->AddMethod("Cat", etc).

I know that you can "discover" available services using an AboutListener like the one provided in the SDK, and I altered my service to do this, but this still doesn't allow you to see the methods available to the client.

Is there a way to retrieve the service interface's method names and arguments so that they can be called in a more dynamic fashion, without hardcoding the method call into the client (as with the "Cat" method example in the basic client and service)?

Sorry if this has been asked, I just couldn't find any documentation available for how this would be done.

Thank in advance!

  • Eric
edit retag flag offensive close merge delete


you might ask on the core mailing list. https://lists.allseenalliance.org/mailman/listinfo/allseen-core

ry.jones ( 2015-09-08 21:37:36 -0700 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-09-10 00:09:17 -0700

praveenb gravatar image

The standard sequence of steps for communication between two AllJoyn applications is as follows:

  • Provider advertises the interfaces it implements via About Announcement
  • Seeker discovers Providers implementing interfaces via Who-Implements query
  • After Seeker discovers a Provider, it establishes a session with Provider
  • Seeker communicates with Provider

AllJoyn is an object-oriented communication mechanism. Provider applications wishing to expose functionality (namely interfaces implemented by them), do so by creating a Bus Object at a specific path, and adding the implemented interfaces to that Bus Object.

Introspection is a mechanism by which the Seeker can query and get a list of all interfaces (and the members of those interfaces) implemented by an application at a specific Bus Object path.

In AllJoyn Standard Core C++ library, introspection is performed using ajn::ProxyBusObject::IntrospectRemoteObject API. After introspection, the ProxyBusObject will be populated and Seeker can make method calls and get/set properties. APIs viz. CreateInterface, AddMethod, AddSignal, AddProperty are not needed when the Seeker uses introspection. An example of this can be found here.

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

Question Tools

1 follower


Asked: 2015-09-04 14:35:30 -0700

Seen: 151 times

Last updated: Sep 10 '15