M7350/external/bluetooth/bluez/test/get-managed-objects

30 lines
659 B
Plaintext
Raw Permalink Normal View History

2024-09-09 08:57:42 +00:00
#!/usr/bin/python
from __future__ import absolute_import, print_function, unicode_literals
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]))