usbmgmt/usbmgrtest/t_charging_emu/src/CUsbBatteryChargingTestPlugin.cpp
changeset 0 c9bc50fca66e
child 15 f92a4f87e424
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include <ecom/implementationproxy.h>
       
    24 
       
    25 #include <usb/usblogger.h>
       
    26 
       
    27 #ifdef __FLOG_ACTIVE
       
    28 _LIT8(KLogComponent, "USBCHARGE TEST");
       
    29 #endif
       
    30 
       
    31 #include <dummyldd.h>
       
    32 #define __D32USBC_H__ // ensure that d32usbc is ignored, and dummyldd used instead
       
    33 #include "CUsbBatteryChargingTestPlugin.h"
       
    34 
       
    35 // Define the private interface UIDs
       
    36 const TImplementationProxy ImplementationTable[] =
       
    37 	{										
       
    38 	IMPLEMENTATION_PROXY_ENTRY(0x1020DEA8, CUsbBatteryChargingTestPlugin::NewL),
       
    39 	};
       
    40 
       
    41 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
    42 	{
       
    43 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
    44 
       
    45 	return ImplementationTable;
       
    46 	}
       
    47 
       
    48 CUsbBatteryChargingTestPlugin* CUsbBatteryChargingTestPlugin::NewL(MUsbmanExtensionPluginObserver& aObserver)
       
    49 	{
       
    50 	LOGTEXT(_L8("NewL Test plug-n"));
       
    51 
       
    52 	CUsbBatteryChargingTestPlugin* self = new(ELeave) CUsbBatteryChargingTestPlugin(aObserver);
       
    53 	CleanupStack::PushL(self);
       
    54 	self->ConstructL();
       
    55 	CleanupStack::Pop(self);
       
    56 	return self;
       
    57 	}
       
    58 
       
    59 CUsbBatteryChargingTestPlugin::CUsbBatteryChargingTestPlugin(MUsbmanExtensionPluginObserver& aObserver)
       
    60 : CUsbBatteryChargingPlugin(aObserver) {}
       
    61 
       
    62 void CUsbBatteryChargingTestPlugin::GetPluginInfo(TPluginTestInfo& aInfo)
       
    63 	{
       
    64 	aInfo.iPluginState = iPluginState;
       
    65 	aInfo.iAvailableMilliAmps = iAvailableMilliAmps;
       
    66 	aInfo.iDeviceState = iDeviceState;
       
    67 	aInfo.iUserSetting = iUserSetting;
       
    68 	aInfo.iCurrentIndexRequested = iCurrentIndexRequested;
       
    69 	aInfo.iRequestedCurrentValue = iRequestedCurrentValue;
       
    70 	}
       
    71 
       
    72 TAny* CUsbBatteryChargingTestPlugin::GetInterface(TUid aUid)
       
    73 	{
       
    74 	TAny* ret = NULL;
       
    75 	if (aUid == KUidUsbBatteryChargingTestPluginInterface2)
       
    76 		{
       
    77 		ret = reinterpret_cast<TAny*>(
       
    78 			static_cast<MUsbBatteryChargingTestPluginInterface2*>(this)
       
    79 			);
       
    80 		}
       
    81 	return ret;
       
    82 	}