more newbie questions....

Thomas Green TGreen2 at
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,
                                    CONNMAN_SERVICE,          // "net.connman"
                                    CONNMAN_MANAGER_PATH,        // "/"
                                    CONNMAN_MANAGER_INTERFACE,        // "net.connman.manager"
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))
if (!g_variant_is_container(tmpVariant))

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?



More information about the dbus mailing list