mtpfws/mtpfw/datatypes/src/tmtptyperesponse.cpp
changeset 0 d0791faffa3f
child 4 60a94a45d437
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  @publishedPartner
       
    19 */
       
    20 
       
    21 #include <mtp/mtpdatatypeconstants.h>
       
    22 #include <mtp/tmtptyperesponse.h>
       
    23 
       
    24 // Dataset element metadata.
       
    25 const TMTPTypeResponse::TElementInfo TMTPTypeResponse::iElementMetaData[ENumElements] = 
       
    26     {
       
    27         {EMTPTypeUINT16,    0,  KMTPTypeUINT16Size},    // EResponseCode
       
    28         {EMTPTypeUINT32,    2,  KMTPTypeUINT32Size},    // EResponseSessionID
       
    29         {EMTPTypeUINT32,    6,  KMTPTypeUINT32Size},    // EResponseTransactionID
       
    30         {EMTPTypeUINT32,    10, KMTPTypeUINT32Size},    // EResponseParameter1
       
    31         {EMTPTypeUINT32,    14, KMTPTypeUINT32Size},    // EResponseParameter2
       
    32         {EMTPTypeUINT32,    18, KMTPTypeUINT32Size},    // EResponseParameter3
       
    33         {EMTPTypeUINT32,    22, KMTPTypeUINT32Size},    // EResponseParameter4
       
    34         {EMTPTypeUINT32,    26, KMTPTypeUINT32Size},    // EResponseParameter5
       
    35     };
       
    36 
       
    37 /**
       
    38 Constructor.
       
    39 */
       
    40 EXPORT_C TMTPTypeResponse::TMTPTypeResponse() :
       
    41     iElementInfo(iElementMetaData, ENumElements),
       
    42     iBuffer(KSize)
       
    43     {
       
    44     SetBuffer(iBuffer);
       
    45     }
       
    46 
       
    47 EXPORT_C TMTPTypeResponse::TMTPTypeResponse(const TMTPTypeResponse& aResponse):
       
    48     iElementInfo(iElementMetaData, ENumElements),
       
    49     iBuffer(KSize)
       
    50     {
       
    51     iBuffer = aResponse.iBuffer;
       
    52     SetBuffer(iBuffer);
       
    53     }
       
    54 
       
    55 EXPORT_C TUint TMTPTypeResponse::Type() const
       
    56     {
       
    57     return EMTPTypeResponseDataset;
       
    58     }
       
    59     
       
    60 EXPORT_C const TMTPTypeFlatBase::TElementInfo& TMTPTypeResponse::ElementInfo(TInt aElementId) const
       
    61     {
       
    62     return iElementInfo[aElementId];
       
    63     }