|
1 /** |
|
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Implements a Symbian OS server that exposes the RUsb API |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file |
|
24 */ |
|
25 |
|
26 #ifndef __CTRANSFERSERVER_H__ |
|
27 #define __CTRANSFERSERVER_H__ |
|
28 |
|
29 #include "general.h" |
|
30 #include "config.h" |
|
31 |
|
32 |
|
33 class CTransferHandle; |
|
34 |
|
35 NONSHARABLE_CLASS(CTransferServer) : public CPolicyServer |
|
36 { |
|
37 public: |
|
38 static CTransferServer* NewLC(); |
|
39 virtual ~CTransferServer(); |
|
40 |
|
41 virtual CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const; |
|
42 void Error(TInt aError); |
|
43 |
|
44 void IncrementSessionCount(); |
|
45 void DecrementSessionCount(); |
|
46 inline TInt SessionCount() const; |
|
47 void LaunchShutdownTimerIfNoSessions(); |
|
48 TInt SetupLdds(TDes& aFileName); |
|
49 void TransferHandleL(); |
|
50 |
|
51 protected: |
|
52 CTransferServer(); |
|
53 void ConstructL(); |
|
54 |
|
55 private: |
|
56 TInt iSessionCount; |
|
57 enum {KShutdownDelay = 2 * 1000 * 1000}; // 2 seconds |
|
58 class CShutdownTimer : public CTimer |
|
59 { |
|
60 public: |
|
61 CShutdownTimer(); |
|
62 void ConstructL(); |
|
63 virtual void RunL(); |
|
64 }; |
|
65 CShutdownTimer* iShutdownTimer; |
|
66 |
|
67 void SetupInterface(IFConfigPtr* aIfPtr, TInt aPortNumber); |
|
68 void FillEndpointsResourceAllocation(IFConfigPtr aIfCfg); |
|
69 void PopulateInterfaceResourceAllocation(IFConfigPtr aFirstIfCfg, TInt aPortNumber); |
|
70 void QueryUsbClientL(LDDConfigPtr aLddPtr, RDEVCLIENT* aPort); |
|
71 |
|
72 TInt iTotalChannels; |
|
73 RFs iFs; |
|
74 RFile iConfigFile; |
|
75 LDDConfigPtr iLddPtr; |
|
76 RDEVCLIENT iPort[KMaxInterfaces]; |
|
77 TBool iSupportResourceAllocationV2; |
|
78 TBool iSoftwareConnect; |
|
79 CConsoleBase* iConsole; |
|
80 |
|
81 CTransferHandle* iTransferHandle; |
|
82 }; |
|
83 |
|
84 #endif |