1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtBluetooth module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#include "qbluetoothuuid.h"
41#include "qbluetoothservicediscoveryagent.h"
42
43#include <QStringList>
44#include <QtEndian>
45
46#include <string.h>
47
48QT_BEGIN_NAMESPACE
49
50// Bluetooth base UUID 00000000-0000-1000-8000-00805F9B34FB
51Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34FB}"))
52
53/*!
54 \class QBluetoothUuid
55 \inmodule QtBluetooth
56 \brief The QBluetoothUuid class generates a UUID for each Bluetooth
57 service.
58
59 \since 5.2
60*/
61
62/*!
63 \enum QBluetoothUuid::ProtocolUuid
64
65 This enum is a convienience type for Bluetooth protocol UUIDs. Values of this type will be
66 implicitly converted into a QBluetoothUuid when necessary.
67
68 \value Sdp SDP protocol UUID
69 \value Udp UDP protocol UUID
70 \value Rfcomm RFCOMM protocol UUID
71 \value Tcp TCP protocol UUID
72 \value TcsBin Telephony Control Specification UUID
73 \value TcsAt Telephony Control Specification AT UUID
74 \value Att Attribute protocol UUID
75 \value Obex OBEX protocol UUID
76 \value Ip IP protocol UUID
77 \value Ftp FTP protocol UUID
78 \value Http HTTP protocol UUID
79 \value Wsp WSP UUID
80 \value Bnep Bluetooth Network Encapsulation Protocol UUID
81 \value Upnp Extended Service Discovery Profile UUID
82 \value Hidp Human Interface Device Profile UUID
83 \value HardcopyControlChannel Hardcopy Cable Replacement Profile UUID
84 \value HardcopyDataChannel Hardcopy Cable Replacement Profile UUID
85 \value HardcopyNotification Hardcopy Cable Replacement Profile UUID
86 \value Avctp Audio/Video Control Transport Protocol UUID
87 \value Avdtp Audio/Video Distribution Transport Protocol UUID
88 \value Cmtp Common ISDN Access Profile
89 \value UdiCPlain UDI protocol UUID
90 \value McapControlChannel Multi-Channel Adaptation Protocol UUID
91 \value McapDataChannel Multi-Channel Adaptation Protocol UUID
92 \value L2cap L2CAP protocol UUID
93
94 \sa QBluetoothServiceInfo::ProtocolDescriptorList
95*/
96
97/*!
98 \enum QBluetoothUuid::ServiceClassUuid
99
100 This enum is a convienience type for Bluetooth service class and profile UUIDs. Values of this type will be
101 implicitly converted into a QBluetoothUuid when necessary. Some UUIDs refer to service class ids, others to profile
102 ids and some can be used as both. In general, profile UUIDs shall only be used in a
103 \l QBluetoothServiceInfo::BluetoothProfileDescriptorList attribute and service class UUIDs shall only be used
104 in a \l QBluetoothServiceInfo::ServiceClassIds attribute. If the UUID is marked as profile and service class UUID
105 it can be used as a value for either of the above service attributes. Such a dual use has historical reasons
106 but is no longer permissible for newer UUIDs.
107
108 The list below explicitly states as what type each UUID shall be used. Bluetooth Low Energy related values
109 starting with 0x18 were introduced by Qt 5.4
110
111 \value ServiceDiscoveryServer Service discovery server UUID (service)
112 \value BrowseGroupDescriptor Browser group descriptor (service)
113 \value PublicBrowseGroup Public browse group service class. Services which have the public
114 browse group in their \l {QBluetoothServiceInfo::BrowseGroupList}{browse group list}
115 are discoverable by the remote devices.
116 \value SerialPort Serial Port Profile UUID (service & profile)
117 \value LANAccessUsingPPP LAN Access Profile UUID (service & profile)
118 \value DialupNetworking Dial-up Networking Profile UUID (service & profile)
119 \value IrMCSync Synchronization Profile UUID (service & profile)
120 \value ObexObjectPush OBEX object push service UUID (service & profile)
121 \value OBEXFileTransfer File Transfer Profile (FTP) UUID (service & profile)
122 \value IrMCSyncCommand Synchronization Profile UUID (profile)
123 \value Headset Headset Profile (HSP) UUID (service & profile)
124 \value AudioSource Advanced Audio Distribution Profile (A2DP) UUID (service)
125 \value AudioSink Advanced Audio Distribution Profile (A2DP) UUID (service)
126 \value AV_RemoteControlTarget Audio/Video Remote Control Profile (AVRCP) UUID (service)
127 \value AdvancedAudioDistribution Advanced Audio Distribution Profile (A2DP) UUID (profile)
128 \value AV_RemoteControl Audio/Video Remote Control Profile (AVRCP) UUID (service & profile)
129 \value AV_RemoteControlController Audio/Video Remote Control Profile UUID (service)
130 \value HeadsetAG Headset Profile (HSP) UUID (service)
131 \value PANU Personal Area Networking Profile (PAN) UUID (service & profile)
132 \value NAP Personal Area Networking Profile (PAN) UUID (service & profile)
133 \value GN Personal Area Networking Profile (PAN) UUID (service & profile)
134 \value DirectPrinting Basic Printing Profile (BPP) UUID (service)
135 \value ReferencePrinting Related to Basic Printing Profile (BPP) UUID (service)
136 \value BasicImage Basic Imaging Profile (BIP) UUID (profile)
137 \value ImagingResponder Basic Imaging Profile (BIP) UUID (service)
138 \value ImagingAutomaticArchive Basic Imaging Profile (BIP) UUID (service)
139 \value ImagingReferenceObjects Basic Imaging Profile (BIP) UUID (service)
140 \value Handsfree Hands-Free Profile (HFP) UUID (service & profile)
141 \value HandsfreeAudioGateway Hands-Free Audio Gateway (HFP) UUID (service)
142 \value DirectPrintingReferenceObjectsService Basic Printing Profile (BPP) UUID (service)
143 \value ReflectedUI Basic Printing Profile (BPP) UUID (service)
144 \value BasicPrinting Basic Printing Profile (BPP) UUID (profile)
145 \value PrintingStatus Basic Printing Profile (BPP) UUID (service)
146 \value HumanInterfaceDeviceService Human Interface Device (HID) UUID (service & profile)
147 \value HardcopyCableReplacement Hardcopy Cable Replacement Profile (HCRP) (profile)
148 \value HCRPrint Hardcopy Cable Replacement Profile (HCRP) (service)
149 \value HCRScan Hardcopy Cable Replacement Profile (HCRP) (service)
150 \value SIMAccess SIM Access Profile (SAP) UUID (service and profile)
151 \value PhonebookAccessPCE Phonebook Access Profile (PBAP) UUID (service)
152 \value PhonebookAccessPSE Phonebook Access Profile (PBAP) UUID (service)
153 \value PhonebookAccess Phonebook Access Profile (PBAP) (profile)
154 \value HeadsetHS Headset Profile (HSP) UUID (service)
155 \value MessageAccessServer Message Access Profile (MAP) UUID (service)
156 \value MessageNotificationServer Message Access Profile (MAP) UUID (service)
157 \value MessageAccessProfile Message Access Profile (MAP) UUID (profile)
158 \value GNSS Global Navigation Satellite System UUID (profile)
159 \value GNSSServer Global Navigation Satellite System Server (UUID) (service)
160 \value Display3D 3D Synchronization Display UUID (service)
161 \value Glasses3D 3D Synchronization Glasses UUID (service)
162 \value Synchronization3D 3D Synchronization UUID (profile)
163 \value MPSProfile Multi-Profile Specification UUID (profile)
164 \value MPSService Multi-Profile Specification UUID (service)
165 \value PnPInformation Device Identification (DID) UUID (service & profile)
166 \value GenericNetworking Generic networking UUID (service)
167 \value GenericFileTransfer Generic file transfer UUID (service)
168 \value GenericAudio Generic audio UUID (service)
169 \value GenericTelephony Generic telephone UUID (service)
170 \value VideoSource Video Distribution Profile (VDP) UUID (service)
171 \value VideoSink Video Distribution Profile (VDP) UUID (service)
172 \value VideoDistribution Video Distribution Profile (VDP) UUID (profile)
173 \value HDP Health Device Profile (HDP) UUID (profile)
174 \value HDPSource Health Device Profile Source (HDP) UUID (service)
175 \value HDPSink Health Device Profile Sink (HDP) UUID (service)
176 \value GenericAccess Generic access service for Bluetooth Low Energy devices UUID (service).
177 It contains generic information about the device. All available Characteristics are readonly.
178 \value GenericAttribute
179 \value ImmediateAlert Immediate Alert UUID (service). The service exposes a control point to allow a peer
180 device to cause the device to immediately alert.
181 \value LinkLoss Link Loss UUID (service). The service defines behavior when a link is lost between two devices.
182 \value TxPower Transmission Power UUID (service). The service exposes a device’s current
183 transmit power level when in a connection.
184 \value CurrentTimeService Current Time UUID (service). The service defines how the current time can be exposed using
185 the Generic Attribute Profile (GATT).
186 \value ReferenceTimeUpdateService Reference Time update UUID (service). The service defines how a client can request
187 an update from a reference time source from a time server.
188 \value NextDSTChangeService Next DST change UUID (service). The service defines how the information about an
189 upcoming DST change can be exposed.
190 \value Glucose Glucose UUID (service). The service exposes glucose and other data from a glucose sensor
191 for use in consumer and professional healthcare applications.
192 \value HealthThermometer Health Thermometer UUID (service). The Health Thermometer service exposes temperature
193 and other data from a thermometer intended for healthcare and fitness applications.
194 \value DeviceInformation Device Information UUID (service). The Device Information Service exposes manufacturer
195 and/or vendor information about a device.
196 \value HeartRate Heart Rate UUID (service). The service exposes the heart rate and other data from a
197 Heart Rate Sensor intended for fitness applications.
198 \value PhoneAlertStatusService Phone Alert Status UUID (service). The service exposes the phone alert status when
199 in a connection.
200 \value BatteryService Battery UUID (service). The Battery Service exposes the state of a battery within a device.
201 \value BloodPressure Blood Pressure UUID (service). The service exposes blood pressure and other data from a blood pressure
202 monitor intended for healthcare applications.
203 \value AlertNotificationService Alert Notification UUID (service). The Alert Notification service exposes alert
204 information on a device.
205 \value HumanInterfaceDevice Human Interface UUID (service). The service exposes the HID reports and other HID data
206 intended for HID Hosts and HID Devices.
207 \value ScanParameters Scan Parameters UUID (service). The Scan Parameters Service enables a GATT Server device
208 to expose a characteristic for the GATT Client to write its scan interval and scan window
209 on the GATT Server device.
210 \value RunningSpeedAndCadence Runnung Speed and Cadence UUID (service). The service exposes speed, cadence and other
211 data from a Running Speed and Cadence Sensor intended for fitness applications.
212 \value CyclingSpeedAndCadence Cycling Speed and Cadence UUID (service). The service exposes speed-related and
213 cadence-related data from a Cycling Speed and Cadence sensor intended for fitness
214 applications.
215 \value CyclingPower Cycling Speed UUID (service). The service exposes power- and force-related data and
216 optionally speed- and cadence-related data from a Cycling Power
217 sensor intended for sports and fitness applications.
218 \value LocationAndNavigation Location Navigation UUID (service). The service exposes location and navigation-related
219 data from a Location and Navigation sensor intended for outdoor activity applications.
220 \value EnvironmentalSensing Environmental sensor UUID (service). The service exposes data from an environmental sensor
221 for sports and fitness applications.
222 \value BodyComposition Body composition UUID (service). The service exposes data about the body composition intended
223 for consumer healthcare applications.
224 \value UserData User Data UUID (service). The User Data service provides user-related data such as name,
225 gender or weight in sports and fitness environments.
226 \value WeightScale Weight Scale UUID (service). The Weight Scale service exposes weight-related data from
227 a scale for consumer healthcare, sports and fitness applications.
228 \value BondManagement Bond Management UUID (service). The Bond Management service enables user to manage the
229 storage of bond information on Bluetooth devices.
230 \value ContinuousGlucoseMonitoring Continuous Glucose Monitoring UUID (service). The Continuous Glucose Monitoring service
231 exposes glucose data from a monitoring sensor for use in healthcare applications.
232*/
233
234/*!
235 \enum QBluetoothUuid::CharacteristicType
236 \since 5.4
237
238 This enum is a convienience type for Bluetooth low energy service characteristics class UUIDs. Values of this type
239 will be implicitly converted into a QBluetoothUuid when necessary. The detailed type descriptions can be found
240 on \l{https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx}{bluetooth.org}.
241
242 \value AerobicHeartRateLowerLimit The lower limit of the heart rate where the user improves his endurance while
243 exercising.
244 \value AerobicHeartRateUpperLimit The upper limit of the heart rate where the user improves his endurance while
245 exercising.
246 \value AerobicThreshold This characteristic states the first metabolic threshold.
247 \value Age This characteristic states the age of the user.
248 \value AnaerobicHeartRateLowerLimit The lower limit of the heart rate where the user enhances his anaerobic
249 tolerance while exercising.
250 \value AnaerobicHeartRateUpperLimit The upper limit of the heart rate where the user enhances his anaerobic
251 tolerance while exercising.
252 \value AnaerobicThreshold This characteristic states the second metabolic threshold.
253 \value AlertCategoryID Categories of alerts/messages.
254 \value AlertCategoryIDBitMask Categories of alerts/messages.
255 \value AlertLevel The level of an alert a device is to sound.
256 If this level is changed while the alert is being sounded,
257 the new level should take effect.
258 \value AlertNotificationControlPoint Control point of the Alert Notification server.
259 Client can write the command here to request the several
260 functions toward the server.
261 \value AlertStatus The Alert Status characteristic defines the Status of alert.
262 \value ApparentWindDirection The characteristic exposes the apparent wind direction. The apparent wind is
263 experienced by an observer in motion. This characteristic states the direction
264 of the wind with an angle measured clockwise relative to the observers heading.
265 \value ApparentWindSpeed The characteristic exposes the apparent wind speed in meters per second.
266 The apparent wind is experienced by an observer in motion.
267 \value Appearance The external appearance of this device. The values are composed
268 of a category (10-bits) and sub-categories (6-bits).
269 \value BarometricPressureTrend This characteristic exposes the trend the barometric pressure is taking.
270 \value BatteryLevel The current charge level of a battery. 100% represents fully charged
271 while 0% represents fully discharged.
272 \value BloodPressureFeature The Blood Pressure Feature characteristic is used to describe the supported
273 features of the Blood Pressure Sensor.
274 \value BloodPressureMeasurement The Blood Pressure Measurement characteristic is a variable length structure
275 containing a Flags field, a Blood Pressure Measurement Compound Value field,
276 and contains additional fields such as Time Stamp, Pulse Rate and User ID
277 as determined by the contents of the Flags field.
278 \value BodyCompositionFeature This characteristic describes the available features in the \l BodyCompositionMeasurement
279 characteristic.
280 \value BodyCompositionMeasurement This characteristic describes the body composition such as muscle percentage
281 or the body water mass.
282 \value BodySensorLocation The Body Sensor Location characteristic describes the location of a sensor on
283 the body (e.g.: chest, finger or hand).
284 \value BootKeyboardInputReport The Boot Keyboard Input Report characteristic is used to transfer fixed format
285 and length Input Report data between a HID Host operating in Boot Protocol Mode
286 and a HID Service corresponding to a boot keyboard.
287 \value BootKeyboardOutputReport The Boot Keyboard Output Report characteristic is used to transfer fixed format
288 and length Output Report data between a HID Host operating in Boot Protocol Mode
289 and a HID Service corresponding to a boot keyboard.
290 \value BootMouseInputReport The Boot Mouse Input Report characteristic is used to transfer fixed format and
291 length Input Report data between a HID Host operating in Boot Protocol Mode and
292 a HID Service corresponding to a boot mouse.
293 \value CSCFeature The CSC (Cycling Speed and Cadence) Feature characteristic is used to describe
294 the supported features of the Server.
295 \value CSCMeasurement The CSC Measurement characteristic (CSC refers to Cycling Speed and Cadence)
296 is a variable length structure containing a Flags field and, based on the contents
297 of the Flags field, may contain one or more additional fields as shown in the tables
298 below.
299 \value CurrentTime The Current Time characteristic shows the same information as the \l ExactTime256
300 characteristic and information on timezone, DST and the method of update employed.
301 \value CyclingPowerControlPoint The Cycling Power Control Point characteristic is used to request a specific function
302 to be executed on the receiving device.
303 \value CyclingPowerFeature The CP Feature characteristic is used to report a list of features supported by
304 the device.
305 \value CyclingPowerMeasurement The Cycling Power Measurement characteristic is a variable length structure containing
306 a Flags field, an Instantaneous Power field and, based on the contents of the Flags
307 field, may contain one or more additional fields as shown in the table below.
308 \value CyclingPowerVector The Cycling Power Vector characteristic is a variable length structure containing
309 a Flags fieldand based on the contents of the Flags field, may contain one or more
310 additional fields as shown in the table below.
311 \value DatabaseChangeIncrement
312 \value DateOfBirth This characteristic states the user's date of birth.
313 \value DateOfThresholdAssessment
314 \value DateTime The Date Time characteristic is used to represent time.
315 \value DayDateTime The Day Date Time characteristic presents the date, time and day of the week.
316 \value DayOfWeek The Day of Week characteristic describes the day of the week (Monday - Sunday).
317 \value DescriptorValueChanged This characteristic is related to the Environmental Sensing Service.
318 \value DeviceName The Device Name characteristic contains the name of the device.
319 \value DewPoint This characteristic states the dew point in degree Celsius.
320 \value DSTOffset The DST Offset characteristic describes the offset employed by daylight-saving time.
321 \value Elevation The Elevation characteristic states the elevation above/below sea level.
322 \value EmailAddress This characteristic states the email of the user.
323 \value ExactTime256 The Exact Time 256 characteristic describes the data, day and time
324 with an accuracy of 1/256th of a second.
325 \value FatBurnHeartRateLowerLimit The lower limit of the heart rate where the user maximizes the fat burn while exercising.
326 \value FatBurnHeartRateUpperLimit The upper limit of the heart rate where the user maximizes the fat burn while exercising.
327 \value FirmwareRevisionString The value of this characteristic is a UTF-8 string representing the firmware revision
328 for the firmware within the device.
329 \value FirstName This characteristic exposes the user's first name.
330 \value FiveZoneHeartRateLimits This characteristic contains the limits between the heart rate zones for the
331 5-zone heart rate definition.
332 \value Gender This characteristic states the user's gender.
333 \value GlucoseFeature The Glucose Feature characteristic is used to describe the supported features
334 of the Server. When read, the Glucose Feature characteristic returns a value
335 that is used by a Client to determine the supported features of the Server.
336 \value GlucoseMeasurement The Glucose Measurement characteristic is a variable length structure containing
337 a Flags field, a Sequence Number field, a Base Time field and, based upon the contents
338 of the Flags field, may contain a Time Offset field, Glucose Concentration field,
339 Type-Sample Location field and a Sensor Status Annunciation field.
340 \value GlucoseMeasurementContext
341 \value GustFactor The characteristic states a factor of wind speed increase between average wind speed in
342 maximum gust speed.
343 \value HardwareRevisionString The value of this characteristic is a UTF-8 string representing the hardware revision
344 for the hardware within the device.
345 \value MaximumRecommendedHeartRate This characteristic exposes the maximum recommended heart rate that limits exertion.
346 \value HeartRateControlPoint
347 \value HeartRateMax This characteristic states the maximum heart rate a user can reach in beats per minute.
348 \value HeartRateMeasurement
349 \value HeatIndex This characteristic provides a heat index in degree Celsius.
350 \value Height This characteristic states the user's height.
351 \value HIDControlPoint The HID Control Point characteristic is a control-point attribute that defines the
352 HID Commands when written.
353 \value HIDInformation The HID Information Characteristic returns the HID attributes when read.
354 \value HipCircumference This characteristic states the user's hip circumference in meters.
355 \value Humidity The characteristic states the humidity in percent.
356 \value IEEE1107320601RegulatoryCertificationDataList The value of the characteristic is an opaque structure listing
357 various regulatory and/or certification compliance items to which the device
358 claims adherence.
359 \value IntermediateCuffPressure This characteristic has the same format as the Blood Pressure Measurement
360 characteristic.
361 \value IntermediateTemperature The Intermediate Temperature characteristic has the same format as the
362 Temperature Measurement characteristic.
363 \value Irradiance This characteristic states the power of electromagnetic radiation in watt per square meter.
364 \value Language This characteristic contains the language definition based on ISO639-1.
365 \value LastName This characteristic states the user's last name.
366 \value LNControlPoint The LN Control Point characteristic is used to request a specific function
367 to be executed on the receiving device.
368 \value LNFeature The LN Feature characteristic is used to report a list of features supported
369 by the device.
370 \value LocalTimeInformation
371 \value LocationAndSpeed The Location and Speed characteristic is a variable length structure containing
372 a Flags field and, based on the contents of the Flags field, may contain a combination
373 of data fields.
374 \value MagneticDeclination The characteristic contains the angle on the horizontal plane between the direction of
375 the (Geographic) True North and the Magnetic North, measured clockwise from True North
376 to Magnetic North.
377 \value MagneticFluxDensity2D This characteristic states the magnetic flux density on an x and y axis.
378 \value MagneticFluxDensity3D This characteristic states the magnetic flux density on an x, y and z axis.
379 \value ManufacturerNameString The value of this characteristic is a UTF-8 string representing the name of the
380 manufacturer of the device.
381 \value MeasurementInterval The Measurement Interval characteristic defines the time between measurements.
382 \value ModelNumberString The value of this characteristic is a UTF-8 string representing the model number
383 assigned by the device vendor.
384 \value Navigation The Navigation characteristic is a variable length structure containing a Flags field,
385 a Bearing field, a Heading field and, based on the contents of the Flags field.
386 \value NewAlert This characteristic defines the category of the alert and how many new alerts of
387 that category have occurred in the server device.
388 \value PeripheralPreferredConnectionParameters
389 \value PeripheralPrivacyFlag
390 \value PnPID The PnP_ID characteristic returns its value when read using the GATT Characteristic
391 Value Read procedure.
392 \value PollenConcentration The characteristic exposes the pollen concentration count per cubic meter.
393 \value PositionQuality The Position Quality characteristic is a variable length structure containing a
394 Flags field and at least one of the optional data.
395 \value Pressure The Pressure characteristic states the value of a pressure sensor.
396 \value ProtocolMode The Protocol Mode characteristic is used to expose the current protocol mode of
397 the HID Service with which it is associated, or to set the desired protocol
398 mode of the HID Service.
399 \value Rainfall This characteristic exposes the rainfall in meters.
400 \value ReconnectionAddress The Information included in this page is informative. The normative descriptions
401 are contained in the applicable specification.
402 \value RecordAccessControlPoint This control point is used with a service to provide basic management functionality
403 for the Glucose Sensor patient record database.
404 \value ReferenceTimeInformation
405 \value Report The Report characteristic is used to exchange data between a HID Device and a HID Host.
406 \value ReportMap Only a single instance of this characteristic exists as part of a HID Service.
407 \value RestingHeartRate This characteristic exposes the lowest heart rate a user can reach.
408 \value RingerControlPoint The Ringer Control Point characteristic defines the Control Point of Ringer.
409 \value RingerSetting The Ringer Setting characteristic defines the Setting of the Ringer.
410 \value RSCFeature The RSC (Running Speed and Cadence) Feature characteristic is used to describe the
411 supported features of the Server.
412 \value RSCMeasurement RSC refers to Running Speed and Cadence.
413 \value SCControlPoint The SC Control Point characteristic is used to request a specific function to be
414 executed on the receiving device.
415 \value ScanIntervalWindow The Scan Interval Window characteristic is used to store the scan parameters of
416 the GATT Client.
417 \value ScanRefresh The Scan Refresh characteristic is used to notify the Client that the Server
418 requires the Scan Interval Window characteristic to be written with the latest
419 values upon notification.
420 \value SensorLocation The Sensor Location characteristic is used to expose the location of the sensor.
421 \value SerialNumberString The value of this characteristic is a variable-length UTF-8 string representing
422 the serial number for a particular instance of the device.
423 \value ServiceChanged
424 \value SoftwareRevisionString The value of this characteristic is a UTF-8 string representing the software
425 revision for the software within the device.
426 \value SportTypeForAerobicAnaerobicThresholds This characteristic is used to preset the various Aerobic and Anaerobic
427 threshold characteristics based on the to-be-performed sport type.
428 \value SupportedNewAlertCategory Category that the server supports for new alert.
429 \value SupportedUnreadAlertCategory Category that the server supports for unread alert.
430 \value SystemID If the system ID is based of a Bluetooth Device Address with a Company Identifier
431 (OUI) is 0x123456 and the Company Assigned Identifier is 0x9ABCDE, then the System
432 Identifier is required to be 0x123456FFFE9ABCDE.
433 \value Temperature The value of this characteristic states the temperature in degree Celsius.
434 \value TemperatureMeasurement The Temperature Measurement characteristic is a variable length structure containing
435 a Flags field, a Temperature Measurement Value field and, based upon the contents of
436 the Flags field, optionally a Time Stamp field and/or a Temperature Type field.
437 \value TemperatureType The Temperature Type characteristic is an enumeration that indicates where the
438 temperature was measured.
439 \value ThreeZoneHeartRateLimits This characteristic contains the limits between the heart rate zones for the
440 3-zone heart rate definition.
441 \value TimeAccuracy
442 \value TimeSource
443 \value TimeUpdateControlPoint
444 \value TimeUpdateState
445 \value TimeWithDST
446 \value TimeZone
447 \value TrueWindDirection The characteristic states the direction of the wind with an angle measured clockwise
448 relative to (Geographic) True North. A wind coming from the east is given as 90 degrees.
449 \value TrueWindSpeed The characteristic states the wind speed in meters per seconds.
450 \value TwoZoneHeartRateLimits This characteristic contains the limits between the heart rate zones for the
451 2-zone heart rate definition.
452 \value TxPowerLevel The value of the characteristic is a signed 8 bit integer that has a fixed point
453 exponent of 0.
454 \value UnreadAlertStatus This characteristic shows how many numbers of unread alerts exist in the specific
455 category in the device.
456 \value UserControlPoint
457 \value UserIndex This characteristic states the index of the user.
458 \value UVIndex This characteristic exposes the UV index.
459 \value VO2Max This characteristic exposes the maximum Oxygen uptake of a user.
460 \value WaistCircumference This characteristic states the user's waist circumference in meters.
461 \value Weight This characteristic exposes the user's weight in kilograms.
462 \value WeightMeasurement This characteristic provides weight related data such as BMI or the user's weight.
463 \value WeightScaleFeature This characteristic describes the available data in the \l WeightMeasurement
464 characteristic.
465 \value WindChill This characteristic states the wind chill in degree Celsius
466*/
467
468/*!
469 \enum QBluetoothUuid::DescriptorType
470 \since 5.4
471
472 Descriptors are attributes that describe Bluetooth Low Energy characteristic values.
473
474 This enum is a convienience type for descriptor class UUIDs. Values of this type
475 will be implicitly converted into a QBluetoothUuid when necessary. The detailed type specifications
476 can be found on \l{https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx}{bluetooth.org}.
477
478 \value CharacteristicExtendedProperties Descriptor defines additional Characteristic Properties.
479 The existence of this descriptor is indicated by the
480 \l QLowEnergyCharacteristic::ExtendedProperty flag.
481 \value CharacteristicUserDescription Descriptor provides a textual user description for a characteristic value.
482 \value ClientCharacteristicConfiguration Descriptor defines how the characteristic may be configured by a specific client.
483 \value ServerCharacteristicConfiguration Descriptor defines how the characteristic descriptor is associated with may be
484 configured for the server.
485 \value CharacteristicPresentationFormat Descriptor defines the format of the Characteristic Value.
486 \value CharacteristicAggregateFormat Descriptor defines the format of an aggregated Characteristic Value.
487 \value ValidRange descriptor is used for defining the range of a characteristics.
488 Two mandatory fields are contained (upper and lower bounds) which define the range.
489 \value ExternalReportReference Allows a HID Host to map information from the Report Map characteristic value for
490 Input Report, Output Report or Feature Report data to the Characteristic UUID of
491 external service characteristics used to transfer the associated data.
492 \value ReportReference Mapping information in the form of a Report ID and Report Type which maps the
493 current parent characteristic to the Report ID(s) and Report Type (s) defined
494 within the Report Map characteristic.
495 \value EnvironmentalSensingConfiguration Descriptor defines how multiple trigger settings descriptors are combined. Therefore
496 this descriptor works together with the \l EnvironmentalSensingTriggerSetting descriptor
497 to define the conditions under which the associated characteristic value can be notified.
498 \value EnvironmentalSensingMeasurement Descriptor defines the additional information for the environmental sensing server
499 such as the intended application, sampling functions or measurement period and uncertainty.
500 \value EnvironmentalSensingTriggerSetting Descriptor defines under which conditions an environmental sensing server (ESS) should
501 trigger notifications. Examples of such conditions are certain thresholds being reached
502 or timers having expired. This implies that the ESS characteristic supports notifications.
503 \value UnknownDescriptorType The descriptor type is unknown.
504*/
505
506static void registerQBluetoothUuidMetaType()
507{
508 static bool initDone = false;
509 if (!initDone) {
510 qRegisterMetaType<QBluetoothUuid>();
511 initDone = true;
512 }
513}
514
515/*!
516 Constructs a new null Bluetooth UUID.
517*/
518QBluetoothUuid::QBluetoothUuid()
519{
520 registerQBluetoothUuidMetaType();
521}
522
523/*!
524 Constructs a new Bluetooth UUID from the protocol \a uuid.
525*/
526QBluetoothUuid::QBluetoothUuid(ProtocolUuid uuid)
527: QUuid(uuid, baseUuid()->data2,
528 baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1],
529 baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
530 baseUuid()->data4[6], baseUuid()->data4[7])
531{
532 registerQBluetoothUuidMetaType();
533}
534
535/*!
536 Constructs a new Bluetooth UUID from the service class \a uuid.
537*/
538QBluetoothUuid::QBluetoothUuid(ServiceClassUuid uuid)
539: QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1],
540 baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
541 baseUuid()->data4[6], baseUuid()->data4[7])
542{
543 registerQBluetoothUuidMetaType();
544}
545
546/*!
547 Constructs a new Bluetooth UUID from the characteristic type \a uuid.
548 \since 5.4
549*/
550QBluetoothUuid::QBluetoothUuid(CharacteristicType uuid)
551: QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1],
552 baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
553 baseUuid()->data4[6], baseUuid()->data4[7])
554{
555 registerQBluetoothUuidMetaType();
556}
557
558/*!
559 Constructs a new Bluetooth UUID from the descriptor type \a uuid.
560 \since 5.4
561*/
562QBluetoothUuid::QBluetoothUuid(DescriptorType uuid)
563 : QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1],
564 baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
565 baseUuid()->data4[6], baseUuid()->data4[7])
566{
567 registerQBluetoothUuidMetaType();
568}
569
570/*!
571 Constructs a new Bluetooth UUID from the 16 bit \a uuid.
572*/
573QBluetoothUuid::QBluetoothUuid(quint16 uuid)
574: QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1],
575 baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
576 baseUuid()->data4[6], baseUuid()->data4[7])
577{
578 registerQBluetoothUuidMetaType();
579}
580
581/*!
582 Constructs a new Bluetooth UUID from the 32 bit \a uuid.
583*/
584QBluetoothUuid::QBluetoothUuid(quint32 uuid)
585: QUuid(uuid, baseUuid()->data2, baseUuid()->data3, baseUuid()->data4[0], baseUuid()->data4[1],
586 baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
587 baseUuid()->data4[6], baseUuid()->data4[7])
588{
589 registerQBluetoothUuidMetaType();
590}
591
592/*!
593 Constructs a new Bluetooth UUID from the 128 bit \a uuid.
594
595 Note that \a uuid must be in big endian order.
596*/
597QBluetoothUuid::QBluetoothUuid(quint128 uuid)
598{
599 registerQBluetoothUuidMetaType();
600QT_WARNING_PUSH
601QT_WARNING_DISABLE_GCC("-Wstrict-aliasing")
602 data1 = qFromBigEndian<quint32>(*reinterpret_cast<quint32 *>(&uuid.data[0]));
603 data2 = qFromBigEndian<quint16>(*reinterpret_cast<quint16 *>(&uuid.data[4]));
604 data3 = qFromBigEndian<quint16>(*reinterpret_cast<quint16 *>(&uuid.data[6]));
605QT_WARNING_POP
606
607 memcpy(data4, &uuid.data[8], 8);
608}
609
610/*!
611 Creates a QBluetoothUuid object from the string \a uuid,
612 which must be formatted as five hex fields separated by '-',
613 e.g., "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where 'x' is a hex digit.
614 The curly braces shown here are optional, but it is normal to include them.
615 If the conversion fails, a null UUID is created. See \l QUuid::toString() for an
616 explanation of how the five hex fields map to the public data members in QUuid.
617*/
618QBluetoothUuid::QBluetoothUuid(const QString &uuid)
619: QUuid(uuid)
620{
621 registerQBluetoothUuidMetaType();
622}
623
624/*!
625 Constructs a new Bluetooth UUID that is a copy of \a uuid.
626*/
627QBluetoothUuid::QBluetoothUuid(const QBluetoothUuid &uuid)
628: QUuid(uuid)
629{
630 registerQBluetoothUuidMetaType();
631}
632
633/*!
634 Constructs a new Bluetooth UUID that is a copy of \a uuid.
635*/
636QBluetoothUuid::QBluetoothUuid(const QUuid &uuid)
637: QUuid(uuid)
638{
639 registerQBluetoothUuidMetaType();
640}
641
642/*!
643 Destroys the Bluetooth UUID.
644*/
645QBluetoothUuid::~QBluetoothUuid()
646{
647}
648
649/*!
650 Returns the minimum size in bytes that this UUID can be represented in. For non-null UUIDs 2,
651 4 or 16 is returned. 0 is returned for null UUIDs.
652
653 \sa isNull(), toUInt16(), toUInt32(), toUInt128()
654*/
655int QBluetoothUuid::minimumSize() const
656{
657 if (data2 == baseUuid()->data2 && data3 == baseUuid()->data3 &&
658 memcmp(data4, baseUuid()->data4, 8) == 0) {
659 // 16 or 32 bit Bluetooth UUID
660 if (data1 & 0xFFFF0000)
661 return 4;
662 else
663 return 2;
664 }
665
666 if (isNull())
667 return 0;
668
669 return 16;
670}
671
672/*!
673 Returns the 16 bit representation of this UUID. If \a ok is passed, it is set to true if the
674 conversion is possible, otherwise it is set to false. The return value is undefined if \a ok is
675 set to false.
676*/
677quint16 QBluetoothUuid::toUInt16(bool *ok) const
678{
679 if (data1 & 0xFFFF0000 || data2 != baseUuid()->data2 || data3 != baseUuid()->data3 ||
680 memcmp(data4, baseUuid()->data4, 8) != 0) {
681 // not convertable to 16 bit Bluetooth UUID.
682 if (ok)
683 *ok = false;
684 return 0;
685 }
686
687 if (ok)
688 *ok = true;
689
690 return data1;
691}
692
693/*!
694 Returns the 32 bit representation of this UUID. If \a ok is passed, it is set to true if the
695 conversion is possible, otherwise it is set to false. The return value is undefined if \a ok is
696 set to false.
697*/
698quint32 QBluetoothUuid::toUInt32(bool *ok) const
699{
700 if (data2 != baseUuid()->data2 || data3 != baseUuid()->data3 ||
701 memcmp(data4, baseUuid()->data4, 8) != 0) {
702 // not convertable to 32 bit Bluetooth UUID.
703 if (ok)
704 *ok = false;
705 return 0;
706 }
707
708 if (ok)
709 *ok = true;
710
711 return data1;
712}
713
714/*!
715 Returns the 128 bit representation of this UUID.
716*/
717quint128 QBluetoothUuid::toUInt128() const
718{
719 quint128 uuid;
720
721 quint32 tmp32 = qToBigEndian<quint32>(data1);
722 memcpy(&uuid.data[0], &tmp32, 4);
723
724 quint16 tmp16 = qToBigEndian<quint16>(data2);
725 memcpy(&uuid.data[4], &tmp16, 2);
726
727 tmp16 = qToBigEndian<quint16>(data3);
728 memcpy(&uuid.data[6], &tmp16, 2);
729
730 memcpy(&uuid.data[8], data4, 8);
731
732 return uuid;
733}
734
735/*!
736 Returns a human-readable and translated name for the given service class
737 represented by \a uuid.
738
739 \sa QBluetoothUuid::ServiceClassUuid
740 \since Qt 5.4
741 */
742QString QBluetoothUuid::serviceClassToString(QBluetoothUuid::ServiceClassUuid uuid)
743{
744 switch (uuid) {
745 case QBluetoothUuid::ServiceDiscoveryServer: return QBluetoothServiceDiscoveryAgent::tr("Service Discovery");
746 case QBluetoothUuid::BrowseGroupDescriptor: return QBluetoothServiceDiscoveryAgent::tr("Browse Group Descriptor");
747 case QBluetoothUuid::PublicBrowseGroup: return QBluetoothServiceDiscoveryAgent::tr("Public Browse Group");
748 case QBluetoothUuid::SerialPort: return QBluetoothServiceDiscoveryAgent::tr("Serial Port Profile");
749 case QBluetoothUuid::LANAccessUsingPPP: return QBluetoothServiceDiscoveryAgent::tr("LAN Access Profile");
750 case QBluetoothUuid::DialupNetworking: return QBluetoothServiceDiscoveryAgent::tr("Dial-Up Networking");
751 case QBluetoothUuid::IrMCSync: return QBluetoothServiceDiscoveryAgent::tr("Synchronization");
752 case QBluetoothUuid::ObexObjectPush: return QBluetoothServiceDiscoveryAgent::tr("Object Push");
753 case QBluetoothUuid::OBEXFileTransfer: return QBluetoothServiceDiscoveryAgent::tr("File Transfer");
754 case QBluetoothUuid::IrMCSyncCommand: return QBluetoothServiceDiscoveryAgent::tr("Synchronization Command");
755 case QBluetoothUuid::Headset: return QBluetoothServiceDiscoveryAgent::tr("Headset");
756 case QBluetoothUuid::AudioSource: return QBluetoothServiceDiscoveryAgent::tr("Audio Source");
757 case QBluetoothUuid::AudioSink: return QBluetoothServiceDiscoveryAgent::tr("Audio Sink");
758 case QBluetoothUuid::AV_RemoteControlTarget: return QBluetoothServiceDiscoveryAgent::tr("Audio/Video Remote Control Target");
759 case QBluetoothUuid::AdvancedAudioDistribution: return QBluetoothServiceDiscoveryAgent::tr("Advanced Audio Distribution");
760 case QBluetoothUuid::AV_RemoteControl: return QBluetoothServiceDiscoveryAgent::tr("Audio/Video Remote Control");
761 case QBluetoothUuid::AV_RemoteControlController: return QBluetoothServiceDiscoveryAgent::tr("Audio/Video Remote Control Controller");
762 case QBluetoothUuid::HeadsetAG: return QBluetoothServiceDiscoveryAgent::tr("Headset AG");
763 case QBluetoothUuid::PANU: return QBluetoothServiceDiscoveryAgent::tr("Personal Area Networking (PANU)");
764 case QBluetoothUuid::NAP: return QBluetoothServiceDiscoveryAgent::tr("Personal Area Networking (NAP)");
765 case QBluetoothUuid::GN: return QBluetoothServiceDiscoveryAgent::tr("Personal Area Networking (GN)");
766 case QBluetoothUuid::DirectPrinting: return QBluetoothServiceDiscoveryAgent::tr("Basic Direct Printing (BPP)");
767 case QBluetoothUuid::ReferencePrinting: return QBluetoothServiceDiscoveryAgent::tr("Basic Reference Printing (BPP)");
768 case QBluetoothUuid::BasicImage: return QBluetoothServiceDiscoveryAgent::tr("Basic Imaging Profile");
769 case QBluetoothUuid::ImagingResponder: return QBluetoothServiceDiscoveryAgent::tr("Basic Imaging Responder");
770 case QBluetoothUuid::ImagingAutomaticArchive: return QBluetoothServiceDiscoveryAgent::tr("Basic Imaging Archive");
771 case QBluetoothUuid::ImagingReferenceObjects: return QBluetoothServiceDiscoveryAgent::tr("Basic Imaging Ref Objects");
772 case QBluetoothUuid::Handsfree: return QBluetoothServiceDiscoveryAgent::tr("Hands-Free");
773 case QBluetoothUuid::HandsfreeAudioGateway: return QBluetoothServiceDiscoveryAgent::tr("Hands-Free AG");
774 case QBluetoothUuid::DirectPrintingReferenceObjectsService: return QBluetoothServiceDiscoveryAgent::tr("Basic Printing RefObject Service");
775 case QBluetoothUuid::ReflectedUI: return QBluetoothServiceDiscoveryAgent::tr("Basic Printing Reflected UI");
776 case QBluetoothUuid::BasicPrinting: return QBluetoothServiceDiscoveryAgent::tr("Basic Printing");
777 case QBluetoothUuid::PrintingStatus: return QBluetoothServiceDiscoveryAgent::tr("Basic Printing Status");
778 case QBluetoothUuid::HumanInterfaceDeviceService: return QBluetoothServiceDiscoveryAgent::tr("Human Interface Device");
779 case QBluetoothUuid::HardcopyCableReplacement: return QBluetoothServiceDiscoveryAgent::tr("Hardcopy Cable Replacement");
780 case QBluetoothUuid::HCRPrint: return QBluetoothServiceDiscoveryAgent::tr("Hardcopy Cable Replacement Print");
781 case QBluetoothUuid::HCRScan: return QBluetoothServiceDiscoveryAgent::tr("Hardcopy Cable Replacement Scan");
782 case QBluetoothUuid::SIMAccess: return QBluetoothServiceDiscoveryAgent::tr("SIM Access Server");
783 case QBluetoothUuid::PhonebookAccessPCE: return QBluetoothServiceDiscoveryAgent::tr("Phonebook Access PCE");
784 case QBluetoothUuid::PhonebookAccessPSE: return QBluetoothServiceDiscoveryAgent::tr("Phonebook Access PSE");
785 case QBluetoothUuid::PhonebookAccess: return QBluetoothServiceDiscoveryAgent::tr("Phonebook Access");
786 case QBluetoothUuid::HeadsetHS: return QBluetoothServiceDiscoveryAgent::tr("Headset HS");
787 case QBluetoothUuid::MessageAccessServer: return QBluetoothServiceDiscoveryAgent::tr("Message Access Server");
788 case QBluetoothUuid::MessageNotificationServer: return QBluetoothServiceDiscoveryAgent::tr("Message Notification Server");
789 case QBluetoothUuid::MessageAccessProfile: return QBluetoothServiceDiscoveryAgent::tr("Message Access");
790 case QBluetoothUuid::GNSS: return QBluetoothServiceDiscoveryAgent::tr("Global Navigation Satellite System");
791 case QBluetoothUuid::GNSSServer: return QBluetoothServiceDiscoveryAgent::tr("Global Navigation Satellite System Server");
792 case QBluetoothUuid::Display3D: return QBluetoothServiceDiscoveryAgent::tr("3D Synchronization Display");
793 case QBluetoothUuid::Glasses3D: return QBluetoothServiceDiscoveryAgent::tr("3D Synchronization Glasses");
794 case QBluetoothUuid::Synchronization3D: return QBluetoothServiceDiscoveryAgent::tr("3D Synchronization");
795 case QBluetoothUuid::MPSProfile: return QBluetoothServiceDiscoveryAgent::tr("Multi-Profile Specification (Profile)");
796 case QBluetoothUuid::MPSService: return QBluetoothServiceDiscoveryAgent::tr("Multi-Profile Specification");
797 case QBluetoothUuid::PnPInformation: return QBluetoothServiceDiscoveryAgent::tr("Device Identification");
798 case QBluetoothUuid::GenericNetworking: return QBluetoothServiceDiscoveryAgent::tr("Generic Networking");
799 case QBluetoothUuid::GenericFileTransfer: return QBluetoothServiceDiscoveryAgent::tr("Generic File Transfer");
800 case QBluetoothUuid::GenericAudio: return QBluetoothServiceDiscoveryAgent::tr("Generic Audio");
801 case QBluetoothUuid::GenericTelephony: return QBluetoothServiceDiscoveryAgent::tr("Generic Telephony");
802 case QBluetoothUuid::VideoSource: return QBluetoothServiceDiscoveryAgent::tr("Video Source");
803 case QBluetoothUuid::VideoSink: return QBluetoothServiceDiscoveryAgent::tr("Video Sink");
804 case QBluetoothUuid::VideoDistribution: return QBluetoothServiceDiscoveryAgent::tr("Video Distribution");
805 case QBluetoothUuid::HDP: return QBluetoothServiceDiscoveryAgent::tr("Health Device");
806 case QBluetoothUuid::HDPSource: return QBluetoothServiceDiscoveryAgent::tr("Health Device Source");
807 case QBluetoothUuid::HDPSink: return QBluetoothServiceDiscoveryAgent::tr("Health Device Sink");
808 case QBluetoothUuid::GenericAccess: return QBluetoothServiceDiscoveryAgent::tr("Generic Access");
809 case QBluetoothUuid::GenericAttribute: return QBluetoothServiceDiscoveryAgent::tr("Generic Attribute");
810 case QBluetoothUuid::ImmediateAlert: return QBluetoothServiceDiscoveryAgent::tr("Immediate Alert");
811 case QBluetoothUuid::LinkLoss: return QBluetoothServiceDiscoveryAgent::tr("Link Loss");
812 case QBluetoothUuid::TxPower: return QBluetoothServiceDiscoveryAgent::tr("Tx Power");
813 case QBluetoothUuid::CurrentTimeService: return QBluetoothServiceDiscoveryAgent::tr("Current Time Service");
814 case QBluetoothUuid::ReferenceTimeUpdateService: return QBluetoothServiceDiscoveryAgent::tr("Reference Time Update Service");
815 case QBluetoothUuid::NextDSTChangeService: return QBluetoothServiceDiscoveryAgent::tr("Next DST Change Service");
816 case QBluetoothUuid::Glucose: return QBluetoothServiceDiscoveryAgent::tr("Glucose");
817 case QBluetoothUuid::HealthThermometer: return QBluetoothServiceDiscoveryAgent::tr("Health Thermometer");
818 case QBluetoothUuid::DeviceInformation: return QBluetoothServiceDiscoveryAgent::tr("Device Information");
819 case QBluetoothUuid::HeartRate: return QBluetoothServiceDiscoveryAgent::tr("Heart Rate");
820 case QBluetoothUuid::PhoneAlertStatusService: return QBluetoothServiceDiscoveryAgent::tr("Phone Alert Status Service");
821 case QBluetoothUuid::BatteryService: return QBluetoothServiceDiscoveryAgent::tr("Battery Service");
822 case QBluetoothUuid::BloodPressure: return QBluetoothServiceDiscoveryAgent::tr("Blood Pressure");
823 case QBluetoothUuid::AlertNotificationService: return QBluetoothServiceDiscoveryAgent::tr("Alert Notification Service");
824 case QBluetoothUuid::HumanInterfaceDevice: return QBluetoothServiceDiscoveryAgent::tr("Human Interface Device");
825 case QBluetoothUuid::ScanParameters: return QBluetoothServiceDiscoveryAgent::tr("Scan Parameters");
826 case QBluetoothUuid::RunningSpeedAndCadence: return QBluetoothServiceDiscoveryAgent::tr("Running Speed and Cadence");
827 case QBluetoothUuid::CyclingSpeedAndCadence: return QBluetoothServiceDiscoveryAgent::tr("Cycling Speed and Cadence");
828 case QBluetoothUuid::CyclingPower: return QBluetoothServiceDiscoveryAgent::tr("Cycling Power");
829 case QBluetoothUuid::LocationAndNavigation: return QBluetoothServiceDiscoveryAgent::tr("Location and Navigation");
830 case QBluetoothUuid::EnvironmentalSensing: return QBluetoothServiceDiscoveryAgent::tr("Environmental Sensing");
831 case QBluetoothUuid::BodyComposition: return QBluetoothServiceDiscoveryAgent::tr("Body Composition");
832 case QBluetoothUuid::UserData: return QBluetoothServiceDiscoveryAgent::tr("User Data");
833 case QBluetoothUuid::WeightScale: return QBluetoothServiceDiscoveryAgent::tr("Weight Scale");
834 //: Connection management (Bluetooth)
835 case QBluetoothUuid::BondManagement: return QBluetoothServiceDiscoveryAgent::tr("Bond Management");
836 case QBluetoothUuid::ContinuousGlucoseMonitoring: return QBluetoothServiceDiscoveryAgent::tr("Continuous Glucose Monitoring");
837 default:
838 break;
839 }
840
841 return QString();
842}
843
844
845/*!
846 Returns a human-readable and translated name for the given protocol
847 represented by \a uuid.
848
849 \sa QBluetoothUuid::ProtocolUuid
850
851 \since 5.4
852 */
853QString QBluetoothUuid::protocolToString(QBluetoothUuid::ProtocolUuid uuid)
854{
855 switch (uuid) {
856 case QBluetoothUuid::Sdp: return QBluetoothServiceDiscoveryAgent::tr("Service Discovery Protocol");
857 case QBluetoothUuid::Udp: return QBluetoothServiceDiscoveryAgent::tr("User Datagram Protocol");
858 case QBluetoothUuid::Rfcomm: return QBluetoothServiceDiscoveryAgent::tr("Radio Frequency Communication");
859 case QBluetoothUuid::Tcp: return QBluetoothServiceDiscoveryAgent::tr("Transmission Control Protocol");
860 case QBluetoothUuid::TcsBin: return QBluetoothServiceDiscoveryAgent::tr("Telephony Control Specification - Binary");
861 case QBluetoothUuid::TcsAt: return QBluetoothServiceDiscoveryAgent::tr("Telephony Control Specification - AT");
862 case QBluetoothUuid::Att: return QBluetoothServiceDiscoveryAgent::tr("Attribute Protocol");
863 case QBluetoothUuid::Obex: return QBluetoothServiceDiscoveryAgent::tr("Object Exchange Protocol");
864 case QBluetoothUuid::Ip: return QBluetoothServiceDiscoveryAgent::tr("Internet Protocol");
865 case QBluetoothUuid::Ftp: return QBluetoothServiceDiscoveryAgent::tr("File Transfer Protocol");
866 case QBluetoothUuid::Http: return QBluetoothServiceDiscoveryAgent::tr("Hypertext Transfer Protocol");
867 case QBluetoothUuid::Wsp: return QBluetoothServiceDiscoveryAgent::tr("Wireless Short Packet Protocol");
868 case QBluetoothUuid::Bnep: return QBluetoothServiceDiscoveryAgent::tr("Bluetooth Network Encapsulation Protocol");
869 case QBluetoothUuid::Upnp: return QBluetoothServiceDiscoveryAgent::tr("Extended Service Discovery Protocol");
870 case QBluetoothUuid::Hidp: return QBluetoothServiceDiscoveryAgent::tr("Human Interface Device Protocol");
871 case QBluetoothUuid::HardcopyControlChannel: return QBluetoothServiceDiscoveryAgent::tr("Hardcopy Control Channel");
872 case QBluetoothUuid::HardcopyDataChannel: return QBluetoothServiceDiscoveryAgent::tr("Hardcopy Data Channel");
873 case QBluetoothUuid::HardcopyNotification: return QBluetoothServiceDiscoveryAgent::tr("Hardcopy Notification");
874 case QBluetoothUuid::Avctp: return QBluetoothServiceDiscoveryAgent::tr("Audio/Video Control Transport Protocol");
875 case QBluetoothUuid::Avdtp: return QBluetoothServiceDiscoveryAgent::tr("Audio/Video Distribution Transport Protocol");
876 case QBluetoothUuid::Cmtp: return QBluetoothServiceDiscoveryAgent::tr("Common ISDN Access Protocol");
877 case QBluetoothUuid::UdiCPlain: return QBluetoothServiceDiscoveryAgent::tr("UdiCPlain");
878 case QBluetoothUuid::McapControlChannel: return QBluetoothServiceDiscoveryAgent::tr("Multi-Channel Adaptation Protocol - Control");
879 case QBluetoothUuid::McapDataChannel: return QBluetoothServiceDiscoveryAgent::tr("Multi-Channel Adaptation Protocol - Data");
880 case QBluetoothUuid::L2cap: return QBluetoothServiceDiscoveryAgent::tr("Layer 2 Control Protocol");
881 default:
882 break;
883 }
884
885 return QString();
886}
887
888/*!
889 Returns a human-readable and translated name for the given characteristic type
890 represented by \a uuid.
891
892 \sa QBluetoothUuid::CharacteristicType
893
894 \since 5.4
895*/
896QString QBluetoothUuid::characteristicToString(CharacteristicType uuid)
897{
898 switch (uuid) {
899 //: GAP: Generic Access Profile (Bluetooth)
900 case QBluetoothUuid::DeviceName: return QBluetoothServiceDiscoveryAgent::tr("GAP Device Name");
901 //: GAP: Generic Access Profile (Bluetooth)
902 case QBluetoothUuid::Appearance: return QBluetoothServiceDiscoveryAgent::tr("GAP Appearance");
903 case QBluetoothUuid::PeripheralPrivacyFlag:
904 //: GAP: Generic Access Profile (Bluetooth)
905 return QBluetoothServiceDiscoveryAgent::tr("GAP Peripheral Privacy Flag");
906 case QBluetoothUuid::ReconnectionAddress:
907 //: GAP: Generic Access Profile (Bluetooth)
908 return QBluetoothServiceDiscoveryAgent::tr("GAP Reconnection Address");
909 case QBluetoothUuid::PeripheralPreferredConnectionParameters:
910 return QBluetoothServiceDiscoveryAgent::tr("GAP Peripheral Preferred Connection Parameters");
911 //: GATT: _G_eneric _Att_ribute Profile (Bluetooth)
912 case QBluetoothUuid::ServiceChanged: return QBluetoothServiceDiscoveryAgent::tr("GATT Service Changed");
913 case QBluetoothUuid::AlertLevel: return QBluetoothServiceDiscoveryAgent::tr("Alert Level");
914 case QBluetoothUuid::TxPowerLevel: return QBluetoothServiceDiscoveryAgent::tr("TX Power");
915 case QBluetoothUuid::DateTime: return QBluetoothServiceDiscoveryAgent::tr("Date Time");
916 case QBluetoothUuid::DayOfWeek: return QBluetoothServiceDiscoveryAgent::tr("Day Of Week");
917 case QBluetoothUuid::DayDateTime: return QBluetoothServiceDiscoveryAgent::tr("Day Date Time");
918 case QBluetoothUuid::ExactTime256: return QBluetoothServiceDiscoveryAgent::tr("Exact Time 256");
919 case QBluetoothUuid::DSTOffset: return QBluetoothServiceDiscoveryAgent::tr("DST Offset");
920 case QBluetoothUuid::TimeZone: return QBluetoothServiceDiscoveryAgent::tr("Time Zone");
921 case QBluetoothUuid::LocalTimeInformation:
922 return QBluetoothServiceDiscoveryAgent::tr("Local Time Information");
923 case QBluetoothUuid::TimeWithDST: return QBluetoothServiceDiscoveryAgent::tr("Time With DST");
924 case QBluetoothUuid::TimeAccuracy: return QBluetoothServiceDiscoveryAgent::tr("Time Accuracy");
925 case QBluetoothUuid::TimeSource: return QBluetoothServiceDiscoveryAgent::tr("Time Source");
926 case QBluetoothUuid::ReferenceTimeInformation:
927 return QBluetoothServiceDiscoveryAgent::tr("Reference Time Information");
928 case QBluetoothUuid::TimeUpdateControlPoint:
929 return QBluetoothServiceDiscoveryAgent::tr("Time Update Control Point");
930 case QBluetoothUuid::TimeUpdateState: return QBluetoothServiceDiscoveryAgent::tr("Time Update State");
931 case QBluetoothUuid::GlucoseMeasurement: return QBluetoothServiceDiscoveryAgent::tr("Glucose Measurement");
932 case QBluetoothUuid::BatteryLevel: return QBluetoothServiceDiscoveryAgent::tr("Battery Level");
933 case QBluetoothUuid::TemperatureMeasurement:
934 return QBluetoothServiceDiscoveryAgent::tr("Temperature Measurement");
935 case QBluetoothUuid::TemperatureType: return QBluetoothServiceDiscoveryAgent::tr("Temperature Type");
936 case QBluetoothUuid::IntermediateTemperature:
937 return QBluetoothServiceDiscoveryAgent::tr("Intermediate Temperature");
938 case QBluetoothUuid::MeasurementInterval: return QBluetoothServiceDiscoveryAgent::tr("Measurement Interval");
939 case QBluetoothUuid::BootKeyboardInputReport: return QBluetoothServiceDiscoveryAgent::tr("Boot Keyboard Input Report");
940 case QBluetoothUuid::SystemID: return QBluetoothServiceDiscoveryAgent::tr("System ID");
941 case QBluetoothUuid::ModelNumberString: return QBluetoothServiceDiscoveryAgent::tr("Model Number String");
942 case QBluetoothUuid::SerialNumberString: return QBluetoothServiceDiscoveryAgent::tr("Serial Number String");
943 case QBluetoothUuid::FirmwareRevisionString: return QBluetoothServiceDiscoveryAgent::tr("Firmware Revision String");
944 case QBluetoothUuid::HardwareRevisionString: return QBluetoothServiceDiscoveryAgent::tr("Hardware Revision String");
945 case QBluetoothUuid::SoftwareRevisionString: return QBluetoothServiceDiscoveryAgent::tr("Software Revision String");
946 case QBluetoothUuid::ManufacturerNameString: return QBluetoothServiceDiscoveryAgent::tr("Manufacturer Name String");
947 case QBluetoothUuid::IEEE1107320601RegulatoryCertificationDataList:
948 return QBluetoothServiceDiscoveryAgent::tr("IEEE 11073 20601 Regulatory Certification Data List");
949 case QBluetoothUuid::CurrentTime: return QBluetoothServiceDiscoveryAgent::tr("Current Time");
950 case QBluetoothUuid::ScanRefresh: return QBluetoothServiceDiscoveryAgent::tr("Scan Refresh");
951 case QBluetoothUuid::BootKeyboardOutputReport:
952 return QBluetoothServiceDiscoveryAgent::tr("Boot Keyboard Output Report");
953 case QBluetoothUuid::BootMouseInputReport: return QBluetoothServiceDiscoveryAgent::tr("Boot Mouse Input Report");
954 case QBluetoothUuid::GlucoseMeasurementContext:
955 return QBluetoothServiceDiscoveryAgent::tr("Glucose Measurement Context");
956 case QBluetoothUuid::BloodPressureMeasurement:
957 return QBluetoothServiceDiscoveryAgent::tr("Blood Pressure Measurement");
958 case QBluetoothUuid::IntermediateCuffPressure:
959 return QBluetoothServiceDiscoveryAgent::tr("Intermediate Cuff Pressure");
960 case QBluetoothUuid::HeartRateMeasurement: return QBluetoothServiceDiscoveryAgent::tr("Heart Rate Measurement");
961 case QBluetoothUuid::BodySensorLocation: return QBluetoothServiceDiscoveryAgent::tr("Body Sensor Location");
962 case QBluetoothUuid::HeartRateControlPoint: return QBluetoothServiceDiscoveryAgent::tr("Heart Rate Control Point");
963 case QBluetoothUuid::AlertStatus: return QBluetoothServiceDiscoveryAgent::tr("Alert Status");
964 case QBluetoothUuid::RingerControlPoint: return QBluetoothServiceDiscoveryAgent::tr("Ringer Control Point");
965 case QBluetoothUuid::RingerSetting: return QBluetoothServiceDiscoveryAgent::tr("Ringer Setting");
966 case QBluetoothUuid::AlertCategoryIDBitMask:
967 return QBluetoothServiceDiscoveryAgent::tr("Alert Category ID Bit Mask");
968 case QBluetoothUuid::AlertCategoryID: return QBluetoothServiceDiscoveryAgent::tr("Alert Category ID");
969 case QBluetoothUuid::AlertNotificationControlPoint:
970 return QBluetoothServiceDiscoveryAgent::tr("Alert Notification Control Point");
971 case QBluetoothUuid::UnreadAlertStatus: return QBluetoothServiceDiscoveryAgent::tr("Unread Alert Status");
972 case QBluetoothUuid::NewAlert: return QBluetoothServiceDiscoveryAgent::tr("New Alert");
973 case QBluetoothUuid::SupportedNewAlertCategory:
974 return QBluetoothServiceDiscoveryAgent::tr("Supported New Alert Category");
975 case QBluetoothUuid::SupportedUnreadAlertCategory:
976 return QBluetoothServiceDiscoveryAgent::tr("Supported Unread Alert Category");
977 case QBluetoothUuid::BloodPressureFeature: return QBluetoothServiceDiscoveryAgent::tr("Blood Pressure Feature");
978 //: HID: Human Interface Device Profile (Bluetooth)
979 case QBluetoothUuid::HIDInformation: return QBluetoothServiceDiscoveryAgent::tr("HID Information");
980 case QBluetoothUuid::ReportMap: return QBluetoothServiceDiscoveryAgent::tr("Report Map");
981 //: HID: Human Interface Device Profile (Bluetooth)
982 case QBluetoothUuid::HIDControlPoint: return QBluetoothServiceDiscoveryAgent::tr("HID Control Point");
983 case QBluetoothUuid::Report: return QBluetoothServiceDiscoveryAgent::tr("Report");
984 case QBluetoothUuid::ProtocolMode: return QBluetoothServiceDiscoveryAgent::tr("Protocol Mode");
985 case QBluetoothUuid::ScanIntervalWindow: return QBluetoothServiceDiscoveryAgent::tr("Scan Interval Window");
986 case QBluetoothUuid::PnPID: return QBluetoothServiceDiscoveryAgent::tr("PnP ID");
987 case QBluetoothUuid::GlucoseFeature: return QBluetoothServiceDiscoveryAgent::tr("Glucose Feature");
988 case QBluetoothUuid::RecordAccessControlPoint:
989 //: Glucose Sensor patient record database.
990 return QBluetoothServiceDiscoveryAgent::tr("Record Access Control Point");
991 //: RSC: Running Speed and Cadence
992 case QBluetoothUuid::RSCMeasurement: return QBluetoothServiceDiscoveryAgent::tr("RSC Measurement");
993 //: RSC: Running Speed and Cadence
994 case QBluetoothUuid::RSCFeature: return QBluetoothServiceDiscoveryAgent::tr("RSC Feature");
995 case QBluetoothUuid::SCControlPoint: return QBluetoothServiceDiscoveryAgent::tr("SC Control Point");
996 //: CSC: Cycling Speed and Cadence
997 case QBluetoothUuid::CSCMeasurement: return QBluetoothServiceDiscoveryAgent::tr("CSC Measurement");
998 //: CSC: Cycling Speed and Cadence
999 case QBluetoothUuid::CSCFeature: return QBluetoothServiceDiscoveryAgent::tr("CSC Feature");
1000 case QBluetoothUuid::SensorLocation: return QBluetoothServiceDiscoveryAgent::tr("Sensor Location");
1001 case QBluetoothUuid::CyclingPowerMeasurement:
1002 return QBluetoothServiceDiscoveryAgent::tr("Cycling Power Measurement");
1003 case QBluetoothUuid::CyclingPowerVector: return QBluetoothServiceDiscoveryAgent::tr("Cycling Power Vector");
1004 case QBluetoothUuid::CyclingPowerFeature: return QBluetoothServiceDiscoveryAgent::tr("Cycling Power Feature");
1005 case QBluetoothUuid::CyclingPowerControlPoint:
1006 return QBluetoothServiceDiscoveryAgent::tr("Cycling Power Control Point");
1007 case QBluetoothUuid::LocationAndSpeed: return QBluetoothServiceDiscoveryAgent::tr("Location And Speed");
1008 case QBluetoothUuid::Navigation: return QBluetoothServiceDiscoveryAgent::tr("Navigation");
1009 case QBluetoothUuid::PositionQuality: return QBluetoothServiceDiscoveryAgent::tr("Position Quality");
1010 case QBluetoothUuid::LNFeature: return QBluetoothServiceDiscoveryAgent::tr("LN Feature");
1011 case QBluetoothUuid::LNControlPoint: return QBluetoothServiceDiscoveryAgent::tr("LN Control Point");
1012 case QBluetoothUuid::MagneticDeclination:
1013 //: Angle between geographic and magnetic north
1014 return QBluetoothServiceDiscoveryAgent::tr("Magnetic Declination");
1015 //: Above/below sea level
1016 case QBluetoothUuid::Elevation: return QBluetoothServiceDiscoveryAgent::tr("Elevation");
1017 case QBluetoothUuid::Pressure: return QBluetoothServiceDiscoveryAgent::tr("Pressure");
1018 case QBluetoothUuid::Temperature: return QBluetoothServiceDiscoveryAgent::tr("Temperature");
1019 case QBluetoothUuid::Humidity: return QBluetoothServiceDiscoveryAgent::tr("Humidity");
1020 //: Wind speed while standing
1021 case QBluetoothUuid::TrueWindSpeed: return QBluetoothServiceDiscoveryAgent::tr("True Wind Speed");
1022 case QBluetoothUuid::TrueWindDirection : return QBluetoothServiceDiscoveryAgent::tr("True Wind Direction");
1023 case QBluetoothUuid::ApparentWindSpeed:
1024 //: Wind speed while observer is moving
1025 return QBluetoothServiceDiscoveryAgent::tr("Apparent Wind Speed");
1026 case QBluetoothUuid::ApparentWindDirection: return QBluetoothServiceDiscoveryAgent::tr("Apparent Wind Direction");
1027 case QBluetoothUuid::GustFactor:
1028 //: Factor by which wind gust is stronger than average wind
1029 return QBluetoothServiceDiscoveryAgent::tr("Gust Factor");
1030 case QBluetoothUuid::PollenConcentration: return QBluetoothServiceDiscoveryAgent::tr("Pollen Concentration");
1031 case QBluetoothUuid::UVIndex: return QBluetoothServiceDiscoveryAgent::tr("UV Index");
1032 case QBluetoothUuid::Irradiance: return QBluetoothServiceDiscoveryAgent::tr("Irradiance");
1033 case QBluetoothUuid::Rainfall: return QBluetoothServiceDiscoveryAgent::tr("Rainfall");
1034 case QBluetoothUuid::WindChill: return QBluetoothServiceDiscoveryAgent::tr("Wind Chill");
1035 case QBluetoothUuid::HeatIndex: return QBluetoothServiceDiscoveryAgent::tr("Heat Index");
1036 case QBluetoothUuid::DewPoint: return QBluetoothServiceDiscoveryAgent::tr("Dew Point");
1037 case QBluetoothUuid::DescriptorValueChanged:
1038 //: Environmental sensing related
1039 return QBluetoothServiceDiscoveryAgent::tr("Descriptor Value Changed");
1040 case QBluetoothUuid::AerobicHeartRateLowerLimit:
1041 return QBluetoothServiceDiscoveryAgent::tr("Aerobic Heart Rate Lower Limit");
1042 case QBluetoothUuid::AerobicHeartRateUpperLimit:
1043 return QBluetoothServiceDiscoveryAgent::tr("Aerobic Heart Rate Upper Limit");
1044 case QBluetoothUuid::AerobicThreshold: return QBluetoothServiceDiscoveryAgent::tr("Aerobic Threshold");
1045 //: Age of person
1046 case QBluetoothUuid::Age: return QBluetoothServiceDiscoveryAgent::tr("Age");
1047 case QBluetoothUuid::AnaerobicHeartRateLowerLimit:
1048 return QBluetoothServiceDiscoveryAgent::tr("Anaerobic Heart Rate Lower Limit");
1049 case QBluetoothUuid::AnaerobicHeartRateUpperLimit:
1050 return QBluetoothServiceDiscoveryAgent::tr("Anaerobic Heart Rate Upper Limit");
1051 case QBluetoothUuid::AnaerobicThreshold: return QBluetoothServiceDiscoveryAgent::tr("Anaerobic Threshold");
1052 case QBluetoothUuid::DateOfBirth: return QBluetoothServiceDiscoveryAgent::tr("Date Of Birth");
1053 case QBluetoothUuid::DateOfThresholdAssessment: return QBluetoothServiceDiscoveryAgent::tr("Date Of Threshold Assessment");
1054 case QBluetoothUuid::EmailAddress: return QBluetoothServiceDiscoveryAgent::tr("Email Address");
1055 case QBluetoothUuid::FatBurnHeartRateLowerLimit:
1056 return QBluetoothServiceDiscoveryAgent::tr("Fat Burn Heart Rate Lower Limit");
1057 case QBluetoothUuid::FatBurnHeartRateUpperLimit:
1058 return QBluetoothServiceDiscoveryAgent::tr("Fat Burn Heart Rate Upper Limit");
1059 case QBluetoothUuid::FirstName: return QBluetoothServiceDiscoveryAgent::tr("First Name");
1060 case QBluetoothUuid::FiveZoneHeartRateLimits: return QBluetoothServiceDiscoveryAgent::tr("5-Zone Heart Rate Limits");
1061 case QBluetoothUuid::Gender: return QBluetoothServiceDiscoveryAgent::tr("Gender");
1062 case QBluetoothUuid::HeartRateMax: return QBluetoothServiceDiscoveryAgent::tr("Heart Rate Maximum");
1063 //: Height of a person
1064 case QBluetoothUuid::Height: return QBluetoothServiceDiscoveryAgent::tr("Height");
1065 case QBluetoothUuid::HipCircumference: return QBluetoothServiceDiscoveryAgent::tr("Hip Circumference");
1066 case QBluetoothUuid::LastName: return QBluetoothServiceDiscoveryAgent::tr("Last Name");
1067 case QBluetoothUuid::MaximumRecommendedHeartRate:
1068 return QBluetoothServiceDiscoveryAgent::tr("Maximum Recommended Heart Rate");
1069 case QBluetoothUuid::RestingHeartRate: return QBluetoothServiceDiscoveryAgent::tr("Resting Heart Rate");
1070 case QBluetoothUuid::SportTypeForAerobicAnaerobicThresholds:
1071 return QBluetoothServiceDiscoveryAgent::tr("Sport Type For Aerobic/Anaerobic Thresholds");
1072 case QBluetoothUuid::ThreeZoneHeartRateLimits: return QBluetoothServiceDiscoveryAgent::tr("3-Zone Heart Rate Limits");
1073 case QBluetoothUuid::TwoZoneHeartRateLimits: return QBluetoothServiceDiscoveryAgent::tr("2-Zone Heart Rate Limits");
1074 case QBluetoothUuid::VO2Max: return QBluetoothServiceDiscoveryAgent::tr("Oxygen Uptake");
1075 case QBluetoothUuid::WaistCircumference: return QBluetoothServiceDiscoveryAgent::tr("Waist Circumference");
1076 case QBluetoothUuid::Weight: return QBluetoothServiceDiscoveryAgent::tr("Weight");
1077 case QBluetoothUuid::DatabaseChangeIncrement:
1078 //: Environmental sensing related
1079 return QBluetoothServiceDiscoveryAgent::tr("Database Change Increment");
1080 case QBluetoothUuid::UserIndex: return QBluetoothServiceDiscoveryAgent::tr("User Index");
1081 case QBluetoothUuid::BodyCompositionFeature: return QBluetoothServiceDiscoveryAgent::tr("Body Composition Feature");
1082 case QBluetoothUuid::BodyCompositionMeasurement: return QBluetoothServiceDiscoveryAgent::tr("Body Composition Measurement");
1083 case QBluetoothUuid::WeightMeasurement: return QBluetoothServiceDiscoveryAgent::tr("Weight Measurement");
1084 case QBluetoothUuid::UserControlPoint: return QBluetoothServiceDiscoveryAgent::tr("User Control Point");
1085 case QBluetoothUuid::MagneticFluxDensity2D: return QBluetoothServiceDiscoveryAgent::tr("Magnetic Flux Density 2D");
1086 case QBluetoothUuid::MagneticFluxDensity3D: return QBluetoothServiceDiscoveryAgent::tr("Magnetic Flux Density 3D");
1087 case QBluetoothUuid::Language: return QBluetoothServiceDiscoveryAgent::tr("Language");
1088 case QBluetoothUuid::BarometricPressureTrend: return QBluetoothServiceDiscoveryAgent::tr("Barometric Pressure Trend");
1089 default:
1090 break;
1091 }
1092
1093 return QString();
1094}
1095
1096/*!
1097 Returns a human-readable and translated name for the given descriptor type
1098 represented by \a uuid.
1099
1100 \sa QBluetoothUuid::DescriptorType
1101
1102 \since 5.4
1103*/
1104QString QBluetoothUuid::descriptorToString(QBluetoothUuid::DescriptorType uuid)
1105{
1106 switch (uuid) {
1107 case QBluetoothUuid::CharacteristicExtendedProperties:
1108 return QBluetoothServiceDiscoveryAgent::tr("Characteristic Extended Properties");
1109 case QBluetoothUuid::CharacteristicUserDescription:
1110 return QBluetoothServiceDiscoveryAgent::tr("Characteristic User Description");
1111 case QBluetoothUuid::ClientCharacteristicConfiguration:
1112 return QBluetoothServiceDiscoveryAgent::tr("Client Characteristic Configuration");
1113 case QBluetoothUuid::ServerCharacteristicConfiguration:
1114 return QBluetoothServiceDiscoveryAgent::tr("Server Characteristic Configuration");
1115 case QBluetoothUuid::CharacteristicPresentationFormat:
1116 return QBluetoothServiceDiscoveryAgent::tr("Characteristic Presentation Format");
1117 case QBluetoothUuid::CharacteristicAggregateFormat:
1118 return QBluetoothServiceDiscoveryAgent::tr("Characteristic Aggregate Format");
1119 case QBluetoothUuid::ValidRange:
1120 return QBluetoothServiceDiscoveryAgent::tr("Valid Range");
1121 case QBluetoothUuid::ExternalReportReference:
1122 return QBluetoothServiceDiscoveryAgent::tr("External Report Reference");
1123 case QBluetoothUuid::ReportReference:
1124 return QBluetoothServiceDiscoveryAgent::tr("Report Reference");
1125 case QBluetoothUuid::EnvironmentalSensingConfiguration:
1126 return QBluetoothServiceDiscoveryAgent::tr("Environmental Sensing Configuration");
1127 case QBluetoothUuid::EnvironmentalSensingMeasurement:
1128 return QBluetoothServiceDiscoveryAgent::tr("Environmental Sensing Measurement");
1129 case QBluetoothUuid::EnvironmentalSensingTriggerSetting:
1130 return QBluetoothServiceDiscoveryAgent::tr("Environmental Sensing Trigger Setting");
1131 default:
1132 break;
1133 }
1134
1135 return QString();
1136}
1137
1138/*!
1139 Returns \c true if \a other is equal to this Bluetooth UUID, otherwise \c false.
1140*/
1141bool QBluetoothUuid::operator==(const QBluetoothUuid &other) const
1142{
1143 return QUuid::operator==(other);
1144}
1145
1146/*!
1147 \fn bool QBluetoothUuid::operator!=(const QBluetoothUuid &other) const
1148 Returns \c true if \a other is not equal to this Bluetooth UUID, otherwise \c false.
1149 \since 5.7
1150*/
1151
1152QT_END_NAMESPACE
1153