From 5bd90821d03c7aaf4d5258e7af6df68d5c46c3a9 Mon Sep 17 00:00:00 2001 From: Murillo Bernardes Date: Sat, 2 Dec 2017 14:49:36 +0800 Subject: 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 --- core/btdiscovery.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core') 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 } -- cgit v1.2.3-70-g09d2