300
|
1 |
// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
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 |
// Implements a Session of a Symbian OS server for the RUsbMassStorage API
|
300
|
15 |
//
|
0
|
16 |
//
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
/**
|
|
21 |
@file
|
|
22 |
@internalTechnology
|
|
23 |
*/
|
|
24 |
|
|
25 |
#include <e32cmn.h>
|
|
26 |
#include <e32base.h>
|
|
27 |
|
|
28 |
#include "msmanclientserver.h"
|
|
29 |
|
|
30 |
#include <f32file.h>
|
|
31 |
#include <d32usbdi_hubdriver.h>
|
|
32 |
#include <d32otgdi.h>
|
|
33 |
#include "usbtypes.h"
|
|
34 |
|
|
35 |
#include "cusbhostao.h"
|
|
36 |
#include "cusbhost.h"
|
|
37 |
|
|
38 |
|
|
39 |
#include "cusbhostserver.h"
|
|
40 |
#include "cusbhostsession.h"
|
|
41 |
|
|
42 |
|
|
43 |
CUsbHostSession* CUsbHostSession::NewL()
|
300
|
44 |
{
|
|
45 |
CUsbHostSession* r = new (ELeave) CUsbHostSession();
|
|
46 |
CleanupStack::PushL(r);
|
|
47 |
r->ConstructL();
|
|
48 |
CleanupStack::Pop();
|
|
49 |
return r;
|
|
50 |
}
|
0
|
51 |
|
|
52 |
|
|
53 |
CUsbHostSession::CUsbHostSession()
|
300
|
54 |
{
|
|
55 |
}
|
0
|
56 |
|
|
57 |
void CUsbHostSession::ConstructL()
|
300
|
58 |
{
|
|
59 |
}
|
0
|
60 |
|
|
61 |
|
|
62 |
void CUsbHostSession::CreateL()
|
300
|
63 |
{
|
0
|
64 |
Server().AddSession();
|
300
|
65 |
}
|
0
|
66 |
|
|
67 |
|
|
68 |
CUsbHostSession::~CUsbHostSession()
|
300
|
69 |
{
|
0
|
70 |
Server().RemoveSession();
|
300
|
71 |
}
|
0
|
72 |
|
|
73 |
|
|
74 |
void CUsbHostSession::ServiceL(const RMessage2& aMessage)
|
300
|
75 |
{
|
|
76 |
DispatchMessageL(aMessage);
|
|
77 |
}
|
0
|
78 |
|
|
79 |
|
|
80 |
void CUsbHostSession::DispatchMessageL(const RMessage2& aMessage)
|
300
|
81 |
{
|
|
82 |
TInt ret = KErrNone;
|
0
|
83 |
|
300
|
84 |
switch (aMessage.Function())
|
|
85 |
{
|
|
86 |
case EUsbHostStart:
|
|
87 |
ret = Start(aMessage);
|
|
88 |
break;
|
|
89 |
default:
|
|
90 |
aMessage.Panic(KUsbHostClientPncCat, EUsbHostPanicIllegalIPC);
|
|
91 |
break;
|
|
92 |
}
|
0
|
93 |
|
300
|
94 |
aMessage.Complete(ret);
|
|
95 |
}
|
0
|
96 |
|
|
97 |
|
|
98 |
TInt CUsbHostSession::Start(const RMessage2& aMessage)
|
300
|
99 |
{
|
0
|
100 |
Server().iUsbHost->Start();
|
300
|
101 |
return KErrNone;
|
|
102 |
}
|