diff -r 000000000000 -r 4e1aa6a622a0 accessoryservices/remotecontrolfw/client/extapi1/src/absvoltarget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/accessoryservices/remotecontrolfw/client/extapi1/src/absvoltarget.cpp Tue Feb 02 00:53:00 2010 +0200 @@ -0,0 +1,139 @@ +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file + @internalComponent +*/ + +#include +#include +#include +#include +#include +#include +#include "absvolutils.h" + +#ifdef __FLOG_ACTIVE +_LIT8(KLogComponent, LOG_COMPONENT_REMCON_EXTAPI1); +#endif + +EXPORT_C CRemConAbsVolTarget* CRemConAbsVolTarget::NewL(CRemConInterfaceSelector& aInterfaceSelector, + MRemConAbsVolTargetObserver& aObserver) + { + LOG_STATIC_FUNC + + CRemConAbsVolTarget* self = new(ELeave) CRemConAbsVolTarget(aInterfaceSelector, aObserver); + CleanupStack::PushL(self); + self->BaseConstructL(); + CleanupStack::Pop(self); + return self; + } + +CRemConAbsVolTarget::CRemConAbsVolTarget(CRemConInterfaceSelector& aInterfaceSelector, + MRemConAbsVolTargetObserver& aObserver) +: CRemConInterfaceBase(TUid::Uid(KRemConAbsVolApiUid), + KMaxOperationDataSize, + aInterfaceSelector, + ERemConClientTypeTarget), + iObserver(aObserver) + { + } + +EXPORT_C CRemConAbsVolTarget::~CRemConAbsVolTarget() + { + LOG_FUNC + } + +TAny* CRemConAbsVolTarget::GetInterfaceIf(TUid aUid) + { + TAny* ret = NULL; + if ( aUid == TUid::Uid(KRemConInterfaceIf1) ) + { + ret = reinterpret_cast( + static_cast(this) + ); + } + + return ret; + } + +void CRemConAbsVolTarget::MrcibNewMessage(TUint aOperationId, const TDesC8& aData) + { + LOG_FUNC + LOG1(_L("\taOperationId = 0x%02x"), aOperationId); + LOG1(_L("\taData.Length = %d"), aData.Length()); + + switch ( aOperationId ) + { + case ERemConGetAbsoluteVolume: + iObserver.MrcavtoGetAbsoluteVolume(); + break; + + case ERemConSetAbsoluteVolume: + { + TUint absVol; + TUint maxVol; + // 20 is the length of the abs vol data. + if(aData.Length()