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
bluetoothmanagement_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 BLUETOOTHMANAGEMENT_P_H
5#define BLUETOOTHMANAGEMENT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qdatetime.h>
19#include <QtCore/qmutex.h>
20#include <QtCore/qobject.h>
21
22#include <QtBluetooth/qbluetoothaddress.h>
23
24#ifndef QPRIVATELINEARBUFFER_BUFFERSIZE
25#define QPRIVATELINEARBUFFER_BUFFERSIZE qsizetype(16384)
26#endif
28
30
31class QSocketNotifier;
32
34{
36
37public:
38
39 enum class EventCode {
40 CommandCompleteEvent = 0x0001,
41 CommandStatusEvent = 0x0002,
42 ControllerErrorEvent = 0x0003,
43 IndexAddedEvent = 0x0004,
44 IndexRemovedEvent = 0x0005,
45 NewSettingsEvent = 0x0006,
47 LocalNameChangedEvent = 0x0008,
48 NewLinkKeyEvent = 0x0009,
49 NewLongTermKeyEvent = 0x000A,
50 DeviceConnectedEvent = 0x000B,
52 ConnectFailedEvent = 0x000D,
53 PINCodeRequestEvent = 0x000E,
57 DeviceFoundEvent = 0x0012,
58 DiscoveringEvent = 0x0013,
59 DeviceBlockedEvent = 0x0014,
60 DeviceUnblockedEvent = 0x00150,
61 DeviceUnpairedEvent = 0x0016,
62 PasskeyNotifyEvent = 0x0017,
65 DeviceAddedEvent = 0x001a,
66 DeviceRemovedEvent = 0x001b,
74 AdvertisingAddedEvent = 0x0023,
86 };
88
89 explicit BluetoothManagement(QObject *parent = nullptr);
91
92 bool isAddressRandom(const QBluetoothAddress &address) const;
93 bool isMonitoringEnabled() const;
94
95private slots:
96 void _q_readNotifier();
97 void processRandomAddressFlagInformation(const QBluetoothAddress &address);
98 void cleanupOldAddressFlags();
99
100private:
101 void readyRead();
102
103 int fd = -1;
104 QSocketNotifier* notifier;
106 QHash<QBluetoothAddress, QDateTime> privateFlagAddresses;
107 mutable QMutex accessLock;
108};
109
110
112
113#endif // BLUETOOTHMANAGEMENT_P_H
bool isAddressRandom(const QBluetoothAddress &address) const
BluetoothManagement(QObject *parent=nullptr)
static BluetoothManagement * instance()
\inmodule QtBluetooth
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore
Combined button and popup list for selecting options.
GLenum GLuint buffer
GLuint64 GLenum GLint fd
GLuint GLuint64EXT address
#define Q_ENUM(x)
#define Q_OBJECT
#define slots