diff options
author | Murillo Bernardes <mfbernardes@gmail.com> | 2017-12-02 14:55:47 +0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-02 08:21:33 -0800 |
commit | 8f3ac0402c95ae983ce5a35c2b1367fc01ac9872 (patch) | |
tree | 784bf62e8b8949d2863aecb89809a3eb056fa279 /mobile-widgets/qml/DownloadFromDiveComputer.qml | |
parent | 5bd90821d03c7aaf4d5258e7af6df68d5c46c3a9 (diff) | |
download | subsurface-8f3ac0402c95ae983ce5a35c2b1367fc01ac9872.tar.gz |
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 <mfbernardes@gmail.com>
Diffstat (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml')
-rw-r--r-- | mobile-widgets/qml/DownloadFromDiveComputer.qml | 5 |
1 files changed, 5 insertions, 0 deletions
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 |