marshalling signal with glib-dbus

Will averylongnamewhichnobodyhas at gmail.com
Thu Jul 28 08:35:39 PDT 2011


I am having some problems receiving a signal sent by a python dbus
server. Here is the output from dbus-monitor:

signal sender=:1.134 -> dest=(null destination) serial=193032
path=/org/wicd/daemon; interface=org.wicd.daemon; member=StatusChanged
   uint32 0
   array [
      variant          string "hello"
   ]

Here is the code in which I am trying to receive the signal:

//start of snippet

GMainLoop *mainloop= g_main_loop_new (NULL, FALSE);

/* returns a known working proxy which I can successfully call remote 
functions with */

DBusGProxy * proxy = get_daemon_proxy();

/* based on this post :
http://old.nabble.com/glib-signal-marshaller-td21724700.html */

GType otype = dbus_g_type_get_struct("GValueArray",
                                       G_TYPE_STRING,
                                      G_TYPE_INVALID); 

otype = dbus_g_type_get_collection("GPtrArray", otype);

                                     

// dont need using builtin
dbus_g_object_register_marshaller (_wicd_marshal_VOID__UINT_BOXED,
G_TYPE_NONE, G_TYPE_UINT, otype, G_TYPE_INVALID);

dbus_g_proxy_add_signal (proxy, "StatusChanged", G_TYPE_UINT, otype,
G_TYPE_INVALID);

dbus_g_proxy_connect_signal (proxy, "StatusChanged", G_CALLBACK
(status_signal_handler),
                       NULL, NULL);

g_main_loop_run (mainloop);

//end of snippet

Any ideas on how I can get this working?

Thanks, Will.



More information about the dbus mailing list