maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Failed to listen to ClearCallNotification (https://talk.maemo.org/showthread.php?t=47657)

omeriko9 2010-03-18 08:53

Failed to listen to ClearCallNotification
 
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?...

omeriko9 2010-03-21 09:15

Re: Failed to listen to ClearCallNotification
 
Anyone?

A python code for listening to a different d-bus would be useful as well

omeriko9 2010-03-22 14:36

Re: Failed to listen to ClearCallNotification
 
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?...

noobmonkey 2010-03-22 14:45

Re: Failed to listen to ClearCallNotification
 
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 :D

omeriko9 2010-03-22 14:54

Re: Failed to listen to ClearCallNotification
 
Quote:

Originally Posted by noobmonkey (Post 577203)
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 :D

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 2010-03-22 15:07

Re: Failed to listen to ClearCallNotification
 
Quote:

Originally Posted by omeriko9 (Post 577217)
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 :D - 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.

krk969 2010-03-22 15:17

Re: Failed to listen to ClearCallNotification
 
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.

fred123 2010-03-22 16:05

Re: Failed to listen to ClearCallNotification
 
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.

omeriko9 2010-03-22 17:30

Re: Failed to listen to ClearCallNotification
 
@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 2010-03-22 17:32

Re: Failed to listen to ClearCallNotification
 
Quote:

Originally Posted by omeriko9 (Post 577481)
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.


All times are GMT. The time now is 11:27.

vBulletin® Version 3.8.8