Re: org.freedesktop.DBus.ObjectManager in glibmm?
- From: Johannes Dohmen <johannes dohmen amano eu>
- To: gtkmm-list gnome org
- Subject: Re: org.freedesktop.DBus.ObjectManager in glibmm?
- Date: Wed, 17 Aug 2016 09:53:49 +0200
Hi Andrey,
yes, I know this thread (this was my starting point trying to construct
the response for GetManagedObjects by myself).
I can use the same type you mention at
https://bugzilla.gnome.org/show_bug.cgi?id=747508
to cast_dynamic from a response of GetManagedObjects from another Dbus
object.
However I cannot use this type with
Gio::DBus::MethodInvocation::return_value(const
Glib::VariantContainerBase& parameters)
as it fails with an runtime assertion:
Type of return value is incorrect: expected '(a{oa{sa{sv}}})', got
'(a{sa{sa{sv}}})''
Regards Johannes
Am 17.08.2016 um 09:29 schrieb Andrejs Hanins:
Hi,
I had a very similar problem discussed here http://marc.info/?t=142780233100003&r=1&w=2
Hope it helps!
BR, Andrey
On 08/17/2016 10:15 AM, Johannes Dohmen wrote:
Hi there.
I have a question regarding glibmm and its dbus implementation.
Does glibmm (directly) support an ObjectManager (org.freedesktop.DBus.ObjectManager) like Gio (I think) does? If not is
there a different/better approach to answer a "GetManagedObjects" call I receive through dbus?
At the moment I try to provided an answer through a allback given by Gio::DBus::InterfaceVTable
However I cannot construct a valid answer and I am not sure if this is the proper way of doing it.
Anyway, I tried the following:
typedef std::map<Glib::ustring, map<Glib::ustring, std::map<Glib::ustring, Glib::VariantBase> > >
managed_objects_t;
Glib::Variant<managed_objects_t> response = Glib::Variant<managed_objects_t>::create(tmp);
invocation->return_value(Glib::Variant<managed_objects_t>::create_tuple(response));
But when the callback is executed I get:
(process:22695): GLib-GIO-WARNING **: Type of return value is incorrect: expected '(a{oa{sa{sv}}})', got
'(a{sa{sa{sv}}})''
I cannot change the first template argument of managed_objects_t to
Glib::VariantStringBase
which could hold an Object-path, but does not have operator< implemented (needed for std::map).
Background information:
I think I need this because bluez seems to rely on the GetManagedObjects method of the ObjectManager
interface.
Thanks for your help
Johannes
(Re-send after joining the mailing list. Sorry for any inconvenience.)
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
--
Johannes Dohmen
Amano Parking Europe N.V.
Uersfeld 24
52072 Aachen, Germany
tel +49(0)241-53808930
e-mail: johannes dohmen amano eu
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]