Active Topics

 


Reply
Thread Tools
Posts: 23 | Thanked: 11 times | Joined on Feb 2010 @ Finland
#1
I'm trying to show bluetooth device search dialog which i found here, but havent got it working yet. This is the code I use to call the dialog:
Code:
osso_return_t ret;
osso_rpc_t retval = {};
ret = osso_rpc_run_system(app->osso_cont,
	                   CONBTDIALOGS_DBUS_SERVICE,
	                   CONBTDIALOGS_DBUS_PATH,
	                   CONBTDIALOGS_DBUS_INTERFACE,
	                   CONBTDIALOGS_SEARCH_REQ, &retval,
	                   DBUS_TYPE_STRING, "",
	                   DBUS_TYPE_STRING, "",
	                   DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
	                   DBUS_TYPE_STRING, "require",
	                   DBUS_TYPE_INVALID);

	if (ret != OSSO_OK)
	{
		g_print(_("Could not show bluetooth dialog: (%s)\n"), ossoErrorStr(ret));
		return FALSE;
	}
Code compiles fine, but returns OSSO_RPC_ERROR every time it runs. Any help is appreciated, also this is my first time using rpc calls so there could be something wrong with its structure.

EDIT: call works in n900 if I use dbus-send but this C code segfaults (I edited code to use system bus after looking at bluemaemo's sourcecode). Any ideas?

Last edited by durazell; 2010-08-22 at 15:17.
 
Posts: 23 | Thanked: 11 times | Joined on Feb 2010 @ Finland
#2
Looks like using system() and calling dbus-send is only way to go since this doesn't work .
 
Posts: 23 | Thanked: 11 times | Joined on Feb 2010 @ Finland
#3
bump. i can use osso_rpc_run_system only with com.nokia.* calls. other messages return rpc error. please help
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#4
maemo-developers list would be a better place to ask this question, give it a go, and best of luck sorting it out.
 

The Following User Says Thank You to lardman For This Useful Post:
Posts: 3 | Thanked: 2 times | Joined on Sep 2010
#5
Documentation of libosso "http://maemo.org/api_refs/3.x/libosso/group__RPC.html#ga5" says that only six argument types are supported, and DBUS_TYPE_ARRAY is not one of them.


Besides the proper way to send an array is described in dbus documentation:

Code:
To append an array of fixed-length basic types, pass in the DBUS_TYPE_ARRAY typecode, the element typecode, the address of the array pointer, and a 32-bit integer giving the number of elements in the array. So for example:

 const dbus_int32_t array[] = { 1, 2, 3 };
 const dbus_int32_t *v_ARRAY = array;
 dbus_message_append_args (message,
                           DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &v_ARRAY, 3,
                           DBUS_TYPE_INVALID);
You may try to send an array with libosso that way, but i guess it wouldn't work anyway.

You may have to use some low-level dbus API if you want to send arrays and structs, or dbus signals.
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:54.