Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: btdevice.h
Link against: btdevice.lib

Class CBTDevice

class CBTDevice : public CBase;

Description

Encapsulates all information that must be known about a device.

Stores useful information concerning a remote device, including names

Derivation

Members

Defined in CBTDevice:
AsNamelessDevice(), AsNamelessDevice(), AssignL(), BDAddr(), CompareTo(), CopyL(), DeleteLinkKey(), DeviceClass(), DeviceName(), EAllNameProperties, EDeviceName, EFriendlyName, ELast, ExternalizeL(), FriendlyName(), GlobalSecurity(), InternalizeL(), IsPaired(), IsValidBDAddr(), IsValidDeviceClass(), IsValidDeviceName(), IsValidFriendlyName(), IsValidGlobalSecurity(), IsValidLinkKey(), IsValidPaired(), IsValidPassKey(), IsValidSeen(), IsValidUsed(), LinkKey(), NewL(), NewL(), NewL(), NewLC(), NewLC(), NewLC(), PassKey(), PassKeyLength(), Seen(), SetDeviceAddress(), SetDeviceClass(), SetFriendlyNameL(), SetGlobalSecurity(), SetPaired(), SetSeen(), SetUsed(), TBTDeviceNameSelector, UpdateL(), Used(), operator!=(), operator==(), ~CBTDevice()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CBTDevice *NewL(const TBTDevAddr &aBDAddr);

Description

Two-phase constructor Create a device and set its address.

Parameters

const TBTDevAddr &aBDAddr

the address of the device to which this class refers

Return value

CBTDevice *

The new CBTDevice object.

Leave codes

This

method will leave if an error occurs.


NewLC()

static IMPORT_C CBTDevice *NewLC(const TBTDevAddr &aBDAddr);

Description

Two-phase constructor

Parameters

const TBTDevAddr &aBDAddr

the address of the device to which this class refers

Return value

CBTDevice *

The new CBTDevice object. The object will be left on the cleanupstack.

Leave codes

This

method will leave if an error occurs.


NewL()

static IMPORT_C CBTDevice *NewL(const TBTNamelessDevice &aNamelessDevice);

Description

Two-phase copy constructor Create a device based on the smaller nameless device

Parameters

const TBTNamelessDevice &aNamelessDevice

the device to copy

Return value

CBTDevice *

this Device

Leave codes

This

method will leave if an error occurs.


NewLC()

static IMPORT_C CBTDevice *NewLC(const TBTNamelessDevice &aNamelessDevice);

Description

Two-phase copy constructor Create a device based on the smaller nameless device

Parameters

const TBTNamelessDevice &aNamelessDevice

the device to copy

Return value

CBTDevice *

this Device, placed on the cleanupstack.

Leave codes

This

method will leave if an error occurs.


NewL()

static IMPORT_C CBTDevice *NewL();

Description

Two-phase default constructor Create an empty device.

Return value

CBTDevice *

The new CBTDevice object.

Leave codes

This

method will leave if an error occurs.


NewLC()

static IMPORT_C CBTDevice *NewLC();

Description

Two-phase default constructor Create an empty device. The object will be placed on the cleanupstack and must be removed by the caller.

Return value

CBTDevice *

CBTDevice

Leave codes

This

method will leave if an error occurs.


~CBTDevice()

IMPORT_C ~CBTDevice();

Description

Destructor.

[Top]


Member functions


CopyL()

IMPORT_C CBTDevice *CopyL() const;

Description

Copies the contents of this into a new CBTDevice object.

Return value

CBTDevice *

Leave codes

This

method will leave if an error occurs.


UpdateL()

IMPORT_C void UpdateL(const CBTDevice &aDevice);

Description

Copies the contents of aDevice into *this

Parameters

const CBTDevice &aDevice

copied into *this

Leave codes

This

method will leave if an error occurs.


AssignL()

IMPORT_C void AssignL(CBTDevice &aDevice);

Description

Effectively operator=, but can leave.

Parameters

CBTDevice &aDevice

The device details to assign to this object.

Leave codes

This

method will leave if an error occurs.


DeviceName()

IMPORT_C const TDesC8 &DeviceName() const;

Description

Returns the name of the device

Return value

const TDesC8 &

The device name. If the device has no name, a zero-length descriptor will be returned.


FriendlyName()

IMPORT_C const TDesC &FriendlyName() const;

Description

Returns the friendly name of the device

Return value

const TDesC &

The friendly name. If the device has no friendly name, a zero-length descriptor will be returned.


SetFriendlyNameL()

IMPORT_C void SetFriendlyNameL(const TDesC &aName);

Description

Set the friendly name.

Parameters

const TDesC &aName

friendly name of the device

Leave codes

This

method will leave if an error occurs.


IsValidDeviceName()

IMPORT_C TBool IsValidDeviceName() const;

Description

Has the name of the device been set?

Return value

TBool

ETrue=>device name has been set, otherwise EFalse


IsValidFriendlyName()

IMPORT_C TBool IsValidFriendlyName() const;

Description

Has the friendly name of the device been set?

Return value

TBool

ETrue=>device name has been set, otherwise EFalse


operator==()

IMPORT_C TBool operator==(const CBTDevice &aDevice) const;

Description

Equality operator

Parameters

const CBTDevice &aDevice

instance against which this is compared

Return value

TBool

ETrue if aDevice==this


operator!=()

IMPORT_C TBool operator!=(const CBTDevice &aDevice) const;

Description

Inequality operator

Parameters

const CBTDevice &aDevice

instance against which this is compared

Return value

TBool

ETrue if aDevice!=this


CompareTo()

IMPORT_C TUint CompareTo(const CBTDevice &aDevice) const;

