/*
* Component Name: Headset Simulator
* Author: Comarch S.A.
* Version: 1.0
* Copyright (c) 2010 Comarch S.A.
*
* This Software is submitted by Comarch S.A. to Symbian Foundation Limited on
* the basis of the Member Contribution Agreement entered between Comarch S.A.
* and Symbian Foundation Limited on 5th June 2009 (“Agreement”) and may be
* used only in accordance with the terms and conditions of the Agreement.
* Any other usage, duplication or redistribution of this Software is not
* allowed without written permission of Comarch S.A.
*
*/
inline CHsCoDBase* CHsCoDBase::NewL( const TUid aUid )
{
TAny *impl = REComSession::CreateImplementationL( aUid, _FOFF( CHsCoDBase,
iDtor_ID_Key ) );
return (CHsCoDBase*) impl;
}
inline CHsCoDBase* CHsCoDBase::NewL( const TDesC8 &aData )
{
TEComResolverParams params;
params.SetDataType( aData );
params.SetWildcardMatch( ETrue );
TAny *impl = REComSession::CreateImplementationL(
KHsCoDBaseInterfaceDefinitionUid,
_FOFF( CHsCoDBase, iDtor_ID_Key ), params );
return (CHsCoDBase*) impl;
}
inline CHsCoDBase::~CHsCoDBase()
{
REComSession::DestroyedImplementation( iDtor_ID_Key );
}
inline TInt CHsCoDBase::SetDefaultCod()
{
TBTDeviceClass defaultDeviceClass( iDefaultDeviceClass );
TInt err = RProperty::Set( KPropertyUidBluetoothCategory,
KPropertyKeyBluetoothSetDeviceClass,
defaultDeviceClass.DeviceClass() );
return err;
}
inline TInt CHsCoDBase::RestoreOldCod()
{
return SetDefaultCod();
}
inline TInt CHsCoDBase::SaveOldCod()
{
TInt defaultCoDasInt, err;
err = RProperty::Get( KPropertyUidBluetoothCategory,
KPropertyKeyBluetoothGetDeviceClass, defaultCoDasInt );
TBTDeviceClass defaultCoD( defaultCoDasInt );
iDefaultDeviceClass = defaultCoD.DeviceClass();
return err;
}