usbmgmt/usbmgrtest/t_charging_emu/src/CUsbBatteryChargingTestPlugin.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 02:02:59 +0200
changeset 0 c9bc50fca66e
child 29 59aa7d6e3e0f
permissions -rw-r--r--
Revision: 201001 Kit: 201005

/*
* 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"

// 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)
	{
	LOGTEXT(_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;
	}