Changeset 6837120 in subsurface


Ignore:
Timestamp:
Jun 30, 2017, 1:12:07 PM (4 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
c145cbd
Parents:
a4d4d1c
git-author:
Dirk Hohndel <dirk@…> (06/29/17 19:43:00)
git-committer:
Dirk Hohndel <dirk@…> (06/30/17 13:12:07)
Message:

BLE handling: create helper function to add the LE: prefix

Signed-off-by: Dirk Hohndel <dirk@…>

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/btdiscovery.cpp

    rf5e1df0 r6837120  
    105105extern QHash<QString, QStringList> productList;
    106106extern QStringList vendorList;
     107
     108QString markBLEAddress(const QBluetoothDeviceInfo *device)
     109{
     110        QBluetoothDeviceInfo::CoreConfigurations flags;
     111        QString prefix = "";
     112
     113        flags = device->coreConfigurations();
     114        if (flags == QBluetoothDeviceInfo::LowEnergyCoreConfiguration)
     115                prefix = "LE:";
     116
     117        return prefix + device->address().toString();
     118}
    107119
    108120void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
  • desktop-widgets/btdeviceselectiondialog.cpp

    ra4d4d1c r6837120  
    425425}
    426426
     427extern QString markBLEAddress(const QBluetoothDeviceInfo *device);
     428
    427429QString BtDeviceSelectionDialog::getSelectedDeviceAddress()
    428430{
    429         if (selectedRemoteDeviceInfo) {
    430                 QBluetoothDeviceInfo *deviceInfo = selectedRemoteDeviceInfo.data();
    431                 QBluetoothDeviceInfo::CoreConfigurations flags;
    432                 QString prefix = "";
    433 
    434                 flags = deviceInfo->coreConfigurations();
    435                 if (flags == QBluetoothDeviceInfo::LowEnergyCoreConfiguration)
    436                         prefix = "LE:";
    437                 return prefix + deviceInfo->address().toString();
    438         }
     431        if (selectedRemoteDeviceInfo)
     432                return markBLEAddress(selectedRemoteDeviceInfo.data());
    439433
    440434        return QString();
Note: See TracChangeset for help on using the changeset viewer.