63 @param aParamEndOffset The element ID of the last in the set of contiguous |
63 @param aParamEndOffset The element ID of the last in the set of contiguous |
64 source dataset parameter values. |
64 source dataset parameter values. |
65 @param aIsNullParamValid a boolean value to check if a null parameter is valid. A value of ETrue means a null parameter is valid; EFalse means invalid. |
65 @param aIsNullParamValid a boolean value to check if a null parameter is valid. A value of ETrue means a null parameter is valid; EFalse means invalid. |
66 @param aNumOfNullParam the number of valid null parameters to be copied. |
66 @param aNumOfNullParam the number of valid null parameters to be copied. |
67 */ |
67 */ |
68 EXPORT_C void TMTPUsbParameterPayloadBlock::CopyIn(const TMTPTypeFlatBase& aFrom, TUint aParamStartOffset, TUint aParamEndOffset, TBool aIsNullParamValid, TUint aNumOfNullParam) |
68 EXPORT_C void TMTPUsbParameterPayloadBlock::CopyIn(const TMTPTypeFlatBase& aFrom, TUint aParamStartOffset, TUint aParamEndOffset, TBool /*aIsNullParamValid*/, TUint /*aNumOfNullParam*/) |
69 { |
69 { |
70 __ASSERT_DEBUG((aParamEndOffset >= aParamStartOffset && (aParamEndOffset - aParamStartOffset + 1) <= ENumElements), User::Invariant()); |
70 __ASSERT_DEBUG((aParamEndOffset >= aParamStartOffset && (aParamEndOffset - aParamStartOffset) <= ENumElements), User::Invariant()); |
71 TUint32 parameter = KMTPNotSpecified32; |
71 TUint32 parameter = KMTPNotSpecified32; |
72 TUint numberOfNullParam = 0; |
|
73 TUint loopCount = aParamEndOffset - aParamStartOffset; |
72 TUint loopCount = aParamEndOffset - aParamStartOffset; |
74 |
73 |
75 for (TUint i(TMTPUsbParameterPayloadBlock::EParameter1); i <= loopCount; i++) |
74 for (TUint i(TMTPUsbParameterPayloadBlock::EParameter1); i < loopCount; i++) |
76 { |
75 { |
77 parameter = aFrom.Uint32(aParamStartOffset + i); |
76 parameter = aFrom.Uint32(aParamStartOffset + i); |
78 if (parameter != KMTPNotSpecified32) |
77 SetUint32(i, parameter); |
79 { |
78 } |
80 SetUint32(i, parameter); |
|
81 } |
|
82 else if(aIsNullParamValid && (numberOfNullParam < aNumOfNullParam)) |
|
83 { |
|
84 SetUint32(i, parameter); |
|
85 numberOfNullParam++; |
|
86 } |
|
87 } |
|
88 } |
79 } |
89 |
80 |
90 /** |
81 /** |
91 Copies the non-null parameter values from the parameter block dataset into the |
82 Copies the non-null parameter values from the parameter block dataset into the |
92 specified dataset. Note: the number of parameters to be copied out depends on two conditions: |
83 specified dataset. Note: the number of parameters to be copied out depends on two conditions: |