Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometime introspection doesnt work for remote object #25

Open
funky12 opened this issue Feb 21, 2015 · 2 comments
Open

Sometime introspection doesnt work for remote object #25

funky12 opened this issue Feb 21, 2015 · 2 comments

Comments

@funky12
Copy link

funky12 commented Feb 21, 2015

Hi,

Is it mandatory to specify "Method" in interface explicitly?

=== Not working===
I tried following to call a remote method I wrote "ActivateConnection", passed the argument using following piece of code:

Note I have not specified interface here

dialer_iface = DBusInterface(DIALUP_INTFACE)
self.dobj= yield self.mdmModel.bus.getRemoteObject(DIALUP_SERVICE, DIALUP_OBJECT,dialer_iface)
self.path = yield self.dobj.callRemote('ActivateConnection',self.mdmModel.device_opath,
timeout=80)
--> This gives an error that Remote Object doesnt have ActivateConnection in any of interfaces --->

=== working===
Then I tried explicitly specifying the method in interface

dialer_iface = DBusInterface(DIALUP_INTFACE,
Method('ActivateConnection', 'o',returns=''))
self.dobj= yield self.mdmModel.bus.getRemoteObject(DIALUP_SERVICE, DIALUP_OBJECT,dialer_iface)
self.path = yield self.dobj.callRemote('ActivateConnection',self.mdmModel.device_opath,
timeout=80)

It works fine.. here, am I missing something?

  • Also do you have API documentation for all public API ?
  • Since from tutorial its tough to find all API definition and corresponding options
@cocagne
Copy link
Owner

cocagne commented Feb 22, 2015

In order to call remote methods, an interface description is required.
Otherwise, the client code wouldn't know how to encode the arguments. The
interface can either be introspected on-the-fly or provided explicitly as
you're doing in your working code. Generally speaking, it's better to
provide an explicit interface as introspection isn't required by the DBus
specification and it only works if the object in question is online at the
time of the query. It's good for development and testing but I wouldn't
recommend relying upon it in production.

As to the API documentation, there isn't a well-documented API separate
from the tutorial. The docstrings are all there in the code but I never
figured out how to generate a separate doc with Lore. It might "just work"
but I haven't tried it. I recommend just browsing the modules on Github
directly. It's not quite as convenient as a standalone document but the
docstrings stick out pretty well and it's not a particularly large codebase.

Tom

On Sat, Feb 21, 2015 at 5:37 PM, funky12 [email protected] wrote:

Hi,

Is it mandatory to specify "Method" in interface explicitly?

=== Not working===
I tried following to call a remote method I wrote "ActivateConnection",
passed the argument using following piece of code:
Note I have not specified interface here

dialer_iface = DBusInterface(DIALUP_INTFACE)
self.dobj= yield self.mdmModel.bus.getRemoteObject(DIALUP_SERVICE,
DIALUP_OBJECT,dialer_iface)
self.path = yield
self.dobj.callRemote('ActivateConnection',self.mdmModel.device_opath,
timeout=80)
--> This gives an error that Remote Object doesnt have ActivateConnection
in any of interfaces --->

=== working===
Then I tried explicitly specifying the method in interface

dialer_iface = DBusInterface(DIALUP_INTFACE,
Method('ActivateConnection', 'o',returns=''))
self.dobj= yield self.mdmModel.bus.getRemoteObject(DIALUP_SERVICE,
DIALUP_OBJECT,dialer_iface)
self.path = yield
self.dobj.callRemote('ActivateConnection',self.mdmModel.device_opath,
timeout=80)

It works fine.. here, am I missing something?

  • Also do you have API documentation for all public API ?
  • Since from tutorial its tough to find all API definition and
    corresponding options


Reply to this email directly or view it on GitHub
#25.

@funky12
Copy link
Author

funky12 commented Feb 27, 2015

Thanks Tom, Yes now I am always using explicit definition. Will go through the code and if I comeup with a documentation, would try to share on the blog and give u the link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants