87 { |
87 { |
88 if(iTrace) |
88 if(iTrace) |
89 iTrace->Trace(_L("COMASuplStartState::~COMASuplStartState..."), KTraceFileName, __LINE__); |
89 iTrace->Trace(_L("COMASuplStartState::~COMASuplStartState..."), KTraceFileName, __LINE__); |
90 |
90 |
91 delete iLocationIDRequestor; |
91 delete iLocationIDRequestor; |
92 iTrace->Trace(_L("Deleted iLocationIDRequestor..."), KTraceFileName, __LINE__); |
92 if(iTrace) |
|
93 iTrace->Trace(_L("Deleted iLocationIDRequestor..."), KTraceFileName, __LINE__); |
93 |
94 |
94 if(iPosRequestor) |
95 if(iPosRequestor) |
95 { |
96 { |
96 iPosRequestor->DestroyList(); |
97 iPosRequestor->DestroyList(); |
97 } |
98 } |
98 else |
99 else |
99 { |
100 { |
100 delete iSETCapabilities ; |
101 delete iSETCapabilities ; |
101 iTrace->Trace(_L("Deleted iSETCapabilities ..."), KTraceFileName, __LINE__); |
102 if(iTrace) |
|
103 iTrace->Trace(_L("Deleted iSETCapabilities ..."), KTraceFileName, __LINE__); |
102 } |
104 } |
103 |
105 |
104 delete iAllowedCapabilities; |
106 delete iAllowedCapabilities; |
105 iTrace->Trace(_L("Deleted iAllowedCapabilities..."), KTraceFileName, __LINE__); |
107 |
|
108 if(iTrace) |
|
109 iTrace->Trace(_L("Deleted iAllowedCapabilities..."), KTraceFileName, __LINE__); |
106 |
110 |
107 if(iLocationId) |
111 if(iLocationId) |
108 { |
112 { |
109 iTrace->Trace(_L("Deleted iLocationId..."), KTraceFileName, __LINE__); |
113 if(iTrace) |
|
114 iTrace->Trace(_L("Deleted iLocationId..."), KTraceFileName, __LINE__); |
110 delete iLocationId; |
115 delete iLocationId; |
111 iLocationId=NULL; |
116 iLocationId=NULL; |
112 } |
117 } |
113 } |
118 } |
114 |
119 |
239 posTechnology2.SetPosTechnology(aGpsSetAssisted, aGpsSetBased, autonomousGps, AFLT, EOTD, OTDOA); |
244 posTechnology2.SetPosTechnology(aGpsSetAssisted, aGpsSetBased, autonomousGps, AFLT, EOTD, OTDOA); |
240 |
245 |
241 TBool tia801, rrlp, rrc; |
246 TBool tia801, rrlp, rrc; |
242 posProtocol.GetPosProtocol(tia801, rrlp, rrc); |
247 posProtocol.GetPosProtocol(tia801, rrlp, rrc); |
243 posProtocol2.SetPosProtocol(tia801, rrlp, rrc); |
248 posProtocol2.SetPosProtocol(tia801, rrlp, rrc); |
244 |
249 if(iSETCapabilities2) |
245 iSETCapabilities2->SetSETCapabilities(posTechnology2, prefMethod2, posProtocol2); |
250 iSETCapabilities2->SetSETCapabilities(posTechnology2, prefMethod2, posProtocol2); |
246 } |
251 } |
247 OMASuplStart->SetMessageBase(aSuplVersion,aSessionId); |
252 OMASuplStart->SetMessageBase(aSuplVersion,aSessionId); |
248 |
253 |
249 // Add trigger capability to SET Capabilities |
254 // Add trigger capability to SET Capabilities |
250 // Services supported |
255 // Services supported |
284 serviceCaps.SetSuplSessionCapabilities(sessionCaps); |
289 serviceCaps.SetSuplSessionCapabilities(sessionCaps); |
285 |
290 |
286 // Set SET Capability extn |
291 // Set SET Capability extn |
287 TOMAVer2SetCapExtn setCapsExtn; |
292 TOMAVer2SetCapExtn setCapsExtn; |
288 setCapsExtn.SetServiceCaps(serviceCaps); |
293 setCapsExtn.SetServiceCaps(serviceCaps); |
289 iTrace->Trace(_L("SetVer2SetCapExtn"), KTraceFileName, __LINE__); |
294 iTrace->Trace(_L("SetVer2SetCapExtn"), KTraceFileName, __LINE__); |
290 // Set SET Capabilities |
295 // Set SET Capabilities |
291 iSETCapabilities2->SetVer2SetCapExtn(setCapsExtn); |
296 if(iSETCapabilities2) |
|
297 iSETCapabilities2->SetVer2SetCapExtn(setCapsExtn); |
292 //iLocationId ownership will be with SUPL start class |
298 //iLocationId ownership will be with SUPL start class |
293 OMASuplStart->SetSuplStart(iSETCapabilities2,iLocationId2,iECId); |
299 OMASuplStart->SetSuplStart(iSETCapabilities2,iLocationId2,iECId); |
294 if(iECId) |
300 if(iECId) |
295 { |
301 { |
296 OMASuplStart->SetECellId(iMmCellInfo); |
302 OMASuplStart->SetECellId(iMmCellInfo); |
638 // COMASuplStartState::LocationIDRequestCompleted |
644 // COMASuplStartState::LocationIDRequestCompleted |
639 // Gets called when location request completed |
645 // Gets called when location request completed |
640 // (other items were commented in a header). |
646 // (other items were commented in a header). |
641 // ----------------------------------------------------------------------------- |
647 // ----------------------------------------------------------------------------- |
642 // |
648 // |
643 void COMASuplStartState::LocationIDRequestCompletedL(COMASuplLocationId* aLocationId, |
649 void COMASuplStartState::LocationIDRequestCompletedL( |
644 TInt aErrorCode) |
650 COMASuplLocationId* aLocationId, TInt aErrorCode) |
645 { |
651 { |
646 iTrace->Trace(_L("COMASuplStartState::LocationIDRequestCompleted..."), KTraceFileName, __LINE__); |
652 delete iLocationId; |
647 iGenerationStatus = EFalse; |
653 iLocationId = NULL; |
648 if(aErrorCode!=KErrNone) |
654 iLocationId = aLocationId; |
649 { |
655 iTrace->Trace(_L("COMASuplStartState::LocationIDRequestCompleted..."), |
650 iTrace->Trace(_L("COMASuplStartState::LocationRequestFailed"), KTraceFileName, __LINE__); |
656 KTraceFileName, __LINE__); |
651 if(iMsgStateObserver) |
657 iGenerationStatus = EFalse; |
652 { |
658 if (aErrorCode != KErrNone) |
653 iMsgStateObserver->OperationCompleteL(aErrorCode); |
659 { |
654 return; |
660 iTrace->Trace(_L("COMASuplStartState::LocationRequestFailed"), |
655 } |
661 KTraceFileName, __LINE__); |
656 } |
662 if (iMsgStateObserver) |
657 |
663 { |
658 COMASuplGSMCellInfo* cellInfo = COMASuplGSMCellInfo::NewL(); |
664 iMsgStateObserver->OperationCompleteL(aErrorCode); |
659 COMASuplLocationId::TOMASuplStatus status; |
665 return; |
660 TInt err = aLocationId->SuplLocationId(cellInfo, status); |
666 } |
661 |
667 } |
662 if(err == KErrNone) |
668 |
663 { |
669 COMASuplGSMCellInfo* cellInfo = COMASuplGSMCellInfo::NewL(); |
664 TInt refMNC,refMCC,refCI,refLac; |
670 COMASuplLocationId::TOMASuplStatus status; |
665 cellInfo->SuplGSMCellInfo(refMNC,refMCC,refCI,refLac); |
671 TInt err = aLocationId->SuplLocationId(cellInfo, status); |
666 |
672 |
667 COMASuplGSMCellInfo* cellInfoClone = COMASuplGSMCellInfo::NewL(); |
673 if (err == KErrNone) |
668 cellInfoClone->SetSuplGSMCellInfo(refMNC,refMCC,refCI,refLac); |
674 { |
669 iLocationId2->SetSuplLocationId(cellInfoClone, status); |
675 TInt refMNC, refMCC, refCI, refLac; |
670 |
676 cellInfo->SuplGSMCellInfo(refMNC, refMCC, refCI, refLac); |
671 iLocationId = aLocationId; |
677 |
672 |
678 COMASuplGSMCellInfo* cellInfoClone = COMASuplGSMCellInfo::NewL(); |
673 if(iECId) |
679 cellInfoClone->SetSuplGSMCellInfo(refMNC, refMCC, refCI, refLac); |
674 { |
680 iLocationId2->SetSuplLocationId(cellInfoClone, status); |
675 iTrace->Trace(_L("COMASuplStartState::LocationIDRequestCompletedL...Retrive E-CellId"), KTraceFileName, __LINE__); |
681 |
676 iGenerationStatus = ETrue; |
682 if (iECId) |
677 iLocationIDRequestor->GetECellID(); |
683 { |
678 } |
684 iTrace->Trace( |
679 else |
685 _L("COMASuplStartState::LocationIDRequestCompletedL...Retrive E-CellId"), |
680 { |
686 KTraceFileName, __LINE__); |
681 GetAssistceDataFromPluginL(aErrorCode); |
687 iGenerationStatus = ETrue; |
682 } |
688 iLocationIDRequestor->GetECellID(); |
683 } |
689 } |
684 } |
690 else |
|
691 { |
|
692 GetAssistceDataFromPluginL(aErrorCode); |
|
693 } |
|
694 } |
|
695 } |
685 |
696 |
686 // ----------------------------------------------------------------------------- |
697 // ----------------------------------------------------------------------------- |
687 // COMASuplStartState::LocationECellIdRequestCompletedL |
698 // COMASuplStartState::LocationECellIdRequestCompletedL |
688 // Gets called when E-Cell Id location request completed |
699 // Gets called when E-Cell Id location request completed |
689 // (other items were commented in a header). |
700 // (other items were commented in a header). |