call_get_managed_object doesn't work
running the following code:
from dbus_next.aio import MessageBus
from dbus_next import BusType, Message
import asyncio
loop = asyncio.get_event_loop()
async def main():
bus = await MessageBus(bus_type=BusType.SYSTEM).connect()
introspection = await bus.introspect('org.bluez', '/org/bluez')
db = bus.get_proxy_object('org.bluez', '/org/freedesktop/DBus', introspection.default())
object_manager = db.get_interface('org.freedesktop.DBus.ObjectManager')
objects = await object_manager.call_get_managed_objects()
await loop.create_future()
loop.run_until_complete(main())
generates a signature error: dbus_next.errors.DBusError: Method "GetManagedObjects" with signature "" on interface "org.freedesktop.DBus.ObjectManager" doesn't exist
Am I calling this incorrectly?
Hi,
BlueZ Object Manager is on the root node only. You need to introspect and get proxy object of "/".
Try this:
introspection = await bus.introspect('org.bluez', '/')
db = bus.get_proxy_object('org.bluez', '/', introspection)
object_manager = db.get_interface('org.freedesktop.DBus.ObjectManager')
Does it advertise the interface and method on the path /org/bluez and say there's no method? That seems like a mistake on the server.