diff options
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp index 04c25fdc..4ed62c25 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp @@ -37,8 +37,6 @@ #include "qbluetoothdeviceinfo.h" #include "qbluetoothdevicediscoveryagent.h" -#include "qlowenergyserviceinfo_p.h" - #include <QStringList> #include "qbluetoothuuid.h" #include <stdio.h> @@ -345,9 +343,29 @@ void QBluetoothServiceDiscoveryAgentPrivate::remoteDevicesChanged(int fd) leUuid = QBluetoothUuid(lowEnergyUuid.toUShort(0,0)); } - QLowEnergyServiceInfo lowEnergyService(leUuid); + //Check if the UUID is in the uuidFilter + if (!uuidFilter.isEmpty() && !uuidFilter.contains(leUuid)) + continue; + + QBluetoothServiceInfo lowEnergyService; lowEnergyService.setDevice(discoveredDevices.at(0)); - qCDebug(QT_BT_QNX) << "Adding Low Energy service" << lowEnergyService.serviceUuid(); + + bool ok = false; + quint16 serviceClass = leUuid.toUInt16(&ok); + if (ok) + lowEnergyService.setServiceName(QBluetoothUuid::serviceClassToString( + static_cast<QBluetoothUuid::ServiceClassUuid>(serviceClass))); + + QBluetoothServiceInfo::Sequence classId; + classId << QVariant::fromValue(leUuid); + lowEnergyService.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classId); + + QBluetoothServiceInfo::Sequence protocolDescriptorList; + protocolDescriptorList << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap)); + service.setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList); + + qCDebug(QT_BT_QNX) << "Adding Low Energy service" << leUuid; + q_ptr->serviceDiscovered(lowEnergyService); } |