Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qbluetoothservicediscoveryagent.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QBLUETOOTHSERVICEDISCOVERYAGENT_H
5#define QBLUETOOTHSERVICEDISCOVERYAGENT_H
6
7#include <QtBluetooth/qtbluetoothglobal.h>
8
9#include <QtCore/QObject>
10#include <QtCore/QVariant>
11
12#include <QtBluetooth/QBluetoothServiceInfo>
13#include <QtBluetooth/QBluetoothUuid>
14#include <QtBluetooth/QBluetoothDeviceDiscoveryAgent>
15
16#if QT_CONFIG(bluez)
17#include <QtCore/qprocess.h>
18#endif
19
21
24
25class Q_BLUETOOTH_EXPORT QBluetoothServiceDiscoveryAgent : public QObject
26{
28 Q_DECLARE_PRIVATE(QBluetoothServiceDiscoveryAgent)
29
30public:
31 enum Error {
38 //New Errors must be added after Unknown Error the space before UnknownError is reserved
39 //for future device discovery errors
40 };
42
45 FullDiscovery
46 };
48
49 explicit QBluetoothServiceDiscoveryAgent(QObject *parent = nullptr);
50 explicit QBluetoothServiceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent = nullptr);
52
53 bool isActive() const;
54
55 Error error() const;
56 QString errorString() const;
57
58 QList<QBluetoothServiceInfo> discoveredServices() const;
59
60 void setUuidFilter(const QList<QBluetoothUuid> &uuids);
61 void setUuidFilter(const QBluetoothUuid &uuid);
62 QList<QBluetoothUuid> uuidFilter() const;
63 bool setRemoteAddress(const QBluetoothAddress &address);
64 QBluetoothAddress remoteAddress() const;
65
66public Q_SLOTS:
67 void start(DiscoveryMode mode = MinimalDiscovery);
68 void stop();
69 void clear();
70
73 void finished();
74 void canceled();
76
77private:
79};
80
82
83#endif
bool isActive
\inmodule QtBluetooth
void finished()
This signal is emitted when the Bluetooth service discovery completes.
DiscoveryMode
This enum describes the service discovery mode.
void serviceDiscovered(const QBluetoothServiceInfo &info)
This signal is emitted when the Bluetooth service described by info is discovered.
void errorOccurred(QBluetoothServiceDiscoveryAgent::Error error)
This signal is emitted when an error occurs.
void canceled()
This signal is triggered when the service discovery was canceled via a call to \l stop().
Error
This enum describes errors that can occur during service discovery.
\inmodule QtBluetooth
\inmodule QtBluetooth
DiscoveryMode
This enum lists service discovery modes.
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
b clear()
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLenum mode
GLuint start
GLuint GLuint64EXT address
@ NoError
Definition main.cpp:34
#define Q_ENUM(x)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
QHostInfo info
[0]