198 // COMASuplETel::HandleLocationIdL(), |
198 // COMASuplETel::HandleLocationIdL(), |
199 // (other items were commented in a header). |
199 // (other items were commented in a header). |
200 // ----------------------------------------------------------------------------- |
200 // ----------------------------------------------------------------------------- |
201 // |
201 // |
202 void COMASuplETel::HandleLocationIdL() |
202 void COMASuplETel::HandleLocationIdL() |
203 { |
203 { |
204 switch (iNetworkInfo.iMode) |
204 switch (iNetworkInfo.iMode) |
|
205 { |
|
206 case RMobilePhone::ENetworkModeGsm: |
205 { |
207 { |
206 case RMobilePhone::ENetworkModeGsm: |
208 //coverity[alloc_fn] |
207 { |
209 //coverity[assign] |
208 // For GSM Cell Information |
210 // For GSM Cell Information |
209 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
211 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
210 //Comment to ignore coverity cleanup stack error |
212 //coverity[push] |
211 //coverity[SYMBIAN.CLEANUP_STACK :FALSE] |
213 CleanupStack::PushL(locationId); |
212 CleanupStack::PushL(locationId); |
214 |
213 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
215 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
214 CleanupStack::PushL(gsmCellInfo); |
216 CleanupStack::PushL(gsmCellInfo); |
215 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
217 COMASuplLocationId::TOMASuplStatus lStatus = |
216 |
218 COMASuplLocationId::ECurrent; |
217 TInt MCC=0; |
219 |
218 TInt64 MNC=0; |
220 TInt MCC = 0; |
219 TUint LAC, CellId; |
221 TInt64 MNC = 0; |
220 TLex LexMCC(iNetworkInfo.iCountryCode); |
222 TUint LAC, CellId; |
221 TLex LexMNC(iNetworkInfo.iNetworkId); |
223 TLex LexMCC(iNetworkInfo.iCountryCode); |
222 |
224 TLex LexMNC(iNetworkInfo.iNetworkId); |
223 LexMCC.Val(MCC); |
225 |
224 LexMNC.Val(MNC); |
226 LexMCC.Val(MCC); |
225 LAC = iLocationInfo.iLocationAreaCode; |
227 LexMNC.Val(MNC); |
226 CellId = iLocationInfo.iCellId; |
228 LAC = iLocationInfo.iLocationAreaCode; |
227 |
229 CellId = iLocationInfo.iCellId; |
228 |
230 |
229 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC,CellId,LAC); |
231 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC, CellId, LAC); |
230 locationId->SetSuplLocationId(gsmCellInfo,lStatus); |
232 locationId->SetSuplLocationId(gsmCellInfo, lStatus); |
231 CleanupStack::Pop(gsmCellInfo); |
233 CleanupStack::Pop(gsmCellInfo); |
232 CleanupStack::Pop(locationId); |
234 //coverity[pop] |
233 |
235 CleanupStack::Pop(locationId); |
234 #if defined(_DEBUG) //This is only for logging purpose. |
236 |
235 TBuf<128> msg; |
237 #if defined(_DEBUG) //This is only for logging purpose. |
236 |
238 TBuf<128> msg; |
237 msg.Copy(_L("It is GSM Network. MCC = ")); |
239 |
238 msg.AppendNum(MCC); |
240 msg.Copy(_L("It is GSM Network. MCC = ")); |
239 |
241 msg.AppendNum(MCC); |
240 msg.Append(_L(" MNC = ")); |
242 |
241 msg.AppendNum(MNC); |
243 msg.Append(_L(" MNC = ")); |
242 |
244 msg.AppendNum(MNC); |
243 |
245 |
244 msg.Append(_L(" CellId = ")); |
246 msg.Append(_L(" CellId = ")); |
245 msg.AppendNum(CellId); |
247 msg.AppendNum(CellId); |
246 |
248 |
247 |
249 msg.Append(_L(" LAC = ")); |
248 msg.Append(_L(" LAC = ")); |
250 msg.AppendNum(LAC); |
249 msg.AppendNum(LAC); |
251 |
250 |
252 iTrace->Trace(msg, KTraceFileName, __LINE__); |
251 iTrace->Trace(msg,KTraceFileName, __LINE__); |
253 #endif |
252 #endif |
254 |
253 |
255 if (iCellMode == EOMASuplCellId) |
254 if(iCellMode == EOMASuplCellId) |
256 iObserver.LocationIDRequestCompletedL(locationId, KErrNone); |
255 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
257 else if (iCellMode == EOMASuplCompareCellId) |
256 else if(iCellMode == EOMASuplCompareCellId) |
258 iObserver.ComparisionLocationIDRequestCompletedL(locationId, |
257 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
259 KErrNone); |
258 break; |
260 //coverity[memory_leak] |
259 } |
261 break; |
260 case RMobilePhone::ENetworkModeWcdma: |
|
261 { |
|
262 // For WCDMA Cell Information |
|
263 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
264 //Comment to ignore coverity cleanup stack error |
|
265 //coverity[SYMBIAN.CLEANUP_STACK :FALSE] |
|
266 CleanupStack::PushL(locationId); |
|
267 COMASuplCellInfo* wcdmaCellInfo = COMASuplCellInfo::NewL(); |
|
268 CleanupStack::PushL(wcdmaCellInfo); |
|
269 |
|
270 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
|
271 TInt MCC=0; |
|
272 TInt64 MNC=0; |
|
273 TUint UC; |
|
274 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
275 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
276 |
|
277 LexMCC.Val(MCC); |
|
278 LexMNC.Val(MNC); |
|
279 UC = iLocationInfo.iCellId; |
|
280 |
|
281 |
|
282 wcdmaCellInfo->SetSuplCellInfo(MNC, MCC, UC); |
|
283 locationId->SetSuplLocationId(wcdmaCellInfo,lStatus); |
|
284 CleanupStack::Pop(wcdmaCellInfo); |
|
285 CleanupStack::Pop(locationId); |
|
286 |
|
287 #if defined(_DEBUG) //This is only for logging purpose. |
|
288 TBuf<128> msg; |
|
289 |
|
290 msg.Copy(_L("It is CDMA Network. MCC = ")); |
|
291 msg.AppendNum(MCC); |
|
292 |
|
293 msg.Append(_L(" MNC = ")); |
|
294 msg.AppendNum(MNC); |
|
295 |
|
296 |
|
297 msg.Append(_L(" UC = ")); |
|
298 msg.AppendNum(UC); |
|
299 |
|
300 iTrace->Trace(msg,KTraceFileName, __LINE__); |
|
301 #endif |
|
302 |
|
303 if(iCellMode == EOMASuplCellId) |
|
304 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
|
305 else if(iCellMode == EOMASuplCompareCellId) |
|
306 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
|
307 break; |
|
308 } |
|
309 default: |
|
310 { |
|
311 #if _DEBUG |
|
312 // For GSM Cell Information |
|
313 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
314 //Comment to ignore coverity cleanup stack error |
|
315 //coverity[SYMBIAN.CLEANUP_STACK :FALSE] |
|
316 CleanupStack::PushL(locationId); |
|
317 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
|
318 CleanupStack::PushL(gsmCellInfo); |
|
319 |
|
320 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
|
321 TInt MCC=0; |
|
322 TInt64 MNC=0; |
|
323 TUint LAC, CellId; |
|
324 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
325 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
326 |
|
327 LexMCC.Val(MCC); |
|
328 LexMNC.Val(MNC); |
|
329 LAC = iLocationInfo.iLocationAreaCode; |
|
330 CellId = iLocationInfo.iCellId; |
|
331 |
|
332 |
|
333 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC,CellId,LAC); |
|
334 locationId->SetSuplLocationId(gsmCellInfo,lStatus); |
|
335 CleanupStack::Pop(gsmCellInfo); |
|
336 CleanupStack::Pop(locationId); |
|
337 |
|
338 #if defined(_DEBUG) //This is only for logging purpose. |
|
339 TBuf<128> msg; |
|
340 msg.Copy(_L("It is GSM Network. MCC = ")); |
|
341 msg.AppendNum(MCC); |
|
342 |
|
343 msg.Append(_L(" MNC = ")); |
|
344 msg.AppendNum(MNC); |
|
345 |
|
346 msg.Append(_L(" CellId = ")); |
|
347 msg.AppendNum(CellId); |
|
348 |
|
349 msg.Append(_L(" LAC = ")); |
|
350 msg.AppendNum(LAC); |
|
351 |
|
352 iTrace->Trace(msg,KTraceFileName, __LINE__); |
|
353 |
|
354 #endif |
|
355 if(iCellMode == EOMASuplCellId) |
|
356 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
|
357 else if(iCellMode == EOMASuplCompareCellId) |
|
358 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
|
359 #else |
|
360 iTrace->Trace(_L("Error in getting Location Id"),KTraceFileName, __LINE__); |
|
361 if(iCellMode == EOMASuplCellId) |
|
362 iObserver.LocationIDRequestCompletedL(NULL,KErrNotSupported); |
|
363 else if(iCellMode == EOMASuplCompareCellId) |
|
364 iObserver.ComparisionLocationIDRequestCompletedL(NULL,KErrNotSupported); |
|
365 #endif |
|
366 break; |
|
367 } |
|
368 } |
262 } |
369 |
263 case RMobilePhone::ENetworkModeWcdma: |
370 } |
264 { |
|
265 //coverity[alloc_fn] |
|
266 //coverity[assign] |
|
267 // For WCDMA Cell Information |
|
268 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
269 //coverity[push] |
|
270 CleanupStack::PushL(locationId); |
|
271 |
|
272 COMASuplCellInfo* wcdmaCellInfo = COMASuplCellInfo::NewL(); |
|
273 CleanupStack::PushL(wcdmaCellInfo); |
|
274 |
|
275 COMASuplLocationId::TOMASuplStatus lStatus = |
|
276 COMASuplLocationId::ECurrent; |
|
277 TInt MCC = 0; |
|
278 TInt64 MNC = 0; |
|
279 TUint UC; |
|
280 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
281 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
282 |
|
283 LexMCC.Val(MCC); |
|
284 LexMNC.Val(MNC); |
|
285 UC = iLocationInfo.iCellId; |
|
286 |
|
287 wcdmaCellInfo->SetSuplCellInfo(MNC, MCC, UC); |
|
288 locationId->SetSuplLocationId(wcdmaCellInfo, lStatus); |
|
289 CleanupStack::Pop(wcdmaCellInfo); |
|
290 //coverity[pop] |
|
291 CleanupStack::Pop(locationId); |
|
292 |
|
293 #if defined(_DEBUG) //This is only for logging purpose. |
|
294 TBuf<128> msg; |
|
295 |
|
296 msg.Copy(_L("It is CDMA Network. MCC = ")); |
|
297 msg.AppendNum(MCC); |
|
298 |
|
299 msg.Append(_L(" MNC = ")); |
|
300 msg.AppendNum(MNC); |
|
301 |
|
302 msg.Append(_L(" UC = ")); |
|
303 msg.AppendNum(UC); |
|
304 |
|
305 iTrace->Trace(msg, KTraceFileName, __LINE__); |
|
306 #endif |
|
307 |
|
308 if (iCellMode == EOMASuplCellId) |
|
309 iObserver.LocationIDRequestCompletedL(locationId, KErrNone); |
|
310 else if (iCellMode == EOMASuplCompareCellId) |
|
311 iObserver.ComparisionLocationIDRequestCompletedL(locationId, |
|
312 KErrNone); |
|
313 //coverity[memory_leak] |
|
314 break; |
|
315 } |
|
316 default: |
|
317 { |
|
318 #if _DEBUG |
|
319 //coverity[alloc_fn] |
|
320 //coverity[assign] |
|
321 // For GSM Cell Information |
|
322 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
323 //coverity[push] |
|
324 CleanupStack::PushL(locationId); |
|
325 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
|
326 CleanupStack::PushL(gsmCellInfo); |
|
327 |
|
328 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
|
329 TInt MCC=0; |
|
330 TInt64 MNC=0; |
|
331 TUint LAC, CellId; |
|
332 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
333 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
334 |
|
335 LexMCC.Val(MCC); |
|
336 LexMNC.Val(MNC); |
|
337 LAC = iLocationInfo.iLocationAreaCode; |
|
338 CellId = iLocationInfo.iCellId; |
|
339 |
|
340 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC,CellId,LAC); |
|
341 locationId->SetSuplLocationId(gsmCellInfo,lStatus); |
|
342 CleanupStack::Pop(gsmCellInfo); |
|
343 //coverity[pop] |
|
344 CleanupStack::Pop(locationId); |
|
345 |
|
346 #if defined(_DEBUG) //This is only for logging purpose. |
|
347 TBuf<128> msg; |
|
348 msg.Copy(_L("It is GSM Network. MCC = ")); |
|
349 msg.AppendNum(MCC); |
|
350 |
|
351 msg.Append(_L(" MNC = ")); |
|
352 msg.AppendNum(MNC); |
|
353 |
|
354 msg.Append(_L(" CellId = ")); |
|
355 msg.AppendNum(CellId); |
|
356 |
|
357 msg.Append(_L(" LAC = ")); |
|
358 msg.AppendNum(LAC); |
|
359 |
|
360 iTrace->Trace(msg,KTraceFileName, __LINE__); |
|
361 |
|
362 #endif |
|
363 if(iCellMode == EOMASuplCellId) |
|
364 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
|
365 else if(iCellMode == EOMASuplCompareCellId) |
|
366 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
|
367 #else |
|
368 iTrace->Trace(_L("Error in getting Location Id"), KTraceFileName, |
|
369 __LINE__); |
|
370 if (iCellMode == EOMASuplCellId) |
|
371 iObserver.LocationIDRequestCompletedL(NULL, KErrNotSupported); |
|
372 else if (iCellMode == EOMASuplCompareCellId) |
|
373 iObserver.ComparisionLocationIDRequestCompletedL(NULL, |
|
374 KErrNotSupported); |
|
375 #endif |
|
376 //coverity[memory_leak] |
|
377 break; |
|
378 } |
|
379 } |
|
380 |
|
381 } |
371 |
382 |
372 // ----------------------------------------------------------------------------- |
383 // ----------------------------------------------------------------------------- |
373 // COMASuplETel::HandleECellIdL(), |
384 // COMASuplETel::HandleECellIdL(), |
374 // (other items were commented in a header). |
385 // (other items were commented in a header). |
375 // ----------------------------------------------------------------------------- |
386 // ----------------------------------------------------------------------------- |