- Qt 5.3
- Qt Bluetooth
- C++ Classes
- QBluetoothUuid
- Qt 5.3.2 Reference Documentation

# QBluetoothUuid Class

The QBluetoothUuid class generates a UUID for each Bluetooth service. More...

Header: | `#include <QBluetoothUuid>`
qmake: | `QT += bluetooth`

- List of all members, including inherited members

## Public Types

enum | ProtocolUuid { Sdp, Udp, Rfcomm, Tcp, ..., L2cap }
enum | ServiceClassUuid { ServiceDiscoveryServer, BrowseGroupDescriptor, PublicBrowseGroup, SerialPort, ..., HDPSink }

## Public Functions

| QBluetoothUuid()
| QBluetoothUuid(ProtocolUuid uuid)
| QBluetoothUuid(ServiceClassUuid uuid)
| QBluetoothUuid(quint16 uuid)
| QBluetoothUuid(quint32 uuid)
| QBluetoothUuid(quint128 uuid)
| QBluetoothUuid(const QString & uuid)
| QBluetoothUuid(const QBluetoothUuid & uuid)
| QBluetoothUuid(const QUuid & uuid)
| ~QBluetoothUuid()
int | minimumSize() const
quint16 | toUInt16(bool * ok = 0) const
quint32 | toUInt32(bool * ok = 0) const
quint128 | toUInt128() const
bool | operator==(const QBluetoothUuid & other) const

## Detailed Description

The QBluetoothUuid class generates a UUID for each Bluetooth service.

## Member Type Documentation

### enum QBluetoothUuid::ProtocolUuid

This enum is a convienience type for Bluetooth protocol UUIDs. Values of this type will be implicitly converted into a QBluetoothUuid when necessary.

Constant | Value | Description
--- | --- | ---
`QBluetoothUuid::Sdp` | `0x0001` | SDP protocol UUID
`QBluetoothUuid::Udp` | `0x0002` | UDP protocol UUID
`QBluetoothUuid::Rfcomm` | `0x0003` | RFCOMM protocol UUID
`QBluetoothUuid::Tcp` | `0x0004` | TCP protocol UUID
`QBluetoothUuid::TcsBin` | `0x0005` | Telephony Control Specification UUID
`QBluetoothUuid::TcsAt` | `0x0006` | Telephony Control Specification AT UUID
`QBluetoothUuid::Att` | `0x0007` | Attribute protocol UUID
`QBluetoothUuid::Obex` | `0x0008` | OBEX protocol UUID
`QBluetoothUuid::Ip` | `0x0009` | IP protocol UUID
`QBluetoothUuid::Ftp` | `0x000A` | FTP protocol UUID
`QBluetoothUuid::Http` | `0x000C` | HTTP protocol UUID
`QBluetoothUuid::Wsp` | `0x000E` | WSP UUID
`QBluetoothUuid::Bnep` | `0x000F` | Bluetooth Network Encapsulation Protocol UUID
`QBluetoothUuid::Upnp` | `0x0010` | Extended Service Discovery Profile UUID
`QBluetoothUuid::Hidp` | `0x0011` | Human Interface Device Profile UUID
`QBluetoothUuid::HardcopyControlChannel` | `0x0012` | Hardcopy Cable Replacement Profile UUID
`QBluetoothUuid::HardcopyDataChannel` | `0x0014` | Hardcopy Cable Replacement Profile UUID
`QBluetoothUuid::HardcopyNotification` | `0x0016` | Hardcopy Cable Replacement Profile UUID
`QBluetoothUuid::Avctp` | `0x0017` | Audio/Video Control Transport Protocol UUID
`QBluetoothUuid::Avdtp` | `0x0019` | Audio/Video Distribution Transport Protocol UUID
`QBluetoothUuid::Cmtp` | `0x001B` | Common ISDN Access Profile
`QBluetoothUuid::UdiCPlain` | `0x001D` | UDI protocol UUID
`QBluetoothUuid::McapControlChannel` | `0x001E` | Multi-Channel Adaptation Protocol UUID
`QBluetoothUuid::McapDataChannel` | `0x001F` | Multi-Channel Adaptation Protocol UUID
`QBluetoothUuid::L2cap` | `0x0100` | L2CAP protocol UUID

See also QBluetoothServiceInfo::ProtocolDescriptorList.

### enum QBluetoothUuid::ServiceClassUuid

This enum is a convienience type for Bluetooth service class and profile UUIDs. Values of this type will be implicitly converted into a QBluetoothUuid when necessary. Some UUIDs refer to service class ids, others to profile ids and some can be used as both. In general, profile UUIDs shall only be used in a QBluetoothServiceInfo::BluetoothProfileDescriptorList attribute and service class UUIDs shall only be used in a QBluetoothServiceInfo::ServiceClassIds attribute. If the UUID is marked as profile and service class UUID it can be used as a value for either of the above service attributes. Such a dual use has historical reasons but is no longer permissible for newer UUIDs.

The list below explicitly states as what type each UUID shall be used.

