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

source code of qtconnectivity/src/bluetooth/qbluetoothuuid.cpp