Blob: get-managed-objects

Blob id: 7ad359db4b9a9d6b268260a1b8da66492af80374

Size: 709 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later

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]))