Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QBluetoothSdpUuid Class Reference
[QtBluetoothModule]

The QBluetoothSdpUuid class encapsulates Unique Identifiers defined and used by the Bluetooth Service Discovery Protocol. More...

    #include <QBluetoothSdpUuid>

Public Types

Public Functions

Static Public Members


Detailed Description

The QBluetoothSdpUuid class encapsulates Unique Identifiers defined and used by the Bluetooth Service Discovery Protocol.

There are three UUID sizes: 16 bit, 32 bit and 128 bit. The 16 bit and 32 bit UUIDs can be upward converted to a 128 bit UUID.

All values to this class should be given in host byte order. They will be converted to the appropriate byte ordering automatically.


Member Type Documentation

enum QBluetoothSdpUuid::Type

Defines the size of the UUID.

ConstantValueDescription
QBluetoothSdpUuid::UUID16016 bit UUID.
QBluetoothSdpUuid::UUID32132 bit UUID.
QBluetoothSdpUuid::UUID1282128 bit UUID.


Member Function Documentation

QBluetoothSdpUuid::QBluetoothSdpUuid ()

Constructs a new invalid UUID.

See also isValid().

QBluetoothSdpUuid::QBluetoothSdpUuid ( quint16 data )

Constructs a new 16 bit UUID with the value given by data. The type of the UUID will be UUID16

See also isValid().

QBluetoothSdpUuid::QBluetoothSdpUuid ( quint32 data )

Constructs a new 32 bit UUID with the value given by data. The type of the UUID will be UUID32

See also isValid().

QBluetoothSdpUuid::QBluetoothSdpUuid ( quint128 data )

Constructs a new 128 bit UUID with the value given by data. The type of the UUID will be UUID128

See also isValid().

QBluetoothSdpUuid::QBluetoothSdpUuid ( const QString & str )

Constructs a new UUID from a string representation str. The UUID type will be inferred from the size and format of the string. If the string is not in a valid format, an invalid UUID is created.

See also isValid().

QBluetoothSdpUuid::QBluetoothSdpUuid ( const QBluetoothSdpUuid & other )

Constructs a UUID from a UUID given by other.

QBluetoothSdpUuid::~QBluetoothSdpUuid ()

Deconstructs a UUID.

QBluetoothSdpUuid QBluetoothSdpUuid::create128Bit ( quint128 id )   [static]

This is a convenience method for creating 128 bit UUIDs. The id parameter specifies the 128 bit id to create.

See also create16Bit() and create32Bit().

QBluetoothSdpUuid QBluetoothSdpUuid::create16Bit ( quint16 id )   [static]

This is a convenience method for creating 16 bit UUIDs. The id parameter specifies the 16 bit id to create.

See also create32Bit() and create128Bit().

QBluetoothSdpUuid QBluetoothSdpUuid::create32Bit ( quint32 id )   [static]

This is a convenience method for creating 32 bit UUIDs. The id parameter specifies the 32 bit id to create.

See also create16Bit() and create128Bit().

QBluetoothSdpUuid QBluetoothSdpUuid::fromProfile ( QBluetooth::SDPProfile profile )   [static]

This is a convenience method for creating a QBluetoothSdpUuid from profile. The profile enumeration is converted to a Bluetooth assigned number corresponding to the the profile UUID.

bool QBluetoothSdpUuid::isValid () const

Returns whether the UUID is valid.

QString QBluetoothSdpUuid::toString () const

Converts a UUID into string form.

If the UUID is a 16 bit UUID, the string returned will be in this format: 0xXXXX, where X represents a hexadecimal number. The string will be 0-padded, e.g. 0x00FF.

If the UUID is a 32 bit UUID, the string returned will be in this format: 0xXXXXXXXX where X represents a hexadecimal number. The string will be 0-padded, e.g. 0x0000FFFFFF.

If the UUID is a 128 bit UUID, the string returned will be in the format of: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX where X is a hexadecimal number.

QBluetoothSdpUuid QBluetoothSdpUuid::toUuid128 () const

Converts a 16 or 32 bit UUID to a 128 bit UUID and returns the result. If the UUID is already a 128 bit UUID, a copy of the current object is returned.

See also type().

QBluetoothSdpUuid::Type QBluetoothSdpUuid::type () const

Returns the type of the UUID.

See also uuid().

QVariant QBluetoothSdpUuid::uuid ()

Returns the uuid as a QVariant. The QVariant should be interpreted based on the QBluetoothSdpUuid type. E.g. quint16 if type is UUID16, quint32 if type is UUID32, and quint128 if type is UUID128.

See also type().

bool QBluetoothSdpUuid::operator!= ( const QBluetoothSdpUuid & other ) const

This function returns true if UUID in the current does not match the UUID given by other.

See also operator==().

QBluetoothSdpUuid & QBluetoothSdpUuid::operator= ( const QBluetoothSdpUuid & other )

Assigns the contents of UUID other to the current UUID object.

bool QBluetoothSdpUuid::operator== ( const QBluetoothSdpUuid & other ) const

Compares the current UUID to uuid given by other. If the types do not match, the UUIDs are converted to 128 bit UUIDs and are bitwise compared. The method returns true if uuids match, false otherwise.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3