75#if defined(QT_WINRT_BLUETOOTH)
79#elif defined(QT_OSX_BLUETOOTH)
80 :
public QObject,
public DarwinBluetooth::SDPInquiryDelegate
85 Q_DECLARE_PUBLIC(QBluetoothServiceDiscoveryAgent)
86 friend class ::tst_QBluetoothServiceDiscoveryAgent;
90 static constexpr int kMaxSdpRecursionDepth = 64;
118 void _q_sdpScannerDone(
int exitCode, QProcess::ExitStatus status);
119 void _q_finishSdpScan(QBluetoothServiceDiscoveryAgent::Error errorCode,
120 const QString &errorDescription,
121 const QStringList &xmlRecords);
123#ifdef QT_ANDROID_BLUETOOTH
124 void _q_processFetchedUuids(
const QBluetoothAddress &address,
const QList<QBluetoothUuid> &uuids);
126 void populateDiscoveredServices(
const QBluetoothDeviceInfo &remoteDevice,
127 const QList<QBluetoothUuid> &uuids);
128 void _q_fetchUuidsTimeout();
129 void _q_hostModeStateChanged(QBluetoothLocalDevice::HostMode state);
133 void start(
const QBluetoothAddress &address);
135 bool isDuplicatedService(
const QBluetoothServiceInfo &serviceInfo)
const;
138 void startBluez5(
const QBluetoothAddress &address);
139 void runExternalSdpScan(
const QBluetoothAddress &remoteAddress,
140 const QBluetoothAddress &localAddress);
141 void sdpScannerDone(
int exitCode, QProcess::ExitStatus exitStatus);
142 QVariant readAttributeValue(QXmlStreamReader &xml,
int depth = 0);
143 QBluetoothServiceInfo parseServiceXml(
const QString& xml);
144 void performMinimalServiceDiscovery(
const QBluetoothAddress &deviceAddress);
148 QBluetoothServiceDiscoveryAgent::Error error;
156 DiscoveryState state;
157 QList<QBluetoothUuid> uuidFilter;
159 QBluetoothDeviceDiscoveryAgent *deviceDiscoveryAgent =
nullptr;
161 QBluetoothServiceDiscoveryAgent::DiscoveryMode mode;
165 QString foundHostAdapterPath;
166 QtBluetoothPrivate::OrgFreedesktopDBusObjectManagerInterface *manager =
nullptr;
167 QProcess *sdpScannerProcess =
nullptr;
170#ifdef QT_ANDROID_BLUETOOTH
171 ServiceDiscoveryBroadcastReceiver *receiver =
nullptr;
172 LocalDeviceBroadcastReceiver *localDeviceReceiver =
nullptr;
174 QJniObject btAdapter;
181 QMap<QBluetoothAddress,QPair<QBluetoothDeviceInfo,QList<QBluetoothUuid> > > sdpCache;
184#ifdef QT_WINRT_BLUETOOTH
186 void processFoundService(quint64 deviceAddress,
const QBluetoothServiceInfo &info);
187 void onScanFinished(quint64 deviceAddress);
191 void releaseWorker();
192 QPointer<QWinRTBluetoothServiceDiscoveryWorker> worker;
195#ifdef QT_OSX_BLUETOOTH
197 void SDPInquiryFinished(
void *device) override;
198 void SDPInquiryError(
void *device, IOReturn errorCode) override;
200 void performMinimalServiceDiscovery(
const QBluetoothAddress &deviceAddress);
203 bool serviceHasMatchingUuid(
const QBluetoothServiceInfo &serviceInfo)
const;
205 DarwinBluetooth::ScopedPointer serviceInquiry;
209 QBluetoothServiceDiscoveryAgent *q_ptr;