From 8f3ac0402c95ae983ce5a35c2b1367fc01ac9872 Mon Sep 17 00:00:00 2001 From: Murillo Bernardes Date: Sat, 2 Dec 2017 14:55:47 +0800 Subject: iOS: check for UUID instead of physical address on iOS the address we display on Connection is an UUID, not a physical address. This change the pattern (on iOS) used to enable bluetooth_mode. Signed-off-by: Murillo Bernardes --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index d1ee08f86..1091a0350 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -159,6 +159,11 @@ Kirigami.Page { onCurrentTextChanged: { // pattern that matches BT addresses var btAddr = /[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]/ ; + + // On iOS we store UUID instead of device address. + if (Qt.platform.os === 'ios') + btAddr = /\{?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\}/; + if (btAddr.test(currentText)) downloadThread.deviceData.bluetoothMode = true else -- cgit v1.2.3-70-g09d2