[SailfishDevel] Nemo DBus typedCall

Slava Monich slava.monich at jolla.com
Sun Jun 11 22:00:55 UTC 2017


Yes, in that respect the changes are backward compatible. Whatever you 
are getting from GetProperties can be monitored by handling the 
PropertyChanged signals. You just need to be prepared that SetProperty 
and other calls (Connect, Disconnect etc.) may respond with 
net.connman.Error.PermissionDenied if your process doesn't have enough 
privileges for that.

The idea is that the user has to be reasonably sure that a random app 
pulled from Jolla Store doesn't mess with the system configuration (e.g. 
doesn't enable mobile data behind your back). Most likely, a similar 
fate is awaiting ofono and a few other D-Bus interfaces. Right now Jolla 
Store apps can do way too much over D-Bus. We (well, at least I) will 
try not to not break backward compatibility of D-Bus APIs except when 
the breakage is absolutely inevitable, even though those are not 
officially supported APIs.

And as always, all these changes are open for close examination at 
git.merproject.org.

Cheers,
-Slava


> Can I still monitor for changes and read properties? Can you give a 
> more complete view what will change exactly? I am building an 
> universal bridge between Python and QML with integrated Platform APIs 
> based on DBUS and other stuff.
>
> Dylan
>
>
>
>
>> -------- Original Message --------
>> Subject: Re: [SailfishDevel] Nemo DBus typedCall
>> Local Time: June 11, 2017 7:16 PM
>> UTC Time: June 11, 2017 5:16 PM
>> From: slava.monich at jolla.com
>> To: devel at lists.sailfishos.org
>> Dylan Van Assche <dylan.van.assche at protonmail.com>
>>
>> And keep in mind that starting with Sailfish OS 2.1.1 non-privileged 
>> processes won't be able to set this property (as well as do a few 
>> other connman things, e.g. manipulate the services). In order to be 
>> able to use the restricted D-Bus APIs you would have to ask the 
>> launcher to run your app under nemo:privileged but that would 
>> automatically disqualify the app from getting accepted to Jolla 
>> Store. Sailfish OS is getting security conscious!
>>
>> Cheers,
>> -Slava
>>
>>
>>
>>> You’re missing the property name. You need:
>>>
>>>
>>> string:Powered variant:boolean:true
>>>
>>>
>>> ref:
>>>
>>> https://together.jolla.com/question/56437/i-would-like-to-toggle-internet-connectivity-via-terminal-with-dbus/
>>>
>>>
>>> typedCall('SetProperty', [ {'type':'s', 'value': 'Powered'}, 
>>> {'type':'v', 'value': valuet}], …);
>>>
>>>
>>> ref: https://talk.maemo.org/archive/index.php/t-92303.html
>>>
>>>
>>>
>>> -kimmo
>>>
>>>
>>> *From:*Devel [mailto:devel-bounces at lists.sailfishos.org] *On Behalf 
>>> Of *Dylan Van Assche via Devel
>>> *Sent:* 10. kesäkuuta 2017 12:45
>>> *To:* Sailfish OS Developers mailing list
>>> *Subject:* [SailfishDevel] Nemo DBus typedCall
>>>
>>>
>>> Hi devs,
>>>
>>>
>>> I'm playing around with the Nemo DBus QML plugin but I'm a little 
>>> bit stuck when using the function typedCall().
>>>
>>>
>>>
>>>
>>> DBusInterface{
>>> id:/wifi/
>>> bus:DBus.SystemBus
>>> service:'net.connman'
>>> path:'/net/connman/technology/wifi'
>>> iface:'net.connman.Technology'
>>>   
>>> signalsEnabled:true
>>>   
>>> function/setState/(powered){
>>> var/value/=/powered/?'true':'false'
>>> typedCall('SetProperty',
>>> {'type':'s','value':/value/},
>>> function(){/console/.log('[INFO]wifipowerstate set')},
>>> function(){/console/.log('[ERROR]wifipowerstate failed')})
>>> }
>>>   
>>> function/propertyChanged/(name,value){
>>> /console/.log("WiFichangedNAME=%1VALUE=%2".arg(/name/).arg(/value/))
>>> }
>>> }
>>>
>>>
>>> But it seems that I'm doing something wrong when I try to 
>>> enable/disable wifi. It's my first attempts with DBus but I have 
>>> managed to read the signals with the plugin without any issues.
>>>
>>>
>>> Cheers,
>>>
>>> Dylan
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> SailfishOS.org Devel mailing list
>>> To unsubscribe, please send a mail todevel-unsubscribe at lists.sailfishos.org
>
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20170612/60aa9edd/attachment-0001.html>


More information about the Devel mailing list