sl@0
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// CUsbMassStorageController implementation.
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
@internalTechnology
|
sl@0
|
21 |
*/
|
sl@0
|
22 |
|
sl@0
|
23 |
#include <e32test.h>
|
sl@0
|
24 |
#include "t_cusbmassstoragecontroller.h"
|
sl@0
|
25 |
#include "massstoragedebug.h"
|
sl@0
|
26 |
#include "mstestdatadef.h"
|
sl@0
|
27 |
|
sl@0
|
28 |
GLDEF_D RTest test(_L("t_msunittest"));
|
sl@0
|
29 |
|
sl@0
|
30 |
CUsbMassStorageController* CUsbMassStorageController::NewL()
|
sl@0
|
31 |
{
|
sl@0
|
32 |
__PRINT(_L("CUsbMassStorageController::CUsbMassStorageController\n"));
|
sl@0
|
33 |
return new (ELeave) CUsbMassStorageController;
|
sl@0
|
34 |
}
|
sl@0
|
35 |
|
sl@0
|
36 |
/**
|
sl@0
|
37 |
Destructor
|
sl@0
|
38 |
*/
|
sl@0
|
39 |
CUsbMassStorageController::~CUsbMassStorageController()
|
sl@0
|
40 |
{
|
sl@0
|
41 |
__PRINT(_L("CUsbMassStorageController::~CUsbMassStorageController\n"));
|
sl@0
|
42 |
test.Close();
|
sl@0
|
43 |
}
|
sl@0
|
44 |
|
sl@0
|
45 |
/**
|
sl@0
|
46 |
Starts the transport and initializes the protocol.
|
sl@0
|
47 |
@param aConfig Reference to Mass Storage configuration data
|
sl@0
|
48 |
*/
|
sl@0
|
49 |
TInt CUsbMassStorageController::Start(TMassStorageConfig& aConfig)
|
sl@0
|
50 |
{
|
sl@0
|
51 |
__PRINT(_L("CUsbMassStorageController::Start\n"));
|
sl@0
|
52 |
test.Printf(_L("VendorId: %S\n"), &aConfig.iVendorId);
|
sl@0
|
53 |
test.Printf(_L("ProudcdId: %S\n"), &aConfig.iProductId);
|
sl@0
|
54 |
test.Printf(_L("ProudcdRev: %S\n"), &aConfig.iProductRev);
|
sl@0
|
55 |
/*
|
sl@0
|
56 |
TBuf<8> vendorId(_L("vendor"));
|
sl@0
|
57 |
TBuf<16> productId(_L("product"));
|
sl@0
|
58 |
TBuf<4> productRev(_L("Rev"));
|
sl@0
|
59 |
*/
|
sl@0
|
60 |
test(aConfig.iVendorId.Compare(t_vendorId) == 0
|
sl@0
|
61 |
&& aConfig.iProductId.Compare(t_productId) == 0
|
sl@0
|
62 |
&& aConfig.iProductRev.Compare(t_productRev) == 0);
|
sl@0
|
63 |
|
sl@0
|
64 |
return KErrNone; // return value not used
|
sl@0
|
65 |
}
|
sl@0
|
66 |
|
sl@0
|
67 |
/**
|
sl@0
|
68 |
Stops the transport.
|
sl@0
|
69 |
*/
|
sl@0
|
70 |
TInt CUsbMassStorageController::Stop()
|
sl@0
|
71 |
{
|
sl@0
|
72 |
__PRINT(_L("CUsbMassStorageController::Stop\n"));
|
sl@0
|
73 |
test(ETrue);
|
sl@0
|
74 |
|
sl@0
|
75 |
return KErrNone; // return value not used
|
sl@0
|
76 |
}
|
sl@0
|
77 |
|