diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-03-06 15:37:38 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-07 10:46:00 +0100 |
commit | dc29213a7510baef9cda83dc6c520f3f50eff65f (patch) | |
tree | 3443f0b5597d21d2fd97bf028b723cc7416cff3a /src | |
parent | bab88aab8f144fedae8704931ae71ef048befd64 (diff) |
Android: Fix ommission of found services during SDP discovery
serviceClassUuids were not correctly written and hence only ever one
service was found per device. The deviceInfo and serviceUuid were the
same anyway as we are talking about the same remote device and the
absence of custom service uuids.
Change-Id: I2d8dad2d38381b1c171afb236ee56822e62ffee3
Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_android.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp index c79cffce..e0e17c14 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_android.cpp @@ -452,16 +452,16 @@ void QBluetoothServiceDiscoveryAgentPrivate::populateDiscoveredServices(const QB if (!customUuids.contains(i)) { //if we don't have custom uuid use it as class id as well - QList<QBluetoothUuid> serviceClassId; - serviceClassId << uuids.at(i); - serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, QVariant::fromValue(serviceClassId)); + QBluetoothServiceInfo::Sequence classId; + classId << QVariant::fromValue(uuids.at(i)); + serviceInfo.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); serviceInfo.setServiceName(serviceNameForClassUuid(uuids.at(i).data1)); } //don't include the service if we already discovered it before bool alreadyDiscovered = false; - for (int i = 0; i < discoveredServices.count(); i++) { - const QBluetoothServiceInfo &info = discoveredServices.at(i); + for (int j = 0; j < discoveredServices.count(); j++) { + const QBluetoothServiceInfo &info = discoveredServices.at(j); if (info.device() == serviceInfo.device() && info.serviceClassUuids() == serviceInfo.serviceClassUuids() && info.serviceUuid() == serviceInfo.serviceUuid()) { |