Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: bttypes.h
Link against: bluetooth.lib

Class TBTDevAddr

TBTDevAddr

Support

Supported from 6.1

Description

A 48-bit Bluetooth device address.

This class represents the unique address that each Bluetooth device has built into its hardware. It is used for handling addresses of remote devices.

The classes handles addresses as big-endian: i.e. the first byte of the address is the most significant.

Defined in TBTDevAddr:
Des(), Reset(), TBTDevAddr(), operator!=(), operator==(), operator[]()


Constructors


TBTDevAddr()

TBTDevAddr();

Description

Default constructor.

The address is initialised to 0.


TBTDevAddr()

TBTDevAddr(const TInt64 &aInt);

Description

Constructs a device address from a TInt64.

The function panics if the most significant 16 bits of aInt are non-zero, as device addresses are 48 bits in size.

Parameters

const TInt64 &aInt

Value for device address.


TBTDevAddr()

TBTDevAddr(const TDesC8 &aDes);

Description

Constructs a device address from a data buffer.

The buffer is copied directly into the object. The function panics if aDes does not have a length of 6 bytes (48 bits).

Parameters

const TDesC8 &aDes

Data buffer for device address

[Top]


Overloaded operators


operator==()

TBool operator==(const TBTDevAddr& aAddr) const;

Description

Overloaded equality operator.

Parameters

const TBTDevAddr& aAddr

Address against which to compare

Return value

TBool

True if aAddr has the same address as the object, otherwise false


operator!=()

TBool operator!=(const TBTDevAddr& aAddr) const;

Description

Overloaded inequality operator.

Parameters

const TBTDevAddr& aAddr

Address against which to compare

Return value

TBool

True if aAddr does not have the same address as the object, otherwise false


operator[]()

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

Description

Overloaded array element operator, const version.

This function handles the address as a 6-byte array of TUint values.

Parameters

TInt aIndex

Index of the byte to get

Return value

const TUint8&

Value of the address byte indexed by aIndex


operator[]()

TUint8& operator[](TInt aIndex);

Description

Overloaded array element operator, non-const version.

This function handles the address as a 6-byte array of TUint values.

Parameters

TInt aIndex

Index of the byte to get

Return value

TUint8&

Value of the address byte indexed by aIndex

[Top]


Getters and setters


Des()

const TPtrC8 Des() const;

Description

Gets the address as a descriptor, const version.

Return value

const TPtrC8

Address


Des()

TPtr8 Des();

Description

Gets the address as a descriptor, non-const version.

Return value

TPtr8

Address


Reset()

void Reset();

Description

Sets the address to zero.