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 |
* header file for NTB16 build class
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
/**
|
|
21 |
@file
|
|
22 |
@internalComponent
|
|
23 |
*/
|
|
24 |
|
|
25 |
|
|
26 |
#ifndef NCMNTB16BUILDER_H
|
|
27 |
#define NCMNTB16BUILDER_H
|
|
28 |
|
|
29 |
#include <e32base.h>
|
|
30 |
#include "ncmntbbuilder.h"
|
|
31 |
#include "ncmpktdrvcommon.h"
|
|
32 |
|
|
33 |
|
|
34 |
class MNcmNtbBuildObserver;
|
|
35 |
|
|
36 |
|
|
37 |
NONSHARABLE_CLASS(TDatagramEntry)
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
TUint16 iWDatagramIndex;
|
|
41 |
TUint16 iWDatagramLength;
|
|
42 |
};
|
|
43 |
|
|
44 |
/**
|
|
45 |
Responsible for build NTB16 payload
|
|
46 |
*/
|
|
47 |
|
|
48 |
NONSHARABLE_CLASS(CNcmNtb16Builder) : public CNcmNtbBuilder
|
|
49 |
{
|
|
50 |
public:
|
|
51 |
static CNcmNtbBuilder* NewL(MNcmNtbBuildObserver&);
|
|
52 |
~CNcmNtb16Builder();
|
|
53 |
|
|
54 |
public:
|
|
55 |
/**
|
|
56 |
*derived from CNcmNtbBuilder
|
|
57 |
*/
|
|
58 |
void StartNewNtb(const TNcmBuffer& aBuffer);
|
|
59 |
TInt AppendPacket(const RMBufChain& aPacket);
|
|
60 |
TInt SetNtbInMaxSize(TInt aSize);
|
|
61 |
void CompleteNtbBuild();
|
|
62 |
void Reset();
|
|
63 |
|
|
64 |
private:
|
|
65 |
CNcmNtb16Builder(MNcmNtbBuildObserver&);
|
|
66 |
void ConstructL();
|
|
67 |
void BuildNtbHeader();
|
|
68 |
void BuildNdp();
|
|
69 |
|
|
70 |
|
|
71 |
private:
|
|
72 |
/**
|
|
73 |
* offset of NDP in buffer
|
|
74 |
*/
|
|
75 |
TUint16 iNdpOffset;
|
|
76 |
/**
|
|
77 |
* length of NDP
|
|
78 |
*/
|
|
79 |
TUint16 iNdpLength;
|
|
80 |
/**
|
|
81 |
* offset of next datagram can be in.
|
|
82 |
*/
|
|
83 |
TUint16 iDatagramOffset;
|
|
84 |
/**
|
|
85 |
* array of datagrams index and length in NTB.
|
|
86 |
*/
|
|
87 |
RArray<TDatagramEntry> iPacketsArray;
|
|
88 |
};
|
|
89 |
|
|
90 |
|
|
91 |
#endif //NCMNTB16BUILDER_H
|
|
92 |
|