maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to use led? (Fremantle/Qt 4.6) (https://talk.maemo.org/showthread.php?t=43259)

TNiga 2010-02-03 15:42

How to use led? (Fremantle/Qt 4.6)
 
Hi,

I would like to make led blink in my app, couldn't find any examples or documentation about it. So how is it done?

If you don't know but you do know some (preferably quite small) app which uses led, please tell which app so I can check the source code.

twaelti 2010-02-03 15:50

Re: How to use led? (Fremantle/Qt 4.6)
 
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:PatternCommunicationIM

The various patterns can be found in /etc/mce/mce.ini
You can also add your own there (caution if you edit this file!!!)

jfk 2010-02-03 15:59

Re: How to use led? (Fremantle/Qt 4.6)
 
Maybe it would be better to use the low-level /sys interface? There's a little documentation in the wiki: http://wiki.maemo.org/LED_patterns#Low_Level

That way you could just use custom patterns without messing with a configuration file.

TNiga 2010-02-03 16:00

Re: How to use led? (Fremantle/Qt 4.6)
 
How to stop the blinking? :D

qwerty12 2010-02-03 16:02

Re: How to use led? (Fremantle/Qt 4.6)
 
Quote:

Originally Posted by TNiga (Post 508854)
How to stop the blinking? :D

dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:PatternCommunicationIM

TNiga 2010-02-03 16:03

Re: How to use led? (Fremantle/Qt 4.6)
 
Quote:

Originally Posted by qwerty12 (Post 508858)
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:PatternCommunicationIM

Yeah that's what I guessed but didn't dare to test. Thanks.

TNiga 2010-02-03 16:08

Re: How to use led? (Fremantle/Qt 4.6)
 
Quote:

Originally Posted by jfk (Post 508851)
Maybe it would be better to use the low-level /sys interface? There's a little documentation in the wiki: http://wiki.maemo.org/LED_patterns#Low_Level

That way you could just use custom patterns without messing with a configuration file.

I didn't quite understand how that works. Care to give a little example?

jfk 2010-02-03 16:09

Re: How to use led? (Fremantle/Qt 4.6)
 
Quote:

Originally Posted by TNiga (Post 508872)
I didn't quite understand how that works. Care to give a little example?

Uhm, I was just pointing in the direction. That doesn't mean I've used it or know how it works. :o

TNiga 2010-02-03 16:13

Re: How to use led? (Fremantle/Qt 4.6)
 
Ok :)

Is it possible to do the dbus-send thingie and put somehow a custom pattern instead of those in the configuration file?

qwerty12 2010-02-03 16:15

Re: How to use led? (Fremantle/Qt 4.6)
 
Quote:

Originally Posted by TNiga (Post 508879)
Ok :)

Is it possible to do the dbus-send thingie and put somehow a custom pattern instead of those in the configuration file?

dbus-send is preferred to the sysfs approach because you don't have to be root to have the LED activated, AFAIK.

To add new patterns, you have to edit /etc/mce/mce.ini.

TNiga 2010-02-03 16:19

Re: How to use led? (Fremantle/Qt 4.6)
 
Ok, so there is no way to use custom patterns in my app without fiddling with the config file?

tmsha 2010-02-04 04:09

Re: How to use led? (Fremantle/Qt 4.6)
 
TNiga: May I ask you for a code snippet of how you do this with dbus in Qt ?

Thank you.


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

vBulletin® Version 3.8.8