CBTEngSettings Class Reference

class CBTEngSettings : public CBase

Class CBTEngSettings

This class provides functionality for getting and setting Bluetooth settings.

btengsettings.lib
Since
S60 v3.2

Inherits from

Constructor & Destructor Documentation

CBTEngSettings(MBTEngSettingsObserver *)

CBTEngSettings ( MBTEngSettingsObserver * aObserver ) [private]

C++ default constructor

Since
S60 v3.2

Parameters

MBTEngSettingsObserver * aObserver Pointer to callback interface that receives settings change events.

~CBTEngSettings()

~CBTEngSettings ( ) [virtual]

Destructor

Member Functions Documentation

ChangePowerStateTemporarily()

IMPORT_C TInt ChangePowerStateTemporarily ( )

Sets the Bluetooth power state (on or off). If a callback interface has been provided, the result is communicated through PowerStateChanged() when to power state change has been fully completed. If bluetooth is on, power will be switched off gracefully after all temporary connections have been disconnected. If a non-temporary connection has been established in the mean time (e.g. with a headset), power will be switched on permanently. Note: power will only be switched off gracefully if it has also been switched on through this method, otherwise KErrAccessDenied will be returned.

Since
S60 v5.0

ConstructL()

void ConstructL ( ) [private]

Symbian 2nd-phase constructor

Since
S60 v3.2

GetCenRepKeyL(const TUid, const TInt, TInt &, const TInt, const TInt, const TInt, const TInt)

void GetCenRepKeyL ( const TUid aUid,
const TInt aKey,
TInt & aValue,
const TInt aMinRange1,
const TInt aMaxRange1,
const TInt aMinRange2 = 0,
const TInt aMaxRange2 = 0
) [private]

Helper function for reading a Central Repository key, and verifying that the value is within the appropriate range.

Since
S60 v3.2

Parameters

const TUid aUid UID of the key to be read.
const TInt aKey The key to be read.
TInt & aValue Default value of the key; on return contains the value as read from CenRep.
const TInt aMinRange1 Lower limit of the first valid range of key values.
const TInt aMaxRange1 Upper limit of the first valid range of key values.
const TInt aMinRange2 = 0 Lower limit of the second valid range of key values.
const TInt aMaxRange2 = 0 Upper limit of the second valid range of key values.

GetLocalName(TDes &)

IMPORT_C TInt GetLocalName ( TDes & aName )

Gets Bluetooth local name. If the name has not been set, a zero-lenght name is returned.

Since
S60 v3.2

Parameters

TDes & aName

GetLocalNameModified(TBool &)

TInt GetLocalNameModified ( TBool & aStatus ) [private]

Helper function to get the status from Central Repository of whether the local name has been modified.

Since
S60 v3.2

Parameters

TBool & aStatus On return, contains the current status of the local name.

GetOfflineModeSettings(TCoreAppUIsNetworkConnectionAllowed &, TBTEnabledInOfflineMode &)

IMPORT_C TInt GetOfflineModeSettings ( TCoreAppUIsNetworkConnectionAllowed & aOffline,
TBTEnabledInOfflineMode & aOfflineAllowed
)

Gets Bluetooth offline mode settings.

Since
S60 v5.0

Parameters

TCoreAppUIsNetworkConnectionAllowed & aOffline On return, indicates whether Offline Mode is active.
TBTEnabledInOfflineMode & aOfflineAllowed On return, indicates wether Bluetooth is allowed to be turned on in offline mode.

GetPowerState(TBTPowerStateValue &)

IMPORT_C TInt GetPowerState ( TBTPowerStateValue & aState )

Gets the Bluetooth power state (on or off).

Since
S60 v3.2

Parameters

TBTPowerStateValue & aState On return, contains the current power mode.

GetVisibilityMode(TBTVisibilityMode &)

IMPORT_C TInt GetVisibilityMode ( TBTVisibilityMode & aMode )

Gets Bluetooth visibility mode (hidden, limited or general discoverable mode).

Since
S60 v3.2

Parameters

TBTVisibilityMode & aMode On return, contains the current visibility mode.

HandleBTRegistryNameSetting(TDes &)

TInt HandleBTRegistryNameSetting ( TDes & aName ) [private]

Helper function for getting/setting BT local name in BT Registry.

Since
S60 v3.2

Parameters

TDes & aName The BT local device name to be read or written. If it contains an empty string, it will hold the name on return, otherwise the contained string will be set to BT Registry.

NewL(MBTEngSettingsObserver *)

IMPORT_C CBTEngSettings * NewL ( MBTEngSettingsObserver * aObserver = NULL ) [static]

Two-phase constructor

Since
S60 v3.2

Parameters

MBTEngSettingsObserver * aObserver = NULL Pointer to callback interface that receives settings change events.

NewLC(MBTEngSettingsObserver *)

IMPORT_C CBTEngSettings * NewLC ( MBTEngSettingsObserver * aObserver = NULL ) [static]

Two-phase constructor

Since
S60 v3.2

Parameters

MBTEngSettingsObserver * aObserver = NULL Pointer to callback interface that receives settings change events.

SetLocalName(const TDes &)

IMPORT_C TInt SetLocalName ( const TDes & aName )

Sets Bluetooth local name.

Since
S60 v3.2

Parameters

const TDes & aName

SetPowerState(TBTPowerStateValue)

IMPORT_C TInt SetPowerState ( TBTPowerStateValue aState )

Sets the Bluetooth power state (on or off). If a callback interface has been provided, the result is communicated through PowerStateChanged() when to power state change has been fully completed.

Since
S60 v3.2

Parameters

TBTPowerStateValue aState Power mode to be set.

SetVisibilityMode(TBTVisibilityMode, TInt)

IMPORT_C TInt SetVisibilityMode ( TBTVisibilityMode aMode,
TInt aTime = 0
)

Sets Bluetooth visibility mode (hidden, limited or general discoverable mode).

Since
S60 v3.2

Parameters

TBTVisibilityMode aMode Discoverability mode to be set to Central Repository.
TInt aTime = 0 Time during which the phone remains in general discoverable state (in minutes), only used with EBTDiscModeTemporary (otherwise ignored).

Member Data Documentation

MBTEngSettingsObserver * iObserver

MBTEngSettingsObserver * iObserver [private]

Observer for changes in BT settings. Not own.

CBTEngSettingsNotify * iSettingsWatcher

CBTEngSettingsNotify * iSettingsWatcher [private]

Timer for temporary discoverable mode. Own.