![]() |
2010-05-11
, 14:29
|
Posts: 726 |
Thanked: 345 times |
Joined on Apr 2010
@ Sweden
|
#2
|
The Following User Says Thank You to Joorin For This Useful Post: | ||
![]() |
2010-05-11
, 14:41
|
|
Posts: 534 |
Thanked: 723 times |
Joined on Oct 2009
|
#3
|
![]() |
2010-05-11
, 14:47
|
Posts: 1,086 |
Thanked: 2,964 times |
Joined on Jan 2010
|
#4
|
Did you see this page?
http://wiki.maemo.org/Documentation/..._in_Freemantle
import gobject, dbus from dbus.mainloop.glib import DBusGMainLoop def handle_sms(pdu, msgcenter, somestring, sendernumber): print 'New message from %s' % sendernumber DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() bus.add_signal_receiver(handle_sms, path='/com/nokia/phone/SMS', dbus_interface='Phone.SMS', signal_name='IncomingSegment') gobject.MainLoop().run()
This is inefficient and I want it to be a real time reaction. That way I can control my project on receipt of the sms, rather than waiting for the next polling cycle to come around. I know this has been done before but I don't know how to do it, and Im new to Maemo and confused by some of the things Ive read. Im hoping for some direction or advice, and if Im extra lucky maybe a code snippet, but a pointer in the right direction would be great. I think it has something to do with the Dbus, can I monitor it for a sms message arriving, intercept it and read it? At the same time, I don't want to interfere with the normal process of logging my other personal sms messages to the event log database.
My project is written in PyQt. Many thanks for all help, much appreciated.