-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.8.4, 6.9.2
-
-
3
-
42b3dd064 (dev), 88790da2d (6.10), d2afe045d (tqtc/lts-6.8)
-
Foundation Sprint 140
On Windows, QBluetoothDeviceInfo::isCached() always reports true for all discovered BLE devices, including those actively advertising and not known to the system. This makes it impossible to distinguish cached devices from live ones.
#include <QtCore> #include <QtBluetooth> int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); QTextStream out(stdout); QBluetoothDeviceDiscoveryAgent agent; agent.setLowEnergyDiscoveryTimeout(6000); auto show = [&](QString tag, const QBluetoothDeviceInfo &info) { auto id = info.address().isNull() ? info.deviceUuid().toString() : info.address().toString(); out << tag << " " << info.name() << " [" << id << "] isCached=" << info.isCached() << " rssi=" << info.rssi() << "\n"; }; QObject::connect(&agent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, [&](auto info){ show("DISC", info); }); QObject::connect(&agent, &QBluetoothDeviceDiscoveryAgent::deviceUpdated, [&](auto info, auto){ show("UPDT", info); }); QObject::connect(&agent, &QBluetoothDeviceDiscoveryAgent::finished, [&]{ out << "FINISHED\n"; app.quit(); }); agent.start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod); return app.exec(); }
- Devices found during the current scan should return false
- Only devices coming from the system’s cache should return true
For Gerrit Dashboard: QTBUG-140825 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
682861,2 | Fix QBluetoothDeviceInfo::isCached() on Windows | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
683363,2 | Fix QBluetoothDeviceInfo::isCached() on Windows | 6.10 | qt/qtconnectivity | Status: MERGED | +2 | 0 |
683425,2 | Fix QBluetoothDeviceInfo::isCached() on Windows | tqtc/lts-6.8 | qt/tqtc-qtconnectivity | Status: MERGED | +2 | 0 |