core/BLE: don't insist on pairing of pure BLE devices

Most (all?) BLE dive computers actually don't need to be paired, and some
apparently can't be paired. So let's not enforce that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-08-22 13:18:36 -07:00
parent 14f47c627d
commit c5b1fd9f53

View file

@ -235,9 +235,12 @@ void BtDeviceSelectionDialog::currentItemChanged(QListWidgetItem *item, QListWid
bool enableSaveButton = true;
#if !defined(Q_OS_WIN)
// On other platforms than Windows we can obtain the pairing status so if the devices are not paired we disable the button
// except on MacOS for those devices that only give us a Uuid and not and address (as we have no pairing status for those, either)
if (!remoteDeviceInfo.address().isNull()) {
// On platforms other than Windows we can obtain the pairing status so if the devices are non-BLE devices
// and not paired we disable the button
// on MacOS some devices (including all BLE devices) only give us a Uuid and not and address; for those
// we have no pairing status, either
if (!remoteDeviceInfo.address().isNull() &&
remoteDeviceInfo.coreConfigurations() != QBluetoothDeviceInfo::LowEnergyCoreConfiguration) {
QBluetoothLocalDevice::Pairing pairingStatus = localDevice->pairingStatus(remoteDeviceInfo.address());
if (pairingStatus == QBluetoothLocalDevice::Unpaired) {