os/kernelhwsrv/kerneltest/f32test/smassstorage/src/t_cusbmassstoragecontroller.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     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 // CUsbMassStorageController implementation.
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @internalTechnology
    21 */
    22 
    23 #include <e32test.h>
    24 #include "t_cusbmassstoragecontroller.h"
    25 #include "massstoragedebug.h"
    26 #include "mstestdatadef.h"
    27 
    28 GLDEF_D RTest test(_L("t_msunittest"));
    29 
    30 CUsbMassStorageController* CUsbMassStorageController::NewL()
    31     {
    32     __PRINT(_L("CUsbMassStorageController::CUsbMassStorageController\n"));
    33     return new (ELeave) CUsbMassStorageController;
    34     }
    35 
    36 /**
    37  Destructor
    38  */
    39 CUsbMassStorageController::~CUsbMassStorageController()
    40 	{
    41 	__PRINT(_L("CUsbMassStorageController::~CUsbMassStorageController\n"));
    42 	test.Close();
    43 	}
    44 
    45 /**
    46  Starts the transport and initializes the protocol.
    47  @param aConfig Reference to Mass Storage configuration data
    48  */
    49 TInt CUsbMassStorageController::Start(TMassStorageConfig& aConfig)
    50 	{
    51 	__PRINT(_L("CUsbMassStorageController::Start\n"));
    52 	test.Printf(_L("VendorId: %S\n"), &aConfig.iVendorId);
    53 	test.Printf(_L("ProudcdId: %S\n"), &aConfig.iProductId);
    54 	test.Printf(_L("ProudcdRev: %S\n"), &aConfig.iProductRev);
    55 /*	
    56 	TBuf<8> vendorId(_L("vendor"));
    57 	TBuf<16> productId(_L("product"));
    58 	TBuf<4> productRev(_L("Rev"));
    59 */	
    60 	test(aConfig.iVendorId.Compare(t_vendorId) == 0
    61 		&& aConfig.iProductId.Compare(t_productId) == 0
    62 		&& aConfig.iProductRev.Compare(t_productRev) == 0);
    63 		
    64 	return KErrNone;	// return value not used
    65 	}
    66 
    67 /**
    68  Stops the transport.
    69  */
    70 TInt CUsbMassStorageController::Stop()
    71 	{
    72 	__PRINT(_L("CUsbMassStorageController::Stop\n"));
    73 	test(ETrue);
    74 	
    75 	return KErrNone; 	// return value not used
    76 	}
    77