121 { |
124 { |
122 switch(aRequestedInfo) |
125 switch(aRequestedInfo) |
123 { |
126 { |
124 case ELbsConversionOutputPosition: |
127 case ELbsConversionOutputPosition: |
125 { |
128 { |
|
129 TBool specialTreatmentOfPos = EFalse; |
|
130 |
126 // Extract the area info provided by the client. |
131 // Extract the area info provided by the client. |
127 // If client has specified only coordinate info, |
132 // If client has specified only coordinate info, |
128 // return KErrNotSupported. |
133 // return KErrNotSupported. |
129 RLbsAreaInfoBaseArray areaInfoArray; |
134 RLbsAreaInfoBaseArray areaInfoArray; |
130 CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; |
135 CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; |
131 areaInfoMask |= CLbsLocationInfo::ELbsGsmInfo | |
136 areaInfoMask |= CLbsLocationInfo::ELbsGsmInfo | |
132 CLbsLocationInfo::ELbsWcdmaInfo | |
137 CLbsLocationInfo::ELbsWcdmaInfo | |
133 CLbsLocationInfo::ELbsWlanInfo; |
138 CLbsLocationInfo::ELbsWlanInfo; |
134 aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); |
139 aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); |
135 TInt count = areaInfoArray.Count(); |
140 TInt count = areaInfoArray.Count(); |
136 |
141 |
137 |
|
138 |
|
139 if( count == 0 ) |
142 if( count == 0 ) |
140 { |
143 { |
141 iObserver.OnConversionComplete(KErrNotSupported); |
144 iObserver.OnConversionComplete(KErrNotSupported); |
142 return; |
145 return; |
143 } |
146 } |
|
147 |
144 TLocality locality; |
148 TLocality locality; |
145 if (areaInfoArray[0]->Type() == ELbsAreaGsmCellInfoClass) |
149 if (areaInfoArray[0]->Type() == ELbsAreaGsmCellInfoClass) |
146 { |
150 { |
147 CLbsGsmCellInfo* posInfo = |
151 CLbsGsmCellInfo* posInfo = |
148 static_cast<CLbsGsmCellInfo*> (areaInfoArray[0]); |
152 static_cast<CLbsGsmCellInfo*> (areaInfoArray[0]); |
153 { |
157 { |
154 iRetainLocalityInCache = EFalse; |
158 iRetainLocalityInCache = EFalse; |
155 } |
159 } |
156 else |
160 else |
157 { |
161 { |
158 // for all others values ensiure that we put |
162 // for all others values ensure that we put |
159 // localities in cache |
163 // localities in cache |
160 iRetainLocalityInCache = ETrue; |
164 iRetainLocalityInCache = ETrue; |
161 } |
165 } |
162 |
166 |
163 if ((timingAdvance == KTimingAdvanceSpecialValue) |
167 if ((timingAdvance == KTimingAdvanceSpecialValue) |
164 || (timingAdvance |
168 || (timingAdvance |
165 == KTimingAdvanceSaveToCacheTrue) |
169 == KTimingAdvanceSaveToCacheTrue) |
166 || (timingAdvance |
170 || (timingAdvance |
167 == KTimingAdvanceSaveToCacheFalse)) |
171 == KTimingAdvanceSaveToCacheFalse)) |
168 { |
172 { |
169 // For all the special tests |
173 // For all the special GSM tests |
170 TReal64 lat = posInfo->MobileCountryCode(); |
174 TReal64 lat = posInfo->MobileCountryCode(); |
171 TReal64 lng = posInfo->MobileNetworkCode(); |
175 TReal64 lng = posInfo->MobileNetworkCode(); |
172 TReal32 alt = posInfo->LocationAreaCode(); |
176 TReal32 alt = posInfo->LocationAreaCode(); |
173 |
177 |
174 TReal32 horAcc = posInfo->CellId(); |
178 TReal32 horAcc = posInfo->CellId(); |
175 |
179 |
176 locality.SetCoordinate(lat, lng, alt); |
180 locality.SetCoordinate(lat, lng, alt); |
177 locality.SetAccuracy(horAcc, 11.0); |
181 locality.SetAccuracy(horAcc, 11.0); |
178 } |
182 |
179 else |
183 specialTreatmentOfPos = ETrue; |
180 { |
|
181 // and for the original tests |
|
182 locality.SetCoordinate(62.5285, 23.9385, 1.22f); |
|
183 locality.SetAccuracy(10.0f, 0.0); |
|
184 |
|
185 } |
184 } |
186 } |
185 } |
187 else |
186 else if (areaInfoArray[0]->Type() == ELbsAreaWcmdaCellInfoClass) |
188 { |
187 { |
189 // and for the original tests |
188 iRetainLocalityInCache = ETrue; |
|
189 |
|
190 CLbsWcdmaCellInfo* posInfo = |
|
191 static_cast<CLbsWcdmaCellInfo*> (areaInfoArray[0]); |
|
192 |
|
193 if (posInfo->ScramblingCode() == KScramblingCodeWcdmaTests ) |
|
194 { |
|
195 // For all the special wcdma tests |
|
196 // note we don't set the horiz accuracy to same as cell id (as in GSM tests) as this |
|
197 // makes the accuracy too low! |
|
198 TReal64 lat = posInfo->MobileCountryCode(); |
|
199 TReal64 lng = posInfo->MobileNetworkCode(); |
|
200 TReal32 alt = 25.6; |
|
201 |
|
202 locality.SetCoordinate(lat, lng, alt); |
|
203 locality.SetAccuracy(24.3, 11.0); |
|
204 |
|
205 specialTreatmentOfPos = ETrue; |
|
206 } |
|
207 } |
|
208 |
|
209 // For the original tests we stick with a set position value |
|
210 if (!specialTreatmentOfPos) |
|
211 { |
190 locality.SetCoordinate(62.5285, 23.9385, 1.22f); |
212 locality.SetCoordinate(62.5285, 23.9385, 1.22f); |
191 locality.SetAccuracy(10.0f, 0.0); |
213 locality.SetAccuracy(10.0f, 0.0); |
192 } |
214 } |
|
215 |
193 areaInfoArray.ResetAndDestroy(); |
216 areaInfoArray.ResetAndDestroy(); |
194 |
217 |
195 CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); |
218 CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); |
196 CleanupStack::PushL( positionInfo ); |
219 CleanupStack::PushL( positionInfo ); |
197 aLocationInfoArray[i]->AddAreaInfoL( positionInfo ); |
220 aLocationInfoArray[i]->AddAreaInfoL( positionInfo ); |
198 CleanupStack::Pop( positionInfo ); |
221 CleanupStack::Pop( positionInfo ); |
199 break; |
222 break; |
200 } |
223 } |
|
224 |
201 case ELbsConversionOutputGsm: |
225 case ELbsConversionOutputGsm: |
202 { |
226 { |
203 // Extract the area info provided by the client. |
227 // Extract the area info provided by the client. |
204 // If client has specified only gsm info, |
228 // If client has specified only gsm info, |
205 // return KErrNotSupported. |
229 // return KErrNotSupported. |