os/kernelhwsrv/kerneltest/f32test/smassstorage/src/t_cusbmassstoragecontroller.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/smassstorage/src/t_cusbmassstoragecontroller.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,77 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// CUsbMassStorageController implementation.
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalTechnology
1.24 +*/
1.25 +
1.26 +#include <e32test.h>
1.27 +#include "t_cusbmassstoragecontroller.h"
1.28 +#include "massstoragedebug.h"
1.29 +#include "mstestdatadef.h"
1.30 +
1.31 +GLDEF_D RTest test(_L("t_msunittest"));
1.32 +
1.33 +CUsbMassStorageController* CUsbMassStorageController::NewL()
1.34 + {
1.35 + __PRINT(_L("CUsbMassStorageController::CUsbMassStorageController\n"));
1.36 + return new (ELeave) CUsbMassStorageController;
1.37 + }
1.38 +
1.39 +/**
1.40 + Destructor
1.41 + */
1.42 +CUsbMassStorageController::~CUsbMassStorageController()
1.43 + {
1.44 + __PRINT(_L("CUsbMassStorageController::~CUsbMassStorageController\n"));
1.45 + test.Close();
1.46 + }
1.47 +
1.48 +/**
1.49 + Starts the transport and initializes the protocol.
1.50 + @param aConfig Reference to Mass Storage configuration data
1.51 + */
1.52 +TInt CUsbMassStorageController::Start(TMassStorageConfig& aConfig)
1.53 + {
1.54 + __PRINT(_L("CUsbMassStorageController::Start\n"));
1.55 + test.Printf(_L("VendorId: %S\n"), &aConfig.iVendorId);
1.56 + test.Printf(_L("ProudcdId: %S\n"), &aConfig.iProductId);
1.57 + test.Printf(_L("ProudcdRev: %S\n"), &aConfig.iProductRev);
1.58 +/*
1.59 + TBuf<8> vendorId(_L("vendor"));
1.60 + TBuf<16> productId(_L("product"));
1.61 + TBuf<4> productRev(_L("Rev"));
1.62 +*/
1.63 + test(aConfig.iVendorId.Compare(t_vendorId) == 0
1.64 + && aConfig.iProductId.Compare(t_productId) == 0
1.65 + && aConfig.iProductRev.Compare(t_productRev) == 0);
1.66 +
1.67 + return KErrNone; // return value not used
1.68 + }
1.69 +
1.70 +/**
1.71 + Stops the transport.
1.72 + */
1.73 +TInt CUsbMassStorageController::Stop()
1.74 + {
1.75 + __PRINT(_L("CUsbMassStorageController::Stop\n"));
1.76 + test(ETrue);
1.77 +
1.78 + return KErrNone; // return value not used
1.79 + }
1.80 +