【发布时间】:2015-02-28 21:07:25
【问题描述】:
是否可以使用 dbus-send 收集 DBus 连接名称的完整对象树?
目前,我能够执行对所需目的地的多次调用,指定方法“org.freedesktop.DBus.Introspectable.Introspect”并第一次使用“/”作为路径,而不是检索内部节点并执行新的呼吁。
例如:
$ dbus-send --session --print-reply --reply-timeout=2000 --type=method_call --dest=org.gnome.Bluetooth.applet / org.freedesktop.DBus.Introspectable.Introspect
gives nodes Factory and org. So I proceed with the calls:
$ dbus-send --session --print-reply --reply-timeout=2000 --type=method_call --dest=org.gnome.Bluetooth.applet /Factory org.freedesktop.DBus.Introspectable.Introspect
$ dbus-send --session --print-reply --reply-timeout=2000 --type=method_call --dest=org.gnome.Bluetooth.applet /org org.freedesktop.DBus.Introspectable.Introspect
and so on...
我想立即检索完整的树。
我知道像 d-feet 这样的工具可以做到这一点,但我需要一个 cli 界面,dbus-send 会非常方便。
【问题讨论】:
-
我找到了一个可能的“一次性解决方案”,至少满足我的需要:gdbus introspect --session --dest org.gnome.Bluetooth.applet --object-path / --recurse - -xml