![]() |
How can I read and respond to trigger SMS messages on arrival?
I have a small arduino project and Im using the n900 to run/send commands to it on receipt of particular sms messages. For example, if the subject line of a SMS is "led1red" it sends a message to the arduino to turn the led at 1 to the colour red. To do this, currently Im polling the event log database with a simple sql query at 10 minute intervals to read through the sms collection and determine if one has arrived with a trigger message.
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. |
Re: How can I read and respond to trigger SMS messages on arrival?
Listening for a dbus message sounds just right. By registering as a listener, you won't interfere and can use this to either start your search in the database as now, or try to pick just the right message and use that data directly.
There are good resources on the wiki covering the dbus and how it will behave both on incoming calls and SMS messages. |
Re: How can I read and respond to trigger SMS messages on arrival?
Did you see this page?
http://wiki.maemo.org/Documentation/..._in_Freemantle |
Re: How can I read and respond to trigger SMS messages on arrival?
Quote:
Code:
import gobject, dbus "Please be aware that the recommended way to use the phone functionality is Telepathy" But if it works then it works, i'll not worry too much about Telepathy. |
All times are GMT. The time now is 01:07. |
vBulletin® Version 3.8.8