mtptransports/mtpusbtransport/usbdatatypes/src/tmtpusbcontrolrequestmodheader.cpp
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 #include "mtpusbdatatypeconstants.h"
       
    22 #include "tmtpusbcontrolrequestmodheader.h"
       
    23     
       
    24 // Dataset element metadata.
       
    25 const TMTPUsbControlRequestMODHeader::TElementInfo TMTPUsbControlRequestMODHeader::iElementMetaData[ENumElements] = 
       
    26     {
       
    27         {EMTPTypeUINT32,    0,  KMTPTypeUINT32Size},    // EdwLength
       
    28         {EMTPTypeUINT16,    4,  KMTPTypeUINT16Size},    // EbcdVersion
       
    29         {EMTPTypeUINT16,    6,  KMTPTypeUINT16Size},    // EwIndex
       
    30         {EMTPTypeUINT8,     8,  KMTPTypeUINT8Size},     // EbCount
       
    31         {EMTPTypeUINT8,     9,  KMTPTypeUINT8Size},     // EReserved1 
       
    32         {EMTPTypeUINT8,     10, KMTPTypeUINT8Size},     // EReserved2 
       
    33         {EMTPTypeUINT8,     11, KMTPTypeUINT8Size},     // EReserved3 
       
    34         {EMTPTypeUINT8,     12, KMTPTypeUINT8Size},     // EReserved4 
       
    35         {EMTPTypeUINT8,     13, KMTPTypeUINT8Size},     // EReserved5 
       
    36         {EMTPTypeUINT8,     14, KMTPTypeUINT8Size},     // EReserved6 
       
    37         {EMTPTypeUINT8,     15, KMTPTypeUINT8Size},     // EReserved7 
       
    38     }; 
       
    39 
       
    40 /** 
       
    41 Constructor
       
    42 */
       
    43 EXPORT_C TMTPUsbControlRequestMODHeader::TMTPUsbControlRequestMODHeader() :
       
    44     iElementInfo(iElementMetaData, ENumElements),
       
    45     iBuffer(KSize)
       
    46     {
       
    47     SetBuffer(iBuffer);
       
    48     }     
       
    49 
       
    50 EXPORT_C TUint TMTPUsbControlRequestMODHeader::Type() const
       
    51 	{
       
    52 	return EMTPUsbTypeControlRequestMODHeader;
       
    53 	}
       
    54     
       
    55 EXPORT_C const TMTPTypeFlatBase::TElementInfo& TMTPUsbControlRequestMODHeader::ElementInfo(TInt aElementId) const
       
    56     {
       
    57     __ASSERT_DEBUG((aElementId < ENumElements), User::Invariant());
       
    58     return iElementInfo[aElementId];
       
    59     }