From 92aaf1c4ab97aada3b5bd864ffebda4c79158f3e Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sun, 30 Apr 2017 18:33:25 -0700 Subject: bluetooth: allow detection of bluetooth enabled Bluetooth can now be enabled via connmand dbus service, and needs to detect if already enabled. Change-Id: I279a571b89381579eb05705410210a9266039377 Bug-AGL: SPEC-570 Signed-off-by: Matt Ranostay --- app/bluetooth/Bluetooth.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/bluetooth') diff --git a/app/bluetooth/Bluetooth.qml b/app/bluetooth/Bluetooth.qml index a1cc5ae..71e3635 100644 --- a/app/bluetooth/Bluetooth.qml +++ b/app/bluetooth/Bluetooth.qml @@ -25,6 +25,7 @@ SettingPage { icon: '/bluetooth/images/HMI_Settings_BluetoothIcon.svg' title: 'Bluetooth' checkable: true + readonly property bool isBluetooth: true property string btAPIpath: bindingAddress + '/Bluetooth-manager/' property var jsonObjectBT: [] @@ -431,6 +432,15 @@ SettingPage { clip: true } + function checkBluetooth() { + request(btAPIpath + 'power', function (o) { + // log the json response + var msg = JSON.parse(o.responseText) + console.log(o.responseText) + checked = msg.response.power == "on" + }) + } + function findDevice(address){ for (var i = 0; i < btDeviceList.count; i++) { if (address === btDeviceList.get(i).deviceAddress){ -- cgit 1.2.3-korg