![]() |
Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Hi, developers...
I'd like to enhance Queen Beecon Widget with the ability to perform QBW to QBW instance and System to QBW instance IPC (Inter Process Communication). I just need a very basic and simple IPC mechanism which responds to commands like these: Code:
run-standalone.sh dbus-send --session --type=signal /com/nokia/qbw/Object com.nokia.qbw.Interface.update string:"id0" string:"layout"Code:
run-standalone.sh dbus-send --session --type=signal /com/nokia/qbw/Object com.nokia.qbw.Interface.update string:"id<xx>" string:"content"I already coded some snippets into QBW: DBUS, Signal & Marshalling includes: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
Code:
[sbox-FREMANTLE_X86: ~] > run-standalone.sh dbus-send --session --type=signal /com/nokia/qbw/Object com.nokia.qbw.Interface.update string:"id0" string:"layout"Code:
[sbox-FREMANTLE_X86: ~] > run-standalone.sh dbus-monitor "type='signal',interface='com.nokia.qbw.Interface'"Any help will be greately appreciated. I already googled here and there for hints but without success. Also I already had a look at Help with creating daemon for n900 thread here Ciao. |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Hello,
I'm no D-Bus expert, but I don't think signals are what you want. Signals, generally, are emitted when your application does something and you want listeners to be notified of a change. A method call would be better suited to this application. Anyway, what you appear to be doing would be listening for a signal emission. I guess you'd specify that it is your program providing the method call. The DBus-GLib way would be http://dbus.freedesktop.org/doc/dbus...ml#glib-server Examples of programs doing this are, off the top of my head: Evince (look for its XML files), Diablo's hildon-desktop (look in the background-manager folder), my FMTX Faker (I would not recommend looking at it, however) and N900 FMRX Enabler among others. |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Quote:
I know signals is not the most orthodox way to do that and methods are the way to go ... I just needed a quick, cheap and dirty solution to provide very basic IPC. For use case and very simple POC: imagine 1 QBW (button) which gives "roll" impulse to 2 instances of QBW Naive Dice Roller, or drives "shuffle" of - say - 5 cards-looking QBWs or (long requested) have many QBW buttons for changing CPU overclocking frequencies and impulse to a gauge QBW for displaying results and other stats. I'll inspect much further but it's still a mistery why QBW doesn't receive signals (I tried also with a basic signal with no parameters and no marshalling) Second mistery is how I can debug issues like this one... Ciao. |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
1 Attachment(s)
My attempt is attached. It's pretty bad and I'm not sure all instances recieve the signal...
Test with "dbus-send --session --type=method_call --dest=com.nokia.qbw /com/nokia/qbw com.nokia.qbw.update string:"id0" string:"layout"" Crap, I forgot to apply the org.freedesktop.DBus.GLib.NoReply attribute OK, it does only work for one instance. What you probably should do is when dbus-g-connection-register-g-object is called, is to append the path "/com/nokia/qbw" so that it looks like "/com/nokia/qbw/$ID" so that each instance of the object has their own path - this way you also don't need to pass the id as a parameter too |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Quote:
R E S P E C T... my friend! I'll give it a shot tomorrow!!! :D |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Also remember that you're trying to use D-Bus not in an app, but in a hildon-desktop widget. Therefore, you need a special way to get hold of the DBusConnection.
An alternate hackish python way can be found in my recaller sourcecode (I'm using it for the autorecording, listening to systemdbus). |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Quote:
PHP Code:
However that could have been my mistake in calling the function back in my "try-this-and-see-what-happens" hours!!! GOD SAVE THE MAEMO COMMUNITY!!!! :cool: |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Quote:
Quote:
Secondly got your warning here: PHP Code:
Ciao. |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Quote:
Quote:
"it.nononoyes.qbw"? :P Best regards. |
Re: Help needed: DBUS signals not received by hildon-desktop widget (I need widget2widget & system2widget IPC)
Quote:
As for debugging these sorts of issues, it can be pretty horrible. I recommend using scratchbox, in an X86 session. Start up the hildon environment, then kill hildon-desktop and re-run it under gdb (see http://wiki.maemo.org/Using_Valgrind..._in_Scratchbox, particularly the section on "Starting Maemo-Launched Application with Maemo-Summoner "). |
| All times are GMT. The time now is 12:12. |
vBulletin® Version 3.8.8