#include <btdevice.h>
Link against:
btdevice.lib
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
CBase
-
Base class for all classes to be instantiated on the heap.
CBTDevice
- Encapsulates all information that must be known about a device.
Members
Defined in CBTDevice
:
Inherited from CBase
:
Construction and destruction
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
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
Return value
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
Return value
CBTDevice *
|
this Device, placed on the cleanupstack.
|
|
Leave codes
This |
method will leave if an error occurs.
|
|
IMPORT_C static CBTDevice* NewL();
Description
Two-phase default constructor Create an empty device.
Return value
Leave codes
This |
method will leave if an error occurs.
|
|
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
Leave codes
This |
method will leave if an error occurs.
|
|
IMPORT_C ~CBTDevice();
Description
Destructor.
IMPORT_C CBTDevice* CopyL() const;
Description
Copies the contents of this into a new CBTDevice object.
Return value
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
Leave codes
This |
method will leave if an error occurs.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
IMPORT_C const TBTDevAddr& BDAddr() const;
Description
Get the device address.
Return value
IMPORT_C const TBTLinkKey& LinkKey() const;
Description
Get the link key.
Return value
IMPORT_C TBTDeviceClass DeviceClass() const;
Description
Get the device class.
Return value
IMPORT_C const TBTDeviceSecurity GlobalSecurity() const;
Description
Get the global security settings.
Return value
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
SetGlobalSecurity(const TBTDeviceSecurity &)
IMPORT_C void SetGlobalSecurity(const TBTDeviceSecurity &aSetting);
Description
Set the global security settings.
Parameters
IMPORT_C void DeleteLinkKey();
Description
Ensure that the previously known linkkey is discarded
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
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
IMPORT_C TBTNamelessDevice& AsNamelessDevice();
Description
Get the TBTNamelessDevice
portion of this.
Return value
IMPORT_C const TBTNamelessDevice& AsNamelessDevice() const;
Description
Get the TBTNamelessDevice
portion of this.
Return value
IMPORT_C TBool IsPaired() const;
Description
Check whether the device is paired.
Return value
TBool
|
ETrue if the device is paired.
|
|
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
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.
|
|
IMPORT_C const TBTPinCode& PassKey() const;
Description
Get the pin code
Return value
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.
|
|
IMPORT_C TUint PassKeyLength() const;
Description
Get the pin code length
Return value
TUint
|
The pin code length
|
|
Enum TBTDeviceNameSelector
TBTDeviceNameSelector
Description
Describes the similarities between two devices.