Active Topics

 


Reply
Thread Tools
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#1
I'm using the following pymaemo script to listen to the d-bus for ClearCallNotification (in order to know when a missed cal has been viewed).

PHP Code:
import gobjectdbus
from dbus
.mainloop.glib import DBusGMainLoop

def handle_led
():
    print 
'hi'

DBusGMainLoop(set_as_default=True)
bus dbus.SystemBus()
#bus.add_signal_receiver(handle_led, path='/org/freedesktop/Telepathy/Client/NotificationUI', dbus_interface='com.nokia.RtcomNotificationUi', signal_name='ClearCallNotification')
bus.add_signal_receiver(handle_led"ClearCallNotification""org.freedesktop.Telepathy.Client.NotificationUI""com.nokia.RtcomNotificationUi""/org/freedesktop/Telepathy/Client/NotificationUI")
gobject.MainLoop().run() 
I've tried both bus.add_... lines, the one with remark # and the one without, as I saw two versions of bus.add_signal_receiver.

But none works. When I run "python dbs.py", get a missed call, and view it - it doesn't print "hi" as expected.

What am I doing wrong?...

Last edited by omeriko9; 2010-03-18 at 09:03.
 
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#2
Anyone?

A python code for listening to a different d-bus would be useful as well
 
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#3
No d-bus guru's here?...

I'll try to be more verbal, maybe that will get some responses...

I'm trying to catch the moment where the user is viewing a missed call.
I used dbus-monitor to listen to session d-bus notifications.
Then I called myself, and viewed the missed call yellow window.

The response I got from the dbus-monitor was:

Code:
method call sender=:1.675 -> dest=org.freedesktop.Telepathy.Client.NotificationUI serial=374 path=/org/freedesktop/Telepathy/Client/NotificationUI; interface=com.nokia.RtcomNotificationUi; member=ClearCallNotification

This is what led me to the code above (in the first post) but it seems not to listen to that event.

Anything I'm doing wrong?...

Last edited by omeriko9; 2010-03-22 at 14:41.
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#4
Hi Omerik, i am following this thread, but just to give it a boost i thought i'd say hi.
The only dbus i know is from Jebba's dbus pages. here

I'm not sure how i can help, but i may tinker and try what you are doing next week - if i get anywhere i'll poop back and let you know
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#5
Originally Posted by noobmonkey View Post
Hi Omerik, i am following this thread, but just to give it a boost i thought i'd say hi.
The only dbus i know is from Jebba's dbus pages. here

I'm not sure how i can help, but i may tinker and try what you are doing next week - if i get anywhere i'll poop back and let you know
Hi noobmonkey

Thank you very much for saying hi. I appreciate your help in the past and your experience with d-bus notifications (health check).

The link you mentioned talks only about send notification and not listen notifications, what make me wonder if this is possible with pymaemo at all...

I would be very grateful if you could try this next week
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#6
Originally Posted by omeriko9 View Post
Hi noobmonkey

Thank you very much for saying hi. I appreciate your help in the past and your experience with d-bus notifications (health check).

The link you mentioned talks only about send notification and not listen notifications, what make me wonder if this is possible with pymaemo at all...

I would be very grateful if you could try this next week
Not a problem, yeah me too - my experience so far is very much so with sending... i'm trying at the moment to receive other calls and interpret - but that involves knowing alot more about threading (Which i currently dont have a clue about!)

I think when we do find out we need to update the wiki ourselves - would help everyone else.

I know my code is taken from many sources, so i should open it up to the wiki when it is a bit tidier and break it down.
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#7
have you had a look at some of the QT Dbus wrappers ?
I know for sure you can listen to screen orientation, brightness, display state etc using these wrappers, not aware of what you mentioned above though.
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 

The Following 2 Users Say Thank You to krk969 For This Useful Post:
Posts: 196 | Thanked: 54 times | Joined on Jan 2010 @ UK
#8
What firmware version are you on?

If I run dbus-monitor I get
Code:
signal sender=:1.28 -> dest=:1.27 serial=70 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=NotificationClosed
   uint32 12
method call sender=:1.28 -> dest=com.nokia.HildonSVNotificationDaemon serial=71 path=/com/nokia/HildonSVNotificationDaemon; interface=com.nokia.HildonSVNotificationDaemon; member=StopEvent
   int32 -1
when I close the orange notification window.
 

The Following User Says Thank You to fred123 For This Useful Post:
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#9
@noobmonkey, no doubt the wiki page needs to be refreshed with some code example of pymaemo for listening to different dbus services. I have no problem doing it when I'll found out how

@fred123, Thank you for your note.
I'm using the latest firmware (3.2010.02-8).
You are correct, the dbus-monitor output you mentioned above is indeed the d-bus notification for closing the window.
The output I wrote is for clicking the yellow window (and by that opening the phone log). This also makes the yellow window to disappear, thus the confusion

I did tried both notifications as well but unfortunately I still don't get the desired result (the method "handle_led" is never called").

@krk969, thank you very much. But I'm trying to do that with python, and it doesn't seem like the QT DBus wrappers has any PyQt implementation yet...
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#10
Originally Posted by omeriko9 View Post
But I'm trying to do that with python, and it doesn't seem like the QT DBus wrappers has any PyQt implementation yet...
Code:
apt-get install python2.5-qt4-dbus
http://dbus.freedesktop.org/doc/dbus...eiving-signals

if you dont want to go via QT
found this example that listens to incoming sms'es.
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”

Last edited by krk969; 2010-03-22 at 17:35.
 

The Following User Says Thank You to krk969 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:29.