<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hi,</pre><div><br></div><div>I'm trying to listen to the MCE DBUS API for changes from the display and the radios.<br></div><div>For some reason, I won't receive the signals while writing on the /request endpoint works perfectly.<br></div><div>Someone an idea?<br></div><div><br></div><div>Seems that Slava can make this work: <a href="https://github.com/monich/harbour-lib/blob/master/src/HarbourSystemState.cpp">https://github.com/monich/harbour-lib/blob/master/src/HarbourSystemState.cpp</a><br></div><div><br></div><div>DBusInterface<span class="colour" style="color:rgb(192, 192, 192)"> </span>{<br></div><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(128, 0, 0)">id</span>:<span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 0, 0)"><i>dbusFlight</i></span><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(128, 0, 0)">bus</span>:<span class="colour" style="color:rgb(192, 192, 192)"> </span>DBus.SystemBus<br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(128, 0, 0)">service</span>:<span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">"com.nokia.mce"</span><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(128, 0, 0)">path</span>:<span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">"/com/nokia/mce/signal"</span><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(128, 0, 0)">iface</span>:<span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">"com.nokia.mce.signal"</span><br></pre><pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">//</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">Signals</span><br></pre><pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(128, 128, 0)">function</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 0, 0)"><i>radio_states_ind</i></span>(state)<span class="colour" style="color:rgb(192, 192, 192)"> </span>{<br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 85, 175)"><i>console</i></span>.log(<span class="colour" style="color:rgb(0, 85, 175)"><i>JSON</i></span>.stringify(<span class="colour" style="color:rgb(0, 128, 0)">"MCE</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">radio</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">state=</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">"</span><span class="colour" style="color:rgb(192, 192, 192)"> </span>+<span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(41, 133, 199)"><i>state</i></span>))<br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span>}<br></pre><pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(128, 128, 0)">function</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 0, 0)"><i>display_status_ind</i></span>(state)<span class="colour" style="color:rgb(192, 192, 192)"> </span>{<br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 85, 175)"><i>console</i></span>.log(<span class="colour" style="color:rgb(0, 85, 175)"><i>JSON</i></span>.stringify(<span class="colour" style="color:rgb(0, 128, 0)">"MCE</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">display</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">state=</span><span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(0, 128, 0)">"</span><span class="colour" style="color:rgb(192, 192, 192)"> </span>+<span class="colour" style="color:rgb(192, 192, 192)"> </span><span class="colour" style="color:rgb(41, 133, 199)"><i>state</i></span>))<br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="colour" style="color:rgb(192, 192, 192)"> </span>}<br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">}<br></pre><div><br></div><div>Cheers,<br></div><div>Dylan</div><div class="protonmail_signature_block protonmail_signature_block-empty"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><div><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><blockquote class="protonmail_quote" type="cite"><div>-------- Original Message --------<br></div><div>Subject: Re: [SailfishDevel] Nemo DBus typedCall<br></div><div>Local Time: June 12, 2017 12:00 AM<br></div><div>UTC Time: June 11, 2017 10:00 PM<br></div><div>From: slava.monich@jolla.com<br></div><div>To: Sailfish OS Developers <devel@lists.sailfishos.org><br></div><div>Dylan Van Assche <dylan.van.assche@protonmail.com><br></div><div><br></div><div> 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.<br></div><div> <br></div><div> 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.<br></div><div> <br></div><div> And as always, all these changes are open for close examination at
git.merproject.org.<br></div><div> <br></div><div> Cheers,<br></div><div> -Slava<br></div><div> <br></div><div> <br></div><div> <br></div><blockquote type="cite"><div>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.<br></div><div><div><br></div><div>Dylan<br></div><div> <br></div></div><div class="protonmail_signature_block
protonmail_signature_block-empty"><div class="protonmail_signature_block-user
protonmail_signature_block-empty"><div><br></div></div><div class="protonmail_signature_block-proton
protonmail_signature_block-empty"><br></div></div><div><br></div><blockquote type="cite" class="protonmail_quote"><div>-------- Original Message --------<br></div><div>Subject: Re: [SailfishDevel] Nemo DBus typedCall<br></div><div>Local Time: June 11, 2017 7:16 PM<br></div><div>UTC Time: June 11, 2017 5:16 PM<br></div><div>From: <a href="mailto:slava.monich@jolla.com" class="moz-txt-link-abbreviated" rel="noreferrer nofollow noopener">slava.monich@jolla.com</a><br></div><div>To: <a href="mailto:devel@lists.sailfishos.org" class="moz-txt-link-abbreviated" rel="noreferrer nofollow noopener">devel@lists.sailfishos.org</a><br></div><div>Dylan Van Assche <a href="mailto:dylan.van.assche@protonmail.com" class="moz-txt-link-rfc2396E" rel="noreferrer nofollow noopener"><dylan.van.assche@protonmail.com></a><br></div><div><br></div><div>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!<br></div><div><br></div><div>Cheers,<br></div><div>-Slava<br></div><div><br></div><div><br></div><div class="moz-cite-prefix"><br></div><blockquote type="cite"><div class="WordSection1"><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt">You’re
missing the property name. You need:</span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"> </span></span></span><br></p><p class="MsoNormal"><span class="font" style="font-family:"Courier
New""><span class="size" style="font-size:10pt">string:Powered variant:boolean:true</span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"> </span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt">ref:</span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"><a href="https://together.jolla.com/question/56437/i-would-like-to-toggle-internet-connectivity-via-terminal-with-dbus/" rel="noreferrer nofollow noopener">https://together.jolla.com/question/56437/i-would-like-to-toggle-internet-connectivity-via-terminal-with-dbus/</a></span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"> </span></span></span><br></p><p class="MsoNormal"><span class="font" style="font-family:"Courier
New""><span class="size" style="font-size:10pt">typedCall('SetProperty', [ {'type':'s',
'value': 'Powered'}, {'type':'v', 'value': valuet}],
…);</span></span><br></p><p class="MsoNormal"><span lang="EN-US"> </span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt">ref: </span></span></span><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"><a href="https://talk.maemo.org/archive/index.php/t-92303.html" rel="noreferrer nofollow noopener"><span lang="FI">https://talk.maemo.org/archive/index.php/t-92303.html</span></a></span></span></span><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"> </span></span></span><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"></span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"> </span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"> </span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt">-kimmo</span></span></span><br></p><p class="MsoNormal"><span class="colour" style="color:rgb(31, 73, 125)"><span class="font" style="font-family:Calibri, sans-serif"><span class="size" style="font-size:11pt"> </span></span></span><br></p><p class="MsoNormal"><b><span class="font" style="font-family:Tahoma, sans-serif"><span class="size" style="font-size:10pt">From:</span></span></b><span class="font" style="font-family:Tahoma, sans-serif"><span class="size" style="font-size:10pt"> Devel [<a class="moz-txt-link-freetext" href="mailto:devel-bounces@lists.sailfishos.org" rel="noreferrer nofollow noopener">mailto:devel-bounces@lists.sailfishos.org</a>] <b>On Behalf Of </b>Dylan Van Assche via Devel<br> <b>Sent:</b> 10. kesäkuuta 2017 12:45<br> <b>To:</b> Sailfish OS Developers mailing list<br> <b>Subject:</b> [SailfishDevel] Nemo DBus typedCall</span></span></p><p class="MsoNormal"> <br></p><div><p class="MsoNormal">Hi devs,<br></p></div><div><p class="MsoNormal"> <br></p></div><div><p class="MsoNormal">I'm playing around with the Nemo DBus
QML plugin but I'm a little bit stuck when using the
function typedCall().<br></p></div><div><p class="MsoNormal"> <br></p></div><div><div><div><p class="MsoNormal"> <br></p></div></div><div><p class="MsoNormal"> <br></p></div></div><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span></span>DBusInterface<span class="colour"><span class="colour" style="color:silver"> </span></span>{
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:maroon">id</span></span>:<span class="colour"><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:black">wifi</span></i></span>
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:maroon">bus</span></span>:<span class="colour"><span class="colour" style="color:silver"> </span></span>DBus.SystemBus
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:maroon">service</span></span>:<span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">'net.connman'</span></span>
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:maroon">path</span></span>:<span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">'/net/connman/technology/wifi'</span></span>
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:maroon">iface</span></span>:<span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">'net.connman.Technology'</span></span>
<br></pre><pre style="-qt-paragraph-type:empty;-qt-block-indent:0">
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:maroon">signalsEnabled</span></span>:<span class="colour"><span class="colour" style="color:silver"> </span></span>true
<br></pre><pre style="-qt-paragraph-type:empty;-qt-block-indent:0">
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:olive">function</span><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:black">setState</span></i></span>(powered)<span class="colour"><span class="colour" style="color:silver"> </span></span>{
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:olive">var</span><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:rgb(41, 133, 199)">value</span></i><span class="colour" style="color:silver"> </span></span>=<span class="colour"><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:rgb(41, 133, 199)">powered</span></i></span>?<span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">'true'</span></span>:<span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">'false'</span></span>
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span></span>typedCall(<span class="colour"><span class="colour" style="color:green">'SetProperty'</span></span>,
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span></span>{<span class="colour"><span class="colour" style="color:green">'type'</span></span>:<span class="colour"><span class="colour" style="color:green">'s'</span></span>,<span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">'value'</span></span>:<span class="colour"><i><span class="colour" style="color:rgb(41, 133, 199)">value</span></i></span>},
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:olive">function</span></span>()<span class="colour"><span class="colour" style="color:silver"> </span></span>{<span class="colour"><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:rgb(0, 85, 175)">console</span></i></span>.log(<span class="colour"><span class="colour" style="color:green">'[INFO]</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">wifi</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">power</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">state set'</span></span>)<span class="colour"><span class="colour" style="color:silver"> </span></span>},
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:olive">function</span></span>()<span class="colour"><span class="colour" style="color:silver"> </span></span>{<span class="colour"><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:rgb(0, 85, 175)">console</span></i></span>.log(<span class="colour"><span class="colour" style="color:green">'[ERROR]</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">wifi</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">power</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">state failed'</span></span>)<span class="colour"><span class="colour" style="color:silver"> </span></span>})
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span></span>}
<br></pre><pre style="-qt-paragraph-type:empty;-qt-block-indent:0">
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><span class="colour" style="color:olive">function</span><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:black">propertyChanged</span></i></span>(name,<span class="colour"><span class="colour" style="color:silver"> </span></span>value)<span class="colour"><span class="colour" style="color:silver"> </span></span>{
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span><i><span class="colour" style="color:rgb(0, 85, 175)">console</span></i></span>.log(<span class="colour"><span class="colour" style="color:green">"WiFi</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">changed</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">NAME=%1</span><span class="colour" style="color:silver"> </span><span class="colour" style="color:green">VALUE=%2"</span></span>.arg(<span class="colour"><i><span class="colour" style="color:rgb(41, 133, 199)">name</span></i></span>).arg(<span class="colour"><i><span class="colour" style="color:rgb(41, 133, 199)">value</span></i></span>))
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span></span>}
<br></pre><pre style="-qt-block-indent:0"><span class="colour"><span class="colour" style="color:silver"> </span></span>}
<br></pre><div><p class="MsoNormal"> <br></p></div><div><p class="MsoNormal">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.<br></p></div><div><p class="MsoNormal"> <br></p></div><div><p class="MsoNormal">Cheers,<br></p></div><div><p class="MsoNormal">Dylan<br></p></div><div><p class="MsoNormal"> <br></p></div></div><div><br></div><div><br></div><pre wrap="">_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to <a class="moz-txt-link-abbreviated" href="mailto:devel-unsubscribe@lists.sailfishos.org" rel="noreferrer nofollow noopener">devel-unsubscribe@lists.sailfishos.org</a>
<br></pre></blockquote></blockquote><div><br></div><div><br></div><div><br></div><pre wrap="">_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" class="moz-txt-link-abbreviated" rel="noreferrer nofollow noopener">devel-unsubscribe@lists.sailfishos.org</a><br></pre></blockquote></blockquote><div><br></div>