sendeing an integer

Mike Gorse mgorse at novell.com
Tue May 5 07:39:38 PDT 2009


There are several types of ints: DBUS_TYPE_INT16, DBUS_TYPE_INT32, 
DBUS_TYPE_INT64, and each has a corresponding UINT type.  Also, you'll 
need to make sure that the argument you pass to 
dbus_message_iter_append_basic points to an int of the correct size. 
There are types defined in dbus-types.h (ie, dbus_int32_t) that will 
guarantee that your int will be the correct size.

On Tue, 5 May 2009, Anas Alzouhbi wrote:

> Hello
> I followed the tutorial on this site
> http://dbus.freedesktop.org/doc/dbus/libdbus-tutorial.html
> to use the dbus.
> I like to change it to send an integer instead of string, so while
> appending the arguments onto signal,
> I wrote:
> (!dbus_message_iter_append_basic(&args, DBUS_TYPE_INT,sigvalue))
> intead of   if (!dbus_message_iter_append_basic(&args,
> DBUS_TYPE_STRING, &sigvalue))
> but the compiler didn't know DBUS_TYPE_INT, showing this error
> sender.c: In function 'sendsignal':
> sender.c:63: error: 'DBUS_TYPE_INT' undeclared (first use in this function)
>
>
> what I have to do?? to send an integer
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>


More information about the dbus mailing list