bb96b82d48dd4a4fcaa33cfbee53feee5d65de3c
[modest] / tests / dbus_api / test_hello.c
1 #include <libosso.h>
2 #include <stdio.h>
3
4 #define MODEST_DBUS_NAME    "modestemail"
5 #define MODEST_DBUS_EXAMPLE_MESSAGE "HelloWorld"
6
7
8
9 int main(int argc, char *argv[])
10 {
11         /* Initialize maemo application */
12         osso_context_t * osso_context = osso_initialize(
13             "test_hello", "0.0.1", TRUE, NULL);
14                
15         /* Check that initialization was ok */
16         if (osso_context == NULL)
17         {
18                 printf("osso_initialize() failed.\n");
19             return OSSO_ERROR;
20         }
21         
22         osso_rpc_t retval;
23         osso_return_t ret = osso_rpc_run_with_defaults(osso_context, 
24                    MODEST_DBUS_NAME, 
25                    MODEST_DBUS_EXAMPLE_MESSAGE, &retval, DBUS_TYPE_INVALID);
26         if (ret != OSSO_OK) {
27                         printf("osso_rpc_run() failed.\n");
28                 return OSSO_ERROR;
29         } else {
30                 printf("osso_rpc_run() succeeded.\n");
31         }
32                 
33         osso_rpc_free_val(&retval);
34                 
35     /* Exit */
36     return 0;
37 }