Constant | Value | Description
--- | --- | ---
`QBluetoothUuid::ServiceDiscoveryServer` | `0x1000` | Service discovery server UUID (service)
`QBluetoothUuid::BrowseGroupDescriptor` | `0x1001` | Browser group descriptor (service)
`QBluetoothUuid::PublicBrowseGroup` | `0x1002` | Public browse group service class. Services which have the public browse group in their browse group list are discoverable by the remote devices.
`QBluetoothUuid::SerialPort` | `0x1101` | Serial Port Profile UUID (service & profile)
`QBluetoothUuid::LANAccessUsingPPP` | `0x1102` | LAN Access Profile UUID (service & profile)
`QBluetoothUuid::DialupNetworking` | `0x1103` | Dial-up Networking Profile UUID (service & profile)
`QBluetoothUuid::IrMCSync` | `0x1104` | Synchronization Profile UUID (service & profile)
`QBluetoothUuid::ObexObjectPush` | `0x1105` | OBEX object push service UUID (service & profile)
`QBluetoothUuid::OBEXFileTransfer` | `0x1106` | File Transfer Profile (FTP) UUID (service & profile)
`QBluetoothUuid::IrMCSyncCommand` | `0x1107` | Synchronization Profile UUID (profile)
`QBluetoothUuid::Headset` | `0x1108` | Headset Profile (HSP) UUID (service & profile)
`QBluetoothUuid::AudioSource` | `0x110a` | Advanced Audio Distribution Profile (A2DP) UUID (service)
`QBluetoothUuid::AudioSink` | `0x110b` | Advanced Audio Distribution Profile (A2DP) UUID (service)
`QBluetoothUuid::AV_RemoteControlTarget` | `0x110c` | Audio/Video Remote Control Profile (AVRCP) UUID (service)
`QBluetoothUuid::AdvancedAudioDistribution` | `0x110d` | Advanced Audio Distribution Profile (A2DP) UUID (profile)
`QBluetoothUuid::AV_RemoteControl` | `0x110e` | Audio/Video Remote Control Profile (AVRCP) UUID (service & profile)
`QBluetoothUuid::AV_RemoteControlController` | `0x110f` | Audio/Video Remote Control Profile UUID (service)
`QBluetoothUuid::HeadsetAG` | `0x1112` | Headset Profile (HSP) UUID (service)
`QBluetoothUuid::PANU` | `0x1115` | Personal Area Networking Profile (PAN) UUID (service & profile)
`QBluetoothUuid::NAP` | `0x1116` | Personal Area Networking Profile (PAN) UUID (service & profile)
`QBluetoothUuid::GN` | `0x1117` | Personal Area Networking Profile (PAN) UUID (service & profile)
`QBluetoothUuid::DirectPrinting` | `0x1118` | Basic Printing Profile (BPP) UUID (service)
`QBluetoothUuid::ReferencePrinting` | `0x1119` | Related to Basic Printing Profile (BPP) UUID (service)
`QBluetoothUuid::BasicImage` | `0x111a` | Basic Imaging Profile (BIP) UUID (profile)
`QBluetoothUuid::ImagingResponder` | `0x111b` | Basic Imaging Profile (BIP) UUID (service)
`QBluetoothUuid::ImagingAutomaticArchive` | `0x111c` | Basic Imaging Profile (BIP) UUID (service)
`QBluetoothUuid::ImagingReferenceObjects` | `0x111d` | Basic Imaging Profile (BIP) UUID (service)
`QBluetoothUuid::Handsfree` | `0x111e` | Hands-Free Profile (HFP) UUID (service & profile)
`QBluetoothUuid::HandsfreeAudioGateway` | `0x111f` | Hands-Free Audio Gateway (HFP) UUID (service)
`QBluetoothUuid::DirectPrintingReferenceObjectsService` | `0x1120` | Basic Printing Profile (BPP) UUID (service)
`QBluetoothUuid::ReflectedUI` | `0x1121` | Basic Printing Profile (BPP) UUID (service)
`QBluetoothUuid::BasicPrinting` | `0x1122` | Basic Printing Profile (BPP) UUID (profile)
`QBluetoothUuid::PrintingStatus` | `0x1123` | Basic Printing Profile (BPP) UUID (service)
`QBluetoothUuid::HumanInterfaceDeviceService` | `0x1124` | Human Interface Device (HID) UUID (service & profile)
`QBluetoothUuid::HardcopyCableReplacement` | `0x1125` | Hardcopy Cable Replacement Profile (HCRP) (profile)
`QBluetoothUuid::HCRPrint` | `0x1126` | Hardcopy Cable Replacement Profile (HCRP) (service)
`QBluetoothUuid::HCRScan` | `0x1127` | Hardcopy Cable Replacement Profile (HCRP) (service)
`QBluetoothUuid::SIMAccess` | `0x112d` | SIM Access Profile (SAP) UUID (service and profile)
`QBluetoothUuid::PhonebookAccessPCE` | `0x112e` | Phonebook Access Profile (PBAP) UUID (service)
`QBluetoothUuid::PhonebookAccessPSE` | `0x112f` | Phonebook Access Profile (PBAP) UUID (service)
`QBluetoothUuid::PhonebookAccess` | `0x1130` | Phonebook Access Profile (PBAP) (profile)
`QBluetoothUuid::HeadsetHS` | `0x1131` | Headset Profile (HSP) UUID (service)
`QBluetoothUuid::MessageAccessServer` | `0x1132` | Message Access Profile (MAP) UUID (service)
`QBluetoothUuid::MessageNotificationServer` | `0x1133` | Message Access Profile (MAP) UUID (service)
`QBluetoothUuid::MessageAccessProfile` | `0x1134` | Message Access Profile (MAP) UUID (profile)
`QBluetoothUuid::GNSS` | `0x1135` | Global Navigation Satellite System UUID (profile)
`QBluetoothUuid::GNSSServer` | `0x1136` | Global Navigation Satellite System Server (UUID) (service)
`QBluetoothUuid::Display3D` | `0x1137` | 3D Synchronization Display UUID (service)
`QBluetoothUuid::Glasses3D` | `0x1138` | 3D Synchronization Glasses UUID (service)
`QBluetoothUuid::Synchronization3D` | `0x1139` | 3D Synchronization UUID (profile)
`QBluetoothUuid::MPSProfile` | `0x113a` | Multi-Profile Specification UUID (profile)
`QBluetoothUuid::MPSService` | `0x113b` | Multi-Profile Specification UUID (service)
`QBluetoothUuid::PnPInformation` | `0x1200` | Device Identification (DID) UUID (service & profile)
`QBluetoothUuid::GenericNetworking` | `0x1201` | Generic networking UUID (service)
`QBluetoothUuid::GenericFileTransfer` | `0x1202` | Generic file transfer UUID (service)
`QBluetoothUuid::GenericAudio` | `0x1203` | Generic audio UUID (service)
`QBluetoothUuid::GenericTelephony` | `0x1204` | Generic telephone UUID (service)
`QBluetoothUuid::VideoSource` | `0x1303` | Video Distribution Profile (VDP) UUID (service)
`QBluetoothUuid::VideoSink` | `0x1304` | Video Distribution Profile (VDP) UUID (service)
`QBluetoothUuid::VideoDistribution` | `0x1305` | Video Distribution Profile (VDP) UUID (profile)
`QBluetoothUuid::HDP` | `0x1400` | Health Device Profile (HDP) UUID (profile)
`QBluetoothUuid::HDPSource` | `0x1401` | Health Device Profile Source (HDP) UUID (service)
`QBluetoothUuid::HDPSink` | `0x1402` | Health Device Profile Sink (HDP) UUID (service)

