kerneltest/e32test/usbho/t_otgdi/src/t_otgdi_fdfactor_main.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    22 #include <e32base_private.h>
    22 #include <e32base_private.h>
    23 #include <e32std.h>
    23 #include <e32std.h>
    24 #include <e32std_private.h>
    24 #include <e32std_private.h>
    25 
    25 
    26 #include "t_otgdi_fdfactor.h"
    26 #include "t_otgdi_fdfactor.h"
    27 #include "OstTraceDefinitions.h"
       
    28 #ifdef OST_TRACE_COMPILER_IN_USE
       
    29 #include "t_otgdi_fdfactor_mainTraces.h"
       
    30 #endif
       
    31 
    27 
    32 LOCAL_C void DoStartL()
    28 LOCAL_C void DoStartL()
    33 	{
    29 	{
    34 	_LIT(KDriverLddFileName,"usbhubdriver");
    30 	_LIT(KDriverLddFileName,"usbhubdriver");
    35 	TInt err = User::LoadLogicalDevice(KDriverLddFileName);
    31 	TInt err = User::LoadLogicalDevice(KDriverLddFileName);
    36 	if(err)
    32 	if(err)
    37 		{
    33 		{
    38 		OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL, "FDFActor failed to load LDD %d",err);
    34 		RDebug::Print(_L("FDFActor failed to load LDD %d"),err);
    39 		}
    35 		}
    40 
    36 
    41 	// Create active scheduler (to run active objects)
    37 	// Create active scheduler (to run active objects)
    42 	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    38 	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    43 	CleanupStack::PushL(scheduler);
    39 	CleanupStack::PushL(scheduler);
    65 	CleanupStack::PopAndDestroy(3, scheduler);
    61 	CleanupStack::PopAndDestroy(3, scheduler);
    66 	
    62 	
    67 	err = User::FreeLogicalDevice(RUsbHubDriver::Name());
    63 	err = User::FreeLogicalDevice(RUsbHubDriver::Name());
    68 	if(err)
    64 	if(err)
    69 		{
    65 		{
    70 		OstTrace1(TRACE_NORMAL, DOSTARTL_DOSTARTL_DUP01, "FDFActor failed to unload LDD %d",err);
    66 		RDebug::Print(_L("FDFActor failed to unload LDD %d"),err);
    71 		}	
    67 		}	
    72 	}
    68 	}
    73 
    69 
    74 
    70 
    75 //  Global Functions
    71 //  Global Functions
    83 	TRAPD(mainError,DoStartL());
    79 	TRAPD(mainError,DoStartL());
    84 
    80 
    85 
    81 
    86 	if (mainError)
    82 	if (mainError)
    87 		{
    83 		{
    88 		OstTrace1(TRACE_NORMAL, E32MAIN_E32MAIN, "FDF Actor left with %d", mainError);
    84 		RDebug::Print(_L("FDF Actor left with %d"), mainError);
    89 		//	Also means that we left before we did a Rendezvous(KErrNone) to free up t_otgdi.exe
    85 		//	Also means that we left before we did a Rendezvous(KErrNone) to free up t_otgdi.exe
    90 		//	Rendezvous with KErrAbort to indicate we couldn't start up properly.
    86 		//	Rendezvous with KErrAbort to indicate we couldn't start up properly.
    91 		RProcess::Rendezvous(KErrAbort);
    87 		RProcess::Rendezvous(KErrAbort);
    92 		}
    88 		}
    93 
    89 
    94 	delete cleanup;
    90 	delete cleanup;
    95 	__UHEAP_MARKEND;
    91 	__UHEAP_MARKEND;
    96 
    92 
    97 	OstTrace0(TRACE_NORMAL, E32MAIN_E32MAIN_DUP01, "About to end FDFActor process");
    93 	RDebug::Print(_L("About to end FDFActor process"));
    98 	return KErrNone;
    94 	return KErrNone;
    99 	}
    95 	}
   100 
    96 
   101 
    97 
   102 
    98