Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

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

Class TBTDevAddr

class TBTDevAddr;

Description

48-bit bluetooth device address. Each bluetooth device has a unique address built into the hardware, which is represented by this class. Used for identifying remote addresses. The interface operates in a big-endian manner -- e.g. addr[0] refers to the most significant byte of the address. This is the same ordering as the addresses would naturally be written down on paper.

Members

Defined in TBTDevAddr:


Construction and destruction


TBTDevAddr()

IMPORT_C TBTDevAddr();

Description

Default constructor. The address is initialised to 0.


TBTDevAddr(const TInt64 &)

IMPORT_C 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(const TDesC8 &)

IMPORT_C 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]


Member functions


operator==(const TBTDevAddr &)const

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

Description

Comparison operator.

Parameters

const TBTDevAddr &aAddr

The device address to compare to this object.

Return value

TBool

ETrue if the addresses are equal, EFalse if not.


operator!=(const TBTDevAddr &)const

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

Description

Inequality operator.

Parameters

const TBTDevAddr &aAddr

The device address to compare to this object.

Return value

TBool

EFalse if the addresses are equal, ETrue if not.


operator[](TInt)const

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

Description

Access a single element of the address.

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 address.

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.


Reset()

IMPORT_C void Reset();

Description

Reset the data contained within the object.


Des()

IMPORT_C TPtr8 Des();

Description

Access value as a bigendian descriptor.

Return value

TPtr8

A non-const descriptor.


Des()const

IMPORT_C const TPtrC8 Des() const;

Description

Access value as a bigendian descriptor.

Return value

const TPtrC8

A const descriptor.


SetReadable(const TDesC &)

IMPORT_C TInt SetReadable(const TDesC &aSource);

Description

Convert Readable string into a dev addr.

Address may have leading space and "0x" characters.

Parameters

const TDesC16 &aSource

Readable Hex representation of address

Return value

TInt

EPOC error code on fail, or else number of characters used from aSource in conversion


GetReadable(TDes &)const

IMPORT_C void GetReadable(TDes &aDest) const;

Description

Extract the Bluetooth device address into a human-readable format, in aDest.

Output is in hexadecimal bigendian format, with no padding characters.

Note: aDest must be large enough to hold the entire output, or else a a panic will occur.

Parameters

TDes16 &aDest

Descriptor where result is placed.


GetReadable(TDes &,const TDesC &,const TDesC &,const TDesC &)const

IMPORT_C void GetReadable(TDes &aDest, const TDesC &aPrepend, const TDesC &aByteSeperator, const TDesC &aAppend) const;

Description

Extract the Bluetooth device address into a human-readable format, in aDest.

Output is in hexadecimal bigendian format, with optional padding characters.

Note: aDest must be large enough to hold the entire output, or else a a panic will occur.

Parameters

TDes16 &aDest

Descriptor where result is placed.

const TDesC16 &aPrepend

Added onto front of output.

const TDesC16 &aByteSeperator

Inserted between each byte of address.

const TDesC16 &aAppend

Added onto end of output.


operator<=(const TBTDevAddr &)const

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

Description

Less than operator.

Parameters

const TBTDevAddr &aAddr

The device address to compare to this object.

Return value

TBool

EFalse if the aAddr is greater than this TBTDevAddr, ETrue if not.