Active Topics

 


Reply
Thread Tools
Posts: 10 | Thanked: 0 times | Joined on Mar 2010
#1
I got my N900 two days ago, and after playing around with some stuff I would like to start programming some things myself. I'm still working on getting Scratchbox fully setup on my Debian box, but in the meantime I was wondering how some of the interfaces work. I've had a look around the repos, but I have some difficulty finding the right documentation.

Where would I find the docs on running a certain script/program on certain events? For my first program (after some hello worlds) I would like to make the phone vibrate the name of the sender of a text in morse on receiving a SMS. I'd simply add a pattern for every letter in mce.ini and call those via DBUS. However, I can't find a way to run a program on receiving a text that does the right thing. Of course I could hack the rtcomm event logger, which has all the proper data, but that wouldn't be very neat (or packable). Any ideas?
 
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#2
Well, you can create a deamon for that, I'm not sure how to do it but it can start automatically on startup, run all the time in the bg and listen to the desired dbus.

If you want it to be controllable, you can make it an application or a desktop app or even a status-menu app. The first one will run on demand, the second might run automatically on startup if added to the desktop, and the third one will run on startup.
 
Posts: 10 | Thanked: 0 times | Joined on Mar 2010
#3
Where would I find the correct dbus hook? I couldn't find anything in the docs about which one to listen for. Setting up a daemon and such would be in more general Linux docs, probably. I could find that out once I know what to listen for...
 
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#4
Originally Posted by Kasperl View Post
Where would I find the correct dbus hook? I couldn't find anything in the docs about which one to listen for. Setting up a daemon and such would be in more general Linux docs, probably. I could find that out once I know what to listen for...
I partially use the docs, as they are very partial.

You can find more about DBUS in general here:
http://wiki.maemo.org/Documentation/...us/DBus_Basics

regarding finding the dbus to use, here is what I do:
First, I use "dbus-monitor --session" or "dbus-monitor --system", depends on what channel you need (I believe SMS is session).
I pipeline it to a file (so it will be more convenient) and reproduce the state I'd like to catch it's dbus channel (for incoming SMS, for example, I send myself an SMS from Skype or gmail).
Then the pipelined file contains ALL dbus method and signal calls.
Method call are for invokation (do something), and signals are to listen to something.
The output contains all the necessary information about the dbus (name, path, interface and type).

Hopes this helps.

Last edited by omeriko9; 2010-03-28 at 12:49.
 

The Following 2 Users Say Thank You to omeriko9 For This Useful Post:
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#5
There are dbus-scripts and dbus-scripts-settings packages, exactly for this. See here: http://talk.maemo.org/showthread.php?t=48132
__________________
My repository

"N900 community support for the MeeGo-Harmattan" Is the new "Mer is Fremantle for N810".

No more Nokia devices for me.
 
Posts: 10 | Thanked: 0 times | Joined on Mar 2010
#6
dbus-scripts sounds very promising. I'll log all the stuff to a file and see if I can get some texts. However, logging and intercepting seems rather roundabout for something that should just be documented. Isn't there any API documentation for the dbus signals sent by various packages?
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:53.