mtpfws/mtpfw/dataproviders/devdp/src/cmtpgetdevicepropdesc.cpp
changeset 49 c20dd21d1eb4
parent 29 3ae5cb0b4c02
child 52 866b4af7ffbe
equal deleted inserted replaced
41:2c19c7cf5550 49:c20dd21d1eb4
    29 #include "cmtpdevicedatastore.h"
    29 #include "cmtpdevicedatastore.h"
    30 #include "cmtpgetdevicepropdesc.h"
    30 #include "cmtpgetdevicepropdesc.h"
    31 #include "mtpdevicedpconst.h"
    31 #include "mtpdevicedpconst.h"
    32 #include "mtpdevdppanic.h"
    32 #include "mtpdevdppanic.h"
    33 #include "cmtpdevicedpconfigmgr.h"
    33 #include "cmtpdevicedpconfigmgr.h"
       
    34 #include "mtpdebug.h"
       
    35 #include "OstTraceDefinitions.h"
       
    36 #ifdef OST_TRACE_COMPILER_IN_USE
       
    37 #include "cmtpgetdevicepropdescTraces.h"
       
    38 #endif
       
    39 
    34 
    40 
    35 // Class constants.
    41 // Class constants.
    36 __FLOG_STMT(_LIT8(KComponent,"GetDevicePropDesc");)
       
    37 
    42 
    38 _LIT(KSpace, " ");
    43 _LIT(KSpace, " ");
    39 
    44 
    40 /**
    45 /**
    41 Two-phase constructor.
    46 Two-phase constructor.
    56 /**
    61 /**
    57 Destructor.
    62 Destructor.
    58 */    
    63 */    
    59 CMTPGetDevicePropDesc::~CMTPGetDevicePropDesc()
    64 CMTPGetDevicePropDesc::~CMTPGetDevicePropDesc()
    60     {    
    65     {    
    61     __FLOG(_L8("~CMTPGetDevicePropDesc - Entry"));
    66     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_CMTPGETDEVICEPROPDESC_DES_ENTRY );
    62     delete iData;
    67     delete iData;
    63     delete iPropDesc;
    68     delete iPropDesc;
    64     delete iRepository;
    69     delete iRepository;
    65     iDpSingletons.Close();
    70     iDpSingletons.Close();
    66     __FLOG(_L8("~CMTPGetDevicePropDesc - Exit"));
    71     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_CMTPGETDEVICEPROPDESC_DES_EXIT );
    67     __FLOG_CLOSE;
       
    68     }
    72     }
    69 
    73 
    70 /**
    74 /**
    71 Constructor.
    75 Constructor.
    72 */    
    76 */    
    79 GetDevicePropDesc request validator.
    83 GetDevicePropDesc request validator.
    80 @return EMTPRespCodeOK if request is verified, otherwise one of the error response codes
    84 @return EMTPRespCodeOK if request is verified, otherwise one of the error response codes
    81 */
    85 */
    82 TMTPResponseCode CMTPGetDevicePropDesc::CheckRequestL()
    86 TMTPResponseCode CMTPGetDevicePropDesc::CheckRequestL()
    83     {
    87     {
    84     __FLOG(_L8("CheckRequestL - Entry"));
    88     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_CHECKREQUESTL_ENTRY );
    85     TMTPResponseCode respCode(EMTPRespCodeDevicePropNotSupported);
    89     TMTPResponseCode respCode(EMTPRespCodeDevicePropNotSupported);
    86     iPropCode = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    90     iPropCode = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    87     const TInt count = sizeof(KMTPDeviceDpSupportedProperties) / sizeof(KMTPDeviceDpSupportedProperties[0]);
    91     const TInt count = sizeof(KMTPDeviceDpSupportedProperties) / sizeof(KMTPDeviceDpSupportedProperties[0]);
    88     for (TUint i(0); ((respCode != EMTPRespCodeOK) && (i < count)); i++)
    92     for (TUint i(0); ((respCode != EMTPRespCodeOK) && (i < count)); i++)
    89         {
    93         {
    94         }
    98         }
    95     if((respCode != EMTPRespCodeOK) && iDpSingletons.DeviceDataStore().ExtnDevicePropDp())//2113 
    99     if((respCode != EMTPRespCodeOK) && iDpSingletons.DeviceDataStore().ExtnDevicePropDp())//2113 
    96         {
   100         {
    97         respCode = EMTPRespCodeOK;
   101         respCode = EMTPRespCodeOK;
    98         }
   102         }
    99     __FLOG(_L8("CheckRequestL - Exit"));
   103     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_CHECKREQUESTL_EXIT );
   100     return respCode;
   104     return respCode;
   101     }
   105     }
   102 
   106 
   103 /**
   107 /**
   104 GetDevicePropDesc request handler.
   108 GetDevicePropDesc request handler.
   105 */    
   109 */    
   106 void CMTPGetDevicePropDesc::ServiceL()
   110 void CMTPGetDevicePropDesc::ServiceL()
   107     {
   111     {
   108     __FLOG(_L8("ServiceL - Entry"));    
   112     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEL_ENTRY );  
   109     iPropCode = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
   113     iPropCode = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
   110     //before performing any operation will check the properties are supported or 
   114     //before performing any operation will check the properties are supported or 
   111     //not if not then return EMTPRespCodeDevicePropNotSupported
   115     //not if not then return EMTPRespCodeDevicePropNotSupported
   112     const CMTPTypeArray *mtpArray = &(iDpSingletons.DeviceDataStore().GetSupportedDeviceProperties());
   116     const CMTPTypeArray *mtpArray = &(iDpSingletons.DeviceDataStore().GetSupportedDeviceProperties());
   113     RArray <TUint> supportedArray;	    
   117     RArray <TUint> supportedArray;	    
   114     mtpArray->Array(supportedArray);
   118     mtpArray->Array(supportedArray);
   115     __FLOG_VA((_L8("No of elements in supported property array = %d "), supportedArray.Count()));	
   119     OstTrace1(TRACE_NORMAL, CMTPGETDEVICEPROPDESC_SERVICEL, 
       
   120             "No of elements in supported property array = %d ", supportedArray.Count());
   116     if(KErrNotFound == supportedArray.Find(iPropCode))
   121     if(KErrNotFound == supportedArray.Find(iPropCode))
   117         {
   122         {
   118         SendResponseL(EMTPRespCodeDevicePropNotSupported);       
   123         SendResponseL(EMTPRespCodeDevicePropNotSupported);       
   119         __FLOG(_L8("CMTPGetDevicePropDesc::EMTPRespCodeDevicePropNotSupported "));	  
   124         OstTrace0(TRACE_NORMAL, DUP1_CMTPGETDEVICEPROPDESC_SERVICEL, "CMTPGetDevicePropDesc::EMTPRespCodeDevicePropNotSupported ");
   120         }
   125         }
   121     else
   126     else
   122         {
   127         {
   123         switch (iPropCode)
   128         switch (iPropCode)
   124             {
   129             {
   182                 SendResponseL(EMTPRespCodeDevicePropNotSupported); 
   187                 SendResponseL(EMTPRespCodeDevicePropNotSupported); 
   183             break;
   188             break;
   184             }
   189             }
   185         }
   190         }
   186     supportedArray.Close();
   191     supportedArray.Close();
   187     __FLOG(_L8("ServiceL - Exit"));
   192     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEL_EXIT );
   188     }
   193     }
   189     
   194     
   190     
   195     
   191 void  CMTPGetDevicePropDesc::HandleExtnServiceL(TInt aPropCode, MExtnDevicePropDp* aExtnDevplugin )
   196 void  CMTPGetDevicePropDesc::HandleExtnServiceL(TInt aPropCode, MExtnDevicePropDp* aExtnDevplugin )
   192 	{
   197 	{
       
   198 	OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_HANDLEEXTNSERVICEL_ENTRY );
   193 	//call	 plugin ->desc
   199 	//call	 plugin ->desc
   194 	MMTPType* mtptype;
   200 	MMTPType* mtptype;
   195 	if(KErrNone == aExtnDevplugin->GetDevPropertyDescL((TMTPDevicePropertyCode)aPropCode, &mtptype))
   201 	if(KErrNone == aExtnDevplugin->GetDevPropertyDescL((TMTPDevicePropertyCode)aPropCode, &mtptype))
   196 	{
   202 	{
   197 	SendDataL(*mtptype);	
   203 	SendDataL(*mtptype);	
   200 	{
   206 	{
   201 	SendResponseL(EMTPRespCodeDevicePropNotSupported); 	
   207 	SendResponseL(EMTPRespCodeDevicePropNotSupported); 	
   202 	}
   208 	}
   203 
   209 
   204 	
   210 	
       
   211 	OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_HANDLEEXTNSERVICEL_EXIT );
   205 	}
   212 	}
   206 void CMTPGetDevicePropDesc::DoCancel()
   213 void CMTPGetDevicePropDesc::DoCancel()
   207     {
   214     {
   208     __FLOG(_L8("DoCancel - Entry"));
   215     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_DOCANCEL_ENTRY );
   209     if (iPropCode == EMTPDevicePropCodeBatteryLevel)
   216     if (iPropCode == EMTPDevicePropCodeBatteryLevel)
   210         {
   217         {
   211         iDpSingletons.DeviceDataStore().Cancel();
   218         iDpSingletons.DeviceDataStore().Cancel();
   212         }
   219         }
   213     __FLOG(_L8("DoCancel - Exit"));
   220     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_DOCANCEL_EXIT );
   214     }
   221     }
   215     
   222     
   216 void CMTPGetDevicePropDesc::RunL()
   223 void CMTPGetDevicePropDesc::RunL()
   217     {
   224     {
   218     __FLOG(_L8("RunL - Entry"));
   225     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_RUNL_ENTRY );
   219     if (iPropCode == EMTPDevicePropCodeBatteryLevel)
   226     if (iPropCode == EMTPDevicePropCodeBatteryLevel)
   220         {
   227         {
   221         ServiceBatteryLevelL();
   228         ServiceBatteryLevelL();
   222         }
   229         }
   223     else
   230     else
   224         {
   231         {
   225         __DEBUG_ONLY(Panic(EMTPDevDpUnknownDeviceProperty));
   232         __DEBUG_ONLY(Panic(EMTPDevDpUnknownDeviceProperty));
   226         }
   233         }
   227     __FLOG(_L8("RunL - Exit"));
   234     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_RUNL_EXIT );
   228     }
   235     }
   229 
   236 
   230 /**
   237 /**
   231 Second-phase constructor.
   238 Second-phase constructor.
   232 */        
   239 */        
   233 void CMTPGetDevicePropDesc::ConstructL()
   240 void CMTPGetDevicePropDesc::ConstructL()
   234     {
   241     {
   235     __FLOG_OPEN(KMTPSubsystem, KComponent);
   242     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_CONSTRUCTL_ENTRY );
   236     __FLOG(_L8("CMTPGetDevicePropDesc: ConstructL - Entry")); 
       
   237     iDpSingletons.OpenL(iFramework);
   243     iDpSingletons.OpenL(iFramework);
   238 	const TUint32 KUidMTPRepositoryValue(0x10282FCC);
   244 	const TUint32 KUidMTPRepositoryValue(0x10282FCC);
   239     const TUid KUidMTPRepository = {KUidMTPRepositoryValue};
   245     const TUid KUidMTPRepository = {KUidMTPRepositoryValue};
   240     iRepository = CRepository::NewL(KUidMTPRepository);
   246     iRepository = CRepository::NewL(KUidMTPRepository);
   241     __FLOG(_L8("CMTPGetDevicePropDesc: ConstructL - Exit")); 
   247     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_CONSTRUCTL_EXIT );
   242     }
   248     }
   243 
   249 
   244 /**
   250 /**
   245 Services the battery level property.
   251 Services the battery level property.
   246 */        
   252 */        
   247 void CMTPGetDevicePropDesc::ServiceBatteryLevelL()
   253 void CMTPGetDevicePropDesc::ServiceBatteryLevelL()
   248     {
   254     {
   249     __FLOG(_L8("ServiceBatteryLevelL - Entry")); 
   255     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEBATTERYLEVELL_ENTRY );
   250     CMTPTypeDevicePropDescRangeForm* form = CMTPTypeDevicePropDescRangeForm::NewLC(EMTPTypeUINT8);
   256     CMTPTypeDevicePropDescRangeForm* form = CMTPTypeDevicePropDescRangeForm::NewLC(EMTPTypeUINT8);
   251     form->SetUint8L(CMTPTypeDevicePropDescRangeForm::EMinimumValue, 0);
   257     form->SetUint8L(CMTPTypeDevicePropDescRangeForm::EMinimumValue, 0);
   252     form->SetUint8L(CMTPTypeDevicePropDescRangeForm::EMaximumValue, 100);
   258     form->SetUint8L(CMTPTypeDevicePropDescRangeForm::EMaximumValue, 100);
   253     form->SetUint8L(CMTPTypeDevicePropDescRangeForm::EStepSize, 10);
   259     form->SetUint8L(CMTPTypeDevicePropDescRangeForm::EStepSize, 10);
   254     
   260     
   258     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::EFactoryDefaultValue, 0);    
   264     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::EFactoryDefaultValue, 0);    
   259     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::ECurrentValue, iBatteryLevelValue);
   265     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::ECurrentValue, iBatteryLevelValue);
   260     CleanupStack::PopAndDestroy(form);
   266     CleanupStack::PopAndDestroy(form);
   261 
   267 
   262     SendDataL(*iPropDesc);
   268     SendDataL(*iPropDesc);
   263     __FLOG(_L8("ServiceBatteryLevelL - Exit")); 
   269     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEBATTERYLEVELL_EXIT );
   264     }
   270     }
   265 
   271 
   266 /**
   272 /**
   267 Services the device friendly name property.
   273 Services the device friendly name property.
   268 */    
   274 */    
   269 void CMTPGetDevicePropDesc::ServiceDeviceFriendlyNameL()
   275 void CMTPGetDevicePropDesc::ServiceDeviceFriendlyNameL()
   270     {
   276     {
   271     __FLOG(_L8("ServiceDeviceFriendlyNameL - Entry"));
   277     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEDEVICEFRIENDLYNAMEL_ENTRY );
   272     delete iPropDesc;
   278     delete iPropDesc;
   273     iPropDesc = NULL;
   279     iPropDesc = NULL;
   274     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeDeviceFriendlyName);
   280     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeDeviceFriendlyName);
   275     
   281     
   276     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());
   282     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());
   301         {
   307         {
   302         iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.DeviceFriendlyName());
   308         iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.DeviceFriendlyName());
   303         }
   309         }
   304     
   310     
   305     SendDataL(*iPropDesc);    
   311     SendDataL(*iPropDesc);    
   306     __FLOG(_L8("ServiceDeviceFriendlyNameL - Exit")); 
   312     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEDEVICEFRIENDLYNAMEL_EXIT );
   307     }
   313     }
   308         
   314         
   309 /**
   315 /**
   310 Services the synchronisation partner property.
   316 Services the synchronisation partner property.
   311 */    
   317 */    
   312 void CMTPGetDevicePropDesc::ServiceSynchronisationPartnerL()
   318 void CMTPGetDevicePropDesc::ServiceSynchronisationPartnerL()
   313     {
   319     {
   314     __FLOG(_L8("ServiceSynchronisationPartnerL - Entry")); 
   320     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICESYNCHRONISATIONPARTNERL_ENTRY );
   315     delete iPropDesc;
   321     delete iPropDesc;
   316     iPropDesc = NULL;
   322     iPropDesc = NULL;
   317     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeSynchronizationPartner);
   323     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeSynchronizationPartner);
   318     
   324     
   319     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());
   325     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());
   320     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.SynchronisationPartnerDefault());
   326     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.SynchronisationPartnerDefault());
   321     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.SynchronisationPartner());
   327     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.SynchronisationPartner());
   322     
   328     
   323     SendDataL(*iPropDesc); 
   329     SendDataL(*iPropDesc); 
   324     __FLOG(_L8("ServiceSynchronisationPartnerL - Exit")); 
   330     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICESYNCHRONISATIONPARTNERL_EXIT );
   325     }
   331     }
   326 
   332 
   327 /**
   333 /**
   328 *Services the synchronisation partner property. 
   334 *Services the synchronisation partner property. 
   329 */    
   335 */    
   330 void CMTPGetDevicePropDesc::ServiceSessionInitiatorVersionInfoL()
   336 void CMTPGetDevicePropDesc::ServiceSessionInitiatorVersionInfoL()
   331     {
   337     {
   332     __FLOG(_L8("ServiceSessionInitiatorVersionInfoL - Entry")); 
   338     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICESESSIONINITIATORVERSIONINFOL_ENTRY );
   333     delete iPropDesc;
   339     delete iPropDesc;
   334     iPropDesc = NULL;
   340     iPropDesc = NULL;
   335     // this property is of type set or get 
   341     // this property is of type set or get 
   336     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeSessionInitiatorVersionInfo, 0x01/*set/get*/, 0x00, NULL);   
   342     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeSessionInitiatorVersionInfo, 0x01/*set/get*/, 0x00, NULL);   
   337     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());   
   343     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());   
   338     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.SessionInitiatorVersionInfoDefault());
   344     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.SessionInitiatorVersionInfoDefault());
   339     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.SessionInitiatorVersionInfo());
   345     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.SessionInitiatorVersionInfo());
   340     SendDataL(*iPropDesc); 
   346     SendDataL(*iPropDesc); 
   341     __FLOG(_L8("ServiceSessionInitiatorVersionInfoL - Exit")); 
   347     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICESESSIONINITIATORVERSIONINFOL_EXIT );
   342     }
   348     }
   343 
   349 
   344 /**
   350 /**
   345 *Services the Service Perceived Device Type. 
   351 *Services the Service Perceived Device Type. 
   346 */    
   352 */    
   347 void CMTPGetDevicePropDesc::ServicePerceivedDeviceTypeL()
   353 void CMTPGetDevicePropDesc::ServicePerceivedDeviceTypeL()
   348     {
   354     {
   349     __FLOG(_L8("ServicePerceivedDeviceType - Entry")); 
   355     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEPERCEIVEDDEVICETYPEL_ENTRY ); 
   350     delete iPropDesc;
   356     delete iPropDesc;
   351     iPropDesc = NULL;
   357     iPropDesc = NULL;
   352     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodePerceivedDeviceType, 0x00/*get only*/, 0x00, NULL);
   358     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodePerceivedDeviceType, 0x00/*get only*/, 0x00, NULL);
   353     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());    
   359     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());    
   354     iPropDesc->SetUint32L(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.PerceivedDeviceTypeDefault());
   360     iPropDesc->SetUint32L(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.PerceivedDeviceTypeDefault());
   355     iPropDesc->SetUint32L(CMTPTypeDevicePropDesc::ECurrentValue, device.PerceivedDeviceType());
   361     iPropDesc->SetUint32L(CMTPTypeDevicePropDesc::ECurrentValue, device.PerceivedDeviceType());
   356     SendDataL(*iPropDesc); 
   362     SendDataL(*iPropDesc); 
   357     __FLOG(_L8("ServicePerceivedDeviceType - Exit")); 
   363     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEPERCEIVEDDEVICETYPEL_EXIT );
   358     }
   364     }
   359 
   365 
   360 /**
   366 /**
   361 Services the Date Time property. 
   367 Services the Date Time property. 
   362 */    
   368 */    
   363 void CMTPGetDevicePropDesc::ServiceDateTimeL()
   369 void CMTPGetDevicePropDesc::ServiceDateTimeL()
   364     {
   370     {
   365     __FLOG(_L8("ServicePerceivedDeviceType - Entry")); 
   371     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEDATETIMEL_ENTRY );
   366     delete iPropDesc;
   372     delete iPropDesc;
   367     iPropDesc = NULL;
   373     iPropDesc = NULL;
   368     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeDateTime, 0x01/*get/set*/, 0x00, NULL);
   374     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeDateTime, 0x01/*get/set*/, 0x00, NULL);
   369     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());    
   375     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());    
   370     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.DateTimeL());
   376     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.DateTimeL());
   371     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.DateTimeL());
   377     iPropDesc->SetStringL(CMTPTypeDevicePropDesc::ECurrentValue, device.DateTimeL());
   372     SendDataL(*iPropDesc); 
   378     SendDataL(*iPropDesc); 
   373     __FLOG(_L8("ServicePerceivedDeviceType - Exit")); 
   379     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEDATETIMEL_EXIT );
   374     }
   380     }
   375 
   381 
   376 /**
   382 /**
   377 Services the Date Time property. 
   383 Services the Date Time property. 
   378 */	  
   384 */	  
   379 void CMTPGetDevicePropDesc::ServiceDeviceIconL()
   385 void CMTPGetDevicePropDesc::ServiceDeviceIconL()
   380     {
   386     {
   381     __FLOG(_L8("ServiceDeviceIcon - Entry")); 
   387     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEDEVICEICONL_ENTRY );
   382     delete iPropDesc;
   388     delete iPropDesc;
   383     iPropDesc = NULL;
   389     iPropDesc = NULL;
   384     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeDeviceIcon, 0x00, 0x00, NULL);
   390     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeDeviceIcon, 0x00, 0x00, NULL);
   385     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());	 
   391     CMTPDeviceDataStore& device(iDpSingletons.DeviceDataStore());	 
   386     //need to think of which one to be used for default.
   392     //need to think of which one to be used for default.
   387     iPropDesc->SetL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.DeviceIcon());
   393     iPropDesc->SetL(CMTPTypeDevicePropDesc::EFactoryDefaultValue, device.DeviceIcon());
   388     iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, device.DeviceIcon());
   394     iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, device.DeviceIcon());
   389     SendDataL(*iPropDesc); 
   395     SendDataL(*iPropDesc); 
   390     __FLOG(_L8("ServiceDeviceIcon- Exit"));   
   396     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEDEVICEICONL_EXIT );
   391     }
   397     }
   392 
   398 
   393 /*
   399 /*
   394 *Service Supported format ordered.
   400 *Service Supported format ordered.
   395 */
   401 */
   396 void CMTPGetDevicePropDesc::ServiceSupportedFormatsOrderedL()
   402 void CMTPGetDevicePropDesc::ServiceSupportedFormatsOrderedL()
   397     {
   403     {
   398     __FLOG(_L8("ServiceSupportedFormatsOrdered - Entry")); 
   404     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICESUPPORTEDFORMATSORDEREDL_ENTRY );
   399     delete iPropDesc;
   405     delete iPropDesc;
   400     iPropDesc = NULL;
   406     iPropDesc = NULL;
   401     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeSupportedFormatsOrdered, 0x00, 0x00, NULL);    
   407     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeSupportedFormatsOrdered, 0x00, 0x00, NULL);    
   402     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::EFactoryDefaultValue, (TUint8)FORMAT_UNORDERED);
   408     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::EFactoryDefaultValue, (TUint8)FORMAT_UNORDERED);
   403     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::ECurrentValue, GetFormatOrdered());
   409     iPropDesc->SetUint8L(CMTPTypeDevicePropDesc::ECurrentValue, GetFormatOrdered());
   404     SendDataL(*iPropDesc); 
   410     SendDataL(*iPropDesc); 
   405     __FLOG(_L8("ServiceSupportedFormatsOrdered - Exit")); 
   411     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICESUPPORTEDFORMATSORDEREDL_EXIT );
   406     }
   412     }
   407 
   413 
   408 /*
   414 /*
   409 *Service Supported FuntionalID.
   415 *Service Supported FuntionalID.
   410 */
   416 */
   411 void CMTPGetDevicePropDesc::ServiceFunctionalIDL()
   417 void CMTPGetDevicePropDesc::ServiceFunctionalIDL()
   412     {
   418     {
   413     __FLOG(_L8("ServiceFuntionalIDL - Entry")); 
   419     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEFUNCTIONALIDL_ENTRY );
   414     delete iPropDesc;
   420     delete iPropDesc;
   415     iPropDesc = NULL;
   421     iPropDesc = NULL;
   416     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeFunctionalID, 1, 0, NULL); 
   422     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeFunctionalID, 1, 0, NULL); 
   417     
   423     
   418     delete iData;
   424     delete iData;
   421 	delete iData;
   427 	delete iData;
   422 	iData = GetGUIDL(MMTPFrameworkConfig::EDeviceCurrentFuncationalID); 
   428 	iData = GetGUIDL(MMTPFrameworkConfig::EDeviceCurrentFuncationalID); 
   423 	iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, *iData);
   429 	iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, *iData);
   424 	
   430 	
   425     SendDataL(*iPropDesc); 
   431     SendDataL(*iPropDesc); 
   426     __FLOG(_L8("ServiceFuntionalIDL - Exit")); 
   432     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEFUNCTIONALIDL_EXIT );
   427     }
   433     }
   428 
   434 
   429 /*
   435 /*
   430 *Service Supported ModelID.
   436 *Service Supported ModelID.
   431 */
   437 */
   432 void CMTPGetDevicePropDesc::ServiceModelIDL()
   438 void CMTPGetDevicePropDesc::ServiceModelIDL()
   433     {
   439     {
   434     __FLOG(_L8("ServiceModelIDL - Entry")); 
   440     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEMODELIDL_ENTRY );
   435     delete iPropDesc;
   441     delete iPropDesc;
   436     iPropDesc = NULL;
   442     iPropDesc = NULL;
   437     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeModelID, 0, 0, NULL);   
   443     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeModelID, 0, 0, NULL);   
   438     
   444     
   439     delete iData;
   445     delete iData;
   443     delete iData;
   449     delete iData;
   444     iData = GetGUIDL(MMTPFrameworkConfig::EDeviceCurrentModelID); 
   450     iData = GetGUIDL(MMTPFrameworkConfig::EDeviceCurrentModelID); 
   445 	iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, *iData);
   451 	iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, *iData);
   446 	
   452 	
   447     SendDataL(*iPropDesc); 
   453     SendDataL(*iPropDesc); 
   448     __FLOG(_L8("ServiceModelIDL - Exit")); 
   454     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEMODELIDL_EXIT );
   449     }
   455     }
   450 
   456 
   451 /*
   457 /*
   452 *Service Supported UseDeviceStage.
   458 *Service Supported UseDeviceStage.
   453 */
   459 */
   454 void CMTPGetDevicePropDesc::ServiceUseDeviceStageL()
   460 void CMTPGetDevicePropDesc::ServiceUseDeviceStageL()
   455     {
   461     {
   456     __FLOG(_L8("ServiceUseDeviceStageL - Entry")); 
   462     OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_SERVICEUSEDEVICESTAGEL_ENTRY );
   457     delete iPropDesc;
   463     delete iPropDesc;
   458     iPropDesc = NULL;
   464     iPropDesc = NULL;
   459     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeUseDeviceStage, 0, 0, NULL); 
   465     iPropDesc = CMTPTypeDevicePropDesc::NewL(EMTPDevicePropCodeUseDeviceStage, 0, 0, NULL); 
   460     
   466     
   461     TMTPTypeUint8 *data = new (ELeave)TMTPTypeUint8(1);
   467     TMTPTypeUint8 *data = new (ELeave)TMTPTypeUint8(1);
   463     iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, *data);
   469     iPropDesc->SetL(CMTPTypeDevicePropDesc::ECurrentValue, *data);
   464     
   470     
   465     delete data;
   471     delete data;
   466 
   472 
   467     SendDataL(*iPropDesc); 
   473     SendDataL(*iPropDesc); 
   468     __FLOG(_L8("ServiceUseDeviceStageL - Exit")); 
   474     OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_SERVICEUSEDEVICESTAGEL_EXIT );
   469     }
   475     }
   470 
   476 
   471 /*
   477 /*
   472 *This method to set the supported format order.
   478 *This method to set the supported format order.
   473 *this value will be set by getdevice info based on the formats present in the
   479 *this value will be set by getdevice info based on the formats present in the
   479     RArray<TUint> orderedFormats(8);
   485     RArray<TUint> orderedFormats(8);
   480     CleanupClosePushL(orderedFormats);  
   486     CleanupClosePushL(orderedFormats);  
   481     TRAPD(error,iDpSingletons.ConfigMgr().GetRssConfigInfoArrayL(orderedFormats, EDevDpFormats));
   487     TRAPD(error,iDpSingletons.ConfigMgr().GetRssConfigInfoArrayL(orderedFormats, EDevDpFormats));
   482 	if(error!=KErrNone)
   488 	if(error!=KErrNone)
   483 		{
   489 		{
   484 		__FLOG_VA((_L8("GetRssConfigArray returned with %d"), error));
   490 		OstTrace1(TRACE_WARNING, CMTPGETDEVICEPROPDESC_GETFORMATORDERED,
       
   491 		        "GetRssConfigArray returned with %d", error);
   485 		}
   492 		}
   486     if(orderedFormats.Count() > 0)
   493     if(orderedFormats.Count() > 0)
   487         {
   494         {
   488         formatOrdered = (TUint8)FORMAT_ORDERED;
   495         formatOrdered = (TUint8)FORMAT_ORDERED;
   489         }
   496         }
   497 
   504 
   498 TMTPTypeGuid* CMTPGetDevicePropDesc::GetGUIDL(const TUint aKey)
   505 TMTPTypeGuid* CMTPGetDevicePropDesc::GetGUIDL(const TUint aKey)
   499     {
   506     {
   500     TBuf<KGUIDFormatStringLength> buf;
   507     TBuf<KGUIDFormatStringLength> buf;
   501     
   508     
   502     User::LeaveIfError(iRepository->Get(aKey,buf));
   509     LEAVEIFERROR(iRepository->Get(aKey,buf),
       
   510     OstTrace1( TRACE_ERROR, CMTPGETDEVICEPROPDESC_GETGUIDL, "can't get from iRepository. the parameter is %d", aKey));
   503 
   511 
   504     TMTPTypeGuid* ret = new (ELeave) TMTPTypeGuid( buf );
   512     TMTPTypeGuid* ret = new (ELeave) TMTPTypeGuid( buf );
   505     
   513     
   506     return ret;
   514     return ret;
   507     }
   515     }