4#ifndef QBLUETOOTHDEVICEINFO_H
5#define QBLUETOOTHDEVICEINFO_H
7#include <QtBluetooth/qtbluetoothglobal.h>
8#include <QtBluetooth/QBluetoothUuid>
10#include <QtCore/qbytearray.h>
11#include <QtCore/qlist.h>
12#include <QtCore/qmetatype.h>
13#include <QtCore/qstring.h>
17class QBluetoothDeviceInfoPrivate;
18class QBluetoothAddress;
24 enum MajorDeviceClass {
25 MiscellaneousDevice = 0,
35 UncategorizedDevice = 31
38 enum MinorMiscellaneousClass {
39 UncategorizedMiscellaneous = 0
42 enum MinorComputerClass {
43 UncategorizedComputer = 0,
47 HandheldClamShellComputer = 4,
52 enum MinorPhoneClass {
53 UncategorizedPhone = 0,
57 WiredModemOrVoiceGatewayPhone = 4,
58 CommonIsdnAccessPhone = 5
61 enum MinorNetworkClass {
62 NetworkFullService = 0x00,
63 NetworkLoadFactorOne = 0x08,
64 NetworkLoadFactorTwo = 0x10,
65 NetworkLoadFactorThree = 0x18,
66 NetworkLoadFactorFour = 0x20,
67 NetworkLoadFactorFive = 0x28,
68 NetworkLoadFactorSix = 0x30,
69 NetworkNoService = 0x38
72 enum MinorAudioVideoClass {
73 UncategorizedAudioVideoDevice = 0,
74 WearableHeadsetDevice = 1,
80 PortableAudioDevice = 7,
88 VideoDisplayAndLoudspeaker = 15,
89 VideoConferencing = 16,
94 enum MinorPeripheralClass {
95 UncategorizedPeripheral = 0,
96 KeyboardPeripheral = 0x10,
97 PointingDevicePeripheral = 0x20,
98 KeyboardWithPointingDevicePeripheral = 0x30,
100 JoystickPeripheral = 0x01,
101 GamepadPeripheral = 0x02,
102 RemoteControlPeripheral = 0x03,
103 SensingDevicePeripheral = 0x04,
104 DigitizerTabletPeripheral = 0x05,
105 CardReaderPeripheral = 0x06
108 enum MinorImagingClass {
109 UncategorizedImagingDevice = 0,
116 enum MinorWearableClass {
117 UncategorizedWearableDevice = 0,
118 WearableWristWatch = 1,
126 UncategorizedToy = 0,
134 enum MinorHealthClass {
135 UncategorizedHealthDevice = 0,
136 HealthBloodPressureMonitor = 0x1,
137 HealthThermometer = 0x2,
138 HealthWeightScale = 0x3,
139 HealthGlucoseMeter = 0x4,
140 HealthPulseOximeter = 0x5,
141 HealthDataDisplay = 0x7,
142 HealthStepCounter = 0x8
147 PositioningService = 0x0001,
148 NetworkingService = 0x0002,
149 RenderingService = 0x0004,
150 CapturingService = 0x0008,
151 ObjectTransferService = 0x0010,
152 AudioService = 0x0020,
153 TelephonyService = 0x0040,
154 InformationService = 0x0080,
157 Q_DECLARE_FLAGS(ServiceClasses, ServiceClass)
162 ManufacturerData = 0x0002,
163 ServiceData = 0x0004,
166 Q_DECLARE_FLAGS(Fields, Field)
168 enum CoreConfiguration {
169 UnknownCoreConfiguration = 0x0,
170 LowEnergyCoreConfiguration = 0x01,
171 BaseRateCoreConfiguration = 0x02,
172 BaseRateAndLowEnergyCoreConfiguration = 0x03
174 Q_DECLARE_FLAGS(CoreConfigurations, CoreConfiguration)
176 QBluetoothDeviceInfo();
177 QBluetoothDeviceInfo(
const QBluetoothAddress &address,
const QString &name,
178 quint32 classOfDevice);
179 QBluetoothDeviceInfo(
const QBluetoothUuid &uuid,
const QString &name,
180 quint32 classOfDevice);
181 QBluetoothDeviceInfo(
const QBluetoothDeviceInfo &other);
182 ~QBluetoothDeviceInfo();
184 bool isValid()
const;
185 bool isCached()
const;
187 void setCached(
bool cached);
189 QBluetoothDeviceInfo &operator=(
const QBluetoothDeviceInfo &other);
190 friend bool operator==(
const QBluetoothDeviceInfo &a,
const QBluetoothDeviceInfo &b)
194 friend bool operator!=(
const QBluetoothDeviceInfo &a,
const QBluetoothDeviceInfo &b)
196 return !equals(a, b);
199 QBluetoothAddress address()
const;
200 QString name()
const;
201 void setName(
const QString &name);
203 ServiceClasses serviceClasses()
const;
204 MajorDeviceClass majorDeviceClass()
const;
205 quint8 minorDeviceClass()
const;
208 void setRssi(qint16 signal);
210 QList<QBluetoothUuid> serviceUuids()
const;
211 void setServiceUuids(
const QList<QBluetoothUuid> &uuids);
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;
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;
223 void setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs);
224 QBluetoothDeviceInfo::CoreConfigurations coreConfigurations()
const;
226 void setDeviceUuid(
const QBluetoothUuid &uuid);
227 QBluetoothUuid deviceUuid()
const;
230 QBluetoothDeviceInfoPrivate *d_ptr;
233 static bool equals(
const QBluetoothDeviceInfo &a,
const QBluetoothDeviceInfo &b);
234 Q_DECLARE_PRIVATE(QBluetoothDeviceInfo)
237Q_DECLARE_OPERATORS_FOR_FLAGS(QBluetoothDeviceInfo::CoreConfigurations)
238Q_DECLARE_OPERATORS_FOR_FLAGS(QBluetoothDeviceInfo::ServiceClasses)
242QT_DECL_METATYPE_EXTERN(QBluetoothDeviceInfo, Q_BLUETOOTH_EXPORT)
243#ifdef QT_WINRT_BLUETOOTH
244QT_DECL_METATYPE_EXTERN_TAGGED(QBluetoothDeviceInfo::Fields, QBluetoothDeviceInfo__Fields,
#define QT_BT_MAC_AUTORELEASEPOOL
void characteristicUpdated(QLowEnergyHandle charHandle, const QByteArray &value)
void rssiUpdated(qint16 newValue)
void serviceDetailsDiscoveryFinished(QSharedPointer< QLowEnergyServicePrivate > service)
void servicesWereModified()
void CBManagerError(const QBluetoothUuid &serviceUuid, QLowEnergyController::Error error)
void characteristicRead(QLowEnergyHandle charHandle, const QByteArray &value)
void descriptorRead(QLowEnergyHandle descHandle, const QByteArray &value)
void mtuChanged(int newValue)
void characteristicWritten(QLowEnergyHandle charHandle, const QByteArray &value)
void notificationEnabled(QLowEnergyHandle charHandle, bool enabled)
void CBManagerError(QBluetoothDeviceDiscoveryAgent::Error error)
void serviceDiscoveryFinished()
void descriptorWritten(QLowEnergyHandle descHandle, const QByteArray &value)
ObjCScopedPointer()=default
ObjCScopedPointer(T *ptr, RetainPolicy policy)
void reset(T *ptr, RetainPolicy policy)
void swap(ObjCScopedPointer &other)
ScopedPointer(void *instance, RetainPolicy policy)
StrongReference()=default
StrongReference & operator=(StrongReference &&other) noexcept
StrongReference & operator=(const StrongReference &other) noexcept
StrongReference(void *object, RetainPolicy policy)
void reset(void *newInstance, RetainPolicy policy)
StrongReference(StrongReference &&other)
void swap(StrongReference &other) noexcept
StrongReference(const StrongReference &other)
void characteristicWritten(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
QList< QBluetoothUuid > includedServices
~QLowEnergyServicePrivate()
void setController(QLowEnergyControllerPrivate *control)
void characteristicChanged(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue)
void characteristicRead(const QLowEnergyCharacteristic &info, const QByteArray &value)
QLowEnergyService::DiscoveryMode mode
void descriptorWritten(const QLowEnergyDescriptor &descriptor, const QByteArray &newValue)
QLowEnergyHandle startHandle
void descriptorRead(const QLowEnergyDescriptor &info, const QByteArray &value)
QLowEnergyService::ServiceError lastError
void setError(QLowEnergyService::ServiceError newError)
QLowEnergyHandle endHandle
QLowEnergyService::ServiceTypes type
QPointer< QLowEnergyControllerPrivate > controller
void errorOccurred(QLowEnergyService::ServiceError error)
void setState(QLowEnergyService::ServiceState newState)
QLowEnergyService::ServiceState state
QHash< QLowEnergyHandle, CharData > characteristicList
ObjCStrongReference< NSError > qt_timeoutNSError(OperationTimeout type)
QQueue< LERequest > RequestQueue
ObjCStrongReference< CBUUID > cb_uuid(const QBluetoothUuid &qtUuid)
QHash< NSObject *, QByteArray > ValueHash
const int defaultLEScanTimeoutMS
bool equal_uuids(const QBluetoothUuid &qtUuid, CBUUID *cbUuid)
@ CentralManagerDisconnecting
@ CentralManagerConnecting
@ CentralManagerDiscovering
ObjCStrongReference< NSMutableData > mutable_data_from_bytearray(const QByteArray &qtData)
auto qt_find_watchdog(const std::vector< GCDTimer > &watchdogs, id object, OperationTimeout type)
QByteArray qt_bytearray(NSData *data)
QHash< QLowEnergyHandle, CBDescriptor * > DescHash
QString qt_address(NSString *address)
@ includedServicesDiscovery
@ characteristicsDiscovery
QHash< QLowEnergyHandle, CBService * > ServiceHash
void qt_test_iobluetooth_runloop()
BluetoothDeviceAddress iobluetooth_address(const QBluetoothAddress &address)
NSUInteger qt_countGATTEntries(CBService *service)
QString qt_error_string(IOReturn errorCode)
ObjCStrongReference< NSData > data_from_bytearray(const QByteArray &qtData)
QBluetoothAddress qt_address(const BluetoothDeviceAddress *address)
ObjCStrongReference< IOBluetoothSDPUUID > iobluetooth_uuid(const QBluetoothUuid &uuid)
dispatch_queue_t qt_LE_queue()
QBluetoothUuid qt_uuid(IOBluetoothSDPUUID *uuid)
QHash< QLowEnergyHandle, CBCharacteristic * > CharHash
bool equal_uuids(CBUUID *cbUuid, const QBluetoothUuid &qtUuid)
Combined button and popup list for selecting options.
QHash< QLowEnergyHandle, QLowEnergyServicePrivate::CharData > CharacteristicDataMap
QHash< QLowEnergyHandle, QLowEnergyServicePrivate::DescData > DescriptorDataMap
QHash< QLowEnergyHandle, DescData > descriptorList
QLowEnergyHandle valueHandle
QLowEnergyCharacteristic::PropertyTypes properties