Reply half-received ?

yohann (yrc) coppel varyoh at gmail.com
Thu Oct 27 12:49:55 PDT 2005


Wooow, I feel so stupid...

but now i've understood...

here is the solution... I forgot to use dbus_message_get_args...

int
send_get_current_song ()
{
        DBusMessage *message, *reply;
        DBusError error;
        char* path;

        dbus_error_init (&error);

        message = dbus_message_new_method_call (
                        VNAP_DBUS_SERVICE,
                        VNAP_PLAYER_PATH,
                        VNAP_PLAYER_INTERFACE,
                        VNAP_PLAYER_GET_CURRENT_SONG);

        dbus_message_append_args (message,
                        DBUS_TYPE_INVALID,
                        DBUS_TYPE_STRING, &path,
                        DBUS_TYPE_INVALID);
        
        reply = dbus_connection_send_with_reply_and_block (bus_conn,
message,
2000, &error);
        dbus_message_unref (message);
        dbus_connection_flush (bus_conn);

        // ..... code ......    

        dbus_message_get_args (reply,
                                &error,
                                DBUS_TYPE_STRING, &path,
                                DBUS_TYPE_INVALID);

        // ..... code ......    
        printf(">>> %s\n", path);

        // ..... code ......    
}
/*////// EOF /////////*/

So, why do we have to use &path in dbus_message_append_args ? if it's to
specify it again in dbus_message_get_args ?

Thanks for all!

yrc.



More information about the dbus mailing list