28
|
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 |
*/
|
49
|
80 |
TInt SetupClassSpecificDescriptor(TUint8 aControlInterfaceNumber, TUint8 aDataInterfaceNumber);
|
28
|
81 |
/**
|
|
82 |
* Set NCM interface MAC address into NCM class specific descriptor
|
49
|
83 |
* @param [out] aStrIndex, the index of string which contains NCM
|
28
|
84 |
* interface MAC address
|
|
85 |
*/
|
|
86 |
TInt SetMacAddressString(TUint8& aStrIndex);
|
49
|
87 |
|
28
|
88 |
/**
|
49
|
89 |
* Get interface number
|
|
90 |
* @param aLdd The logic device driver which can be used to query for.
|
|
91 |
* @param aSettingsNumber The alter settings for the interface
|
|
92 |
* @param [out] aInterfaceNumber Carry out the interface bumber back to caller.
|
|
93 |
* @return KErrNone If interface number is return via aInterfaceNumber.
|
|
94 |
* Other system wide error code if anything went wrong.
|
28
|
95 |
*/
|
49
|
96 |
TInt InterfaceNumber(RDevUsbcScClient& aLdd,TInt aSettingsNumber,TUint8& aInterfaceNumber);
|
28
|
97 |
|
|
98 |
private:
|
|
99 |
const TNcmMacAddress& iHostMacAddress;
|
|
100 |
|
|
101 |
TBool iCommLddInitiated;
|
|
102 |
RDevUsbcScClient iCommLdd;
|
|
103 |
TBool iDataLddInitiated;
|
|
104 |
RDevUsbcScClient iDataLdd;
|
|
105 |
};
|
|
106 |
|
|
107 |
#endif // NCMCLIENTMANAGER_H
|