|
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 // Implements a Symbian OS server that exposes the RUsbMassStorage API |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 */ |
|
22 |
|
23 #ifndef __CUSBMASSSTORAGESERVER_H__ |
|
24 #define __CUSBMASSSTORAGESERVER_H__ |
|
25 |
|
26 #include "massstoragedebug.h" |
|
27 |
|
28 |
|
29 _LIT(KUsbMsSvrPncCat, "CUsbMsServer"); |
|
30 |
|
31 enum TUsbPanicServer |
|
32 { |
|
33 EMsClientInvalidSessCount, |
|
34 EMsControlInterfaceBadState, |
|
35 EMsControlInterfaceStillActive, |
|
36 EMsBulkOnlyStillActive, |
|
37 EMsWrongEndpoint |
|
38 }; |
|
39 |
|
40 // |
|
41 // Forward declarations |
|
42 // |
|
43 class CUsbMassStorageController; |
|
44 |
|
45 /** |
|
46 The CUsbMassStorageServer class |
|
47 Implements a Symbian OS server that exposes the RUsbMassStorage API |
|
48 */ |
|
49 class CUsbMassStorageServer : public CPolicyServer |
|
50 { |
|
51 public: |
|
52 static CUsbMassStorageServer* NewLC(CUsbMassStorageController& aController); |
|
53 virtual ~CUsbMassStorageServer(); |
|
54 |
|
55 virtual CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const; |
|
56 void Error(TInt aError); |
|
57 |
|
58 inline CUsbMassStorageController& Controller() const; |
|
59 |
|
60 void IncrementSessionCount(); |
|
61 void DecrementSessionCount(); |
|
62 inline TInt SessionCount() const; |
|
63 |
|
64 protected: |
|
65 CUsbMassStorageServer(CUsbMassStorageController& aController); |
|
66 void ConstructL(); |
|
67 |
|
68 private: |
|
69 CUsbMassStorageController& iController; |
|
70 TInt iSessionCount; |
|
71 }; |
|
72 |
|
73 #include "cusbmassstorageserver.inl" |
|
74 |
|
75 #endif // __CUSBMASSSTORAGESERVER_H__ |
|
76 |
|
77 |