Blink LED programmatically

Hey, is there some way to control the LED programmatically, either from C++ or QML? I mean enable it for some time, and then disable, either some simple blinking or one of the mce patterns (or even steady light would do). Can this be done via some simple D-Bus call? I would like to avoid having to use the whole Notifications framework for that, just a simple LED enable/disable. Couldn’t find absolutely anything on this topic.

1 Like

Related;

might help…

4 Likes

@Edz YES!!! Both the D-Bus calls and mcetool commands listed there work perfectly fine for starting and stopping led patterns, which is more than enough for me.

Thank you very much!

1 Like

These ones?

dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:PatternBatteryFull

or using:

dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:PatternBatteryFull

[root@Sailfish ~]# mcetool --set-sw-breathing=enabled
[root@Sailfish ~]# mcetool --set-sw-breathing-limit=50

1 Like

dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:PatternCommunicationCall

or

mcetool --activate-led-pattern=PatternCommunicationCall

starts the LED pattern

dbus-send --system --print-reply --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:PatternCommunicationCall

or

mcetool --deactivate-led-pattern=PatternCommunicationCall

stops it.

1 Like
  QDBusMessage m = QDBusMessage::createMethodCall("com.nokia.mce",
                                                     "/com/nokia/mce/request",
                                                     "com.nokia.mce.request",
                                                     "req_led_pattern_activate");
    QList<QVariant> args;
    args.append("PatternCommunicationCall");
    m.setArguments(args);

    QDBusConnection::systemBus().call(m);

works just as well. To my big surprise, even with Sailjail enabled.

1 Like

On a different note, does anyone understand the logic behind how the 10 III displays MCE LED patterns?

Most of the default patterns for missed communication, like e.g. PatternCommunicationCall, SMS, email, etc, are configured in /etc/mce/20hybris-led.ini to be blinking (500 ms “OnPeriod”, 1500 ms “OffPeriod”). But most of the time they actually do NOT. They only blink if charging takes place at the same time, but if the phone isn’t charging then they are steady light. The color is right, but the light is steady.