Receiving signals the easy way?

Will Thompson will.thompson at collabora.co.uk
Sun Nov 1 04:44:54 PST 2009


On 01/11/09 12:38, Kees Jongenburger wrote:
> proxy = dbus_g_proxy_new_for_name(connection,  "com.test.Notification",
>                                           "/com/test/Notification",
> "com.test.Notification");

You've constructed a proxy for an object on the bus name
"com.test.Notification"...

> dbus_g_proxy_add_signal(proxy, "Notify",G_TYPE_INVALID);
> dbus_g_proxy_connect_signal(proxy, "Notify", test_callback, NULL, NULL);

and bound to the Notify signal. Then:

> dbus-send \
>         --system \
>         /com/test/Notification \
>         com.test.Notification.Notify

a service connects to the bus, receives a unique name like :1.23, and
emits the com.test.Notification.Notify signal from its
/com/test/Notification object. But you bound to signal emissions by
com.test.Notification, not :1.23.

-- 
Will


More information about the dbus mailing list