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>
This commit is contained in:
Murillo Bernardes 2017-12-02 14:55:47 +08:00 committed by Dirk Hohndel
parent 5bd90821d0
commit 8f3ac0402c

View file

@ -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