GNOME Bugzilla – Bug 758393
gdbusobjectmanagerserver does not allow exporting itself
Last modified: 2016-01-11 16:06:58 UTC
Created attachment 315967 [details] [review] gdbusobjectmanagerserver: allow exporting itself It is not possible to implement an object manager that exports itself and adds it's own path to the managed objects due to an assert in g_dbus_object_manager_server_export_unlocked().
Long version: I ran into this problem when trying to implement a bluez gatt service using gdbus in gio (not to be confused with gdbus in bluez). According to https://kernel.googlesource.com/pub/scm/bluetooth/bluez/+/5.36/doc/gatt-api.txt#274 the path of the object that implements org.bluez.GattService1 and org.freedesktop.DBus.ObjectManager must be one of the objects the are returned when calling org.freedesktop.DBus.ObjectManager.GetManagedObjects otherwise the service will not be accepted by org.bluez.GattManager1.RegisterService (https://kernel.googlesource.com/pub/scm/bluetooth/bluez/+/5.36/doc/gatt-api.txt#312).
It turned out to be a design error in the BlueZ D-Bus API, which has been fixed now: http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=c19813c95ea1eaa990f478b3004db9c1c03632dc