On Tue, 2007-02-13 at 11:29 +0100, ext Christoph Würstle wrote:
> Hi,
> 
> I'm new to dbus stuff and I don't get the right arguments for
> osso_rpc_async_run to run/start e.g. the worldclock program.
> Could anyone please help me.
> I hope this list is (still also) for app development.

That kind of program is attached for your pleasure.

BR; Kimmo

> 
> Thanks a lot,
> Chris
> _______________________________________________
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://maemo.org/mailman/listinfo/maemo-developers
/* Compile with:
 * gcc -Wall `pkg-config --cflags --libs libosso` top-app.c -o top-app */
#include <stdio.h>
#include <glib.h>
#include <libosso.h>

static GMainLoop *loop;

static void async_cb(const gchar *interface, const gchar *method,
                     osso_rpc_t *retval, gpointer data)
{
        printf("method '%s' returned\n", method);
}

int main(int argc, char* argv[])
{
        osso_context_t *context;
        osso_return_t ret;

        loop = g_main_loop_new(NULL, 1);
        context = osso_initialize("toptest", "0.1", 0,
                                  g_main_loop_get_context(loop));
        if (context == NULL) {
                printf("could not connect to D-Bus\n");
                return 1;
        }

        ret = osso_rpc_async_run(context,
                                 "com.nokia.osso_worldclock",
                                 "/com/nokia/osso_worldclock",
                                 "com.nokia.osso_worldclock",
                                 "top_application", async_cb, NULL,
                                 DBUS_TYPE_STRING,
                                 "this is the top_application parameter",
                                 DBUS_TYPE_INVALID);
        if (ret != OSSO_OK) {
                printf("ERROR!\n");
                return 1;
        }

        g_main_loop_run(loop);
        return 0;
}
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers

Reply via email to