mtptransports/mtpptpiptransport/ptpipdatatypes/inc/cptpipinitcmdack.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 #ifndef CPTPIPINITCMDACK_H_
       
    17 #define CPTPIPINITCMDACK_H_
       
    18 
       
    19 
       
    20 
       
    21 #include <mtp/cmtptypecompoundbase.h>
       
    22 
       
    23 
       
    24 class CPTPIPInitCmdAck : public CMTPTypeCompoundBase
       
    25     {
       
    26 public:
       
    27 
       
    28     /**
       
    29     MTP USB generic bulk container dataset element identifiers.
       
    30     */
       
    31     enum TElements
       
    32         {
       
    33 		ELength,
       
    34 		EPktType,
       
    35 		EConNumber,
       
    36 		EResponderGUID,
       
    37 		EVersion,
       
    38         
       
    39         /**
       
    40         The number of elements.
       
    41         */
       
    42         ENumElements        
       
    43  		}; 
       
    44 public:
       
    45     
       
    46     IMPORT_C static CPTPIPInitCmdAck* NewL();
       
    47     IMPORT_C ~CPTPIPInitCmdAck();
       
    48 	IMPORT_C TInt FirstReadChunk(TPtrC8& aChunk) const;   		
       
    49 	IMPORT_C TInt NextReadChunk(TPtrC8& aChunk)  const;
       
    50 	IMPORT_C void SetDeviceFriendlyName(TDesC16& aName); 
       
    51 	IMPORT_C TUint64 Size() const;
       
    52      
       
    53 public: // From MMTPType
       
    54 
       
    55 	IMPORT_C TUint Type() const;
       
    56         
       
    57 private: // From CMTPTypeCompoundBase
       
    58     
       
    59     const TElementInfo& ElementInfo(TInt aElementId) const;
       
    60     
       
    61 private:
       
    62 
       
    63     CPTPIPInitCmdAck();        
       
    64     void ConstructL();   
       
    65     
       
    66 private: // Owned
       
    67         
       
    68     /**
       
    69     Data chunk identifiers.
       
    70     */
       
    71     enum TChunkIds
       
    72         {
       
    73         /**
       
    74         The flat data chunk ID.
       
    75         */
       
    76         EIdFlatChunk,
       
    77         
       
    78         /**
       
    79         The EMTPExtensions element data chunk ID.
       
    80         */
       
    81      //   EIdNameChunk,
       
    82         /**
       
    83         
       
    84         */
       
    85         EIdVersionChunk,        
       
    86         /**
       
    87         The number of data chunks.
       
    88         */
       
    89         EIdNumChunks
       
    90         };
       
    91     
       
    92     /**
       
    93     The flat data chunk comprising the header elements EContainerLength to 
       
    94     ETransactionId.
       
    95     */
       
    96     RMTPTypeCompoundFlatChunk                       iChunkHeader;
       
    97     
       
    98     /**
       
    99     The dataset element metadata table content.
       
   100     */
       
   101     static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[];
       
   102     
       
   103     /**
       
   104     The dataset element metadata table.
       
   105     */
       
   106     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   107     
       
   108     /**
       
   109     The size in bytes of the header data chunk.
       
   110     */
       
   111     static const TUint                              KFlatChunkSize;
       
   112     
       
   113 private: // Not owned
       
   114 	TMTPTypeUint32									iVersion;
       
   115     mutable TInt 									iChunkCount;
       
   116     RBuf16   iBuffer;		           
       
   117     };
       
   118 
       
   119 
       
   120 
       
   121 
       
   122 #endif /*CPTPIPINITCMDACK_H_*/