0
|
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 "cusbhostserver.h"
|
|
21 |
|
|
22 |
|
|
23 |
static void RunServerL()
|
|
24 |
{
|
|
25 |
CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
|
|
26 |
CleanupStack::PushL(scheduler);
|
|
27 |
CActiveScheduler::Install(scheduler);
|
|
28 |
|
|
29 |
CUsbHostServer::NewLC();
|
|
30 |
RProcess::Rendezvous(KErrNone);
|
|
31 |
|
|
32 |
CActiveScheduler::Start();
|
|
33 |
|
|
34 |
CleanupStack::PopAndDestroy(2);
|
|
35 |
RDebug::Printf("USB HOST server shutdown");
|
|
36 |
}
|
|
37 |
|
|
38 |
TInt E32Main()
|
|
39 |
//
|
|
40 |
// Server process entry-point
|
|
41 |
//
|
|
42 |
{
|
|
43 |
__UHEAP_MARK;
|
|
44 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
|
45 |
TInt r = KErrNoMemory;
|
|
46 |
if (cleanup)
|
|
47 |
{
|
|
48 |
TRAP(r, RunServerL());
|
|
49 |
delete cleanup;
|
|
50 |
}
|
|
51 |
__UHEAP_MARKEND;
|
|
52 |
return r;
|
|
53 |
}
|
|
54 |
|