Struct in signal

Brenno Freire brenno.freire at
Wed Feb 18 10:08:20 PST 2009

I created a struct (date) and am trying to send the following way.
typedef struct data {
	unsigned int fileType; 
	char* filePath;  
	unsigned int vol;
	unsigned int x1,y1,x2,y2; 

DBusMessage* msg;
DBusMessageIter msgIter;
DBusConnection* session;
DBusError error;
msg = dbus_message_new_signal(OBJECT, INTERFACE, _method);
dbus_message_iter_init_append(msg, &msgIter);

if ((!dbus_message_iter_append_basic(&msgIter, DBUS_TYPE_STRUCT,
&value))||(!dbus_connection_send(session, msg, &serial))){
    printf("Out Of Memory!\n");

Got the following error. " arguments to dbus_message_iter_append_basic()
were incorrect, assertion "dbus_type_is_basic (type)" failed in file
dbus-message.c line 2241.
This is normally a bug in some application using the D-Bus library.
  D-Bus not built with -rdynamic so unable to print a backtrace
You could guide me?


Em Qua, 2009-02-18 às 20:24 +0200, Thiago Macieira escreveu:
> Brenno Freire wrote:
> >Is there any way to send a struct for a signal?
> Sure.
> A signal can carry any type of parameters, including structures of any 
> type.
> !DSPAM:499c52794021348188260!

More information about the dbus mailing list