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>
This commit is contained in:
Murillo Bernardes 2017-12-02 14:49:36 +08:00 committed by Dirk Hohndel
parent 137e83f7f2
commit 5bd90821d0

View file

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