more newbie questions....
Thomas Green
TGreen2 at Sorenson.com
Thu Dec 4 18:18:27 PST 2014
Two questions...
First I'm trying to connect to a signal from connman. I obtain a proxy thus:
ManagerProxy = g_dbus_proxy_new_sync (DbusConnection,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
CONNMAN_SERVICE, // "net.connman"
CONNMAN_MANAGER_PATH, // "/"
CONNMAN_MANAGER_INTERFACE, // "net.connman.manager"
NULL,
&DbusError);
Then I try to attach to the ServicesChanged signal using a gcclosure that was generated by glib-genmarshal...
Closure = g_cclosure_new(G_CALLBACK(ServicesChangedCallback), this, NULL);
g_closure_set_marshal(Closure, marshal_VOID__BOXED_BOXED);
g_signal_connect_closure(ManagerProxy, "ServicesChanged", Closure, true);
but I get the error
(process:12548): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.40.0/./gobject/gsignal.c:2362: signal 'ServicesChanged' is invalid for instance '0x8127048' of type 'GDBusProxy'
What am I missing to be able to connect to this signal?
Second question....
Again, in connman, I've got a dict that I'm doing lookups on. All work except when I am trying to lookup the key "IPv4" which is supposed to return a nested dict.
GVariant *tmpVariant;
If (!g_variant_dict_lookup(Dict, "IPv4", "a{sv}", &tmpVariant))
return(error);
if (!g_variant_is_container(tmpVariant))
return(error)
the lookup works, but the call to make sure it is a container aborts with this message:
GLib:ERROR:/build/buildd/glib2.0-2.40.0/./glib/gvarianttypeinfo.c:163:g_variant_type_info_check: assertion failed: (info->alignment == 0 || info->alignment == 1 || info->alignment == 3 || info->alignment == 7)
What kind of container am I supposed to use, or am I doing the lookup incorrectly?
Thanks,
Tom
More information about the dbus
mailing list