35 class ConcurrentTraceLoc : public MLiwNotifyCallback |
35 class ConcurrentTraceLoc : public MLiwNotifyCallback |
36 { |
36 { |
37 |
37 |
38 MLiwInterface *iLocationInterface ; |
38 MLiwInterface *iLocationInterface ; |
39 CLiwGenericParamList *iInputList ; |
39 CLiwGenericParamList *iInputList ; |
40 |
40 TInt cnt; |
41 public : |
41 public : |
42 TInt iRetStatus ; |
42 TInt iRetStatus ; |
43 |
43 |
44 TInt HandleNotifyL( |
44 TInt HandleNotifyL( |
45 TInt aCmdId, |
45 TInt aCmdId, |
46 TInt aEventId, |
46 TInt aEventId, |
47 CLiwGenericParamList& aEventParamList, |
47 CLiwGenericParamList& aEventParamList, |
48 const CLiwGenericParamList& aInParamList) ; |
48 const CLiwGenericParamList& aInParamList) ; |
49 |
49 |
50 ConcurrentTraceLoc() : iRetStatus(KErrGeneral) //Default constructor |
50 ConcurrentTraceLoc() : iRetStatus(KErrGeneral),cnt(0) //Default constructor |
51 { |
51 { |
52 ; |
52 ; |
53 } |
53 } |
54 ConcurrentTraceLoc(TInt aCmd , MLiwInterface *aInterface , CLiwGenericParamList *aInputList) ; |
54 ConcurrentTraceLoc(TInt aCmd , MLiwInterface *aInterface , CLiwGenericParamList *aInputList) ; |
55 }; |
55 }; |
56 |
56 |
57 |
57 |
58 ConcurrentTraceLoc :: ConcurrentTraceLoc(TInt aCmd ,MLiwInterface *aInterface , CLiwGenericParamList *aInputList) |
58 ConcurrentTraceLoc :: ConcurrentTraceLoc(TInt aCmd ,MLiwInterface *aInterface , CLiwGenericParamList *aInputList) |
59 { |
59 { |
60 |
60 cnt = 0; |
61 iLocationInterface = aInterface ; |
61 iLocationInterface = aInterface ; |
62 iInputList = aInputList ; |
62 iInputList = aInputList ; |
63 |
63 |
64 } |
64 } |
65 |
65 |
69 CLiwGenericParamList& aEventParamList, |
69 CLiwGenericParamList& aEventParamList, |
70 const CLiwGenericParamList& aInParamList) |
70 const CLiwGenericParamList& aInParamList) |
71 { |
71 { |
72 |
72 |
73 //DeRefrence Allocated Map first |
73 //DeRefrence Allocated Map first |
74 return 0 ; |
74 cnt++; |
75 } |
75 TInt trid = aCmdId; |
|
76 |
|
77 if(cnt == 2) |
|
78 { |
|
79 |
|
80 CActiveScheduler::Stop(); |
|
81 } |
|
82 return 0 ; |
|
83 } |
76 |
84 |
77 |
85 |
78 TInt TraceConcurrentCallsL() |
86 TInt TraceConcurrentCallsL() |
79 { |
87 { |
80 |
88 __UHEAP_MARK ; |
|
89 CActiveScheduler *Scheduler = CActiveScheduler :: Current() ; |
|
90 |
|
91 if(!Scheduler) |
|
92 { |
|
93 Scheduler = new CActiveScheduler ; |
|
94 } |
|
95 |
|
96 |
|
97 CActiveScheduler :: Install(Scheduler) ; |
81 _LIT(KTraceFile , "C:\\Trace.txt") ; |
98 _LIT(KTraceFile , "C:\\Trace.txt") ; |
82 |
99 |
83 RFile TraceFile ; |
100 RFile TraceFile ; |
84 RFs TraceSession ; |
101 RFs TraceSession ; |
85 |
102 |
164 const TLiwGenericParam *errparam1 = outputlist->FindFirst(pos , KErrorCode) ; |
177 const TLiwGenericParam *errparam1 = outputlist->FindFirst(pos , KErrorCode) ; |
165 |
178 |
166 |
179 |
167 locinterface->ExecuteCmdL(CmdBuf , *InputList , *OutParmList ,KLiwOptASyncronous , &GetLoc); |
180 locinterface->ExecuteCmdL(CmdBuf , *InputList , *OutParmList ,KLiwOptASyncronous , &GetLoc); |
168 pos = 0 ; |
181 pos = 0 ; |
169 |
182 CActiveScheduler :: Start() ; |
170 const TLiwGenericParam *errparam = OutParmList->FindFirst(pos , KErrorCode) ; |
183 const TLiwGenericParam *errparam = OutParmList->FindFirst(pos , KErrorCode) ; |
171 |
184 |
172 if(!errparam) |
185 if(!errparam) |
173 { |
186 { |
174 return KErrNotFound ; |
187 return KErrNotFound ; |
175 } |
188 } |
176 TraceFile.Write(_L8("Error param Found \n")) ; |
189 TraceFile.Write(_L8("Error param Found \n")) ; |
177 |
190 |
178 TLiwVariant ErrVariant = errparam->Value() ; |
191 TLiwVariant ErrVariant = errparam->Value() ; |
179 TInt ret = ErrVariant.AsTInt32() ; |
192 TInt ret = ErrVariant.AsTInt32() ; |
180 |
193 a.ResetAndDestroy() ; |
181 locinterface->Close() ; |
194 locinterface->Close() ; |
182 delete ServiceHandler ; |
195 delete ServiceHandler ; |
183 delete InputList ; |
196 delete InputList ; |
184 delete OutParmList ; |
197 delete OutParmList ; |
185 delete Scheduler ; |
198 delete Scheduler ; |
186 TraceFile.Write(_L8("Gracefully returned \n")) ; |
199 TraceFile.Write(_L8("Gracefully returned \n")) ; |
|
200 __UHEAP_MARKEND ; |
187 return ret ; |
201 return ret ; |
188 } |
202 } |
189 |
203 |
190 |
204 |
191 TInt TraceConcurrent(TAny */*Arg*/) |
205 TInt TraceConcurrent(TAny */*Arg*/) |