9QT_IMPL_METATYPE_EXTERN(QBluetoothDeviceInfo)
10#ifdef QT_WINRT_BLUETOOTH
11QT_IMPL_METATYPE_EXTERN_TAGGED(QBluetoothDeviceInfo::Fields, QBluetoothDeviceInfo__Fields)
15
16
17
18
19
20
21
22
23
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
44
45
46
47
48
49
50
51
52
53
54
55
56
59
60
61
62
63
64
67
68
69
70
71
72
73
74
75
76
77
78
81
82
83
84
85
86
87
88
89
90
91
94
95
96
97
98
99
100
101
102
103
104
105
106
107
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
151
152
153
154
155
156
157
158
159
160
163
164
165
166
167
168
169
170
171
172
173
176
177
178
179
180
181
182
183
184
185
186
189
190
191
192
193
194
195
196
197
198
199
200
201
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
223
224
225
226
227
228
229
230
231
232
233
234QBluetoothDeviceInfoPrivate::QBluetoothDeviceInfoPrivate()
239
240
241QBluetoothDeviceInfo::QBluetoothDeviceInfo() :
242 d_ptr(
new QBluetoothDeviceInfoPrivate)
247
248
249
250
251
252
253
254
255
256
257
258
259
260QBluetoothDeviceInfo::QBluetoothDeviceInfo(
const QBluetoothAddress &address,
const QString &name,
261 quint32 classOfDevice) :
262 d_ptr(
new QBluetoothDeviceInfoPrivate)
264 Q_D(QBluetoothDeviceInfo);
266 d->address = address;
269 d->minorDeviceClass =
static_cast<quint8>((classOfDevice >> 2) & 0x3f);
270 d->majorDeviceClass =
static_cast<MajorDeviceClass>((classOfDevice >> 8) & 0x1f);
271 d->serviceClasses =
static_cast<ServiceClasses>((classOfDevice >> 13) & 0x7ff);
279
280
281
282
283
284
285
286
287
288
289QBluetoothDeviceInfo::QBluetoothDeviceInfo(
const QBluetoothUuid &uuid,
const QString &name,
290 quint32 classOfDevice) :
291 d_ptr(
new QBluetoothDeviceInfoPrivate)
293 Q_D(QBluetoothDeviceInfo);
296 d->deviceUuid = uuid;
298 d->minorDeviceClass =
static_cast<quint8>((classOfDevice >> 2) & 0x3f);
299 d->majorDeviceClass =
static_cast<MajorDeviceClass>((classOfDevice >> 8) & 0x1f);
300 d->serviceClasses =
static_cast<ServiceClasses>((classOfDevice >> 13) & 0x7ff);
308
309
310QBluetoothDeviceInfo::QBluetoothDeviceInfo(
const QBluetoothDeviceInfo &other) :
311 d_ptr(
new QBluetoothDeviceInfoPrivate)
317
318
319QBluetoothDeviceInfo::~QBluetoothDeviceInfo()
325
326
327bool QBluetoothDeviceInfo::isValid()
const
329 Q_D(
const QBluetoothDeviceInfo);
335
336
337qint16 QBluetoothDeviceInfo::rssi()
const
339 Q_D(
const QBluetoothDeviceInfo);
345
346
347void QBluetoothDeviceInfo::setRssi(qint16 signal)
349 Q_D(QBluetoothDeviceInfo);
354
355
356QBluetoothDeviceInfo &QBluetoothDeviceInfo::operator=(
const QBluetoothDeviceInfo &other)
358 Q_D(QBluetoothDeviceInfo);
360 d->address = other.d_func()->address;
361 d->name = other.d_func()->name;
362 d->minorDeviceClass = other.d_func()->minorDeviceClass;
363 d->majorDeviceClass = other.d_func()->majorDeviceClass;
364 d->serviceClasses = other.d_func()->serviceClasses;
365 d->valid = other.d_func()->valid;
366 d->cached = other.d_func()->cached;
367 d->serviceUuids = other.d_func()->serviceUuids;
368 d->manufacturerData = other.d_func()->manufacturerData;
369 d->serviceData = other.d_func()->serviceData;
370 d->rssi = other.d_func()->rssi;
371 d->deviceCoreConfiguration = other.d_func()->deviceCoreConfiguration;
372 d->deviceUuid = other.d_func()->deviceUuid;
378
379
380
383
384
385
386
389
390
391
393bool QBluetoothDeviceInfo::equals(
const QBluetoothDeviceInfo &a,
const QBluetoothDeviceInfo &b)
395 if (a.d_func()->cached != b.d_func()->cached)
397 if (a.d_func()->valid != b.d_func()->valid)
399 if (a.d_func()->majorDeviceClass != b.d_func()->majorDeviceClass)
401 if (a.d_func()->minorDeviceClass != b.d_func()->minorDeviceClass)
403 if (a.d_func()->serviceClasses != b.d_func()->serviceClasses)
405 if (a.d_func()->name != b.d_func()->name)
407 if (a.d_func()->address != b.d_func()->address)
409 if (a.d_func()->serviceUuids.size() != b.d_func()->serviceUuids.size())
411 if (a.d_func()->serviceUuids != b.d_func()->serviceUuids)
413 if (a.d_func()->manufacturerData != b.d_func()->manufacturerData)
415 if (a.d_func()->serviceData != b.d_func()->serviceData)
417 if (a.d_func()->deviceCoreConfiguration != b.d_func()->deviceCoreConfiguration)
419 if (a.d_func()->deviceUuid != b.d_func()->deviceUuid)
426
427
428
429
430
431
432
433
434QBluetoothAddress QBluetoothDeviceInfo::address()
const
436 Q_D(
const QBluetoothDeviceInfo);
442
443
444QString QBluetoothDeviceInfo::name()
const
446 Q_D(
const QBluetoothDeviceInfo);
452
453
454
455
456void QBluetoothDeviceInfo::setName(
const QString &name)
458 Q_D(QBluetoothDeviceInfo);
464
465
466QBluetoothDeviceInfo::ServiceClasses QBluetoothDeviceInfo::serviceClasses()
const
468 Q_D(
const QBluetoothDeviceInfo);
470 return d->serviceClasses;
474
475
476QBluetoothDeviceInfo::MajorDeviceClass QBluetoothDeviceInfo::majorDeviceClass()
const
478 Q_D(
const QBluetoothDeviceInfo);
480 return d->majorDeviceClass;
484
485
486
487
488
489
490
491quint8 QBluetoothDeviceInfo::minorDeviceClass()
const
493 Q_D(
const QBluetoothDeviceInfo);
495 return d->minorDeviceClass;
499
500
501
502void QBluetoothDeviceInfo::setServiceUuids(
const QList<QBluetoothUuid> &uuids)
504 Q_D(QBluetoothDeviceInfo);
505 d->serviceUuids = uuids;
509
510
511
512
513
514
515
516QList<QBluetoothUuid> QBluetoothDeviceInfo::serviceUuids()
const
518 Q_D(
const QBluetoothDeviceInfo);
519 return d->serviceUuids;
523
524
525
526
527
528
529QList<quint16> QBluetoothDeviceInfo::manufacturerIds()
const
531 Q_D(
const QBluetoothDeviceInfo);
532 return d->manufacturerData.keys().toList();
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558QByteArray QBluetoothDeviceInfo::manufacturerData(quint16 manufacturerId)
const
560 Q_D(
const QBluetoothDeviceInfo);
561 return d->manufacturerData.value(manufacturerId);
565
566
567
568
569
570
571
572
573
574bool QBluetoothDeviceInfo::setManufacturerData(quint16 manufacturerId,
const QByteArray &data)
576 Q_D(QBluetoothDeviceInfo);
577 auto it = d->manufacturerData.constFind(manufacturerId);
578 while (it != d->manufacturerData.cend() && it.key() == manufacturerId) {
584 d->manufacturerData.insert(manufacturerId, data);
589
590
591
592
593
594
595
596
597
598
599QMultiHash<quint16, QByteArray> QBluetoothDeviceInfo::manufacturerData()
const
601 Q_D(
const QBluetoothDeviceInfo);
602 return d->manufacturerData;
606
607
608
609
610
611QList<QBluetoothUuid> QBluetoothDeviceInfo::serviceIds()
const
613 Q_D(
const QBluetoothDeviceInfo);
614 return d->serviceData.keys().toList();
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635QByteArray QBluetoothDeviceInfo::serviceData(
const QBluetoothUuid &serviceId)
const
637 Q_D(
const QBluetoothDeviceInfo);
638 return d->serviceData.value(serviceId);
642
643
644
645
646
647
648bool QBluetoothDeviceInfo::setServiceData(
const QBluetoothUuid &serviceId,
const QByteArray &data)
650 Q_D(QBluetoothDeviceInfo);
651 auto it = d->serviceData.constFind(serviceId);
652 while (it != d->serviceData.cend() && it.key() == serviceId) {
658 d->serviceData.insert(serviceId, data);
663
664
665
666
667
668
669
670
671
672
673QMultiHash<QBluetoothUuid, QByteArray> QBluetoothDeviceInfo::serviceData()
const
675 Q_D(
const QBluetoothDeviceInfo);
676 return d->serviceData;
680
681
682
683
684
685
686void QBluetoothDeviceInfo::setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs)
688 Q_D(QBluetoothDeviceInfo);
690 d->deviceCoreConfiguration = coreConfigs;
694
695
696
697
698
699
700
701QBluetoothDeviceInfo::CoreConfigurations QBluetoothDeviceInfo::coreConfigurations()
const
703 Q_D(
const QBluetoothDeviceInfo);
705 return d->deviceCoreConfiguration;
709
710
711bool QBluetoothDeviceInfo::isCached()
const
713 Q_D(
const QBluetoothDeviceInfo);
719
720
721
722void QBluetoothDeviceInfo::setCached(
bool cached)
724 Q_D(QBluetoothDeviceInfo);
730
731
732
733
734
735
736
737
738
739void QBluetoothDeviceInfo::setDeviceUuid(
const QBluetoothUuid &uuid)
741 Q_D(QBluetoothDeviceInfo);
743 d->deviceUuid = uuid;
747
748
749
750
751
752
753
754
755
756
757QBluetoothUuid QBluetoothDeviceInfo::deviceUuid()
const
759 Q_D(
const QBluetoothDeviceInfo);
761 return d->deviceUuid;
Combined button and popup list for selecting options.