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 { |
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 |
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; |