kerneltest/e32test/usbho/t_usbdi/src/testdeviceA.cpp
author Tom Cosgrove <tom.cosgrove@nokia.com>
Fri, 28 May 2010 16:29:07 +0100
changeset 30 8aab599e3476
parent 0 a41df078684a
child 43 c1f20ce4abcf
permissions -rw-r--r--
Fix for bug 2283 (RVCT 4.0 support is missing from PDK 3.0.h) Have multiple extension sections in the bld.inf, one for each version of the compiler. The RVCT version building the tools will build the runtime libraries for its version, but make sure we extract all the other versions from zip archives. Also add the archive for RVCT4.

// 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 the License "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 testdeviceA.cpp
// @internalComponent
// 
//

#include "modelleddevices.h"
#include "testinterfacebase.h"
#include "testinterfacesettingbase.h"


namespace NUnitTesting_USBDI
	{
	
RUsbDeviceA::RUsbDeviceA()
	{
	LOG_FUNC
	}
	
RUsbDeviceA::RUsbDeviceA(CBaseTestCase* aTestCase):RUsbDeviceVendor(aTestCase)
	{
	LOG_FUNC
	}
	
RUsbDeviceA::~RUsbDeviceA()
	{
	LOG_FUNC	
	}
	

void RUsbDeviceA::OpenL(const TDesC16& aSerialNumber)
	{
	LOG_FUNC
	
	RUsbDeviceVendor::OpenL(aSerialNumber);
	
	// Create another interface (interface1)
	
	CInterfaceBase* interface1 = new (ELeave) CInterfaceBase(*this,_L("i1"));
	CleanupStack::PushL(interface1);
	interface1->BaseConstructL();
	
	// Create default interface setting 0
	
	CInterfaceSettingBase* interface1s0 = new (ELeave) CInterfaceSettingBase(_L("i1s0"));
	CleanupStack::PushL(interface1s0);
	interface1s0->SetClassCodeL(0xFF,0xFF,0xFF);

	// Create some endpoints
	TBulkOutEndpoint s0_ep1(EEndpoint1);
	TBulkInEndpoint s0_ep2(EEndpoint2);
	
	interface1s0->AddEndpoint(s0_ep1);
	interface1s0->AddEndpoint(s0_ep2);

	interface1->AddInterfaceSettingL(interface1s0);	
	CleanupStack::Pop(interface1s0);
	
	// Create alternate interface setting 1
	
	CInterfaceSettingBase* interface1s1 = new (ELeave) CInterfaceSettingBase(_L("i1s1"));
	CleanupStack::PushL(interface1s1);
	interface1s1->SetClassCodeL(0xFF,0xFF,0xFF);
	
	// Create endpoints
	
	TIntInEndpoint s1_ep1(EEndpoint1,64);
	TBulkOutEndpoint s1_ep2(EEndpoint2);
	TBulkInEndpoint s1_ep3(EEndpoint3);
	
	interface1s1->AddEndpoint(s1_ep1);
	interface1s1->AddEndpoint(s1_ep2);
	interface1s1->AddEndpoint(s1_ep3);
	
	interface1->AddInterfaceSettingL(interface1s1);	
	CleanupStack::Pop(interface1s1);
	
	AddInterface(interface1);
	CleanupStack::Pop(interface1);
	}

	
void RUsbDeviceA::OnStateChangeL(TUsbcDeviceState aNewState)
	{
	LOG_FUNC
	}	
	
	
	}