See also QBluetoothServiceInfo::ServiceClassIds.

## Member Function Documentation

### QBluetoothUuid::QBluetoothUuid()

Constructs a new null Bluetooth UUID.

### QBluetoothUuid::QBluetoothUuid(ProtocolUuid uuid)

Constructs a new Bluetooth UUID from the protocol uuid.

### QBluetoothUuid::QBluetoothUuid(ServiceClassUuid uuid)

Constructs a new Bluetooth UUID from the service class uuid.

### QBluetoothUuid::QBluetoothUuid(quint16 uuid)

Constructs a new Bluetooth UUID from the 16 bit uuid.

### QBluetoothUuid::QBluetoothUuid(quint32 uuid)

Constructs a new Bluetooth UUID from the 32 bit uuid.

### QBluetoothUuid::QBluetoothUuid(quint128 uuid)

Constructs a new Bluetooth UUID from the 128 bit uuid.

### QBluetoothUuid::QBluetoothUuid(const QString & uuid)

Constructs a new Bluetooth UUID from the uuid string.

The string must be in the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

### QBluetoothUuid::QBluetoothUuid(const QBluetoothUuid & uuid)

Constructs a new Bluetooth UUID that is a copy of uuid.

### QBluetoothUuid::QBluetoothUuid(const QUuid & uuid)

Constructs a new Bluetooth UUID that is a copy of uuid.

### QBluetoothUuid::~QBluetoothUuid()

Destroys the Bluetooth UUID.

### int QBluetoothUuid::minimumSize() const

Returns the minimum size in bytes that this UUID can be represented in. For non-null UUIDs 2, 4 or 16 is returned. 0 is returned for null UUIDs.

See also isNull(), toUInt16(), toUInt32(), and toUInt128().

### quint16 QBluetoothUuid::toUInt16(bool * ok = 0) const

Returns the 16 bit representation of this UUID. If ok is passed, it is set to true if the conversion is possible, otherwise it is set to false. The return value is undefined if ok is set to false.

### quint32 QBluetoothUuid::toUInt32(bool * ok = 0) const

Returns the 32 bit representation of this UUID. If ok is passed, it is set to true if the conversion is possible, otherwise it is set to false. The return value is undefined if ok is set to false.

### quint128 QBluetoothUuid::toUInt128() const

Returns the 128 bit representation of this UUID.

### bool QBluetoothUuid::operator==(const QBluetoothUuid & other) const

Returns true if other is equal to this Bluetooth UUID, otherwise false.