diff -r 7e15987c4500 -r 8c311f9acc5e usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp Fri Mar 19 09:48:52 2010 +0200 @@ -0,0 +1,976 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "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: +* +*/ + + + + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include "UsbUiNotifApiTest.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CUsbUiNotifApiTest::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CUsbUiNotifApiTest::Delete() + { + iNotifier -> Close(); + delete iNotifier; + iNotifier = NULL; + iUsbWatcher -> Close(); + delete iUsbWatcher; + iUsbWatcher = NULL; + delete iRepository; + iRepository = NULL; + } + +// ----------------------------------------------------------------------------- +// CUsbUiNotifApiTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CUsbUiNotifApiTest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + ENTRY( "ExecuteApiTestBlock", CUsbUiNotifApiTest::ExecuteApiTestBlock ), + ENTRY( "ExecuteModuleTestBlock", CUsbUiNotifApiTest::ExecuteModuleTestBlock ), + ENTRY( "ExecuteBranchTestBlock", CUsbUiNotifApiTest::ExecuteBranchTestBlock ), + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CUsbUiNotifApiTest::GetTestBlockParamsL +// ----------------------------------------------------------------------------- + +void CUsbUiNotifApiTest::GetTestBlockParamsL( CStifItemParser& aItem ) + { + TRACE_INFO( _L(">>> GetTestBlockParamsL") ); + + // Add new test block branches below, get all required test parameters + if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) + { + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption1 ) ); + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); + User::LeaveIfError( aItem.GetNextInt( iTestBlockParams.iTestIntOption1 ) ); + User::LeaveIfError( aItem.GetNextChar( iTestBlockParams.iTestCharOption1 ) ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CableConnectedNotifierTest" ) ) ) + { + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) + { + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FinishQuery" ) ) ) + { + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGErrorNotifierTests" ) ) ) + { + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGWarningNotifierTests" ) ) ) + { + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "LoadNotifiers" ) ) ) + { + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UnLoadNotifiers" ) ) ) + { + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbMSMMNotifierTests" ) ) ) + { + User::LeaveIfError( aItem.GetNextString( iTestBlockParams.iTestOption2 ) ); + } + else + { + TRACE_INFO( _L("GetTestBlockParamsL() Test type: not found") ); + User::Leave( KErrNotFound ); + } + TRACE_INFO( _L("<<< GetTestBlockParamsL") ); + } + +// ----------------------------------------------------------------------------- +// CUsbUiNotifApiTest::ExecuteApiTestBlock +// ----------------------------------------------------------------------------- + +TInt CUsbUiNotifApiTest::ExecuteApiTestBlock( CStifItemParser& aItem ) + { + TRACE_INFO( _L(">>> ExecuteApiTestBlock") ); + + TInt res; + TUsbUiNotifApiTestResult testResult = ETestCaseFailed; + + TRAP( res, DoExecuteApiTestBlockL( aItem, testResult ) ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("DoExecuteApiTestBlockL error: %d"), res) ); + return res; + } + + STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); + TRACE_INFO( _L("Test case passed") ); + + TRACE_INFO( _L("<<< ExecuteApiTestBlock") ); + + return KErrNone; + } + + +void CUsbUiNotifApiTest::DoExecuteApiTestBlockL( CStifItemParser& aItem, TUsbUiNotifApiTestResult& aTestResult ) + { + TRACE_INFO( _L(">>>DoExecuteApiTestBlockL") ); + + User::LeaveIfError( aItem.GetString( _L( "ExecuteApiTestBlock" ), iTestBlockParams.iTestBlockName ) ); + TRACE_INFO( (_L("Api test type: %S"), &iTestBlockParams.iTestBlockName) ); + + GetTestBlockParamsL( aItem ); + + // Add new API test block branches with optional test parameters here + if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) + { + ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, + iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "CableConnectedNotifierTest" ) ) ) + { + CableConnectedNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) + { + UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "FinishQuery" ) ) ) + { + FinishQuery( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) + { + UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) + { + UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbQueriesNotifierTest" ) ) ) + { + UsbQueriesNotifierTest( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGErrorNotifierTests" ) ) ) + { + UsbOTGErrorNotifierTests( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbOTGWarningNotifierTests" ) ) ) + { + UsbOTGWarningNotifierTests( iTestBlockParams.iTestOption2, aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "LoadNotifiers" ) ) ) + { + LoadNotifiersL( aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UnLoadNotifiers" ) ) ) + { + UnLoadNotifiers( aTestResult ); + } + else if ( !iTestBlockParams.iTestBlockName.Compare( _L( "UsbMSMMNotifierTests" ) ) ) + { + UsbMSMMNotifierTests( iTestBlockParams.iTestOption2, aTestResult ); + } + else + { + TRACE_INFO( _L("DoExecuteApiTestBlockL() Test type: not found") ); + User::Leave( KErrNotFound ); + } + + TRACE_INFO( _L("<<>>ExecuteModuleTestBlock") ); + + TInt res; + TUsbUiNotifApiTestResult testResult; + + TRAP( res, DoExecuteModuleTestBlockL( aItem, testResult ) ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("DoExecuteModuleTestBlockL error: %d"), res) ); + return res; + } + + STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); + TRACE_INFO( _L("Test case passed") ); + TRACE_INFO( _L("<<>>DoExecuteModuleTestBlockL") ); + + User::LeaveIfError( aItem.GetString( _L( "ExecuteModuleTestBlock" ), iTestBlockParams.iTestBlockName ) ); + TRACE_INFO( (_L("Module test type: %S"), &iTestBlockParams.iTestBlockName) ); + + GetTestBlockParamsL( aItem ); + + // Add new module test block branches with optional test parameters here + if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) + { + ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, + iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); + } + else + { + TRACE_INFO( _L("DoExecuteModuleTestBlockL() Test type: not found") ); + User::Leave( KErrNotFound ); + } + + TRACE_INFO( _L("<<>>ExecuteBranchTestBlock") ); + + TInt res; + TUsbUiNotifApiTestResult testResult; + + TRAP( res, DoExecuteBranchTestBlockL( aItem, testResult ) ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("DoExecuteBranchTestBlockL error: %d"), res) ); + return res; + } + + STIF_ASSERT_EQUALS( ETestCasePassed, testResult ); + TRACE_INFO( _L("Test case passed") ); + TRACE_INFO( _L("<<>>DoExecuteBranchTestBlockL") ); + + User::LeaveIfError( aItem.GetString( _L( "ExecuteBranchTestBlock" ), iTestBlockParams.iTestBlockName ) ); + TRACE_INFO( (_L("Branch test type: %S"), &iTestBlockParams.iTestBlockName) ); + + GetTestBlockParamsL( aItem ); + + // Add new branch test block branches with optional test parameters here + if ( !iTestBlockParams.iTestBlockName.Compare( _L( "ExampleTestL" ) ) ) + { + ExampleTestL( iTestBlockParams.iTestOption1, iTestBlockParams.iTestOption2, + iTestBlockParams.iTestIntOption1, iTestBlockParams.iTestCharOption1, aTestResult ); + } + else + { + TRACE_INFO( _L("DoExecuteBranchTestBlockL() Test type: not found") ); + User::Leave( KErrNotFound ); + } + + TRACE_INFO( _L("<<>>ExampleTestL") ); + + if ( !aTestOption.Compare( _L( "API" ) ) ) + { + TRACE_INFO( (_L("Api test option: %S"), &aTestOption) ); + TRACE_INFO( (_L("Api test sub-option: %S"), &aTestSubOption) ); + TRACE_INFO( (_L("Api test int option: %d"), aTestIntOption) ); + TRACE_INFO( (_L("Api test char option: %c"), aTestCharOption) ); + } + else if ( !aTestOption.Compare( _L( "MODULE" ) ) ) + { + TRACE_INFO( (_L("Module test option: %S"), &aTestOption) ); + TRACE_INFO( (_L("Module test sub-option: %S"), &aTestSubOption) ); + TRACE_INFO( (_L("Module test int option: %d"), aTestIntOption) ); + TRACE_INFO( (_L("Module test char option: %c"), aTestCharOption) ); + } + else if ( !aTestOption.Compare( _L( "BRANCH" ) ) ) + { + TRACE_INFO( (_L("Branch test option: %S"), &aTestOption) ); + TRACE_INFO( (_L("Branch test sub-option: %S"), &aTestSubOption) ); + TRACE_INFO( (_L("Branch test int option: %d"), aTestIntOption) ); + TRACE_INFO( (_L("Branch test char option: %c"), aTestCharOption) ); + } + else + { + TRACE_INFO( _L("Invalid test parameter") ); + User::Leave( KErrNotFound ); + } + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>CableConnectedNotifierTest") ); + + TInt res; + TUSBConnectionNotifierParamsPckg emptyNotifierInputPckg; + TPtrC displayedUsbPersonalityName( KNullDesC ); + TInt displayedUsbPersonalityId; + + res = GetPersonalityIdFromString( aTestSubOption, displayedUsbPersonalityId ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("GetPersonalityIdFromString failed with value: %d"), res) ); + return; + } + + res = iRepository -> Get( KUsbWatcherPersonality, iPersonalityIdBackup ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("Personality backup failed with value (cenrep): %d"), res) ); + return; + } + + res = iUsbWatcher -> Connect(); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("Failed to connect UsbWatcher with value: %d"), res) ); + return; + } + TRACE_INFO( _L("UsbWatcher connected") ); + + iUsbWatcher -> SetPersonality( iReqStatus, displayedUsbPersonalityId, ETrue, ETrue ); + User::WaitForRequest( iReqStatus ); + if ( iReqStatus.Int() != KErrNone ) + { + TRACE_INFO( (_L("Failed to set usb personality with value: %d"), iReqStatus.Int()) ); + iUsbWatcher -> Close(); + return; + } + + res = iNotifier -> Connect(); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); + iUsbWatcher -> Close(); + return; + } + TRACE_INFO( _L("RNotifier connected") ); + + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KCableConnectedNotifierUid, emptyNotifierInputPckg, iConnectionNotifierResponseParamsPckg ); + User::WaitForRequest( iReqStatus ); + + TRACE_INFO((_L("StartNotifierAndGetResponse Status: %d, expected: %d"), iReqStatus.Int(), KErrCancel)); + if(iReqStatus.Int() == KErrCancel) + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>UsbQueriesNotifierTest") ); + TInt res; + TUSBUIQueries usbQueryType; + + + res = GetQueryType( aTestSubOption, usbQueryType ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("GetQueryType failed with value: %d"), res) ); + return; + } + + TUSBQueriesNotiferParams notifierParams; + notifierParams.iDrive = 'c'; + notifierParams.iQuery = usbQueryType; + TUSBQueriesNotifierParamsPckg notifierParamsPckg( notifierParams ); + TPckgBuf output; + + res = iNotifier -> Connect(); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); + return; + } + TRACE_INFO( _L("RNotifier connected") ); + + switch( usbQueryType ) + { + case EUSBNoMemoryCard: + iCompleteQuery = ETrue; + break; + case EUSBStorageMediaFailure: + case EUSBChangeFromMassStorage: + iCompleteQuery = EFalse; + break; + default: + break; + } + + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KQueriesNotifier, notifierParamsPckg, output ); + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>UsbOTGErrorNotifierTests") ); + + TInt res; + TUsbUiNotifOtgError usbOTGErrorType; + + res = GetOTGErrorType( aTestSubOption, usbOTGErrorType ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("usbOTGErrorType failed with value: %d"), res) ); + return; + } + + res = iNotifier -> Connect(); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); + return; + } + TRACE_INFO( _L("RNotifier connected") ); + + TPckgBuf notifierParamsPckg; + notifierParamsPckg() = usbOTGErrorType; + iCompleteQuery = EFalse; + + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KUsbUiNotifOtgError, notifierParamsPckg, iRes ); + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>UsbOTGWarningNotifierTests") ); + + TInt res; + TUsbUiNotifOtgWarning usbOTGWarningType; + + + res = GetOTGWarningType( aTestSubOption, usbOTGWarningType ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("usbOTGErrorType failed with value: %d"), res) ); + return; + } + + res = iNotifier -> Connect(); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); + return; + } + TRACE_INFO( _L("RNotifier connected") ); + + TPckgBuf notifierParamsPckg; + notifierParamsPckg() = usbOTGWarningType; + iCompleteQuery = EFalse; + + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KUsbUiNotifOtgWarning, notifierParamsPckg, iRes ); + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>UsbMSMMNotifierTests") ); + + TInt res; + THostMsErrCode usbMSMMNErrorType; + + res = GetMSMMrrorType( aTestSubOption, usbMSMMNErrorType ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("MSMMrrorType failed with value: %d"), res) ); + return; + } + iErrData.iError=usbMSMMNErrorType; + iErrPckg = iErrData; + res = iNotifier -> Connect(); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("Failed to connect RNotifier with value: %d"), res) ); + return; + } + TRACE_INFO( _L("RNotifier connected") ); + + TPckgBuf notifierParamsPckg; + notifierParamsPckg() = usbMSMMNErrorType; + iCompleteQuery = EFalse; + + iNotifier -> StartNotifierAndGetResponse( iReqStatus, KUsbUiNotifMsmmError, iErrPckg, iRes ); + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>FinishQuery") ); + + TInt res; + TTestOption option; + + if ( iCompleteQuery ) + { + TRequestStatus* statPtr = &iReqStatus; + User::RequestComplete( statPtr, KErrNone ); + } + + res = GetTestOption( aTestSubOption, option ); + if ( res != KErrNone ) + { + TRACE_INFO( (_L("GetTestOption failed with value: %d"), res) ); + iNotifier -> Close(); + return res; + } + + User::WaitForRequest( iReqStatus ); + iNotifier -> Close(); + + switch( option ) + { + case EQueryAccepted: + TRACE_INFO( (_L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrNone) ); + STIF_ASSERT_EQUALS( KErrNone, iReqStatus.Int() ); + break; + case EQueryCanceled: + TRACE_INFO( (_L("Request status value: %d, expected: %d"), iReqStatus.Int(), KErrCancel) ); + STIF_ASSERT_EQUALS( KErrCancel, iReqStatus.Int() ); + break; + default: + return KErrNotFound; + } + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>LoadNotifiersL") ); + + iNotifierArray = reinterpret_cast*>( + REComSession::CreateImplementationL(TUid::Uid(0x10281F23), iInstanceUid)); + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>UnLoadNotifiers") ); + + TInt count = iNotifierArray->Count(); + TInt i=0; + for (i=0; iAt(i)->Release(); + } + iNotifierArray->Reset(); + delete iNotifierArray; + REComSession::DestroyedImplementation(iInstanceUid); + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>Update") ); + TInt count = iNotifierArray->Count(); + TInt i=0; + _LIT8(test, "test"); + TBuf8<32> buf(test); + for (i=0; iAt(i)->UpdateL(buf); + } + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>Notifierstart") ); + TInt count = iNotifierArray->Count(); + TInt i=0; + _LIT8(test, "test"); + TBuf8<32> buf(test); + for (i=0; iAt(i)->StartL(buf); + } + + aTestResult = ETestCasePassed; + + TRACE_INFO( _L("<<>>GetQueryType") ); + if ( !aTypeString.Compare( _L( "EUSBNoMemoryCard" ) ) ) + { + aQueryType = EUSBNoMemoryCard; + TRACE_INFO( _L("Query type: EUSBNoMemoryCard") ); + } + else if ( !aTypeString.Compare( _L( "EUSBStorageMediaFailure" ) ) ) + { + aQueryType = EUSBStorageMediaFailure; + TRACE_INFO( _L("Query type: EUSBStorageMediaFailure") ); + } + else if ( !aTypeString.Compare( _L( "EUSBChangeFromMassStorage" ) ) ) + { + aQueryType = EUSBChangeFromMassStorage; + TRACE_INFO( _L("Query type: EUSBChangeFromMassStorage") ); + } + else + { + TRACE_INFO( _L("Query type: not supported") ); + return KErrNotFound; + } + TRACE_INFO( _L("<<>>GetOTGErrorType") ); + + if ( !aTypeString.Compare( _L( "EUsbOtgTooMuchPower" ) ) ) + { + aQueryType = EUsbOtgTooMuchPower; + TRACE_INFO( _L("Query type: EUsbOtgTooMuchPower") ); + } + else if ( !aTypeString.Compare( _L( "EUsbOtgTooMuchPowerRequired" ) ) ) + { + aQueryType = EUsbOtgTooMuchPowerRequired; + TRACE_INFO( _L("Query type: EUsbOtgTooMuchPowerRequired") ); + } + else if ( !aTypeString.Compare( _L( "EUsbOtgUnsupportedDevice" ) ) ) + { + aQueryType = EUsbOtgUnsupportedDevice; + TRACE_INFO( _L("Query type: EUsbOtgUnsupportedDevice") ); + } + else if ( !aTypeString.Compare( _L( "EUsbOtgHubUnsupported" ) ) ) + { + aQueryType = EUsbOtgHubUnsupported; + TRACE_INFO( _L("Query type: EUsbOtgHubUnsupported") ); + } + else if ( !aTypeString.Compare( _L( "EUsbOtgErrorInConnection" ) ) ) + { + aQueryType = EUsbOtgErrorInConnection; + TRACE_INFO( _L("Query type: EUsbOtgErrorInConnection") ); + } + else if ( !aTypeString.Compare( _L( "EUsbOtgErrorAttachTimedOut" ) ) ) + { + aQueryType = EUsbOtgErrorAttachTimedOut; + TRACE_INFO( _L("Query type: EUsbOtgErrorAttachTimedOut") ); + } + else + { + TRACE_INFO( _L("Query type: not supported") ); + return KErrNotFound; + } + + TRACE_INFO( _L("<<>>GetOTGWarningType") ); + + if ( !aTypeString.Compare( _L( "EUsbOtgPartiallySupportedDevice" ) ) ) + { + aQueryType = EUsbOtgPartiallySupportedDevice; + TRACE_INFO( _L("Query type: EUsbOtgPartiallySupportedDevice;") ); + } + else + { + TRACE_INFO( _L("Query type: not supported") ); + return KErrNotFound; + } + + TRACE_INFO( _L("<<>>GetMSMMrrorType") ); + if ( !aTypeString.Compare( _L( "EUsbMSMMGeneralError" ) ) ) + { + aQueryType = EHostMsErrGeneral; + TRACE_INFO( _L("Query type: EUsbOtgPartiallySupportedDevice;") ); + } + else if ( !aTypeString.Compare( _L( "EUsbMSMMUnknownFileSystem" ) ) ) + { + aQueryType = EHostMsErrUnknownFileSystem; + TRACE_INFO( _L("Query type: EUsbMSMMUnknownFileSystem") ); + } + else if ( !aTypeString.Compare( _L( "EUsbMSMMOutOfMemory" ) ) ) + { + aQueryType = EHostMsErrOutOfMemory; + TRACE_INFO( _L("Query type: EUsbMSMMOutOfMemory") ); + } + else + { + TRACE_INFO( _L("Query type: not supported") ); + return KErrNotFound; + } + + TRACE_INFO( _L("<<