diff -r 8b094906a049 -r 60a94a45d437 mtpfws/mtpfw/datatypes/src/tmtptyperesponse.cpp --- a/mtpfws/mtpfw/datatypes/src/tmtptyperesponse.cpp Mon Mar 15 12:43:12 2010 +0200 +++ b/mtpfws/mtpfw/datatypes/src/tmtptyperesponse.cpp Wed Mar 31 22:58:56 2010 +0300 @@ -20,7 +20,6 @@ #include #include - // Dataset element metadata. const TMTPTypeResponse::TElementInfo TMTPTypeResponse::iElementMetaData[ENumElements] = { @@ -32,6 +31,8 @@ {EMTPTypeUINT32, 18, KMTPTypeUINT32Size}, // EResponseParameter3 {EMTPTypeUINT32, 22, KMTPTypeUINT32Size}, // EResponseParameter4 {EMTPTypeUINT32, 26, KMTPTypeUINT32Size}, // EResponseParameter5 + {EMTPTypeINT32, 30, KMTPTypeUINT32Size}, // ENumValidParam + }; /** @@ -42,6 +43,7 @@ iBuffer(KSize) { SetBuffer(iBuffer); + TMTPTypeFlatBase::Reset(); } EXPORT_C TMTPTypeResponse::TMTPTypeResponse(const TMTPTypeResponse& aResponse): @@ -61,3 +63,20 @@ { return iElementInfo[aElementId]; } + +EXPORT_C void TMTPTypeResponse::SetUint32(TInt aElementId, TUint32 aData) + { + // Recalculate iNumOfValidParams + if(aElementId - EResponseTransactionID > TMTPTypeFlatBase::Int32(ENumValidParam)) + { + TMTPTypeFlatBase::SetInt32(ENumValidParam, aElementId - EResponseTransactionID); + } + // Set the element value. + TMTPTypeFlatBase::SetUint32(aElementId, aData); + } + + +EXPORT_C TInt TMTPTypeResponse::GetNumOfValidParams() const + { + return TMTPTypeFlatBase::Int32(ENumValidParam); + }