Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
27
#
include
"../qprivatelinearbuffer_p.h"
28
29
QT_BEGIN_NAMESPACE
30
31
class
QSocketNotifier;
32
33
class
BluetoothManagement
:
public
QObject
34
{
35
Q_OBJECT
36
37
public
:
38
39
enum
class
EventCode
{
40
CommandCompleteEvent
= 0x0001,
41
CommandStatusEvent
= 0x0002,
42
ControllerErrorEvent
= 0x0003,
43
IndexAddedEvent
= 0x0004,
44
IndexRemovedEvent
= 0x0005,
45
NewSettingsEvent
= 0x0006,
46
ClassOfDeviceChangedEvent
= 0x0007,
47
LocalNameChangedEvent
= 0x0008,
48
NewLinkKeyEvent
= 0x0009,
49
NewLongTermKeyEvent
= 0x000A,
50
DeviceConnectedEvent
= 0x000B,
51
DeviceDisconnectedEvent
= 0x000C,
52
ConnectFailedEvent
= 0x000D,
53
PINCodeRequestEvent
= 0x000E,
54
UserConfirmationRequestEvent
= 0x000F,
55
UserPasskeyRequestEvent
= 0x0010,
56
AuthenticationFailedEvent
= 0x0011,
57
DeviceFoundEvent
= 0x0012,
58
DiscoveringEvent
= 0x0013,
59
DeviceBlockedEvent
= 0x0014,
60
DeviceUnblockedEvent
= 0x00150,
61
DeviceUnpairedEvent
= 0x0016,
62
PasskeyNotifyEvent
= 0x0017,
63
NewIdentityResolvingKeyEvent
= 0x0018,
64
NewSignatureResolvingKeyEvent
= 0x0019,
65
DeviceAddedEvent
= 0x001a,
66
DeviceRemovedEvent
= 0x001b,
67
NewConnectionParameterEvent
= 0x001c,
68
UnconfiguredIndexAddedEvent
= 0x001d,
69
UnconfiguredIndexRemovedEvent
= 0x001e,
70
NewConfigurationOptionsEvent
= 0x001f,
71
ExtendedIndexAddedEvent
= 0x0020,
72
ExtendedIndexRemovedEvent
= 0x0021,
73
LocalOutOfBandExtendedDataUpdatedEvent
= 0x0022,
74
AdvertisingAddedEvent
= 0x0023,
75
AdvertisingRemovedEvent
= 0x0024,
76
ExtendedControllerInformationChangedEvent
= 0x0025,
77
PHYConfigurationChangedEvent
= 0x0026,
78
ExperimentalFeatureChangedEvent
= 0x0027,
79
DefaultSystemConfigurationChangedEvent
= 0x0028,
80
DefaultRuntimeConfigurationChangedEvent
= 0x0029,
81
DeviceFlagsChangedEvent
= 0x002a,
82
AdvertisementMonitorAddedEvent
= 0x002b,
83
AdvertisementMonitorRemovedEvent
= 0x002c,
84
ControllerSuspendEvent
= 0x002d,
85
ControllerResumeEvent
= 0x002e
86
};
87
Q_ENUM(EventCode)
88
89
explicit
BluetoothManagement
(
QObject
*
parent
=
nullptr
);
90
static
BluetoothManagement
*
instance
();
91
92
bool
isAddressRandom
(
const
QBluetoothAddress &address)
const
;
93
bool
isMonitoringEnabled
()
const
;
94
95
private
slots
:
96
void
_q_readNotifier
();
97
void
processRandomAddressFlagInformation(
const
QBluetoothAddress &address);
98
void
cleanupOldAddressFlags();
99
100
private
:
101
void
readyRead();
102
103
int
fd = -1;
104
QSocketNotifier* notifier;
105
QPrivateLinearBuffer
buffer;
106
QHash<QBluetoothAddress, QDateTime> privateFlagAddresses;
107
mutable
QMutex accessLock;
108
};
109
110
111
QT_END_NAMESPACE
112
113
#
endif
// BLUETOOTHMANAGEMENT_P_H
_LINUX_CAPABILITY_U32S_3
#define _LINUX_CAPABILITY_U32S_3
Definition
bluetoothmanagement.cpp:72
CAP_TO_INDEX
#define CAP_TO_INDEX(x)
Definition
bluetoothmanagement.cpp:80
_LINUX_CAPABILITY_VERSION_3
#define _LINUX_CAPABILITY_VERSION_3
Definition
bluetoothmanagement.cpp:68
CAP_TO_MASK
#define CAP_TO_MASK(x)
Definition
bluetoothmanagement.cpp:84
sysCallCapGet
static int sysCallCapGet(capHdr *header, capData *data)
Definition
bluetoothmanagement.cpp:89
CAP_NET_ADMIN
#define CAP_NET_ADMIN
Definition
bluetoothmanagement.cpp:76
msecInADay
const int msecInADay
Definition
bluetoothmanagement.cpp:87
hasBtMgmtPermission
static bool hasBtMgmtPermission()
Definition
bluetoothmanagement.cpp:97
QPRIVATELINEARBUFFER_BUFFERSIZE
#define QPRIVATELINEARBUFFER_BUFFERSIZE
Definition
bluetoothmanagement_p.h:25
HCI_CHANNEL_CONTROL
#define HCI_CHANNEL_CONTROL
Definition
bluez_data_p.h:143
BTPROTO_HCI
#define BTPROTO_HCI
Definition
bluez_data_p.h:31
HCI_DEV_NONE
#define HCI_DEV_NONE
Definition
bluez_data_p.h:141
BDADDR_LE_RANDOM
#define BDADDR_LE_RANDOM
Definition
bluez_data_p.h:65
BluetoothManagement
Definition
bluetoothmanagement_p.h:34
BluetoothManagement::isAddressRandom
bool isAddressRandom(const QBluetoothAddress &address) const
Definition
bluetoothmanagement.cpp:255
BluetoothManagement::isMonitoringEnabled
bool isMonitoringEnabled() const
Definition
bluetoothmanagement.cpp:264
BluetoothManagement::instance
static BluetoothManagement * instance()
Definition
bluetoothmanagement.cpp:160
QPrivateLinearBuffer
Definition
qprivatelinearbuffer_p.h:20
MgmtEventDeviceFound
Definition
bluetoothmanagement.cpp:30
MgmtEventDeviceFound::eirLength
quint16 eirLength
Definition
bluetoothmanagement.cpp:35
MgmtEventDeviceFound::bdaddr
bdaddr_t bdaddr
Definition
bluetoothmanagement.cpp:31
MgmtEventDeviceFound::eirData
quint8 eirData[0]
Definition
bluetoothmanagement.cpp:36
MgmtEventDeviceFound::flags
quint32 flags
Definition
bluetoothmanagement.cpp:34
MgmtEventDeviceFound::rssi
quint8 rssi
Definition
bluetoothmanagement.cpp:33
MgmtEventDeviceFound::type
quint8 type
Definition
bluetoothmanagement.cpp:32
capData
Definition
bluetoothmanagement.cpp:61
capData::effective
quint32 effective
Definition
bluetoothmanagement.cpp:62
capData::inheritable
quint32 inheritable
Definition
bluetoothmanagement.cpp:64
capData::permitted
quint32 permitted
Definition
bluetoothmanagement.cpp:63
capHdr
Definition
bluetoothmanagement.cpp:56
capHdr::pid
int pid
Definition
bluetoothmanagement.cpp:58
capHdr::version
quint32 version
Definition
bluetoothmanagement.cpp:57
sockaddr_hci
Definition
bluez_data_p.h:160
sockaddr_hci::hci_dev
unsigned short hci_dev
Definition
bluez_data_p.h:162
sockaddr_hci::hci_channel
unsigned short hci_channel
Definition
bluez_data_p.h:163
qtconnectivity
src
bluetooth
bluez
bluetoothmanagement_p.h
Generated on Fri Sep 20 2024 18:25:02 for Qt by
1.12.0