253
|
1 |
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// @file vendordevice.cpp
|
|
15 |
// @internalComponent
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
#include "modelleddevices.h"
|
|
20 |
#include "testinterfacebase.h"
|
|
21 |
#include "testinterfacesettingbase.h"
|
253
|
22 |
#include "OstTraceDefinitions.h"
|
|
23 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
24 |
#include "vendordeviceTraces.h"
|
|
25 |
#endif
|
0
|
26 |
|
|
27 |
namespace NUnitTesting_USBDI
|
|
28 |
{
|
|
29 |
|
|
30 |
|
|
31 |
RUsbDeviceVendor::RUsbDeviceVendor()
|
|
32 |
{
|
253
|
33 |
OstTraceFunctionEntry1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY, this );
|
|
34 |
OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT, this );
|
0
|
35 |
}
|
|
36 |
|
|
37 |
RUsbDeviceVendor::RUsbDeviceVendor(CBaseTestCase* aTestCase):RUsbTestDevice(aTestCase)
|
|
38 |
{
|
253
|
39 |
OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP01, this );
|
|
40 |
OstTrace1(TRACE_NORMAL, RUSBDEVICEVENDOR_RUSBDEVICEVENDOR, "aTestCase = %d", aTestCase);
|
|
41 |
OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP01, this );
|
0
|
42 |
}
|
|
43 |
|
|
44 |
|
|
45 |
RUsbDeviceVendor::~RUsbDeviceVendor()
|
|
46 |
{
|
253
|
47 |
OstTraceFunctionEntry1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_ENTRY_DUP02, this );
|
|
48 |
OstTraceFunctionExit1( RUSBDEVICEVENDOR_RUSBDEVICEVENDOR_EXIT_DUP02, this );
|
0
|
49 |
}
|
|
50 |
|
|
51 |
|
|
52 |
void RUsbDeviceVendor::OpenL(const TDesC& aSerialNumber)
|
|
53 |
{
|
253
|
54 |
OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_OPENL_ENTRY, this );
|
0
|
55 |
|
|
56 |
RUsbTestDevice::OpenL();
|
|
57 |
|
|
58 |
// Device/Product information
|
|
59 |
SetUsbSpecification(0x0200); // Usb spec. 2.0
|
|
60 |
SetVendor(0x0E22);
|
|
61 |
SetProduct(0x0040, KVendorDevice, KManufacturer,aSerialNumber);
|
|
62 |
SetClassCode(0xFF,0xFF,0xFF);
|
|
63 |
SetConfigurationString(KConfigurationString);
|
|
64 |
|
|
65 |
// Establish a default interface with a default setting
|
|
66 |
CInterfaceBase* interface0 = new (ELeave) CInterfaceBase(*this,_L("i0"));
|
|
67 |
CleanupStack::PushL(interface0);
|
|
68 |
interface0->BaseConstructL();
|
|
69 |
|
|
70 |
// Default interface setting 0
|
|
71 |
CInterfaceSettingBase* interface0s0 = new (ELeave) CInterfaceSettingBase(_L("i0s0"));
|
|
72 |
CleanupStack::PushL(interface0s0);
|
|
73 |
interface0s0->SetClassCodeL(0xFF,0xFF,0xFF);
|
|
74 |
|
|
75 |
interface0->AddInterfaceSettingL(interface0s0);
|
|
76 |
CleanupStack::Pop(interface0s0);
|
|
77 |
AddInterface(interface0);
|
|
78 |
CleanupStack::Pop(interface0);
|
253
|
79 |
OstTraceFunctionExit1( RUSBDEVICEVENDOR_OPENL_EXIT, this );
|
0
|
80 |
}
|
|
81 |
|
|
82 |
|
|
83 |
void RUsbDeviceVendor::OnStateChangeL(TUsbcDeviceState aNewState)
|
|
84 |
{
|
253
|
85 |
OstTraceFunctionEntryExt( RUSBDEVICEVENDOR_ONSTATECHANGEL_ENTRY, this );
|
|
86 |
OstTraceFunctionExit1( RUSBDEVICEVENDOR_ONSTATECHANGEL_EXIT, this );
|
0
|
87 |
}
|
|
88 |
|
|
89 |
|
|
90 |
}
|
|
91 |
|