88#if defined(QT_WINRT_BLUETOOTH)
92#elif defined(QT_OSX_BLUETOOTH)
93 :
public QObject,
public DarwinBluetooth::SDPInquiryDelegate
98 Q_DECLARE_PUBLIC(QBluetoothServiceDiscoveryAgent)
99 friend class ::tst_QBluetoothServiceDiscoveryAgent;
103 static constexpr int kMaxSdpRecursionDepth = 64;
131 void _q_sdpScannerDone(
int exitCode, QProcess::ExitStatus status);
132 void _q_finishSdpScan(QBluetoothServiceDiscoveryAgent::Error errorCode,
133 const QString &errorDescription,
134 const QStringList &xmlRecords);
136#ifdef QT_ANDROID_BLUETOOTH
137 void _q_processFetchedUuids(
const QBluetoothAddress &address,
const QList<QBluetoothUuid> &uuids);
139 void populateDiscoveredServices(
const QBluetoothDeviceInfo &remoteDevice,
140 const QList<QBluetoothUuid> &uuids);
141 void _q_fetchUuidsTimeout();
142 void _q_hostModeStateChanged(QBluetoothLocalDevice::HostMode state);
146 void start(
const QBluetoothAddress &address);
148 bool isDuplicatedService(
const QBluetoothServiceInfo &serviceInfo)
const;
151 void startBluez5(
const QBluetoothAddress &address);
152 void runExternalSdpScan(
const QBluetoothAddress &remoteAddress,
153 const QBluetoothAddress &localAddress);
154 void sdpScannerDone(
int exitCode, QProcess::ExitStatus exitStatus);
155 QVariant readAttributeValue(QXmlStreamReader &xml,
int depth = 0);
156 QBluetoothServiceInfo parseServiceXml(
const QString& xml);
157 void performMinimalServiceDiscovery(
const QBluetoothAddress &deviceAddress);
161 QBluetoothServiceDiscoveryAgent::Error error;
169 DiscoveryState state;
170 QList<QBluetoothUuid> uuidFilter;
172 QBluetoothDeviceDiscoveryAgent *deviceDiscoveryAgent =
nullptr;
174 QBluetoothServiceDiscoveryAgent::DiscoveryMode mode;
178 QString foundHostAdapterPath;
179 QtBluetoothPrivate::OrgFreedesktopDBusObjectManagerInterface *manager =
nullptr;
180 QProcess *sdpScannerProcess =
nullptr;
183#ifdef QT_ANDROID_BLUETOOTH
184 ServiceDiscoveryBroadcastReceiver *receiver =
nullptr;
185 LocalDeviceBroadcastReceiver *localDeviceReceiver =
nullptr;
187 QJniObject btAdapter;
194 QMap<QBluetoothAddress,QPair<QBluetoothDeviceInfo,QList<QBluetoothUuid> > > sdpCache;
197#ifdef QT_WINRT_BLUETOOTH
199 void processFoundService(quint64 deviceAddress,
const QBluetoothServiceInfo &info);
200 void onScanFinished(quint64 deviceAddress);
204 void releaseWorker();
205 QPointer<QWinRTBluetoothServiceDiscoveryWorker> worker;
208#ifdef QT_OSX_BLUETOOTH
210 void SDPInquiryFinished(
void *device) override;
211 void SDPInquiryError(
void *device, IOReturn errorCode) override;
213 void performMinimalServiceDiscovery(
const QBluetoothAddress &deviceAddress);
216 bool serviceHasMatchingUuid(
const QBluetoothServiceInfo &serviceInfo)
const;
218 DarwinBluetooth::ScopedPointer serviceInquiry;
221#ifdef QT_HARMONY_BLUETOOTH
222 void reportErrorAsync(
223 QBluetoothServiceDiscoveryAgent::Error discoveryError,
const QString &discoveryErrorString);
224 void finishDeviceDiscoveryAsync();
225 void reportRemoteDeviceServices(
226 const QtOhosBluetooth::RemoteDeviceServices &remoteDeviceServices);
228 std::shared_ptr<QtOhosBluetooth::QOhosBluetoothRemoteDeviceProxy> m_remoteDeviceProxy;
229 std::optional<std::string> m_optRequestedDeviceId;
233 QBluetoothServiceDiscoveryAgent *q_ptr;