mtptransports/mtpusbtransport/usbdatatypes/src/tmtpusbcontrolrequestsetup.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 "tmtpusbcontrolrequestsetup.h"
       
    23     
       
    24 // Dataset element metadata.
       
    25 const TMTPUsbControlRequestSetup::TElementInfo TMTPUsbControlRequestSetup::iElementMetaData[ENumElements] = 
       
    26     {
       
    27         {EMTPTypeUINT8,     0,  KMTPTypeUINT8Size},     // EbmRequestType
       
    28         {EMTPTypeUINT8,     1,  KMTPTypeUINT8Size},     // EbRequest
       
    29         {EMTPTypeUINT16,    2,  KMTPTypeUINT16Size},    // EwValue
       
    30         {EMTPTypeUINT16,    4,  KMTPTypeUINT16Size},    // EwIndex
       
    31         {EMTPTypeUINT16,    6,  KMTPTypeUINT16Size},    // EwLength 
       
    32     }; 
       
    33 
       
    34 /** 
       
    35 Constructor
       
    36 */
       
    37 EXPORT_C TMTPUsbControlRequestSetup::TMTPUsbControlRequestSetup() :
       
    38     iElementInfo(iElementMetaData, ENumElements),
       
    39     iBuffer(KSize)
       
    40     {
       
    41     SetBuffer(iBuffer);
       
    42     }     
       
    43 
       
    44 EXPORT_C TUint TMTPUsbControlRequestSetup::Type() const
       
    45 	{
       
    46 	return EMTPUsbTypeControlRequestSetup;
       
    47 	}
       
    48     
       
    49 EXPORT_C const TMTPTypeFlatBase::TElementInfo& TMTPUsbControlRequestSetup::ElementInfo(TInt aElementId) const
       
    50     {
       
    51     __ASSERT_DEBUG((aElementId < ENumElements), User::Invariant());
       
    52     return iElementInfo[aElementId];
       
    53     }