![]() |
2015-11-10
, 14:14
|
|
Posts: 394 |
Thanked: 1,341 times |
Joined on Dec 2009
|
#82
|
DBusInterface { id:dbif service: 'org.mpris.MediaPlayer2.jolla-mediaplayer' path: '/org/mpris/MediaPlayer2' iface: 'org.mpris.MediaPlayer2.Player' } // […] dbif.call('Pause', undefined)
DBusInterface { id:dbifcon bus: DBus.SystemBus service: 'net.connman' path: '/net/connman/technology/bluetooth' iface: 'net.connman.Technology' } // […] dbifcon.setProperty('Powered', false)
The Following User Says Thank You to velox For This Useful Post: | ||
![]() |
2015-11-10
, 15:53
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#83
|
propertiesEnabled: true
The Following User Says Thank You to marxian For This Useful Post: | ||
![]() |
2015-11-10
, 16:44
|
|
Posts: 394 |
Thanked: 1,341 times |
Joined on Dec 2009
|
#84
|
![]() |
2015-11-10
, 17:52
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#85
|
The Following User Says Thank You to marxian For This Useful Post: | ||
![]() |
2015-11-10
, 20:32
|
|
Posts: 394 |
Thanked: 1,341 times |
Joined on Dec 2009
|
#86
|
![]() |
2015-11-10
, 23:54
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#87
|
![]() |
2015-11-11
, 20:28
|
|
Posts: 394 |
Thanked: 1,341 times |
Joined on Dec 2009
|
#88
|
btw, net.connman /net/connman/technology/bluetooth NOT using DBus Properties, SetProperty is it's own method, so setProperty over DBusInterface wont work. Use typedCall.
DBusInterface { id:dbif bus: DBus.SystemBus service: 'net.connman' path: '/net/connman/technology/bluetooth' iface: 'net.connman.Technology' function enable(){ var valueVariant = true; dbif.typedCall('SetProperty', [ {'type':'s', 'value': 'Powered'}, {'type':'v', 'value': valueVariant} ]); } function disable(){ var valueVariant = false; dbif.typedCall('SetProperty', [ {'type':'s', 'value': 'Powered'}, {'type':'v', 'value': valueVariant} ]); } }
![]() |
2015-12-28
, 20:04
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, España
|
#89
|
I love you. In a non-sexual, nerdy way.
[…awkward pause…]
Anyway, if anyone is a beginner like me and wants to enable or disable Bluetooth via QML, feel free to copy and paste this working example:
Note: I found the extra var statement to be necessary – from what I understand, writing true/false directly seems to be cast as Boolean, not as Variant.Code:DBusInterface { id:dbif bus: DBus.SystemBus service: 'net.connman' path: '/net/connman/technology/bluetooth' iface: 'net.connman.Technology' function enable(){ var valueVariant = true; dbif.typedCall('SetProperty', [ {'type':'s', 'value': 'Powered'}, {'type':'v', 'value': valueVariant} ]); } function disable(){ var valueVariant = false; dbif.typedCall('SetProperty', [ {'type':'s', 'value': 'Powered'}, {'type':'v', 'value': valueVariant} ]); } }
![]() |
2015-12-29
, 04:14
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#90
|
The Following User Says Thank You to coderus For This Useful Post: | ||
I am sorry for my poor English....
Using N900 in China.
BBS moderator in bbs.dospy.com 's n900 plate.
http://bbs.dospy.com/forum-315-1.html