1 /* |
|
2 * Copyright (c) 2010 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 * |
|
16 */ |
|
17 |
|
18 /** @file |
|
19 @internalComponent |
|
20 */ |
|
21 |
|
22 |
|
23 #ifndef NCMCLIENTMANAGER_H |
|
24 #define NCMCLIENTMANAGER_H |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <e32base.h> |
|
28 |
|
29 #ifdef OVERDUMMY_NCMCC |
|
30 #include <dummyusbsclddapi.h> |
|
31 #else |
|
32 #include <d32usbcsc.h> |
|
33 #endif // OVERDUMMY_NCMCC |
|
34 |
|
35 #include "ncmcommon.h" |
|
36 |
|
37 class RNcmInternalSrv; |
|
38 |
|
39 /** |
|
40 * A class which encapsulates the operations related to USB shared chunk LDD |
|
41 */ |
|
42 class CNcmClientManager : public CBase |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Constructor |
|
47 * @param[in] aHostMacAddress, the NCM interface MAC address |
|
48 * which will be used to config. |
|
49 */ |
|
50 CNcmClientManager(const TNcmMacAddress& aHostMacAddress); |
|
51 |
|
52 ~CNcmClientManager(); |
|
53 |
|
54 /** |
|
55 * Setup NCM interfaces |
|
56 * @param[out] aDataEpBufferSize, NCM data interface EP buffer size |
|
57 */ |
|
58 void SetNcmInterfacesL(TUint& aDataEpBufferSize); |
|
59 /** |
|
60 * Transfer ownership of NCM interface handles to NCM internal |
|
61 * server which is located in C32 process space |
|
62 * @param[in] aServer, NCM internal server. |
|
63 */ |
|
64 void TransferInterfacesL(RNcmInternalSrv& aServer); |
|
65 |
|
66 private: |
|
67 /** |
|
68 * Setup NCM communication interface |
|
69 */ |
|
70 void SetCommunicationInterfaceL(); |
|
71 /** |
|
72 * Setup NCM data interface |
|
73 * @param aDataEpBufferSize, NCM data interface EP buffer size |
|
74 */ |
|
75 void SetDataInterfaceL(TUint& aDataEpBufferSize); |
|
76 /** |
|
77 * Setup NCM class specific descriptors |
|
78 * @param aDataInterfaceNumber, NCM data interface number |
|
79 */ |
|
80 TInt SetupClassSpecificDescriptor(TUint8 aDataInterfaceNumber); |
|
81 /** |
|
82 * Set NCM interface MAC address into NCM class specific descriptor |
|
83 * @param[out] aStrIndex, the index of string which contains NCM |
|
84 * interface MAC address |
|
85 */ |
|
86 TInt SetMacAddressString(TUint8& aStrIndex); |
|
87 /** |
|
88 * Get NCM data interface number |
|
89 * @param[out] aInterfaceNumber, NCM data interface number |
|
90 */ |
|
91 TInt DataInterfaceNumber(TUint8& aInterfaceNumber); |
|
92 |
|
93 private: |
|
94 const TNcmMacAddress& iHostMacAddress; |
|
95 |
|
96 TBool iCommLddInitiated; |
|
97 RDevUsbcScClient iCommLdd; |
|
98 TBool iDataLddInitiated; |
|
99 RDevUsbcScClient iDataLdd; |
|
100 }; |
|
101 |
|
102 #endif // NCMCLIENTMANAGER_H |
|