We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

[SOLVED] Bluetooth - start/stop (switch on/off) via CLI ?

asked 2014-04-26 01:19:31 +0200

Schturman gravatar image

updated 2014-04-26 17:27:50 +0200

Hi to all

Someone know how to start/stop (switch on/off) bluetooth via CLI ? Already tried, but without success:

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

Thanks

edit retag flag offensive close delete

Comments

You can restart/stop/start the bluetooth.service, do you want that ? systemctl restart bluetooth.service

fawz ( 2014-04-26 06:11:44 +0200 )edit

It's not what I need, I mean on/off BT like you do from the setting -> right upper corner...

I found that I can switch BT on with this command:

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:

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 :(

Schturman ( 2014-04-26 10:55:05 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2014-04-26 17:27:17 +0200

Schturman gravatar image

Ok, solution found by Coderus :) Thanks http://talk.maemo.org/showpost.php?p=1422846&postcount=64

ON:

dbus-send --system --print-reply --dest=net.connman /net/connman/technology/bluetooth net.connman.Technology.SetProperty string:"Powered" variant:boolean:true

OFF:

dbus-send --system --print-reply --dest=net.connman /net/connman/technology/bluetooth net.connman.Technology.SetProperty string:"Powered" variant:boolean:false
edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2014-04-26 01:19:31 +0200

Seen: 544 times

Last updated: Apr 26 '14