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

How to enable introspection #23

Open
Ambrevar opened this issue May 28, 2019 · 5 comments
Open

How to enable introspection #23

Ambrevar opened this issue May 28, 2019 · 5 comments

Comments

@Ambrevar
Copy link

When I run D-Feet to introspect the object, it appears in the object list on the session. When I click on it however, I get the following error message:

Missing method-call handler at path / interface
org.freedesktop.DBus.Introspectable name Introspect (36)

Do I need to do something special to enable introspection or is it simply lacking in this library?

@death
Copy link
Owner

death commented May 28, 2019

Support for introspection is not currently implemented in this repository.
There is a fork by @phmarek that has a WIP implementation. [0]
There is also the note I wrote a while ago [1].
I don't currently use dbus, but patches are welcome.

[0] phmarek@d729db6
[1] https://gist.github.com/death/1c5780c5dcf6a838a867d8701969982f.

@Ambrevar
Copy link
Author

On a similar topic, is it possible to use this library to call the method of an object that does not expose any introspection element?

The only way I know to call methods using this library is to introspect objects as follows:

(dbus:with-open-bus (bus (dbus:session-server-addresses))
    (dbus:with-introspected-object (object bus +object-path+ +name+)
      (apply #'object +interface+ method args)))

@Ambrevar
Copy link
Author

I've managed to call an object method without introspection like this:

(dbus:with-open-bus (bus (dbus:session-server-addresses))
    (let ((object (dbus/introspect::make-object
                   (dbus:bus-connection bus) +core-object+ +core-name+
                   (list (dbus/introspect::make-interface
                          +core-interface+
                          (list
                           (dbus/introspect::make-method "make_buffers"
                                        "as"
                                        '("urls")
                                        '("as")
                                        '()))
                          nil nil)))))
      (apply #'dbus:object-invoke object +core-interface+ method args)))

This requires access to a lot of unexposed methods. I believe that introspection is not a requirement of D-Bus and in fact glib's dbus API supports them (that's how I can call Common Lisp methods).

So what about exposing a convenience function that roughly does the above?

@death
Copy link
Owner

death commented May 30, 2019

If you don't want to use introspection, use dbus:invoke-method.

@Ambrevar
Copy link
Author

Ambrevar commented May 31, 2019 via email

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