|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // tptpippayloadresponse.h |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @internalComponent |
|
20 */ |
|
21 |
|
22 #ifndef CPTPIPPAYLOADRESPONSE_H_ |
|
23 #define CPTPIPPAYLOADRESPONSE_H_ |
|
24 |
|
25 #include "ptpipdatatypes.h" |
|
26 |
|
27 /** |
|
28 Defines the PTPIP dataset for the ptpip response operation. This is used |
|
29 as the payload in the generic container when the PTPIP response operation is sent. |
|
30 */ |
|
31 class TPTPIPTypeResponsePayload : public TMTPTypeFlatBase |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 PTPIP operation request dataset element identifiers. |
|
37 */ |
|
38 enum TElements |
|
39 { |
|
40 EResponseCode, |
|
41 ETransactionId, |
|
42 EParameter1, |
|
43 EParameter2, |
|
44 EParameter3, |
|
45 EParameter4, |
|
46 EParameter5, |
|
47 ENumElements |
|
48 }; |
|
49 |
|
50 public: |
|
51 IMPORT_C TPTPIPTypeResponsePayload(); |
|
52 IMPORT_C TUint NumParameters() const; |
|
53 IMPORT_C void CopyIn(const TMTPTypeFlatBase& aFrom, TUint aParamStartOffset, TUint aParamEndOffSet, TBool aIsNullParamValid, TUint aNumOfNullParam); |
|
54 IMPORT_C void CopyOut(TMTPTypeFlatBase& aTo, TUint aParamStartOffset, TUint aParamEndOffset); |
|
55 |
|
56 public: |
|
57 // From TMTPTypeFlatBase |
|
58 IMPORT_C void Reset(); |
|
59 IMPORT_C void SetUint16(TInt aElementId, TUint16 aData); |
|
60 IMPORT_C TUint16 Uint16(TInt aElementId) const; |
|
61 IMPORT_C void SetUint32(TInt aElementId, TUint32 aData); |
|
62 IMPORT_C TUint32 Uint32(TInt aElementId) const; |
|
63 IMPORT_C TInt FirstReadChunk(TPtrC8& aChunk) const; |
|
64 IMPORT_C TUint64 Size() const; |
|
65 IMPORT_C TUint Type() const; |
|
66 IMPORT_C TBool CommitRequired() const; |
|
67 IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk); |
|
68 |
|
69 private: |
|
70 // From TMTPTypeFlatBase |
|
71 IMPORT_C const TMTPTypeFlatBase::TElementInfo& ElementInfo(TInt aElementId) const; |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 The dataset size in bytes. |
|
77 */ |
|
78 static const TInt KSize = 26; |
|
79 |
|
80 /** |
|
81 The size of the 2 header elements - response code and transaction id |
|
82 */ |
|
83 static const TInt KHeaderElementsSize = 6; |
|
84 |
|
85 /** |
|
86 The dataset element metadata table content. |
|
87 */ |
|
88 static const TMTPTypeFlatBase::TElementInfo iElementMetaData[]; |
|
89 |
|
90 /** |
|
91 The dataset element metadata table. |
|
92 */ |
|
93 const TFixedArray<TElementInfo, ENumElements> iElementInfo; |
|
94 |
|
95 /** |
|
96 The data buffer. |
|
97 */ |
|
98 TBuf8<KSize> iBuffer; |
|
99 |
|
100 /** |
|
101 The number of parameters in the block which are set. |
|
102 */ |
|
103 //TUint iNumParameters; |
|
104 TUint iMaxSetParam; |
|
105 |
|
106 }; |
|
107 |
|
108 #endif /*CPTPIPPAYLOADRESPONSE_H_*/ |