summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Murillo Bernardes <mfbernardes@gmail.com>2017-12-02 14:49:36 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-02 08:21:33 -0800
commit5bd90821d03c7aaf4d5258e7af6df68d5c46c3a9 (patch)
treea491f72985e8518c494e02dcfb8f9d1cb0c97edb
parent137e83f7f2595e373be118b724c2fd18db701c98 (diff)
downloadsubsurface-5bd90821d03c7aaf4d5258e7af6df68d5c46c3a9.tar.gz
iOS: save BT DeviceInfo on discovery
On iOS save all discovered devices. Later qt_ble_open queries this list in order to actually connect to the remove device. The Desktop code stores this data with the list items and only saves when the "Save" button is clicked. This is not supported with the current ConnectionListModel implementation. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
-rw-r--r--core/btdiscovery.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index f51a62b23..9594ccb89 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -162,6 +162,15 @@ void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
qDebug() << id.toByteArray();
}
+#if defined(Q_OS_IOS)
+ // On Desktop this is called when "Save" button is clicked. All
+ // DeviceInfo are stored as data on the ui list items.
+ // On mobile (iOS) the current ConnectionListModel does not support
+ // additional data, so just save all discovered devices.
+
+ saveBtDeviceInfo(btDeviceAddress(&device, false).toUtf8().constData(), device);
+#endif
+
btDeviceDiscoveredMain(this_d);
#endif
}