CBTDevice Class Reference
Link against: btdevice.lib
class CBTDevice : public 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.
Enumerator | Value | Description |
---|
EDeviceName | 0x40000000 |
Device name.
|
EFriendlyName | 0x80000000 |
Friendly name.
|
EAllNameProperties | 0xff000000 |
All name properties
|
ELast | KMaxTUint |
Last enum. This is NOT a name property
|
Constructor & Destructor Documentation
Member Function Documentation
AsNamelessDevice ( )
Returns: the TBTNamelessDevice portion of this
AsNamelessDevice ( )
Returns: the TBTNamelessDevice portion of this
AssignL ( CBTDevice & )
Effectively operator=, but can leave.
- leave
- This method will leave if an error occurs.
Parameter | Description | aDevice | The device details to assign to this object. |
BDAddr ( )
Returns: the address of the device.
CompareTo ( const CBTDevice & )
Parameter | Description | aDevice | instance against which this is compared |
Returns: bit field (values of TBTDeviceComparisonResult) describing the similarities.
CopyL ( )
Copies the contents of this into a new
CBTDevice object.
- leave
- This method will leave if an error occurs.
DeleteLinkKey ( )
IMPORT_C void | DeleteLinkKey | ( | ) | |
Ensure that the previously known link key is discarded
DeviceClass ( )
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 & )
Externalise this object to aStream.
- leave
- This method will leave if an error occurs.
Parameter | Description | aStream | The 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 ( )
Get the global security settings.
Returns: the global security overrides of this device
InternalizeL ( RReadStream & )
Internalize this object from aStream.
- leave
- This method will leave if an error occurs.
Parameter | Description | aStream | The stream from which this object shall be internalized. |
IsPaired ( )
IMPORT_C TBool | IsPaired | ( | ) | const |
Check whether the device is paired.
Returns: ETrue if the device is paired.
IsValidBDAddr ( )
IMPORT_C TBool | IsValidBDAddr | ( | ) | const |
Denotes whether the device address has been set.
Returns: ETrue if address has been set
IsValidDeviceClass ( )
IMPORT_C TBool | IsValidDeviceClass | ( | ) | const |
Denotes whether the device class has been set.
Returns: ETrue if DeviceClass has been set
IsValidDeviceName ( )
IMPORT_C TBool | IsValidDeviceName | ( | ) | const |
Has the name of the device been set?
Returns: ETrue=>device name has been set, otherwise EFalse
IsValidFriendlyName ( )
IMPORT_C TBool | IsValidFriendlyName | ( | ) | const |
Has the friendly name of the device been set?
Returns: ETrue=>device name has been set, otherwise EFalse
IsValidGlobalSecurity ( )
IMPORT_C TBool | IsValidGlobalSecurity | ( | ) | const |
Denotes whether the global security settings have been set.
Returns: ETrue if security override has been set
IsValidLinkKey ( )
IMPORT_C TBool | IsValidLinkKey | ( | ) | 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 TBool | IsValidPaired | ( | ) | const |
Denotes whether the device is paired has been set.
Returns: ETrue if whether the device is paired has been set.
IsValidPassKey ( )
IMPORT_C TBool | IsValidPassKey | ( | ) | const |
Denotes whether the PIN code has been set.
Returns: ETrue if whether the PIN code has been set.
IsValidSeen ( )
IMPORT_C TBool | IsValidSeen | ( | ) | const |
Denotes whether the time last seen has been set.
Returns: ETrue if time last seen has been set
IsValidUiCookie ( )
IMPORT_C TBool | IsValidUiCookie | ( | ) | const |
Denotes whether the UI Cookie has been set.
Returns: ETrue = The UI Cookie for the device been set
IsValidUsed ( )
IMPORT_C TBool | IsValidUsed | ( | ) | const |
Denotes whether the time last used has been set.
Returns: ETrue if time last used has been set
LinkKeyType ( )
Returns: the link key type
NewL ( const TBTDevAddr & )
Two-phase constructor Create a device and set its address.
- leave
- This method will leave if an error occurs.
Parameter | Description | aBDAddr | the address of the device to which this class refers |
Returns: The new CBTDevice object.
NewL ( const TBTNamelessDevice & )
Two-phase copy constructor Create a device based on the smaller nameless device
- leave
- This method will leave if an error occurs.
Parameter | Description | aNamelessDevice | the device to copy |
NewL ( )
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 & )
Two-phase constructor
- leave
- This method will leave if an error occurs.
Parameter | Description | aBDAddr | the 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 & )
Two-phase copy constructor Create a device based on the smaller nameless device
- leave
- This method will leave if an error occurs.
Parameter | Description | aNamelessDevice | the device to copy |
Returns: this Device, placed on the cleanupstack.
NewLC ( )
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.
PassKeyLength ( )
IMPORT_C TUint | PassKeyLength | ( | ) | const |
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 void | SetDeviceAddress | ( | const TBTDevAddr & | aBDAddr | ) | |
Parameter | Description | aBDAddr | the address of the device |
SetDeviceClass ( TBTDeviceClass )
Parameter | Description | aDeviceClass | the device class of the device |
SetDeviceNameL ( const TDesC8 & )
IMPORT_C void | SetDeviceNameL | ( | const TDesC8 & | aName | ) | |
Set the device name.
- leave
- This method will leave if an error occurs.
Parameter | Description | aName | device name |
SetFriendlyNameL ( const TDesC & )
IMPORT_C void | SetFriendlyNameL | ( | const TDesC & | aName | ) | |
Set the friendly name.
- leave
- This method will leave if an error occurs.
Parameter | Description | aName | friendly name of the device |
SetGlobalSecurity ( const TBTDeviceSecurity & )
Set the global security settings.
Parameter | Description | aSetting | the security override of the device |
SetLinkKey ( const TBTLinkKey & )
IMPORT_C void | SetLinkKey | ( | const TBTLinkKey & | aLinkKey | ) | |
Parameter | Description | aLinkKey | the link key of the device |
SetLinkKey ( const TBTLinkKey &, TBTLinkKeyType )
Set the link key type of the device.
Parameter | Description | aLinkKey | the link key of the device |
aLinkKeyType | the link key type of the device |
SetPaired ( TBool )
IMPORT_C void | SetPaired | ( | TBool | aPaired | ) | |
Parameter | Description | aPaired | Whether the device is paired |
SetPaired ( TBTLinkKeyType )
Set whether the link key type when the device is paired;
Parameter | Description | aLinkKeyType | the link key type of the paired device |
SetPassKey ( const TBTPinCode & )
IMPORT_C void | SetPassKey | ( | const TBTPinCode & | aPassKey | ) | |
Parameter | Description | aPassKey | the PIN code of the device |
SetSeen ( const TTime & )
IMPORT_C void | SetSeen | ( | const TTime & | aDateTime | ) | |
Set the time when the device was last seen.
Parameter | Description | aDateTime | The time when the device was last seen. |
SetUiCookie ( TUint32 )
IMPORT_C void | SetUiCookie | ( | TUint32 | aUiCookie | ) | |
Sets the UI Cookie for the device. The format of the cookie is specific to the UI using the field.
Parameter | Description | aUiCookie | The 32bit cookie value. |
SetUsed ( const TTime & )
IMPORT_C void | SetUsed | ( | const TTime & | aDateTime | ) | |
Set the time when the device was last used.
Parameter | Description | aDateTime | The time when the device was last used. |
UiCookie ( )
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 void | UpdateL | ( | const CBTDevice & | aDevice | ) | |
Copies the contents of aDevice into *this
- leave
- This method will leave if an error occurs.
Parameter | Description | aDevice | copied 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 & )
Parameter | Description | aDevice | instance against which this is compared |
Returns: ETrue if aDevice!=this
operator== ( const CBTDevice & )
Parameter | Description | aDevice | instance against which this is compared |
Returns: ETrue if aDevice==this