diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2013-10-22 11:37:08 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2013-10-22 11:39:44 +0200 |
commit | b00388ea1448cfd977c54f53d038d1a270562d53 (patch) | |
tree | c6097a3d9ce61d0da5e2a5a4e977250aa5e376ed /src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp | |
parent | 672413c65685883136f4572d34f7d08f7b952641 (diff) | |
parent | 782a09be7c89352b27083bca7ee5b032d9e56ca6 (diff) |
Merge branch 'stable' into dev
Change-Id: I47daf8e94c809bd2786ad27cc56367da839504a0
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp index 16b471da..319e631f 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp @@ -54,6 +54,8 @@ #include <QPointer> #endif +#include <QFile> + #include <QtCore/private/qcore_unix_p.h> QT_BEGIN_NAMESPACE @@ -195,10 +197,15 @@ void QBluetoothServiceDiscoveryAgentPrivate::start(const QBluetoothAddress &addr qBBBluetoothDebug() << "Starting Service discovery for" << address.toString(); const char *filePath = QByteArray("/pps/services/bluetooth/remote_devices/").append(address.toString().toUtf8().constData()).constData(); if ((m_rdfd = qt_safe_open(filePath, O_RDONLY)) == -1) { - qWarning() << "Failed to open " << filePath; - error = QBluetoothServiceDiscoveryAgent::InputOutputError; - errorString = QStringLiteral("Failed to open remote device file"); - q->error(error); + if (QFile::exists(QLatin1String(filePath) + QLatin1String("-00")) || + QFile::exists(QLatin1String(filePath) + QLatin1String("-01"))) { + qBBBluetoothDebug() << "LE device discovered...skipping"; + } else { + qWarning() << "Failed to open " << filePath; + error = QBluetoothServiceDiscoveryAgent::InputOutputError; + errorString = QStringLiteral("Failed to open remote device file"); + q->error(error); + } _q_serviceDiscoveryFinished(); return; } else { @@ -274,8 +281,12 @@ void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd) if (serviceName.size() == 2) { serviceInfo.setServiceUuid(QBluetoothUuid(QLatin1String(serviceName.last()))); suuid = QBluetoothUuid((quint16)(serviceName.first().toUInt(&ok,16))); - if (suuid == QBluetoothUuid::SerialPort) - protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm)); + if (suuid == QBluetoothUuid::SerialPort) { + QBluetoothServiceInfo::Sequence protocol; + protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::Rfcomm)) + << QVariant::fromValue(0); + protocolDescriptorList.append(QVariant::fromValue(protocol)); + } } } else { //We do not have anything better, so we set the service class UUID as service UUID @@ -283,7 +294,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd) } //Check if the UUID is in the uuidFilter - if (!uuidFilter.isEmpty() && !uuidFilter.contains(suuid)) + if (!uuidFilter.isEmpty() && !uuidFilter.contains(serviceInfo.serviceUuid())) continue; serviceInfo.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList); |