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 |
#ifndef NCMCLASSCONTROLLER_H
|
|
23 |
#define NCMCLASSCONTROLLER_H
|
|
24 |
|
|
25 |
#include <e32property.h>
|
|
26 |
#include <cusbclasscontrollerplugin.h>
|
|
27 |
|
|
28 |
#include "ncmconnectionmanagerobserver.h"
|
|
29 |
#include "ncmcommon.h"
|
|
30 |
|
|
31 |
#ifdef OVERDUMMY_NCMCC
|
|
32 |
#include <usb/testncmcc/dummy_ncminternalsrv.h>
|
|
33 |
#else
|
|
34 |
#include "ncminternalsrv.h"
|
|
35 |
#endif // OVERDUMMY_NCMCC
|
|
36 |
|
|
37 |
class CNcmConnectionManager;
|
|
38 |
class CNcmClientManager;
|
|
39 |
|
|
40 |
/**
|
|
41 |
* NCM Class controller.
|
|
42 |
* It is derived from CUsbClassControllerPlugIn. The USB Manager will control
|
|
43 |
* NCM class through it.
|
|
44 |
* And it implements interface MNcmConnectionManagerObserver as well.
|
|
45 |
*/
|
|
46 |
NONSHARABLE_CLASS(CNcmClassController):
|
|
47 |
public CUsbClassControllerPlugIn,
|
|
48 |
public MNcmConnectionManagerObserver
|
|
49 |
{
|
|
50 |
public:
|
|
51 |
static CNcmClassController* NewL(MUsbClassControllerNotify& aOwner);
|
|
52 |
~CNcmClassController();
|
|
53 |
|
|
54 |
// From MNcmConnectionManagerObserver
|
|
55 |
void McmoErrorIndication(TInt aError);
|
|
56 |
|
|
57 |
private:
|
|
58 |
/**
|
|
59 |
* Two-phases construction: phase 1
|
|
60 |
* @param[in] aOwner, an Interface to talk to the USB server.
|
|
61 |
*/
|
|
62 |
CNcmClassController(MUsbClassControllerNotify& aOwner);
|
|
63 |
/**
|
|
64 |
* Two-phases construction: phase 2
|
|
65 |
*/
|
|
66 |
void ConstructL();
|
|
67 |
|
|
68 |
// From CActive
|
|
69 |
void RunL();
|
|
70 |
void DoCancel();
|
|
71 |
TInt RunError(TInt aError);
|
|
72 |
|
|
73 |
// From CUsbClassControllerBase
|
|
74 |
void Start(TRequestStatus& aStatus);
|
|
75 |
void Stop(TRequestStatus& aStatus);
|
|
76 |
void GetDescriptorInfo(TUsbDescriptor& aDescriptorInfo) const;
|
|
77 |
|
|
78 |
|
|
79 |
private:
|
|
80 |
void RandomMacAddressL();
|
|
81 |
|
|
82 |
private:
|
|
83 |
TNcmMacAddress iHostMacAddress;
|
|
84 |
|
|
85 |
CNcmConnectionManager* iConnectionMan; // Owned.
|
|
86 |
|
|
87 |
// Not own.
|
|
88 |
TRequestStatus* iReportStatus;
|
|
89 |
|
|
90 |
CNcmClientManager* iClientMgr; // Owned
|
|
91 |
|
|
92 |
RNcmInternalSrv iNcmInternalSvr;
|
|
93 |
|
|
94 |
TBool iConnectingToNcmPktDrv;
|
|
95 |
|
|
96 |
TUint iDataBufferSize; // Buffer size of data end points
|
|
97 |
};
|
|
98 |
|
|
99 |
#endif // NCMCLASSCONTROLLER_H
|