CBTDevice Class Reference

#include <btdevice.h>

Link against: btdevice.lib

class CBTDevice : public CBase

Inherits from

  • CBTDevice
    Public Member Enumerations
    enumTBTDeviceNameSelector { EDeviceName, EFriendlyName, EAllNameProperties, ELast }
    Public Member Functions
    ~CBTDevice()
    IMPORT_C TBTNamelessDevice &AsNamelessDevice()
    IMPORT_C const TBTNamelessDevice &AsNamelessDevice()
    IMPORT_C voidAssignL(CBTDevice &)
    IMPORT_C const TBTDevAddr &BDAddr()
    IMPORT_C TUintCompareTo(const CBTDevice &)
    IMPORT_C CBTDevice *CopyL()
    IMPORT_C voidDeleteLinkKey()
    IMPORT_C TBTDeviceClassDeviceClass()
    IMPORT_C const TDesC8 &DeviceName()
    IMPORT_C voidExternalizeL(RWriteStream &)
    IMPORT_C const TDesC &FriendlyName()
    IMPORT_C const TBTDeviceSecurityGlobalSecurity()
    IMPORT_C voidInternalizeL(RReadStream &)
    IMPORT_C TBoolIsPaired()
    IMPORT_C TBoolIsValidBDAddr()
    IMPORT_C TBoolIsValidDeviceClass()
    IMPORT_C TBoolIsValidDeviceName()
    IMPORT_C TBoolIsValidFriendlyName()
    IMPORT_C TBoolIsValidGlobalSecurity()
    IMPORT_C TBoolIsValidLinkKey()
    IMPORT_C TBoolIsValidPaired()
    IMPORT_C TBoolIsValidPassKey()
    IMPORT_C TBoolIsValidSeen()
    IMPORT_C TBoolIsValidUiCookie()
    IMPORT_C TBoolIsValidUsed()
    IMPORT_C const TBTLinkKey &LinkKey()
    IMPORT_C TBTLinkKeyTypeLinkKeyType()
    IMPORT_C CBTDevice *NewL(const TBTDevAddr &)
    IMPORT_C CBTDevice *NewL(const TBTNamelessDevice &)
    IMPORT_C CBTDevice *NewL()
    IMPORT_C CBTDevice *NewLC(const TBTDevAddr &)
    IMPORT_C CBTDevice *NewLC(const TBTNamelessDevice &)
    IMPORT_C CBTDevice *NewLC()
    IMPORT_C const TBTPinCode &PassKey()
    IMPORT_C TUintPassKeyLength()
    IMPORT_C const TTime &Seen()
    IMPORT_C voidSetDeviceAddress(const TBTDevAddr &)
    IMPORT_C voidSetDeviceClass(TBTDeviceClass)
    IMPORT_C voidSetDeviceNameL(const TDesC8 &)
    IMPORT_C voidSetFriendlyNameL(const TDesC &)
    IMPORT_C voidSetGlobalSecurity(const TBTDeviceSecurity &)
    IMPORT_C voidSetLinkKey(const TBTLinkKey &)
    IMPORT_C voidSetLinkKey(const TBTLinkKey &, TBTLinkKeyType)
    IMPORT_C voidSetPaired(TBool)
    IMPORT_C voidSetPaired(TBTLinkKeyType)
    IMPORT_C voidSetPassKey(const TBTPinCode &)
    IMPORT_C voidSetSeen(const TTime &)
    IMPORT_C voidSetUiCookie(TUint32)
    IMPORT_C voidSetUsed(const TTime &)
    IMPORT_C TUint32UiCookie()
    IMPORT_C voidUpdateL(const CBTDevice &)
    IMPORT_C const TTime &Used()
    IMPORT_C TBooloperator!=(const CBTDevice &)
    IMPORT_C TBooloperator==(const CBTDevice &)
    Inherited Functions
    CBase::CBase()
    CBase::Delete(CBase *)
    CBase::Extension_(TUint,TAny *&,TAny *)
    CBase::operator new(TUint)
    CBase::operator new(TUint,TAny *)
    CBase::operator new(TUint,TLeave)
    CBase::operator new(TUint,TLeave,TUint)
    CBase::operator new(TUint,TUint)
    CBase::~CBase()

    Detailed Description

    Encapsulates all information that must be known about a device.

    Stores useful information concerning a remote device, including names

    Member Enumeration Documentation

    Enum TBTDeviceNameSelector

    Describes the similarities between two devices.

    EnumeratorValueDescription
    EDeviceName0x40000000

    Device name.

    EFriendlyName0x80000000

    Friendly name.

    EAllNameProperties0xff000000

    All name properties

    ELastKMaxTUint

    Last enum. This is NOT a name property

    Constructor & Destructor Documentation

    ~CBTDevice ( )

    IMPORT_C~CBTDevice()

    Destructor.

    Member Function Documentation

    AsNamelessDevice ( )

    IMPORT_C TBTNamelessDevice &AsNamelessDevice()

    Get the TBTNamelessDevice portion of this.

    Returns: the TBTNamelessDevice portion of this

    AsNamelessDevice ( )

    IMPORT_C const TBTNamelessDevice &AsNamelessDevice()const

    Get the TBTNamelessDevice portion of this.

    Returns: the TBTNamelessDevice portion of this

    AssignL ( CBTDevice & )

    IMPORT_C voidAssignL(CBTDevice &aDevice)
    Effectively operator=, but can leave.
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aDeviceThe device details to assign to this object.

    BDAddr ( )

    IMPORT_C const TBTDevAddr &BDAddr()const

    Get the device address.

    Returns: the address of the device.

    CompareTo ( const CBTDevice & )

    IMPORT_C TUintCompareTo(const CBTDevice &aDevice)const

    Compares two devices.

    ParameterDescription
    aDeviceinstance against which this is compared

    Returns: bit field (values of TBTDeviceComparisonResult) describing the similarities.

    CopyL ( )

    IMPORT_C CBTDevice *CopyL()const
    Copies the contents of this into a new CBTDevice object.
    leave
    This method will leave if an error occurs.

    DeleteLinkKey ( )

    IMPORT_C voidDeleteLinkKey()

    Ensure that the previously known link key is discarded

    DeviceClass ( )

    IMPORT_C TBTDeviceClassDeviceClass()const

    Get the device class.

    Returns: the device class

    DeviceName ( )

    IMPORT_C const TDesC8 &DeviceName()const

    Returns the name of the device

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

    ExternalizeL ( RWriteStream & )

    IMPORT_C voidExternalizeL(RWriteStream &aStream)const
    Externalise this object to aStream.
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aStreamThe stream to which this object will be written.

    FriendlyName ( )

    IMPORT_C const TDesC &FriendlyName()const

    Returns the friendly name of the device

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

    GlobalSecurity ( )

    IMPORT_C const TBTDeviceSecurityGlobalSecurity()const

    Get the global security settings.

    Returns: the global security overrides of this device

    InternalizeL ( RReadStream & )

    IMPORT_C voidInternalizeL(RReadStream &aStream)
    Internalize this object from aStream.
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aStreamThe stream from which this object shall be internalized.

    IsPaired ( )

    IMPORT_C TBoolIsPaired()const

    Check whether the device is paired.

    Returns: ETrue if the device is paired.

    IsValidBDAddr ( )

    IMPORT_C TBoolIsValidBDAddr()const

    Denotes whether the device address has been set.

    Returns: ETrue if address has been set

    IsValidDeviceClass ( )

    IMPORT_C TBoolIsValidDeviceClass()const

    Denotes whether the device class has been set.

    Returns: ETrue if DeviceClass has been set

    IsValidDeviceName ( )

    IMPORT_C TBoolIsValidDeviceName()const

    Has the name of the device been set?

    Returns: ETrue=>device name has been set, otherwise EFalse

    IsValidFriendlyName ( )

    IMPORT_C TBoolIsValidFriendlyName()const

    Has the friendly name of the device been set?

    Returns: ETrue=>device name has been set, otherwise EFalse

    IsValidGlobalSecurity ( )

    IMPORT_C TBoolIsValidGlobalSecurity()const

    Denotes whether the global security settings have been set.

    Returns: ETrue if security override has been set

    IsValidLinkKey ( )

    IMPORT_C TBoolIsValidLinkKey()const

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

    Returns: ETrue if link key has been set

    IsValidPaired ( )

    IMPORT_C TBoolIsValidPaired()const

    Denotes whether the device is paired has been set.

    Returns: ETrue if whether the device is paired has been set.

    IsValidPassKey ( )

    IMPORT_C TBoolIsValidPassKey()const

    Denotes whether the PIN code has been set.

    Returns: ETrue if whether the PIN code has been set.

    IsValidSeen ( )

    IMPORT_C TBoolIsValidSeen()const

    Denotes whether the time last seen has been set.

    Returns: ETrue if time last seen has been set

    IsValidUiCookie ( )

    IMPORT_C TBoolIsValidUiCookie()const

    Denotes whether the UI Cookie has been set.

    Returns: ETrue = The UI Cookie for the device been set

    IsValidUsed ( )

    IMPORT_C TBoolIsValidUsed()const

    Denotes whether the time last used has been set.

    Returns: ETrue if time last used has been set

    LinkKey ( )

    IMPORT_C const TBTLinkKey &LinkKey()const

    Get the link key.

    Returns: the link key

    LinkKeyType ( )

    IMPORT_C TBTLinkKeyTypeLinkKeyType()const

    Get the link key type.

    Returns: the link key type

    NewL ( const TBTDevAddr & )

    IMPORT_C CBTDevice *NewL(const TBTDevAddr &aBDAddr)[static]
    Two-phase constructor Create a device and set its address.
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aBDAddrthe address of the device to which this class refers

    Returns: The new CBTDevice object.

    NewL ( const TBTNamelessDevice & )

    IMPORT_C CBTDevice *NewL(const TBTNamelessDevice &aNamelessDevice)[static]
    Two-phase copy constructor Create a device based on the smaller nameless device
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aNamelessDevicethe device to copy

    Returns: this Device

    NewL ( )

    IMPORT_C CBTDevice *NewL()[static]
    Two-phase default constructor Create an empty device.
    leave
    This method will leave if an error occurs.

    Returns: The new CBTDevice object.

    NewLC ( const TBTDevAddr & )

    IMPORT_C CBTDevice *NewLC(const TBTDevAddr &aBDAddr)[static]
    Two-phase constructor
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aBDAddrthe address of the device to which this class refers

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

    NewLC ( const TBTNamelessDevice & )

    IMPORT_C CBTDevice *NewLC(const TBTNamelessDevice &aNamelessDevice)[static]
    Two-phase copy constructor Create a device based on the smaller nameless device
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aNamelessDevicethe device to copy

    Returns: this Device, placed on the cleanupstack.

    NewLC ( )

    IMPORT_C CBTDevice *NewLC()[static]
    Two-phase default constructor Create an empty device. The object will be placed on the cleanupstack and must be removed by the caller.
    leave
    This method will leave if an error occurs.

    Returns: CBTDevice

    PassKey ( )

    IMPORT_C const TBTPinCode &PassKey()const

    Get the PIN code

    Returns: The PIN code

    PassKeyLength ( )

    IMPORT_C TUintPassKeyLength()const

    Get the PIN code length

    Returns: The PIN code length

    Seen ( )

    IMPORT_C const TTime &Seen()const

    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.

    Returns: The time when the device was last seen.

    SetDeviceAddress ( const TBTDevAddr & )

    IMPORT_C voidSetDeviceAddress(const TBTDevAddr &aBDAddr)

    Set the device address.

    ParameterDescription
    aBDAddrthe address of the device

    SetDeviceClass ( TBTDeviceClass )

    IMPORT_C voidSetDeviceClass(TBTDeviceClassaDeviceClass)

    Set the device class.

    ParameterDescription
    aDeviceClassthe device class of the device

    SetDeviceNameL ( const TDesC8 & )

    IMPORT_C voidSetDeviceNameL(const TDesC8 &aName)
    Set the device name.
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aNamedevice name

    SetFriendlyNameL ( const TDesC & )

    IMPORT_C voidSetFriendlyNameL(const TDesC &aName)
    Set the friendly name.
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aNamefriendly name of the device

    SetGlobalSecurity ( const TBTDeviceSecurity & )

    IMPORT_C voidSetGlobalSecurity(const TBTDeviceSecurity &aSetting)

    Set the global security settings.

    ParameterDescription
    aSettingthe security override of the device

    SetLinkKey ( const TBTLinkKey & )

    IMPORT_C voidSetLinkKey(const TBTLinkKey &aLinkKey)

    Set the link key.

    ParameterDescription
    aLinkKeythe link key of the device

    SetLinkKey ( const TBTLinkKey &, TBTLinkKeyType )

    IMPORT_C voidSetLinkKey(const TBTLinkKey &aLinkKey,
    TBTLinkKeyTypeaLinkKeyType
    )

    Set the link key type of the device.

    ParameterDescription
    aLinkKeythe link key of the device
    aLinkKeyTypethe link key type of the device

    SetPaired ( TBool )

    IMPORT_C voidSetPaired(TBoolaPaired)

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

    See also: CBTDevice::SetPaired(TBTLinkKeyType aLinkKeyType)

    ParameterDescription
    aPairedWhether the device is paired

    SetPaired ( TBTLinkKeyType )

    IMPORT_C voidSetPaired(TBTLinkKeyTypeaLinkKeyType)

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

    ParameterDescription
    aLinkKeyTypethe link key type of the paired device

    SetPassKey ( const TBTPinCode & )

    IMPORT_C voidSetPassKey(const TBTPinCode &aPassKey)

    Set the passkey.

    ParameterDescription
    aPassKeythe PIN code of the device

    SetSeen ( const TTime & )

    IMPORT_C voidSetSeen(const TTime &aDateTime)

    Set the time when the device was last seen.

    ParameterDescription
    aDateTimeThe time when the device was last seen.

    SetUiCookie ( TUint32 )

    IMPORT_C voidSetUiCookie(TUint32aUiCookie)

    Sets the UI Cookie for the device. The format of the cookie is specific to the UI using the field.

    ParameterDescription
    aUiCookieThe 32bit cookie value.

    SetUsed ( const TTime & )

    IMPORT_C voidSetUsed(const TTime &aDateTime)

    Set the time when the device was last used.

    ParameterDescription
    aDateTimeThe time when the device was last used.

    UiCookie ( )

    IMPORT_C TUint32UiCookie()const

    Returns the UI Cookie value associated with the device. The format of the cookie is specific to the UI using the field.

    Returns: The 32bit cookie value.

    UpdateL ( const CBTDevice & )

    IMPORT_C voidUpdateL(const CBTDevice &aDevice)
    Copies the contents of aDevice into *this
    leave
    This method will leave if an error occurs.
    ParameterDescription
    aDevicecopied into *this

    Used ( )

    IMPORT_C const TTime &Used()const

    Get the time when the device was last connected to.

    Returns: The time when the device was last used.

    operator!= ( const CBTDevice & )

    IMPORT_C TBooloperator!=(const CBTDevice &aDevice)const

    Inequality operator

    ParameterDescription
    aDeviceinstance against which this is compared

    Returns: ETrue if aDevice!=this

    operator== ( const CBTDevice & )

    IMPORT_C TBooloperator==(const CBTDevice &aDevice)const

    Equality operator

    ParameterDescription
    aDeviceinstance against which this is compared

    Returns: ETrue if aDevice==this