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
qbluetoothdevicediscoveryagent.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2014 Denis Shienkov <denis.shienkov@gmail.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QBLUETOOTHDEVICEDISCOVERYAGENT_H
6#define QBLUETOOTHDEVICEDISCOVERYAGENT_H
7
8#include <QtBluetooth/qtbluetoothglobal.h>
9
10#include <QtCore/QObject>
11#include <QtBluetooth/QBluetoothDeviceInfo>
12#include <QtBluetooth/QBluetoothAddress>
13
15
17
18class Q_BLUETOOTH_EXPORT QBluetoothDeviceDiscoveryAgent : public QObject
19{
21
22public:
23 // FIXME: add more errors
24 // FIXME: add bluez error handling
37
39 {
40 NoMethod = 0x0,
41 ClassicMethod = 0x01,
42 LowEnergyMethod = 0x02,
43 };
44 Q_DECLARE_FLAGS(DiscoveryMethods, DiscoveryMethod)
45 Q_FLAG(DiscoveryMethods)
46
47 explicit QBluetoothDeviceDiscoveryAgent(QObject *parent = nullptr);
48 explicit QBluetoothDeviceDiscoveryAgent(const QBluetoothAddress &deviceAdapter,
49 QObject *parent = nullptr);
51
52 bool isActive() const;
53
54 Error error() const;
55 QString errorString() const;
56
57 QList<QBluetoothDeviceInfo> discoveredDevices() const;
58
59 void setLowEnergyDiscoveryTimeout(int msTimeout);
60 int lowEnergyDiscoveryTimeout() const;
61
62 static DiscoveryMethods supportedDiscoveryMethods();
63public Q_SLOTS:
64 void start();
65 void start(DiscoveryMethods method);
66 void stop();
67
70 void deviceUpdated(const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields);
71 void finished();
73 void canceled();
74
75private:
76 Q_DECLARE_PRIVATE(QBluetoothDeviceDiscoveryAgent)
78};
79
80Q_DECLARE_OPERATORS_FOR_FLAGS(QBluetoothDeviceDiscoveryAgent::DiscoveryMethods)
81
83
84#endif
bool isActive
\inmodule QtBluetooth
void errorOccurred(QBluetoothDeviceDiscoveryAgent::Error error)
This signal is emitted when an error occurs during Bluetooth device discovery.
void canceled()
This signal is emitted when device discovery is aborted by a call to stop().
DiscoveryMethod
This enum descibes the type of discovery method employed by the QBluetoothDeviceDiscoveryAgent.
void finished()
This signal is emitted when Bluetooth device discovery completes.
void deviceUpdated(const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields)
This signal is emitted when the agent receives additional information about the Bluetooth device desc...
void deviceDiscovered(const QBluetoothDeviceInfo &info)
This signal is emitted when the Bluetooth device described by info is discovered.
Error
Indicates all possible error conditions found during Bluetooth device discovery.
\inmodule QtBluetooth
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLuint start
#define Q_ENUM(x)
#define Q_OBJECT
#define Q_FLAG(x)
#define Q_SLOTS
#define Q_SIGNALS
QHostInfo info
[0]