[maemo-developers] [maemo-developers] osso rpc call with argument : looking for python example
From: Pierre Amadio pierre.amadio at libertysurf.frDate: Sat Feb 10 14:57:39 EET 2007
- Previous message: [maemo-developers] Re: MMH project started
- Next message: [maemo-developers] Is this a bug in python-osso ? (osso rpc call with argument)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello.
I do not understand how to send arguments with libosso.
I have 2 python script: rapier and rapierbg.
I would like rapier to send a rpc call to rapierbg.
I have created the /usr/share/dbus-1/services/rapierbg.service file with
the following content:
[D-BUS Service]
Name=org.maemo.rapierbg
Exec=/home/melmoth/dev/rapier/src/rapierbg.py
In rapier, i have the following code to start the rpc request:
rpc=osso.Rpc(self.osso_context)
test=rpc.rpc_run("org.maemo.rapierbg",
"/org/maemo/rapierbg",
"org.maemo.rapierbg", "do_something")
In rapierbg i have:
osso_c = osso.Context("org.maemo.rapierbg", "0.0.1", False)
osso_rpc = osso.Rpc(osso_c)
osso_rpc.set_rpc_callback("org.maemo.rapierbg",
"/org/maemo/rapierbg",
"org.maemo.rapierbg", callback_func,osso_c)
as well as the following definition:
def callback_func(interface, method, arguments, user_data):
print "A RPC received"
print "interface=",interface
print "arguments=",arguments
print "user_data=",user_data
Now, things sort of work when i launch rapier, callbac_func is called
and i see 'A RPC received' being printed on the console.
If i try to add somes arguments in rapier this way:
args=("aa","bbb","cc")
test=rpc.rpc_run("org.maemo.rapierbg",
"/org/maemo/rapierbg",
"org.maemo.rapierbg", "do_something",args)
Then, it looks like callback_func is not being called at all.
Any idea as to how to send arguments or what error i may have made would be appreciated.
Pierre Amadio
- Previous message: [maemo-developers] Re: MMH project started
- Next message: [maemo-developers] Is this a bug in python-osso ? (osso rpc call with argument)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
