mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-11 21:14:36 +08:00
test: Add test script for getting managed objects
This commit is contained in:
parent
50380dccc9
commit
fe6a611505
27
test/get-managed-objects
Executable file
27
test/get-managed-objects
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import dbus
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
manager = dbus.Interface(bus.get_object("org.bluez", "/"),
|
||||
"org.freedesktop.DBus.ObjectManager")
|
||||
|
||||
objects = manager.GetManagedObjects()
|
||||
|
||||
for path in objects.keys():
|
||||
print "[ %s ]" % (path)
|
||||
|
||||
interfaces = objects[path]
|
||||
|
||||
for interface in interfaces.keys():
|
||||
if interface in ["org.freedesktop.DBus.Introspectable",
|
||||
"org.freedesktop.DBus.Properties"]:
|
||||
continue
|
||||
|
||||
print " %s" % (interface)
|
||||
|
||||
properties = interfaces[interface]
|
||||
|
||||
for key in properties.keys():
|
||||
print " %s = %s" % (key, properties[key])
|
Loading…
Reference in New Issue
Block a user