[maemo-developers] [maemo-developers] Libosso RPC
From: Krzysztof Sasiak krzsas at o2.plDate: Sat Jul 22 09:53:22 EEST 2006
- Previous message: [maemo-developers] proposal - locked keys
- Next message: [maemo-developers] Help on Garage, please!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I recently started developing for the nokia 770 platform. I'm using the RPC functions from libosso wrapper library to communicate between two processes. However I don't really understand how it works. I added a method to be called out whenever a client connects to a server, and sends a message. The method is being called out but I can't get to the contents of the message. All I can read is the types of data I sent, that is when I send an integer and a string I can read 'i', 's'. This is part of the client code:
(...)
void FillMessage (DBusMessage *msg, void *data) {
dbus_int32_t v_INT32 = 42;
const char *v_STRING = "Hello World";
dbus_message_append_args (msg,
DBUS_TYPE_INT32, &v_INT32,
DBUS_TYPE_STRING, &v_STRING,
DBUS_TYPE_INT32, &v_INT32,
DBUS_TYPE_INVALID);
};
(...)
error = osso_rpc_run_with_argfill (main_context,
OSSO_EXAMPLE_SERVICE,
OSSO_EXAMPLE_OBJECT,
OSSO_EXAMPLE_IFACE,
OSSO_EXAMPLE_MESSAGE,
NULL,
FillMessage,
NULL);
(...)
And this is the server code:
(...)
gint dbus_req_handler(const gchar * interface, const gchar * method,
GArray * arguments, gpointer data,
osso_rpc_t * retval)
/*
The libosso documentation says that arguments is an GArray of osso_prc_t structures. I don't understand the definition of this structure. What do '::' mean in the osso_rpc_t definition and how do I get to the contents of a message
*/
{
osso_rpc_t * temp;
guint i;
printf(">>>%s\n", __FUNCTION__);
printf("message from service: %s\n", (gchar *)data);
printf("Interface: %s\n", interface);
printf("Method: %s\n", method);
for (i=0;i<arguments->len;i++)
{
temp = &g_array_index (arguments, osso_rpc_t, i);
printf("%s\n", temp);
};
return OSSO_OK;
}
(...)
result = osso_rpc_set_cb_f(main_context,
OSSO_EXAMPLE_SERVICE,
OSSO_EXAMPLE_OBJECT,
OSSO_EXAMPLE_IFACE,
dbus_req_handler,
&data);
(...)
The libosso documentation says that arguments is an GArray of osso_prc_t structures. I don't understand the definition of this structure. What do '::' mean in the osso_rpc_t definition and how do I get to the contents of a message
I will be grateful for any help. Thanks in advance.
--
Pozdrawiam
Krzysiek Sasiak
TLEN_ID: krzsas
GG: 4358937
- Previous message: [maemo-developers] proposal - locked keys
- Next message: [maemo-developers] Help on Garage, please!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
