mtptransports/mtpptpiptransport/ptpipdatatypes/inc/tptpiprequestpayload.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     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 //
       
    15 
       
    16 /**
       
    17  @internalComponent
       
    18 */
       
    19 
       
    20 #ifndef CPTPIPPAYLOADREQUEST_H_
       
    21 #define CPTPIPPAYLOADREQUEST_H_
       
    22 
       
    23 #include "ptpipdatatypes.h"
       
    24 
       
    25 /**
       
    26  Defines the PTPIP dataset for the ptpip request operation. This is used 
       
    27  as the payload in the generic container when the PTPIP request operation is sent. 
       
    28  */
       
    29 class TPTPIPTypeRequestPayload : public TMTPTypeFlatBase
       
    30 	{
       
    31 public:
       
    32 
       
    33 	/**
       
    34 	 PTPIP operation request dataset element identifiers.
       
    35 	 */
       
    36 	enum TElements
       
    37 		{
       
    38 		EDataPhase,
       
    39 		EOpCode,
       
    40 		ETransactionId,
       
    41 		EParameter1,
       
    42 		EParameter2,
       
    43 		EParameter3,
       
    44 		EParameter4,
       
    45 		EParameter5,
       
    46 		ENumElements
       
    47 		};
       
    48 
       
    49 public:
       
    50 	IMPORT_C TPTPIPTypeRequestPayload();
       
    51 	IMPORT_C TUint NumParameters() const;
       
    52 	IMPORT_C void CopyIn(const TMTPTypeFlatBase& aFrom, TUint aParamStartOffset, TUint aParamEndOffSet, TBool aIsNullParamValid, TUint aNumOfNullParam);
       
    53 	IMPORT_C void CopyOut(TMTPTypeFlatBase& aTo, TUint aParamStartOffset, TUint aParamEndOffset);
       
    54 
       
    55 public:
       
    56 	// From TMTPTypeFlatBase
       
    57 	IMPORT_C void Reset();
       
    58 	IMPORT_C void SetUint16(TInt aElementId, TUint16 aData);
       
    59 	IMPORT_C TUint16 Uint16(TInt aElementId) const;
       
    60 	IMPORT_C void SetUint32(TInt aElementId, TUint32 aData);
       
    61 	IMPORT_C TUint32 Uint32(TInt aElementId) const;
       
    62 	IMPORT_C TInt FirstReadChunk(TPtrC8& aChunk) const;
       
    63 	IMPORT_C TUint64 Size() const;
       
    64 	IMPORT_C TUint Type() const;
       
    65 	IMPORT_C TBool CommitRequired() const;
       
    66 	IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk);
       
    67 
       
    68 private:
       
    69 	// From TMTPTypeFlatBase
       
    70 	IMPORT_C const TMTPTypeFlatBase::TElementInfo& ElementInfo(TInt aElementId) const;
       
    71 
       
    72 private:
       
    73 	/**
       
    74 	 The dataset size in bytes.
       
    75 	 */
       
    76 	static const TInt KSize = 30;
       
    77 
       
    78 	/**
       
    79 	 The size of the 3 header elements - data phase, op code and transaction id
       
    80 	 */
       
    81 	static const TInt KHeaderElementsSize = 10;
       
    82 
       
    83 	/**
       
    84 	 The dataset element metadata table content.
       
    85 	 */
       
    86 	static const TMTPTypeFlatBase::TElementInfo iElementMetaData[];
       
    87 
       
    88 	/**
       
    89 	 The dataset element metadata table.
       
    90 	 */
       
    91 	const TFixedArray<TElementInfo, ENumElements> iElementInfo;
       
    92 
       
    93 	/**
       
    94 	 The data buffer.
       
    95 	 */
       
    96 	TBuf8<KSize> iBuffer;
       
    97 
       
    98 	/**
       
    99 	 The number of parameters(EParameter1 to EParameter5)  in the block which are set.
       
   100 	 It will be between 1 to 5 and 
       
   101 	 will never include the count of the first 3 header elements- data phase, op code and tran id.
       
   102 	 */
       
   103 //	TUint iNumParameters;
       
   104 	TUint iMaxSetParam;
       
   105 	};
       
   106 
       
   107 #endif /*CPTPIPPAYLOADREQUEST_H_*/