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
qbluetoothdeviceinfo.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 QBLUETOOTHDEVICEINFO_H
5#define QBLUETOOTHDEVICEINFO_H
6
7#include <QtBluetooth/qtbluetoothglobal.h>
8#include <QtBluetooth/QBluetoothUuid>
9
10#include <QtCore/qbytearray.h>
11#include <QtCore/qlist.h>
12#include <QtCore/qmetatype.h>
13#include <QtCore/qstring.h>
14
16
19class QBluetoothUuid;
20
21class Q_BLUETOOTH_EXPORT QBluetoothDeviceInfo
22{
23public:
25 MiscellaneousDevice = 0,
26 ComputerDevice = 1,
27 PhoneDevice = 2,
28 NetworkDevice = 3,
29 AudioVideoDevice = 4,
30 PeripheralDevice = 5,
31 ImagingDevice = 6,
32 WearableDevice = 7,
33 ToyDevice = 8,
34 HealthDevice = 9,
35 UncategorizedDevice = 31
36 };
37
39 UncategorizedMiscellaneous = 0
40 };
41
43 UncategorizedComputer = 0,
44 DesktopComputer = 1,
45 ServerComputer = 2,
46 LaptopComputer = 3,
47 HandheldClamShellComputer = 4,
48 HandheldComputer = 5,
49 WearableComputer = 6
50 };
51
53 UncategorizedPhone = 0,
54 CellularPhone = 1,
55 CordlessPhone = 2,
56 SmartPhone = 3,
57 WiredModemOrVoiceGatewayPhone = 4,
58 CommonIsdnAccessPhone = 5
59 };
60
62 NetworkFullService = 0x00,
63 NetworkLoadFactorOne = 0x08,
64 NetworkLoadFactorTwo = 0x10,
65 NetworkLoadFactorThree = 0x18,
66 NetworkLoadFactorFour = 0x20,
67 NetworkLoadFactorFive = 0x28,
68 NetworkLoadFactorSix = 0x30,
69 NetworkNoService = 0x38
70 };
71
73 UncategorizedAudioVideoDevice = 0,
74 WearableHeadsetDevice = 1,
75 HandsFreeDevice = 2,
76 // reserved = 3,
77 Microphone = 4,
78 Loudspeaker = 5,
79 Headphones = 6,
80 PortableAudioDevice = 7,
81 CarAudio = 8,
82 SetTopBox = 9,
83 HiFiAudioDevice = 10,
84 Vcr = 11,
85 VideoCamera = 12,
86 Camcorder = 13,
87 VideoMonitor = 14,
88 VideoDisplayAndLoudspeaker = 15,
89 VideoConferencing = 16,
90 // reserved = 17,
91 GamingDevice = 18
92 };
93
95 UncategorizedPeripheral = 0,
96 KeyboardPeripheral = 0x10,
97 PointingDevicePeripheral = 0x20,
98 KeyboardWithPointingDevicePeripheral = 0x30,
99
100 JoystickPeripheral = 0x01,
101 GamepadPeripheral = 0x02,
102 RemoteControlPeripheral = 0x03,
103 SensingDevicePeripheral = 0x04,
104 DigitizerTabletPeripheral = 0x05,
105 CardReaderPeripheral = 0x06
106 };
107
109 UncategorizedImagingDevice = 0,
110 ImageDisplay = 0x04,
111 ImageCamera = 0x08,
112 ImageScanner = 0x10,
113 ImagePrinter = 0x20
114 };
115
117 UncategorizedWearableDevice = 0,
118 WearableWristWatch = 1,
119 WearablePager = 2,
120 WearableJacket = 3,
121 WearableHelmet = 4,
122 WearableGlasses = 5
123 };
124
126 UncategorizedToy = 0,
127 ToyRobot = 1,
128 ToyVehicle = 2,
129 ToyDoll = 3,
130 ToyController = 4,
131 ToyGame = 5
132 };
133
135 UncategorizedHealthDevice = 0,
136 HealthBloodPressureMonitor = 0x1,
137 HealthThermometer = 0x2,
138 HealthWeightScale = 0x3,
139 HealthGlucoseMeter = 0x4,
140 HealthPulseOximeter = 0x5,
141 HealthDataDisplay = 0x7,
142 HealthStepCounter = 0x8
143 };
144
146 NoService = 0x0000,
147 PositioningService = 0x0001,
148 NetworkingService = 0x0002,
149 RenderingService = 0x0004,
150 CapturingService = 0x0008,
151 ObjectTransferService = 0x0010,
152 AudioService = 0x0020,
153 TelephonyService = 0x0040,
154 InformationService = 0x0080,
155 AllServices = 0x07ff
156 };
157 Q_DECLARE_FLAGS(ServiceClasses, ServiceClass)
158
159 enum class Field {
160 None = 0x0000,
161 RSSI = 0x0001,
162 ManufacturerData = 0x0002,
163 ServiceData = 0x0004,
164 All = 0x7fff
165 };
166 Q_DECLARE_FLAGS(Fields, Field)
167
169 UnknownCoreConfiguration = 0x0,
170 LowEnergyCoreConfiguration = 0x01,
171 BaseRateCoreConfiguration = 0x02,
172 BaseRateAndLowEnergyCoreConfiguration = 0x03
173 };
174 Q_DECLARE_FLAGS(CoreConfigurations, CoreConfiguration)
175
178 quint32 classOfDevice);
180 quint32 classOfDevice);
183
184 bool isValid() const;
185 bool isCached() const;
186
187 void setCached(bool cached);
188
191 {
192 return equals(a, b);
193 }
195 {
196 return !equals(a, b);
197 }
198
200 QString name() const;
201 void setName(const QString &name);
202
203 ServiceClasses serviceClasses() const;
204 MajorDeviceClass majorDeviceClass() const;
205 quint8 minorDeviceClass() const;
206
207 qint16 rssi() const;
208 void setRssi(qint16 signal);
209
210 QList<QBluetoothUuid> serviceUuids() const;
211 void setServiceUuids(const QList<QBluetoothUuid> &uuids);
212
213 QList<quint16> manufacturerIds() const;
214 QByteArray manufacturerData(quint16 manufacturerId) const;
215 bool setManufacturerData(quint16 manufacturerId, const QByteArray &data);
216 QMultiHash<quint16, QByteArray> manufacturerData() const;
217
218 QList<QBluetoothUuid> serviceIds() const;
219 QByteArray serviceData(const QBluetoothUuid &serviceId) const;
220 bool setServiceData(const QBluetoothUuid &serviceId, const QByteArray &data);
221 QMultiHash<QBluetoothUuid, QByteArray> serviceData() const;
222
223 void setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs);
224 QBluetoothDeviceInfo::CoreConfigurations coreConfigurations() const;
225
226 void setDeviceUuid(const QBluetoothUuid &uuid);
228
229protected:
231
232private:
233 static bool equals(const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b);
234 Q_DECLARE_PRIVATE(QBluetoothDeviceInfo)
235};
236
237Q_DECLARE_OPERATORS_FOR_FLAGS(QBluetoothDeviceInfo::CoreConfigurations)
238Q_DECLARE_OPERATORS_FOR_FLAGS(QBluetoothDeviceInfo::ServiceClasses)
239
241
243#ifdef QT_WINRT_BLUETOOTH
244QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothDeviceInfo::Fields, QBluetoothDeviceInfo__Fields,
245 Q_BLUETOOTH_EXPORT)
246#endif
247
248#endif
quint8 rssi
QBluetoothUuid deviceUuid
\inmodule QtBluetooth
\inmodule QtBluetooth
MinorPhoneClass
This enum describes the minor device classes for phone devices.
Field
This enum is used in conjuntion with the \l QBluetoothDeviceDiscoveryAgent::deviceUpdated() signal an...
friend bool operator==(const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b)
Returns true if the two QBluetoothDeviceInfo objects a and b are equal.
QBluetoothDeviceInfoPrivate * d_ptr
MinorWearableClass
This enum describes the minor device classes for wearable devices.
MinorHealthClass
This enum describes the minor device classes for health devices.
MinorImagingClass
This enum describes the minor device classes for imaging devices.
MinorPeripheralClass
This enum describes the minor device classes for peripheral devices.
MajorDeviceClass
This enum describes a Bluetooth device's major device class.
MinorComputerClass
This enum describes the minor device classes for computer devices.
friend bool operator!=(const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b)
Returns true if the two QBluetoothDeviceInfo objects a and b are not equal.
MinorMiscellaneousClass
This enum describes the minor device classes for miscellaneous Bluetooth devices.
ServiceClass
This enum describes the service class of the Bluetooth device.
MinorNetworkClass
This enum describes the minor device classes for local area network access devices.
MinorAudioVideoClass
This enum describes the minor device classes for audio/video devices.
MinorToyClass
This enum describes the minor device classes for toy devices.
\inmodule QtBluetooth
\inmodule QtCore
Definition qbytearray.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
employee setName("Richard Schmit")
auto signal
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
@ None
Definition qhash.cpp:531
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT)
Definition qmetatype.h:1376
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLuint GLuint64EXT address
unsigned int quint32
Definition qtypes.h:50
short qint16
Definition qtypes.h:47
unsigned short quint16
Definition qtypes.h:48
unsigned char quint8
Definition qtypes.h:46
QSharedPointer< T > other(t)
[5]