Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:

Inherited from CBase:


Construction and destruction


NewL(const TBTDevAddr &)

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

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

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

IMPORT_C static 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()

IMPORT_C static 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()

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

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

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(CBTDevice &)

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()const

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()const

IMPORT_C const TDesC& FriendlyName() const;

Description

Returns the friendly name of the device

Return value

const TDesC16 &

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


SetFriendlyNameL(const TDesC &)

IMPORT_C void SetFriendlyNameL(const TDesC &aName);

Description

Set the friendly name.

Parameters

const TDesC16 &aName

friendly name of the device

Leave codes

This

method will leave if an error occurs.


IsValidDeviceName()const

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()const

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==(const CBTDevice &)const

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!=(const CBTDevice &)const

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

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

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(RReadStream &)

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()const

IMPORT_C const TBTDevAddr& BDAddr() const;

Description

Get the device address.

Return value

const TBTDevAddr &

the address of the device.


LinkKey()const

IMPORT_C const TBTLinkKey& LinkKey() const;

Description

Get the link key.

Return value

const TPckgBuf &

the link key


DeviceClass()const

IMPORT_C TBTDeviceClass DeviceClass() const;

Description

Get the device class.

Return value

TBTDeviceClass

the device class


GlobalSecurity()const

IMPORT_C const TBTDeviceSecurity GlobalSecurity() const;

Description

Get the global security settings.

Return value

const TBTDeviceSecurity

the global security overrides of this device


SetDeviceAddress(const TBTDevAddr &)

IMPORT_C void SetDeviceAddress(const TBTDevAddr &aBDAddr);

Description

Set the device address.

Parameters

const TBTDevAddr &aBDAddr

the address of the device


SetDeviceClass(TBTDeviceClass)

IMPORT_C void SetDeviceClass(TBTDeviceClass aDeviceClass);

Description

Set the device class.

Parameters

TBTDeviceClass aDeviceClass

the device class of the device


SetGlobalSecurity(const TBTDeviceSecurity &)

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()const

IMPORT_C TBool IsValidBDAddr() const;

Description

Denotes whether the device address has been set.

Return value

TBool

ETrue if address has been set


IsValidDeviceClass()const

IMPORT_C TBool IsValidDeviceClass() const;

Description

Denotes whether the device class has been set.

Return value

TBool

ETrue if DeviceClass has been set


IsValidLinkKey()const

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()const

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()const

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()const should be used instead.

Return value

const TTime &

The time when the device was last seen.


Used()const

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

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

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()const

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()const

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()const

IMPORT_C const TBTNamelessDevice& AsNamelessDevice() const;

Description

Get the TBTNamelessDevice portion of this.

Return value

const TBTNamelessDevice &

the TBTNamelessDevice portion of this


IsPaired()const

IMPORT_C TBool IsPaired() const;

Description

Check whether the device is paired.

Return value

TBool

ETrue if the device is paired.


SetPaired(TBool)

IMPORT_C void SetPaired(TBool aPaired);

Description

Set whether the device is paired; This function should no longer be used, the overloaded SetPaired function should be used.

Parameters

TBool aPaired

Whether the device is paired

See also:


SetPaired(TBTLinkKeyType)

IMPORT_C void SetPaired(TBTLinkKeyType aLinkKeyType);

Description

Set whether the link key type when the device is paired;

Parameters

TBTLinkKeyType aLinkKeyType

the link key type of the paired device


IsValidPaired()const

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()const

IMPORT_C const TBTPinCode& PassKey() const;

Description

Get the pin code

Return value

const TPckgBuf &

The pin code


IsValidPassKey()const

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()const

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