DBUS hello world service

Rohit Chaudhri rohit.chaudhri at gmail.com
Wed Mar 15 14:37:53 PST 2006


Hi,
I want to use DBUS as the IPC mechanism for my applications running on
an embedded linux device. I can't use the DBUS Glib or Qt bindings so
the implementation will use the DBUS low-level API. Since the
communication will be point-to-point, I don't need to route the
messages through the bus daemon so the service & clients will talk to
each other directly
I'm trying to learn the DBUS API, I've read the DBUS tutorial & spec
and have written a hello-world DBUS service and client using the 0.60
API. The code doesn't do much yet, the service calls the following
functions and goes into a loop:
dbus_server_listen(DBUS_HELLO_SVC,&error);
dbus_server_set_new_connection_function(srv,onConnect,NULL,freeFunction);	dbus_server_set_watch_functions(srv,onWatchAdd,onWatchRemove,onWatchToggled,NULL,freeFunction);

On the client I call dbus_connection_open(DBUS_HELLO_SVC,&error), the
call succeeds however the onConnect function defined in the service
never gets called.
I'm attaching my service/client src files with this email.
Any idea why the onConnect method is not being called in the service?
I've probably not done something correctly or have not initialized the
service completely. Would appreciate any help regarding this.


Thanks,
Rohit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-hello-svc.c
Type: text/x-csrc
Size: 1480 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060315/fc361360/dbus-hello-svc.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-hello-svc.h
Type: text/x-chdr
Size: 168 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060315/fc361360/dbus-hello-svc.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-hello-client.c
Type: text/x-csrc
Size: 397 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060315/fc361360/dbus-hello-client.c


More information about the dbus mailing list