mtpfws/mtpfw/dataproviders/proxydp/src/cmtpgetobjectproplist.cpp
changeset 17 aabe5387f5ce
parent 0 d0791faffa3f
child 20 6e82ae192c3a
equal deleted inserted replaced
0:d0791faffa3f 17:aabe5387f5ce
    31 #include "mtpdppanic.h"
    31 #include "mtpdppanic.h"
    32 #include "cmtpobjectmgr.h"
    32 #include "cmtpobjectmgr.h"
    33 
    33 
    34 __FLOG_STMT( _LIT8( KComponent,"PrxyGetObjPrpLst" ); )
    34 __FLOG_STMT( _LIT8( KComponent,"PrxyGetObjPrpLst" ); )
    35 const TUint KInvalidDpId = 0xFF;
    35 const TUint KInvalidDpId = 0xFF;
       
    36 
       
    37 /**
       
    38 Verification data for the GetObjectPropList request
       
    39 */
       
    40 const TMTPRequestElementInfo KMTPGetObjectPropListPolicy[] = 
       
    41     {
       
    42 		{ TMTPTypeRequest::ERequestParameter1, EMTPElementTypeObjectHandle, EMTPElementAttrNone, 2, KMTPHandleAll, KMTPHandleNone}
       
    43     };
       
    44 
    36 /**
    45 /**
    37 Factory method.
    46 Factory method.
    38 @param aFramework	The data provider framework
    47 @param aFramework	The data provider framework
    39 @param aConnection	The connection from which the request comes
    48 @param aConnection	The connection from which the request comes
    40 @return a pointer to the created request processor object.
    49 @return a pointer to the created request processor object.
   124     __FLOG( _L8("+ProxyTransactionCompleteL") );
   133     __FLOG( _L8("+ProxyTransactionCompleteL") );
   125     __FLOG_1( _L8("Response code is 0x%08X,"), iResponse.Uint16(TMTPTypeResponse::EResponseCode) );
   134     __FLOG_1( _L8("Response code is 0x%08X,"), iResponse.Uint16(TMTPTypeResponse::EResponseCode) );
   126     
   135     
   127 	__ASSERT_DEBUG((( (iRequest == &aRequest) || ( &iCurrentRequest == &aRequest ) ) && (&iConnection == &aConnection)), Panic(EMTPNotSameRequestProxy));
   136 	__ASSERT_DEBUG((( (iRequest == &aRequest) || ( &iCurrentRequest == &aRequest ) ) && (&iConnection == &aConnection)), Panic(EMTPNotSameRequestProxy));
   128 	TUint16 response = iResponse.Uint16(TMTPTypeResponse::EResponseCode);
   137 	TUint16 response = iResponse.Uint16(TMTPTypeResponse::EResponseCode);
   129 	if(( EMTPRespCodeGroupNotSupported == response) || (EMTPRespCodeSpecificationByGroupUnsupported == response))
   138 	if(( EMTPRespCodeGroupNotSupported == response) || (EMTPRespCodeSpecificationByGroupUnsupported == response) || ( EMTPRespCodeObjectPropNotSupported == response))
   130 		{
   139 		{
   131 		response = EMTPRespCodeOK;
   140 		response = EMTPRespCodeOK;
   132 		iResponse.SetUint16(TMTPTypeResponse::EResponseCode, response);
   141 		iResponse.SetUint16(TMTPTypeResponse::EResponseCode, response);
   133 		}
   142 		}
   134 	
   143 	
   176 
   185 
   177 /**
   186 /**
   178 Constructor.
   187 Constructor.
   179 */	
   188 */	
   180 CMTPGetObjectPropList::CMTPGetObjectPropList(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection) :
   189 CMTPGetObjectPropList::CMTPGetObjectPropList(MMTPDataProviderFramework& aFramework, MMTPConnection& aConnection) :
   181     CMTPRequestProcessor(aFramework, aConnection, 0, NULL)
   190     CMTPRequestProcessor(aFramework, aConnection, sizeof(KMTPGetObjectPropListPolicy)/sizeof(TMTPRequestElementInfo), KMTPGetObjectPropListPolicy)
   182     {
   191     {
   183     __FLOG_OPEN( KMTPSubsystem, KComponent );
   192     __FLOG_OPEN( KMTPSubsystem, KComponent );
   184     __FLOG( _L8("+/-Ctor") );
   193     __FLOG( _L8("+/-Ctor") );
   185     }
   194     }
   186 
   195 
   246     iObjBrowser->GoL( fmtCode, handle, depth, callback );
   255     iObjBrowser->GoL( fmtCode, handle, depth, callback );
   247     __FLOG_1( _L8("The total of object handles is %d"), iHandles.Count() );
   256     __FLOG_1( _L8("The total of object handles is %d"), iHandles.Count() );
   248     
   257     
   249     if ( 0 == iHandles.Count() )
   258     if ( 0 == iHandles.Count() )
   250         {
   259         {
   251         if ( handle==KMTPHandleNone && depth==0 )
   260           SendDataL( *iObjectPropList );
   252             {
       
   253             SendDataL( *iObjectPropList );
       
   254             }
       
   255         else if ( fmtCode != KMTPFormatsAll )
       
   256             {
       
   257             SendResponseL(EMTPRespCodeSpecificationByFormatUnsupported);
       
   258             }
       
   259         else if ( handle != KMTPHandleAll )
       
   260             {
       
   261             SendResponseL(EMTPRespCodeInvalidObjectHandle);
       
   262             }
       
   263         }
   261         }
   264     else
   262     else
   265         {
   263         {
   266         Schedule( KErrNone );
   264         Schedule( KErrNone );
   267         }
   265         }