Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <bttypes.h>
Link against: bluetooth.lib

Class TUUID

class TUUID;

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 as down to their shortest form using TUUID::ShortestForm()const.

Members

Defined in TUUID:


Construction and destruction


TUUID()

IMPORT_C TUUID();

Description

Default constructor. Sets the UUID to all zeros.


TUUID(TUint32)

IMPORT_C TUUID(TUint32 aLong);

Description

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

Parameters

TUint32 aLong

is a Big-endian format TUint32 containing the UUID.


TUUID(TUint32,TUint32,TUint32,TUint32)

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

Description

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

Parameters

TUint32 aHH

Highest order word (bits 96 - 127) in its Big-endian format

TUint32 aHL

Second highest order word (bits 64 - 95) in its Big-endian format

TUint32 aLH

Secong lowset order word (bits 32 - 63) in its Big-endian format

TUint32 aLL

Low order word (bits 0 - 31) in its Big-endian format


TUUID(const TUid &)

IMPORT_C TUUID(const TUid &aUid);

Description

Set Bluetooth UUID from an EPOC UUID. Uses a well known reserved range. This defines a one-to-one mapping between all EPOC UIDs and and a range of Bluetooth UUID.

Base UUID used is 00000000-0000-1000-8000-00001B20C7AE; the first four bytes are replaced by the 32 bit Sybmian OS Uid, in big-endian form.

Parameters

const TUid &aUid

EPOC UID to set this Bluetooth UUID from

[Top]


Member functions


SetL(const TDesC8 &)

IMPORT_C void SetL(const TDesC8 &aDes);

Description

Set the UUID from a binary descriptor. Can accept a 2, 4, or 16 byte descriptor. Any other value will cause a leave with KErrArgument . If a 2 or 4 byte descriptor is set, the rest of the UUID will be filled with the Bluetooth well-known base UUID.

Parameters

const TDesC8 &aDes

The binary descriptor. Note that the descriptor is interpretted to be in Big-endian format, i.e. index 0 holds the most significant byte.

Leave codes

This

method will leave if an error occurs.


LongForm()const

IMPORT_C const TPtrC8 LongForm() const;

Description

Returns the full 128 bit version of the UUID.

Return value

const TPtrC8

The long form version of the UUID.


ShortestForm()const

IMPORT_C const TPtrC8 ShortestForm() const;

Description

Get the smallest version the UUID will compress down to. 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

const TPtrC8

TPtrC8 pointing to 2, 4, or 16 bytes of significant address.


Des()const

IMPORT_C const TPtrC8 Des() const;

Description

Return value

const TPtrC8


FixedLengthL(TInt)const

Interface status: deprecated Use SpecifiedLengthL(TInt aLength) instead

IMPORT_C const TPtrC8 FixedLengthL(TInt aLength) const;

Description

Parameters

TInt aLength

Return value

const TPtrC8


MinimumSize()const

IMPORT_C TInt MinimumSize() const;

Description

Returns the minimum size of this UUID.

Return value

TInt


operator==(const TUUID &)const

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

Description

Comparison operator.

Parameters

const TUUID &aUUID

Object to compare to this.

Return value

TBool

ETrue is aUUID is the same as this, EFalse if not.


operator!=(const TUUID &)const

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

Description

Inequality operator.

Parameters

const TUUID &aUUID

Object to compare to this.

Return value

TBool

EFalse is aUUID is the same as this, ETrue if not.


operator[](TInt)const

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

Description

Access a single element of the UUID.

Parameters

TInt aIndex

The index of the element to access.

Return value

const TUint8 &

The element. The reference remains valid as long as this object is in scope.


operator[](TInt)

IMPORT_C TUint8& operator[](TInt aIndex);

Description

Access a single element of the UUID.

Parameters

TInt aIndex

The index of the element to access.

Return value

TUint8 &

The element. The reference remains valid as long as this object is in scope.


SpecifiedLengthL(TInt)const

IMPORT_C const TPtrC8 SpecifiedLengthL(TInt aLength) const;

Description

Return the UUID with a specified length.

Does not allow compressing a UUID to less than its shortest form. If 2 or 4 bytes, the ommitted bytes are implicity those from the Bluetooth base UUID.

Parameters

TInt aLength

The required length (2, 4 or 16 bytes).

Return value

const TPtrC8

TPtrC8 pointing to 2, 4, or 16 bytes of significant UUID data.

Leave codes

KErrArgument

The UUID length requested is invalid.

KErrTotalLossOfPrecision

The UUID cannot be compressed to the requested length.


SetFromLittleEndianL(const TDesC8 &)

IMPORT_C void SetFromLittleEndianL(const TDesC8 &aDes);

Description

Set the UUID from a binary descriptor containing Little-endian format UUID. Can accept a 2, 4, or 16 byte descriptor. Any other value will cause a leave with KErrArgument . If a 2 or 4 byte descriptor is set, the rest of the UUID will be filled with the Bluetooth well-known base UUID.

Parameters

const TDesC8 &aDes

The binary descriptor. Note that the descriptor is interpretted to be in Little-endian format, i.e. index 0 holds the most significant byte.

Leave codes

This

method will leave if an error occurs.