sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "gsmconfigtestdevice.h" sl@0: #include "devsoundciutestdevices.hrh" sl@0: sl@0: sl@0: /* sl@0: CMMFGsmConfig implementation sl@0: */ sl@0: CMMFGsmConfig* CMMFGsmConfig::NewL() sl@0: { sl@0: CMMFGsmConfig* self = new(ELeave) CMMFGsmConfig(); sl@0: return self; sl@0: } sl@0: sl@0: CMMFGsmConfig::~CMMFGsmConfig() sl@0: { sl@0: } sl@0: sl@0: // Actual implementation of method sl@0: TInt CMMFGsmConfig::SetConversionFormat(TMMFGsmConversionFormat aConvFormat) sl@0: { sl@0: iConvFormat = aConvFormat; sl@0: return KErrNone; sl@0: } sl@0: sl@0: // Actual implementation of method sl@0: TInt CMMFGsmConfig::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const sl@0: { sl@0: aConvFormat = iConvFormat; sl@0: return KErrNone; sl@0: } sl@0: sl@0: sl@0: /* sl@0: CGsmConfigTestDevice Implementation sl@0: */ sl@0: CMMFHwDevice* CGsmConfigTestDevice::NewL() sl@0: { sl@0: CGsmConfigTestDevice* self=new(ELeave) CGsmConfigTestDevice(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: CGsmConfigTestDevice::~CGsmConfigTestDevice() sl@0: { sl@0: delete iGsmConfig; sl@0: } sl@0: sl@0: CGsmConfigTestDevice::CGsmConfigTestDevice() sl@0: { sl@0: } sl@0: sl@0: void CGsmConfigTestDevice::ConstructL() sl@0: { sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::Stop() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::Pause() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TAny* CGsmConfigTestDevice::CustomInterface(TUid aInterfaceId) sl@0: { sl@0: // Just return something non-NULL to keep the sl@0: // DevSound initialisation process happy sl@0: TAny* ret = static_cast(this); sl@0: sl@0: // Now for the CIs we want to test... sl@0: if (aInterfaceId == KUidGsmConfig) sl@0: { sl@0: if (!iGsmConfig) sl@0: { sl@0: TRAPD(err, iGsmConfig = CMMFGsmConfig::NewL()); sl@0: if (err == KErrNone && iGsmConfig) sl@0: { sl@0: MMMFGsmConfig* ptr = this; sl@0: ret = static_cast(ptr); sl@0: } sl@0: else sl@0: { sl@0: ret = NULL; sl@0: } sl@0: } sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::StopAndDeleteCodec() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::DeleteCodec() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: CMMFSwCodec& CGsmConfigTestDevice::Codec() sl@0: { sl@0: return *iCodec; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::SetConversionFormat(TMMFGsmConversionFormat aConvFormat) sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iGsmConfig) sl@0: { sl@0: result = iGsmConfig->SetConversionFormat(aConvFormat); sl@0: } sl@0: sl@0: return result; sl@0: } sl@0: sl@0: TInt CGsmConfigTestDevice::ConversionFormat(TMMFGsmConversionFormat& aConvFormat) const sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iGsmConfig) sl@0: { sl@0: result = iGsmConfig->ConversionFormat(aConvFormat); sl@0: } sl@0: sl@0: return result; sl@0: }