182QBluetoothDeviceDiscoveryAgent::QBluetoothDeviceDiscoveryAgent(
183 const QBluetoothAddress &deviceAdapter, QObject *parent) :
185 d_ptr(
new QBluetoothDeviceDiscoveryAgentPrivate(deviceAdapter,
this))
187 if (!deviceAdapter.isNull()) {
188 const QList<QBluetoothHostInfo> localDevices = QBluetoothLocalDevice::allDevices();
189 for (
const QBluetoothHostInfo &hostInfo : localDevices) {
190 if (hostInfo.address() == deviceAdapter)
193 d_ptr->lastError = InvalidBluetoothAdapterError;
194 d_ptr->errorString = tr(
"Invalid Bluetooth adapter address");
321void QBluetoothDeviceDiscoveryAgent::start(DiscoveryMethods methods)
323 if (methods == NoMethod)
326 DiscoveryMethods supported =
327 QBluetoothDeviceDiscoveryAgent::supportedDiscoveryMethods();
329 Q_D(QBluetoothDeviceDiscoveryAgent);
330 if (!((supported & methods) == methods)) {
331 d->lastError = UnsupportedDiscoveryMethod;
332 d->errorString = QBluetoothDeviceDiscoveryAgent::tr(
"One or more device discovery methods "
333 "are not supported on this platform");
334 emit errorOccurred(d->lastError);