[Feature][Jolla C] accessible flashlight

asked 2016-08-11 21:31:25 +0300

FloR707 gravatar image

On the first Jolla the file /sys/kernel/debug/flash_adp1650/mode had write permissions for everybody so that you could switch on the flash light. The corresponding file on the Jolla C /sys/class/leds/torch-light0/brightness has not. Was this intentionally or a mistake?

What is the right way to activate the flashlight on a Jolla C if you are not root?

edit retag flag offensive close delete

Comments

2

with 2.0.2.48 there is a flashlight switch on the ui under events. But I think your Q aims to use the flashlight from a script or program, thats why I did not use 'answer'.

jolladiho ( 2016-08-11 22:24:42 +0300 )edit
1

Based on the comment of hetas, I managed to get the flashlight switched on and off (from within an app).

  DBusInterface {
    id: dbusToggle

    service: 'com.jolla.settings.system.flashlight'
    iface: 'com.jolla.settings.system.flashlight'
    path: '/com/jolla/settings/system/flashlight'

    function toggleTorch(){
        call('toggleFlashlight')
    }

}

Now the toggleTorch funtion is available in your app (don't forget to import org.nemomobile.dbus 2.0).

BUT.. this mechanisme is way too slow to use it for quick on/off actions of the flash (like in my app MorseSender, so I'm also interested in the right answer ;-) (maybe make Torch QML Type available?).

rgrnetalk ( 2016-08-18 14:31:28 +0300 )edit

I got the hint via IRC that the camera app is using "gstreamer". Have not looked into that but maybe this is faster than dbus.

FloR707 ( 2016-08-19 11:33:33 +0300 )edit

The hammerhead torch is also using gstreamer, you can check that out here

rgrnetalk ( 2016-08-19 16:11:38 +0300 )edit