|
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 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 #ifndef NCMDATARECEIVER_H |
|
23 #define NCMDATARECEIVER_H |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 #ifndef __OVER_DUMMYUSBSCLDD__ |
|
28 #include <d32usbcsc.h> |
|
29 #else |
|
30 #include <dummyusbsclddapi.h> |
|
31 #endif |
|
32 |
|
33 #include "ncmpktdrvcommon.h" |
|
34 #include "ncmntbparser.h" |
|
35 |
|
36 |
|
37 class CNcmDataInterface; |
|
38 |
|
39 /** |
|
40 Responsible for receiving NCM packet data |
|
41 */ |
|
42 NONSHARABLE_CLASS(CNcmDataReceiver) : public CActive, public MNcmNdpFrameObserver |
|
43 { |
|
44 public: |
|
45 static CNcmDataReceiver* NewL(RDevUsbcScClient& aPort, CNcmDataInterface& aParent); |
|
46 ~CNcmDataReceiver(); |
|
47 |
|
48 void Start(); |
|
49 void Stop(); |
|
50 |
|
51 //from MNcmNdpFrameObserver |
|
52 void ProcessEtherFrame(RMBufPacket&); |
|
53 void ExpireBuffer(TAny*); |
|
54 |
|
55 inline TUint NtbOutMaxSize() const; |
|
56 private: |
|
57 void ConstructL(); |
|
58 CNcmDataReceiver(RDevUsbcScClient& aPort, CNcmDataInterface& aParent); |
|
59 |
|
60 //From CActive |
|
61 void RunL(); |
|
62 void DoCancel(); |
|
63 |
|
64 void ReadData(); |
|
65 |
|
66 private: |
|
67 RDevUsbcScClient& iPort; |
|
68 TEndpointBuffer iEpIn; |
|
69 TUint8* iBuf; |
|
70 TUint iBufLen; |
|
71 TBool iZlp; |
|
72 CNcmNtbParser* iNtbParser; |
|
73 CNcmDataInterface& iParent; |
|
74 }; |
|
75 |
|
76 // inline functions |
|
77 #include "ncmdatareceiver.inl" |
|
78 |
|
79 #endif //NCMDATARECEIVER_H |
|
80 |