maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Tinkering with DBus on Jolla (https://talk.maemo.org/showthread.php?t=92303)

Schturman 2014-04-25 17:03

Re: Tinkering with DBus on Jolla
 
Someone know how to start/stop bluetooth, I mean switch on/off BT like you do from the setting -> right upper corner... ?
Already tried:
Code:

dbus-send --type=method_call --dest=com.jolla.Bluetooth /com/jolla/Bluetooth org.freedesktop.DBus.Properties.Set string:"enable"
but without success :(

Schturman 2014-04-26 08:03

Re: Tinkering with DBus on Jolla
 
I found that I can switch BT on with this command:
Code:

dbus-send --type=method_call --dest=com.jolla.Bluetooth /com/jolla/Bluetooth com.jolla.Bluetooth.startSession
but the problem is after 2 seconds it start switching BT off (you can see the running line on the top side of screen.
If in this moment you will run this command:
Code:

dbus-send --type=method_call --dest=com.jolla.Bluetooth /com/jolla/Bluetooth com.jolla.Bluetooth.holdSession
it will stop it and BT stayed ON. But now I can't switch BT off, the "endSession" command not work :(

coderus 2014-04-26 09:29

Re: Tinkering with DBus on Jolla
 
mcetool is not solution?

coderus 2014-04-26 09:35

Re: Tinkering with DBus on Jolla
 
dbus-send --system --print-reply --dest=net.connman /net/connman/technology/bluetooth net.connman.Technology.SetProperty string:"Powered" variant:boolean:true
also

Schturman 2014-04-26 09:42

Re: Tinkering with DBus on Jolla
 
Ahhh, thanks! It work now :)
I want create a simple package for the quick On/OFF BT.

P.S. I tried mcetool but phone not found it. Tried to install but it also not found (dev mod activated).

P.S. also when I searched it I used: /usr/lib/qt5/bin/qdbus to find this processes/actions, but I didn't see net.connman here..

nieldk 2014-04-26 10:37

Re: Tinkering with DBus on Jolla
 
perhaps this one :)

http://releases.nemomobile.org/snaps...mo.armv7hl.rpm

Schturman 2014-04-26 15:07

Re: Tinkering with DBus on Jolla
 
Hmmm another question..
Coderus, can I somehow switch OFF BT, but not immediately like with "false" at the end of the command, I want see the progress bar on the top of the screen when it start disabling and if I want leave BT opened I can press on this bar to stop switching OFF.
Is it possible ? (command with "endSession" not work)
Thanks

P.S. And I would like to know how to check if my phone connected to another device ?
I connect Jolla to BT loudspeaker and if I run:
Code:

/usr/lib/qt5/bin/qdbus --system net.connman /net/connman/technology/bluetooth net.connman.Technology.GetProperties
it show me:
Code:

Connected: false
Name: Bluetooth
Powered: true
Tethering: false
Type: bluetooth

The first line show me false although it connected and work good. :confused: Why ?

coderus 2014-04-26 19:36

Re: Tinkering with DBus on Jolla
 
1. you can't do it using command line, you should use qt or bluez library.

coderus 2014-04-26 19:37

Re: Tinkering with DBus on Jolla
 
@Schturman stop creating stu...simple icons in menu. Install lipstick-pandora :)

Schturman 2014-04-26 19:52

Re: Tinkering with DBus on Jolla
 
Quote:

Originally Posted by coderus (Post 1422928)
1. you can't do it using command line, you should use qt or bluez library.

Ahh, ok :o

Quote:

Originally Posted by coderus (Post 1422929)
@Schturman stop creating stu...simple icons in menu. Install lipstick-pandora :)

lipstick-pandora don't do what I need ;)

Can you know how to check if Jolla connected to another device ?


All times are GMT. The time now is 12:40.

vBulletin® Version 3.8.8