83 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::~CEapSimIsaInterface()\n"))); |
83 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::~CEapSimIsaInterface()\n"))); |
84 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapSimIsaInterface::~CEapSimIsaInterface()"); |
84 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapSimIsaInterface::~CEapSimIsaInterface()"); |
85 |
85 |
86 if(IsActive()) |
86 if(IsActive()) |
87 { |
87 { |
88 Cancel(); |
88 Cancel(); |
89 } |
89 } |
90 |
90 |
91 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("Closing RMobilePhone and MMETEL.\n"))); |
91 DisconnectMMETel(); |
92 |
92 |
93 iPhone.Close(); |
|
94 iServer.Close(); // Phone module is unloaded automatically when RTelServer session is closed |
|
95 iCustomAPI.Close(); |
|
96 |
|
97 delete iAuthenticationData; |
93 delete iAuthenticationData; |
98 iAuthenticationData = NULL; |
94 iAuthenticationData = NULL; |
99 |
95 |
100 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
96 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
101 } |
97 } |
167 |
163 |
168 //-------------------------------------------------- |
164 //-------------------------------------------------- |
169 |
165 |
170 void CEapSimIsaInterface::DoCancel() |
166 void CEapSimIsaInterface::DoCancel() |
171 { |
167 { |
172 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::DoCancel() - Cancelling MMETEL query.\n") ) ); |
168 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::DoCancel(): iQueryId=%d\n"), |
|
169 iQueryId) ); |
173 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapSimIsaInterface::DoCancel()"); |
170 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapSimIsaInterface::DoCancel()"); |
174 |
171 |
175 if (iQueryId == EQuerySRESandKC) |
172 if (iQueryId == EQuerySRESandKC) |
176 { |
173 { |
|
174 iQueryId = EQueryNone; |
|
175 |
177 // Cancel the request. |
176 // Cancel the request. |
178 iCustomAPI.CancelAsyncRequest( ECustomGetSimAuthenticationDataIPC ); |
177 iCustomAPI.CancelAsyncRequest( ECustomGetSimAuthenticationDataIPC ); |
|
178 |
|
179 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::DoCancel(): CANCELLED CUSTOM API REQUEST\n") ) ); |
179 } |
180 } |
180 } |
181 } |
181 |
182 |
182 //-------------------------------------------------- |
183 //-------------------------------------------------- |
183 |
184 |
206 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("ISA interface: Got IMSI reply.\n"))); |
207 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("ISA interface: Got IMSI reply.\n"))); |
207 |
208 |
208 EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("IMSI"), |
209 EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("IMSI"), |
209 iSubscriberId.Ptr(), |
210 iSubscriberId.Ptr(), |
210 iSubscriberId.Size())); |
211 iSubscriberId.Size())); |
211 |
212 |
|
213 iQueryId = EQueryNone; |
|
214 |
212 // Convert the IMSI from unicode to UTF8 characters. |
215 // Convert the IMSI from unicode to UTF8 characters. |
213 |
216 |
214 completion_status = imsiInUnicode.set_buffer(iSubscriberId.Ptr(), iSubscriberId.Size(), false, false); |
217 completion_status = imsiInUnicode.set_buffer(iSubscriberId.Ptr(), iSubscriberId.Size(), false, false); |
215 |
218 |
216 if (completion_status != eap_status_ok) |
219 if (completion_status != eap_status_ok) |
226 { |
229 { |
227 imsi.reset(); |
230 imsi.reset(); |
228 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("ISA interface: Could not convert IMSI from UNICODE to UTF8. Not proceeding further here.\n"))); |
231 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("ISA interface: Could not convert IMSI from UNICODE to UTF8. Not proceeding further here.\n"))); |
229 } |
232 } |
230 } |
233 } |
231 |
234 |
|
235 DisconnectMMETel(); |
|
236 |
232 TRAP(error, iParent->complete_SIM_imsi_L(&imsi, completion_status)); |
237 TRAP(error, iParent->complete_SIM_imsi_L(&imsi, completion_status)); |
233 |
238 |
234 break; |
239 break; |
235 |
240 |
236 case EQuerySRESandKC: |
241 case EQuerySRESandKC: |
242 |
247 |
243 EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("KC"), |
248 EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("KC"), |
244 iEAPSim.iKC.Ptr(), |
249 iEAPSim.iKC.Ptr(), |
245 iEAPSim.iKC.Size())); |
250 iEAPSim.iKC.Size())); |
246 |
251 |
|
252 iQueryId = EQueryNone; |
|
253 |
247 // Trim the length of SRES - Remove once the correct length is set for SRES, may be by the API or some where else. |
254 // Trim the length of SRES - Remove once the correct length is set for SRES, may be by the API or some where else. |
248 iEAPSim.iSRES.SetLength(SIM_SRES_LENGTH); |
255 iEAPSim.iSRES.SetLength(SIM_SRES_LENGTH); |
249 EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("SRES after Trimming"), |
256 EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("SRES after Trimming"), |
250 iEAPSim.iSRES.Ptr(), |
257 iEAPSim.iSRES.Ptr(), |
251 iEAPSim.iSRES.Size())); |
258 iEAPSim.iSRES.Size())); |
252 |
259 |
253 delete iAuthenticationData; |
260 delete iAuthenticationData; |
254 iAuthenticationData = NULL; |
261 iAuthenticationData = NULL; |
255 |
262 |
256 // Close the custom API since we don't need it any more. |
263 DisconnectMMETel(); |
257 iCustomAPI.Close(); |
264 |
258 |
|
259 // Complete |
265 // Complete |
260 TRAP(error, iParent->complete_SIM_kc_and_sres_L(iEAPSim.iKC, iEAPSim.iSRES, completion_status)); |
266 TRAP(error, iParent->complete_SIM_kc_and_sres_L(iEAPSim.iKC, iEAPSim.iSRES, completion_status)); |
261 |
267 |
262 break; |
268 break; |
263 } |
269 } |
266 { |
272 { |
267 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("ISA interface: Got error reply.\n"))); |
273 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("ISA interface: Got error reply.\n"))); |
268 |
274 |
269 if( EQuerySRESandKC == iQueryId ) |
275 if( EQuerySRESandKC == iQueryId ) |
270 { |
276 { |
271 // We have to close the custom API anyway. |
277 iQueryId = EQueryNone; |
272 // Rest will be taken care in destructor. |
278 |
273 iCustomAPI.Close(); |
279 DisconnectMMETel(); |
274 |
280 |
275 // Handle duplicate RAND values. |
281 // Handle duplicate RAND values. |
276 // If duplicate RAND values are being used, we get KErrArgument here. |
282 // If duplicate RAND values are being used, we get KErrArgument here. |
277 if(iStatus.Int() == KErrArgument) |
283 if(iStatus.Int() == KErrArgument) |
278 { |
284 { |
289 } |
295 } |
290 else if(EQueryIMSI == iQueryId) |
296 else if(EQueryIMSI == iQueryId) |
291 { |
297 { |
292 completion_status = m_am_tools->convert_am_error_to_eapol_error(iStatus.Int()); |
298 completion_status = m_am_tools->convert_am_error_to_eapol_error(iStatus.Int()); |
293 |
299 |
|
300 iQueryId = EQueryNone; |
|
301 |
|
302 DisconnectMMETel(); |
|
303 |
294 TRAP(error, iParent->complete_SIM_imsi_L(&imsi, completion_status)); |
304 TRAP(error, iParent->complete_SIM_imsi_L(&imsi, completion_status)); |
295 } |
305 } |
296 } |
306 } |
297 |
307 |
298 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
308 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
299 } |
309 } |
|
310 |
|
311 //-------------------------------------------------- |
300 |
312 |
301 TInt CEapSimIsaInterface::CreateMMETelConnectionL() |
313 TInt CEapSimIsaInterface::CreateMMETelConnectionL() |
302 { |
314 { |
303 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
315 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
304 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::CreateMMETelConnectionL()\n"))); |
316 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::CreateMMETelConnectionL()\n"))); |
360 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
372 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
361 |
373 |
362 return errorCode; |
374 return errorCode; |
363 } |
375 } |
364 |
376 |
|
377 void CEapSimIsaInterface::DisconnectMMETel() |
|
378 { |
|
379 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapSimIsaInterface::DisconnectMMETel()\n"))); |
|
380 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapSimIsaInterface::DisconnectMMETel()"); |
|
381 |
|
382 iQueryId = EQueryNone; |
|
383 |
|
384 // Close the custom API since we don't need it any more. |
|
385 iCustomAPI.Close(); |
|
386 |
|
387 if( iMMETELConnectionStatus ) |
|
388 { |
|
389 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("Closing RMobilePhone and MMETEL.\n"))); |
|
390 |
|
391 iPhone.Close(); |
|
392 iServer.Close(); // Phone module is unloaded automatically when RTelServer session is closed |
|
393 |
|
394 iMMETELConnectionStatus = EFalse; |
|
395 } |
|
396 else |
|
397 { |
|
398 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("RMobilePhone and MMETEL already closed.\n"))); |
|
399 } |
|
400 } |
|
401 |
|
402 |
365 // End of file |
403 // End of file |