kerneltest/f32test/shostmassstorage/msman/server/usbotgserver.cpp
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     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 //
       
    15 
       
    16 
       
    17 #include <e32base.h>
       
    18 #include <e32debug.h>
       
    19 
       
    20 #include "cusbotgserver.h"
       
    21 
       
    22 
       
    23 static void RunServerL()
       
    24     {
       
    25     CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
       
    26     CleanupStack::PushL(scheduler);
       
    27     CActiveScheduler::Install(scheduler);
       
    28 
       
    29 	CUsbOtgServer::NewLC();
       
    30     RProcess::Rendezvous(KErrNone);
       
    31 
       
    32     CActiveScheduler::Start();
       
    33     CleanupStack::PopAndDestroy(2);
       
    34     RDebug::Printf("USB OTG Server shutdown");
       
    35     }
       
    36 
       
    37 TInt E32Main()
       
    38 //
       
    39 // Server process entry-point
       
    40 //
       
    41     {
       
    42     __UHEAP_MARK;
       
    43     CTrapCleanup* cleanup = CTrapCleanup::New();
       
    44     TInt r = KErrNoMemory;
       
    45     if (cleanup)
       
    46         {
       
    47         TRAP(r, RunServerL());
       
    48         delete cleanup;
       
    49         }
       
    50     __UHEAP_MARKEND;
       
    51     return r;
       
    52     }
       
    53