Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: btsdp.h
Link against: bluetooth.lib

Class TUUID

TUUID

Support

Supported from 6.1

Description

A Bluetooth Universally Unique Identifier.

This is a 128-bit quantity that can be created without a central registry while still being globally unique. UUIDs are always held in full 128-bit format, however they can be set from BT SIG short form (16 or 32 bit) addresses, and returned in their shortest form using ShortestForm().

See the [BS1 SDP] specification for more on UUIDs.

Defined in TUUID:
Des(), LongForm(), SetL(), ShortestForm(), TUUID(), operator!=(), operator==(), operator[]()


Construction


TUUID()

TUUID();

Description

Default constructor.

The UUID is set to 0.


TUUID()

TUUID(TUint32 aLong);

Description

Constructs a short-form UUID.

The Bluetooth base UUID is appended to the value passed. Use this form of constructor for building 16- or 32-bit short-form UUIDs.

Parameters

TUint32 aLong

Value for the UUID


TUUID()

TUUID(TUint32 aHH, TUint32 aHL, TUint32 aLH, TUint32 aLL);

Description

Constructs a 128-bit UUID.

Use this constructor to build full length 128-bit UUIDs.

Parameters

TUint32 aHH

Highest order word (bits 96 - 127)

TUint32 aHL

Second highest order word (bits 64 - 95)

TUint32 aLH

Second lowset order word (bits 32 - 63)

TUint32 aLL

Low order word (bits 0 - 31)

[Top]


Getters


Des()

const TPtrC8 Des() const;

Description

Gets the shortest form of the UUID, as in ShortestForm().

Return value

TPtrC8

Shortest form of the UUID


ShortestForm()

const TPtrC8 ShortestForm() const;

Description

Get the smallest version to which the UUID will fit.

This might be 2, 4, or 16 bytes. If 2 or 4 bytes, the ommitted bytes are implicity those from the Bluetooth base UUID.

Return value

TPtrC8

Shortest form of the UUID


LongForm()

const TPtrC8 LongForm() const;

Description

Gets the full 128 bit version of the UUID.

Return value

TPtrC8

UUID value


operator[]()

const TUint8& operator[](TInt aIndex) const;

Description

Gets the specified byte of the UUID, const overload.

Parameters

TInt aIndex

Index of the byte to get

Return value

TUint8&

Specified byte


operator[]()

TUint8& operator[](TInt aIndex);

Description

Gets the specified byte of the UUID, non-const overload.

Parameters

TInt aIndex

Index of the byte to get

Return value

TUint8&

Specified byte

[Top]


Setter


SetL()

void SetL(const TDesC8& aDes);

Description

Set the UUID from a binary descriptor.

This can be a 2, 4, or 16 byte descriptor. If a 2 or 4 byte descriptor is used, the rest of the UUID is filled with the Bluetooth well-known base UUID.

Parameters

const TDesC8& aDes

The descriptor is interpreted to be in big-endian format, i.e. index 0 holds the most significant byte.

Leave codes

KErrArgument

aDes is an invalid length

[Top]


Comparison operators


operator==()

TBool operator==(const TUUID& aUUID) const;

Description

Equality operator.

Parameters

const TUUID& aUUID

UUID to compare against

Return value

TBool

True if equal, else false


operator!=()

TBool operator!=(const TUUID& aUUID) const;

Description

Inequality operator.

Parameters

const TUUID& aUUID

UUID to compare against

Return value

TBool

True if unequal, else false