144 |
144 |
145 TMTPResponseCode response = EMTPRespCodeOK; |
145 TMTPResponseCode response = EMTPRespCodeOK; |
146 TUint32 propCode = Request().Uint32(TMTPTypeRequest::ERequestParameter3); |
146 TUint32 propCode = Request().Uint32(TMTPTypeRequest::ERequestParameter3); |
147 if (propCode == 0) |
147 if (propCode == 0) |
148 { |
148 { |
149 TUint32 groupCode = Request().Uint32(TMTPTypeRequest::ERequestParameter4); |
149 /*Do nothing */ |
150 if(groupCode != KMTPImageDpPropertyGroupOneNumber) |
|
151 { |
|
152 //Only supported group one |
|
153 response = EMTPRespCodeSpecificationByGroupUnsupported; |
|
154 } |
|
155 } |
150 } |
156 else if (propCode != KMaxTUint) |
151 else if (propCode != KMaxTUint) |
157 { |
152 { |
158 const TInt count = sizeof(KMTPImageDpSupportedProperties)/sizeof(KMTPImageDpSupportedProperties[0]); |
153 const TInt count = sizeof(KMTPImageDpSupportedProperties)/sizeof(KMTPImageDpSupportedProperties[0]); |
159 TInt i(0); |
154 TInt i(0); |
307 } |
302 } |
308 |
303 |
309 void CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL(TUint32 aHandle,TUint16 /*aGroupCode*/) |
304 void CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL(TUint32 aHandle,TUint16 /*aGroupCode*/) |
310 { |
305 { |
311 __FLOG(_L8(">> CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL")); |
306 __FLOG(_L8(">> CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL")); |
312 |
307 TUint32 groupCode = Request().Uint32(TMTPTypeRequest::ERequestParameter4); |
313 if (iFramework.ObjectMgr().ObjectOwnerId(aHandle) == iFramework.DataProviderId()) |
308 if (KMTPImageDpPropertyGroupOneNumber == groupCode) //only return data for group one |
314 { |
309 { |
315 for (TUint propCodeIndex(0); propCodeIndex < KMTPImageDpGroupOneSize; propCodeIndex++) |
310 if (iFramework.ObjectMgr().ObjectOwnerId(aHandle) == iFramework.DataProviderId()) |
316 { |
311 { |
317 TUint16 propCode = KMTPImageDpGroupOneProperties[propCodeIndex]; |
312 for (TUint propCodeIndex(0); propCodeIndex < KMTPImageDpGroupOneSize; propCodeIndex++) |
318 if(propCode != 0) |
|
319 { |
313 { |
320 ServiceOneObjectPropertyL(aHandle, propCode); |
314 TUint16 propCode = KMTPImageDpGroupOneProperties[propCodeIndex]; |
|
315 if(propCode != 0) |
|
316 { |
|
317 ServiceOneObjectPropertyL(aHandle, propCode); |
|
318 } |
321 } |
319 } |
322 } |
320 } |
323 } |
321 } |
324 __FLOG(_L8("<< CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL")); |
322 __FLOG(_L8("<< CMTPImageDpGetObjectPropList::ServiceGroupPropertiesL")); |
325 } |
323 } |
364 case EMTPObjectPropCodeRepresentativeSampleSize: |
362 case EMTPObjectPropCodeRepresentativeSampleSize: |
365 case EMTPObjectPropCodeRepresentativeSampleHeight: |
363 case EMTPObjectPropCodeRepresentativeSampleHeight: |
366 case EMTPObjectPropCodeRepresentativeSampleWidth: |
364 case EMTPObjectPropCodeRepresentativeSampleWidth: |
367 { |
365 { |
368 TUint32 value; |
366 TUint32 value; |
369 iPropertyMgr.GetPropertyL(TMTPObjectPropertyCode(aPropCode), value); |
367 iPropertyMgr.GetPropertyL(TMTPObjectPropertyCode(aPropCode), value, EFalse); |
370 CMTPTypeObjectPropListElement& propElem = iPropertyList->ReservePropElemL(aHandle, propCode); |
368 CMTPTypeObjectPropListElement& propElem = iPropertyList->ReservePropElemL(aHandle, propCode); |
371 propElem.SetUint32L(CMTPTypeObjectPropListElement::EValue, value); |
369 propElem.SetUint32L(CMTPTypeObjectPropListElement::EValue, value); |
372 iPropertyList->CommitPropElemL(propElem); |
370 iPropertyList->CommitPropElemL(propElem); |
373 } |
371 } |
374 break; |
372 break; |
375 |
373 |
376 case EMTPObjectPropCodeRepresentativeSampleData: |
374 case EMTPObjectPropCodeRepresentativeSampleData: |
377 { |
375 { |
378 CMTPTypeArray* value = CMTPTypeArray::NewLC(EMTPTypeAUINT8); |
376 CMTPTypeArray* value = CMTPTypeArray::NewLC(EMTPTypeAUINT8); |
379 iPropertyMgr.GetPropertyL(TMTPObjectPropertyCode(aPropCode), *value); |
377 iPropertyMgr.GetPropertyL(TMTPObjectPropertyCode(aPropCode), *value, EFalse); |
380 CMTPTypeObjectPropListElement& propElem = iPropertyList->ReservePropElemL(aHandle, propCode); |
378 CMTPTypeObjectPropListElement& propElem = iPropertyList->ReservePropElemL(aHandle, propCode); |
381 propElem.SetArrayL(CMTPTypeObjectPropListElement::EValue, *value); |
379 propElem.SetArrayL(CMTPTypeObjectPropListElement::EValue, *value); |
382 iPropertyList->CommitPropElemL(propElem); |
380 iPropertyList->CommitPropElemL(propElem); |
383 CleanupStack::PopAndDestroy(value); |
381 CleanupStack::PopAndDestroy(value); |
384 } |
382 } |