usbmgmt/usbmgrtest/t_charging_emu/src/CUsbBatteryChargingTestPlugin.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 17:01:47 +0300
branchRCL_3
changeset 15 f92a4f87e424
parent 0 c9bc50fca66e
child 16 012cc2ee6408
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2007-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 <ecom/implementationproxy.h>

#include <usb/usblogger.h>

#ifdef __FLOG_ACTIVE
_LIT8(KLogComponent, "USBCHARGE TEST");
#endif

#include <dummyldd.h>
#define __D32USBC_H__ // ensure that d32usbc is ignored, and dummyldd used instead
#include "CUsbBatteryChargingTestPlugin.h"
#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "CUsbBatteryChargingTestPluginTraces.h"
#endif


// Define the private interface UIDs
const TImplementationProxy ImplementationTable[] =
	{										
	IMPLEMENTATION_PROXY_ENTRY(0x1020DEA8, CUsbBatteryChargingTestPlugin::NewL),
	};

EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
	{
	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);

	return ImplementationTable;
	}

CUsbBatteryChargingTestPlugin* CUsbBatteryChargingTestPlugin::NewL(MUsbmanExtensionPluginObserver& aObserver)
	{
    OstTrace0( TRACE_NORMAL, CUSBBATTERYCHARGINGTESTPLUGIN_NEWL, _L8("NewL Test plug-n"));
    
	CUsbBatteryChargingTestPlugin* self = new(ELeave) CUsbBatteryChargingTestPlugin(aObserver);
	CleanupStack::PushL(self);
	self->ConstructL();
	CleanupStack::Pop(self);
	return self;
	}

CUsbBatteryChargingTestPlugin::CUsbBatteryChargingTestPlugin(MUsbmanExtensionPluginObserver& aObserver)
: CUsbBatteryChargingPlugin(aObserver) {}

void CUsbBatteryChargingTestPlugin::GetPluginInfo(TPluginTestInfo& aInfo)
	{
	aInfo.iPluginState = iPluginState;
	aInfo.iAvailableMilliAmps = iAvailableMilliAmps;
	aInfo.iDeviceState = iDeviceState;
	aInfo.iUserSetting = iUserSetting;
	aInfo.iCurrentIndexRequested = iCurrentIndexRequested;
	aInfo.iRequestedCurrentValue = iRequestedCurrentValue;
	}

TAny* CUsbBatteryChargingTestPlugin::GetInterface(TUid aUid)
	{
	TAny* ret = NULL;
	if (aUid == KUidUsbBatteryChargingTestPluginInterface2)
		{
		ret = reinterpret_cast<TAny*>(
			static_cast<MUsbBatteryChargingTestPluginInterface2*>(this)
			);
		}
	return ret;
	}