mtptransports/mtpusbtransport/usbdatatypes/inc/tmtpusbcontrolrequestdevicestatus.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-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  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef TMTPUSBCONTROLREQUESTDEVICESTATUS_H
       
    22 #define TMTPUSBCONTROLREQUESTDEVICESTATUS_H
       
    23 
       
    24 #include <mtp/tmtptypeflatbase.h>
       
    25 
       
    26 /**
       
    27 Defines the MTP USB device class device status control request dataset. This 
       
    28 dataset is of variable length depending on the number of non-zero parameter
       
    29 values.
       
    30 @internalComponent
       
    31  
       
    32 */
       
    33 class TMTPUsbControlRequestDeviceStatus : public TMTPTypeFlatBase 
       
    34     {
       
    35     
       
    36 public:
       
    37 
       
    38     /**
       
    39     MTP USB device status control request dataset element identifiers.
       
    40     */
       
    41     enum TElements
       
    42         {
       
    43         EwLength,
       
    44         ECode,
       
    45         EParameter1,
       
    46         EParameter2,
       
    47         EParameter3,
       
    48         EParameter4,
       
    49         EParameter5,
       
    50         EParameter6,
       
    51         EParameter7,
       
    52         EParameter8,
       
    53         EParameter9,
       
    54         EParameter10,
       
    55         EParameter11,
       
    56         EParameter12,
       
    57         EParameter13,
       
    58         EParameter14,
       
    59         EParameter15,
       
    60         EParameter16,
       
    61         EParameter17,
       
    62         EParameter18,
       
    63         EParameter19,
       
    64         EParameter20,
       
    65         EParameter21,
       
    66         EParameter22,
       
    67         EParameter23,
       
    68         EParameter24,
       
    69         EParameter25,
       
    70         EParameter26,
       
    71         EParameter27,
       
    72         EParameter28,
       
    73         EParameter29,
       
    74         EParameter30,
       
    75         EParameter31,
       
    76         EParameter32,
       
    77         ENumElements
       
    78         };
       
    79    
       
    80     /**
       
    81     The dataset size in bytes.
       
    82     */
       
    83     static const TInt   KMaxSize        = 132;
       
    84     
       
    85     /**
       
    86     The maximum parameter count.
       
    87     */
       
    88     static const TUint  KMaxParameters  = (ENumElements - EParameter1);
       
    89         
       
    90 public:
       
    91 
       
    92     IMPORT_C TMTPUsbControlRequestDeviceStatus();
       
    93     
       
    94     IMPORT_C TUint NumParameters() const;
       
    95      
       
    96 public: // From TMTPTypeFlatBase
       
    97     
       
    98     IMPORT_C void Reset();
       
    99     IMPORT_C void SetUint32(TInt aElementId, TUint32 aData); 
       
   100     IMPORT_C TUint32 Uint32(TInt aElementId) const;
       
   101     IMPORT_C TInt FirstReadChunk(TPtrC8& aChunk) const;
       
   102     IMPORT_C TUint64 Size() const;
       
   103     IMPORT_C TUint Type() const;
       
   104     IMPORT_C TBool CommitRequired() const;
       
   105     IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk);
       
   106     
       
   107 private: // From TMTPTypeFlatBase
       
   108 
       
   109     IMPORT_C const TMTPTypeFlatBase::TElementInfo& ElementInfo(TInt aElementId) const;
       
   110 
       
   111 private:
       
   112     
       
   113     /**
       
   114     The dataset element metadata table content.
       
   115     */
       
   116     static const TMTPTypeFlatBase::TElementInfo     iElementMetaData[];
       
   117     
       
   118     /**
       
   119     The dataset element metadata table.
       
   120     */
       
   121     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   122     
       
   123     /**
       
   124     The data buffer.
       
   125     */
       
   126     TBuf8<KMaxSize>                                 iBuffer;
       
   127     
       
   128     /**
       
   129     The number of parameters in the dataset which are set.
       
   130     */
       
   131     TUint                                           iNumParameters;
       
   132     };
       
   133     
       
   134 #endif // TMTPUSBCONTROLREQUESTDEVICESTATUS_H