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 * aObserverPointer to callback interface that receives settings change events.

~CBTEngSettings()

~CBTEngSettings()[virtual]

Destructor

Member Functions Documentation

ChangePowerStateTemporarily()

IMPORT_C TIntChangePowerStateTemporarily()

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

voidConstructL()[private]

Symbian 2nd-phase constructor

Since
S60 v3.2

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

voidGetCenRepKeyL(const TUidaUid,
const TIntaKey,
TInt &aValue,
const TIntaMinRange1,
const TIntaMaxRange1,
const TIntaMinRange2 = 0,
const TIntaMaxRange2 = 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 aUidUID of the key to be read.
const TInt aKeyThe key to be read.
TInt & aValueDefault value of the key; on return contains the value as read from CenRep.
const TInt aMinRange1Lower limit of the first valid range of key values.
const TInt aMaxRange1Upper limit of the first valid range of key values.
const TInt aMinRange2 = 0Lower limit of the second valid range of key values.
const TInt aMaxRange2 = 0Upper limit of the second valid range of key values.

GetLocalName(TDes &)

IMPORT_C TIntGetLocalName(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 & aStatusOn return, contains the current status of the local name.

GetOfflineModeSettings(TCoreAppUIsNetworkConnectionAllowed &, TBTEnabledInOfflineMode &)

IMPORT_C TIntGetOfflineModeSettings(TCoreAppUIsNetworkConnectionAllowed &aOffline,
TBTEnabledInOfflineMode &aOfflineAllowed
)

Gets Bluetooth offline mode settings.

Since
S60 v5.0

Parameters

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

GetPowerState(TBTPowerStateValue &)

IMPORT_C TIntGetPowerState(TBTPowerStateValue &aState)

Gets the Bluetooth power state (on or off).

Since
S60 v3.2

Parameters

TBTPowerStateValue & aStateOn return, contains the current power mode.

GetVisibilityMode(TBTVisibilityMode &)

IMPORT_C TIntGetVisibilityMode(TBTVisibilityMode &aMode)

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

Since
S60 v3.2

Parameters

TBTVisibilityMode & aModeOn 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 & aNameThe 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 = NULLPointer 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 = NULLPointer to callback interface that receives settings change events.

SetLocalName(const TDes &)

IMPORT_C TIntSetLocalName(const TDes &aName)

Sets Bluetooth local name.

Since
S60 v3.2

Parameters

const TDes & aName

SetPowerState(TBTPowerStateValue)

IMPORT_C TIntSetPowerState(TBTPowerStateValueaState)

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 aStatePower mode to be set.

SetVisibilityMode(TBTVisibilityMode, TInt)

IMPORT_C TIntSetVisibilityMode(TBTVisibilityModeaMode,
TIntaTime = 0
)

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

Since
S60 v3.2

Parameters

TBTVisibilityMode aModeDiscoverability mode to be set to Central Repository.
TInt aTime = 0Time 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.