Description

Compares two devices.

Parameters

const CBTDevice &aDevice

instance against which this is compared

Return value

TUint

bit field (values of TBTDeviceComparisonResult) describing the similarities.


ExternalizeL()

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalise this object to aStream.

Parameters

RWriteStream &aStream

The stream to which this object will be written.

Leave codes

This

method will leave if an error occurs.


InternalizeL()

IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Internalize this object from aStream.

Parameters

RReadStream &aStream

The stream from which this object shall be internalized.

Leave codes

This

method will leave if an error occurs.


BDAddr()

IMPORT_C const TBTDevAddr &BDAddr() const;

Description

Get the device address.

Return value

const TBTDevAddr &

the address of the device.


LinkKey()

IMPORT_C const TBTLinkKey &LinkKey() const;

Description

Get the link key.

Return value

const TBTLinkKey &

the link key


DeviceClass()

IMPORT_C TBTDeviceClass DeviceClass() const;

Description

Get the device class.

Return value

TBTDeviceClass

the device class


GlobalSecurity()

IMPORT_C const TBTDeviceSecurity GlobalSecurity() const;

Description

Get the global security settings.

Return value

const TBTDeviceSecurity

the global security overrides of this device


SetDeviceAddress()

IMPORT_C void SetDeviceAddress(const TBTDevAddr &aBDAddr);

Description

Set the device address.

Parameters

const TBTDevAddr &aBDAddr

the address of the device


SetDeviceClass()

IMPORT_C void SetDeviceClass(TBTDeviceClass aDeviceClass);

Description

Set the device class.

Parameters

TBTDeviceClass aDeviceClass

the device class of the device


SetGlobalSecurity()

IMPORT_C void SetGlobalSecurity(const TBTDeviceSecurity &aSetting);

Description

Set the global security settings.

Parameters

const TBTDeviceSecurity &aSetting

the security override of the device


DeleteLinkKey()

IMPORT_C void DeleteLinkKey();

Description

Ensure that the previously known linkkey is discarded


IsValidBDAddr()

IMPORT_C TBool IsValidBDAddr() const;

Description

Denotes whether the device address has been set.

Return value

TBool

ETrue if address has been set


IsValidDeviceClass()

IMPORT_C TBool IsValidDeviceClass() const;

Description

Denotes whether the device class has been set.

Return value

TBool

ETrue if DeviceClass has been set


IsValidLinkKey()

IMPORT_C TBool IsValidLinkKey() const;

Description

Denotes whether the link key has been set, and hence whether this is a paired device.

Return value

TBool

ETrue if Linkkey has been set


IsValidGlobalSecurity()

IMPORT_C TBool IsValidGlobalSecurity() const;

Description

Denotes whether the global security settings have been set.

Return value

TBool

ETrue if security override has been set


Seen()

IMPORT_C const TTime &Seen() const;

Description

Get the time when the device was last seen. Note that this feature is not yet implemented in the bluetooth stack, and the method CBTDevice::Used() should be used instead.

Return value

const TTime &

The time when the device was last seen.


Used()

IMPORT_C const TTime &Used() const;

Description

Get the time when the device was last connected to.

Return value

const TTime &

The time when the device was last used.


SetUsed()

IMPORT_C void SetUsed(const TTime &aDateTime);

Description

Set the time when the device was last used.

Parameters

const TTime &aDateTime

The time when the device was last used.


SetSeen()

IMPORT_C void SetSeen(const TTime &aDateTime);

Description

Set the time when the device was last seen.

Parameters

const TTime &aDateTime

The time when the device was last seen.


IsValidUsed()

IMPORT_C TBool IsValidUsed() const;

Description

Denotes whether the time last used has been set.

Return value

TBool

ETrue if time last used has been set


IsValidSeen()

IMPORT_C TBool IsValidSeen() const;

Description

Denotes whether the time last seen has been set.

Return value

TBool

ETrue if time last seen has been set


AsNamelessDevice()

IMPORT_C TBTNamelessDevice &AsNamelessDevice();

Description

Get the TBTNamelessDevice portion of this.

Return value

TBTNamelessDevice &

the TBTNamelessDevice portion of this


AsNamelessDevice()

IMPORT_C const TBTNamelessDevice &AsNamelessDevice() const;

Description

Get the TBTNamelessDevice portion of this.

Return value

const TBTNamelessDevice &

the TBTNamelessDevice portion of this


IsPaired()

IMPORT_C TBool IsPaired() const;

Description

Check whether the device is paired.

Return value

TBool

ETrue if the device is paired.


SetPaired()

IMPORT_C void SetPaired(TBool aPaired);

Description

Set whether the device is paired;

Parameters

TBool aPaired

Whether the device is paired


IsValidPaired()

IMPORT_C TBool IsValidPaired() const;

Description

Denotes whether the device is paired has been set.

Return value

TBool

ETrue if whether the device is paired has been set.


PassKey()

IMPORT_C const TBTPinCode &PassKey() const;

Description

Get the pin code

Return value

const TBTPinCode &

The pin code


IsValidPassKey()

IMPORT_C TBool IsValidPassKey() const;

Description

Denotes whether in code has been set.

Return value

TBool

ETrue if whether the pin code has been set.


PassKeyLength()

IMPORT_C TUint PassKeyLength() const;

Description

Get the pin code length

Return value

TUint

The pin code length

[Top]


Member enumerations


Enum TBTDeviceNameSelector

TBTDeviceNameSelector

Description

Describes the similarities between two devices.

EDeviceName

Device name.

EFriendlyName

Friendly name.

EAllNameProperties

All name properties

ELast

Last enum. This is NOT a name property