telephonyserverplugins/simtsy/src/CSimPhone.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 // Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
    22 
       
    23 
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "CSimPhoneTraces.h"
       
    27 #endif
       
    28 
       
    29 #include <testconfigfileparser.h>
    22 #include <testconfigfileparser.h>
    30 #include "CSimPhone.h"
    23 #include "CSimPhone.h"
    31 #include "CSimCall.h"
    24 #include "CSimCall.h"
    32 #include "csimsmsmess.h"
    25 #include "csimsmsmess.h"
    33 #include "CSimPhBkStore.h"
    26 #include "CSimPhBkStore.h"
    36 #include "CSimSignalStrength.h"
    29 #include "CSimSignalStrength.h"
    37 #include "CSimNetworkStatus.h"
    30 #include "CSimNetworkStatus.h"
    38 #include "CSimDtmf.h"
    31 #include "CSimDtmf.h"
    39 #include "CSimIndicator.h"
    32 #include "CSimIndicator.h"
    40 #include "utils.h"
    33 #include "utils.h"
       
    34 #include "Simlog.h"
    41 #include "CSimPacketService.h"
    35 #include "CSimPacketService.h"
    42 #include "CSimSat.h"
    36 #include "CSimSat.h"
    43 #include "CSimBatteryCharger.h"
    37 #include "CSimBatteryCharger.h"
    44 #include "CSimCallBarring.h"
    38 #include "CSimCallBarring.h"
    45 #include "CSimCallForwarding.h"
    39 #include "CSimCallForwarding.h"
    60 const TInt KPhBkUSimStoreGranularity=5;		// < The granularity of the phonebook store list array.
    54 const TInt KPhBkUSimStoreGranularity=5;		// < The granularity of the phonebook store list array.
    61 const TInt KPhonebookStoreGranularity=2;	// < The granularity of the phonebook store list array.
    55 const TInt KPhonebookStoreGranularity=2;	// < The granularity of the phonebook store list array.
    62 
    56 
    63 GLDEF_C void SimPanic(TSimPanic aPanicNumber, TInt aLineNumber)
    57 GLDEF_C void SimPanic(TSimPanic aPanicNumber, TInt aLineNumber)
    64 	{
    58 	{
    65 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, SIMPANIC_1, "SMS.TSY Panic %d Line %d", aPanicNumber, aLineNumber);
    59 	LOGPHONE3("SMS.TSY Panic %d Line %d", aPanicNumber, aLineNumber);
    66 	(void) aLineNumber;
    60 	(void) aLineNumber;
    67 	_LIT(panicText,"SIM.TSY");
    61 	_LIT(panicText,"SIM.TSY");
    68 	User::Panic(panicText,aPanicNumber);
    62 	User::Panic(panicText,aPanicNumber);
    69 	}
    63 	}
    70 
    64 
   146 					pTableEntry += ((entry-1)/8);
   140 					pTableEntry += ((entry-1)/8);
   147 					*pTableEntry |= (basic << ((entry-1)%8));
   141 					*pTableEntry |= (basic << ((entry-1)%8));
   148 				}
   142 				}
   149 			}
   143 			}
   150 			*aTable = pTable;	
   144 			*aTable = pTable;	
   151 			OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_POPULATESERVICETABLEL_1, "Successfully populated %s table in simtsy", aLookup);
   145 			LOGPHONE2("Successfully populated %s table in simtsy", &aLookup);	
   152 		}
   146 		}
   153 	else	
   147 	else	
   154 		{
   148 		{
   155 		delete(pTable);
   149 		delete(pTable);
   156 		pTable = NULL;
   150 		pTable = NULL;
   157 		OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_POPULATESERVICETABLEL_2, "Failed to populat %s table in simtsy", aLookup);
   151 		LOGPHONE2("Failed to populat %s table in simtsy", &aLookup);			
   158 		}
   152 		}
   159 	}
   153 	}
   160 
   154 
   161 /**
   155 /**
   162  * A utility function for reading the USIM V8 service tables and setting them up
   156  * A utility function for reading the USIM V8 service tables and setting them up
   192  					pTableEntry += ((entry-1)/8);
   186  					pTableEntry += ((entry-1)/8);
   193  					*pTableEntry |= (basic << ((entry-1)%8));
   187  					*pTableEntry |= (basic << ((entry-1)%8));
   194  				}
   188  				}
   195  			}
   189  			}
   196  			*aTableV8 = pTable;	
   190  			*aTableV8 = pTable;	
   197  			OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_POPULATESERVICETABLEV8L_1, "Successfully populated %s table in simtsy", aLookup);
   191  			LOGPHONE2("Successfully populated %s table in simtsy", &aLookup);	
   198  		}
   192  		}
   199  	else	
   193  	else	
   200  		{
   194  		{
   201  		delete(pTable);
   195  		delete(pTable);
   202  		pTable = NULL;
   196  		pTable = NULL;
   203  		OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_POPULATESERVICETABLEV8L_2, "Failed to populate %s table in simtsy", aLookup);
   197  		LOGPHONE2("Failed to populate %s table in simtsy", &aLookup);			
   204  		}
   198  		}
   205  	}
   199  	}
   206 
   200 
   207  
   201  
   208  
   202  
   220          {
   214          {
   221          iConfigSection = iConfigFile->Section(iSectionName);
   215          iConfigSection = iConfigFile->Section(iSectionName);
   222          }
   216          }
   223     else
   217     else
   224         {
   218         {
   225         OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_SETTESTNUMBERANDREADCONFIGURATIONFILE_1, "Section for requested test number (%d) not found in the Config File",testNumber);
   219         LOGPHONE2("Section for requested test number (%d) not found in the Config File",testNumber);
   226         delete iConfigFile;
   220         delete iConfigFile;
   227         iConfigFile = NULL;
   221         iConfigFile = NULL;
   228 
   222 
   229         User::Leave(KErrNotFound);
   223         User::Leave(KErrNotFound);
   230         }
   224         }
   245 #if defined (__WINS__)
   239 #if defined (__WINS__)
   246 	TInt r=User::LoadPhysicalDevice(PDD_NAME);
   240 	TInt r=User::LoadPhysicalDevice(PDD_NAME);
   247 	r=User::LoadLogicalDevice(LDD_NAME);
   241 	r=User::LoadLogicalDevice(LDD_NAME);
   248 #endif
   242 #endif
   249 
   243 
   250 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CONSTRUCTL_1, "Starting to Load and Parse the Config File");
   244 	LOGPHONE1("Starting to Load and Parse the Config File");
   251 	
   245 	
   252 	User::LeaveIfError(iFs.Connect());
   246 	User::LeaveIfError(iFs.Connect());
   253 	
   247 	
   254 	SetTestNumberAndReadConfigurationFileL();
   248 	SetTestNumberAndReadConfigurationFileL();
   255 	
   249 	
   318     if( itemSubscriberId != NULL )
   312     if( itemSubscriberId != NULL )
   319         {
   313         {
   320         TInt ret=CTestConfig::GetElement(itemSubscriberId->Value(),KStdDelimiter,0,IMSI);
   314         TInt ret=CTestConfig::GetElement(itemSubscriberId->Value(),KStdDelimiter,0,IMSI);
   321         if( ret != KErrNone )
   315         if( ret != KErrNone )
   322 			{
   316 			{
   323             OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CONSTRUCTL_2, "WARNING - CONFIGURATION FILE PARSING - Reading element IMSI returned %d (element no. %d) from tag %s.",ret,0,KSubscriberId);
   317             LOGPARSERR("IMSI",ret,0,&KSubscriberId);
   324 			}
   318 			}
   325         // coverity[check_return]
   319         // coverity[check_return]
   326         CTestConfig::GetElement(itemSubscriberId->Value(),KStdDelimiter,1,iSubscriberId.iError);
   320         CTestConfig::GetElement(itemSubscriberId->Value(),KStdDelimiter,1,iSubscriberId.iError);
   327         iSubscriberId.iIMSI.Copy(IMSI);
   321         iSubscriberId.iIMSI.Copy(IMSI);
   328         }
   322         }
   333 
   327 
   334 	iNtwkMode=(RMobilePhone::TMobilePhoneNetworkMode)CfgFile()->ItemValue(KNetworkMode,KNetworkModeDefault);
   328 	iNtwkMode=(RMobilePhone::TMobilePhoneNetworkMode)CfgFile()->ItemValue(KNetworkMode,KNetworkModeDefault);
   335 	//get phone id from config file
   329 	//get phone id from config file
   336 	GetPhoneIdAndCaps();
   330 	GetPhoneIdAndCaps();
   337 
   331 
   338 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CONSTRUCTL_3, "Loading the version configuration");
   332 	LOGPHONE1("Loading the version configuration");
   339 	iSimTsyVersion = CfgFile()->ItemValue(KTsyVersionNumber,KSimTsyDefaultVersion);
   333 	iSimTsyVersion = CfgFile()->ItemValue(KTsyVersionNumber,KSimTsyDefaultVersion);
   340 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CONSTRUCTL_4, "Simulated SIMTSY version: %d", iSimTsyVersion);
   334 	LOGPHONE2("Simulated SIMTSY version: %d", iSimTsyVersion);
   341 	
   335 	
   342 	iPacketService = CSimPacketService::NewL(this);
   336 	iPacketService = CSimPacketService::NewL(this);
   343 	iBatteryCharger = CSimBatteryCharger::NewL(this);
   337 	iBatteryCharger = CSimBatteryCharger::NewL(this);
   344 	iSat = CSimSat::NewL(this);
   338 	iSat = CSimSat::NewL(this);
   345 	iIndicator = CSimIndicator::NewL(this);
   339 	iIndicator = CSimIndicator::NewL(this);
   413 		iNetworkModeTimer->Start(initialNetworkMode.iDuration, &iTimerCallBackNetworkMode);
   407 		iNetworkModeTimer->Start(initialNetworkMode.iDuration, &iTimerCallBackNetworkMode);
   414 		}
   408 		}
   415 	// end of network mode simulation setup
   409 	// end of network mode simulation setup
   416 	iTestNumberObserver = CSimTestNumberObserver::NewL(*this);
   410 	iTestNumberObserver = CSimTestNumberObserver::NewL(*this);
   417 	
   411 	
   418 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CONSTRUCTL_5, "Completed Loading and Parsing the Config File");
   412 	LOGPHONE1("Completed Loading and Parsing the Config File");
   419 	}
   413 	}
   420 
   414 
   421 CSimReduceTimers* CSimPhone::GetReduceTimersSubject()
   415 CSimReduceTimers* CSimPhone::GetReduceTimersSubject()
   422 	{
   416 	{
   423 	return iReduceTimers;
   417 	return iReduceTimers;
   430 	{
   424 	{
   431 	TInt  ret = RProperty::Get(KUidPSSimTsyCategory, KPSSimTsyTestNumber, aTestNumber);
   425 	TInt  ret = RProperty::Get(KUidPSSimTsyCategory, KPSSimTsyTestNumber, aTestNumber);
   432 
   426 
   433 	if (ret == KErrNone  &&  aTestNumber >= 0)
   427 	if (ret == KErrNone  &&  aTestNumber >= 0)
   434 		{
   428 		{
   435 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_GETTESTNUMBER_1, "Got system property KUidPSSimTsyCategory/KPSSimTsyTestNumber. testNumber=%d", aTestNumber);
   429 		LOGPHONE2("Got system property KUidPSSimTsyCategory/KPSSimTsyTestNumber. testNumber=%d", aTestNumber);
   436 		}
   430 		}
   437 	else
   431 	else
   438 		{
   432 		{
   439 		aTestNumber = KDefaultTestNumber;
   433 		aTestNumber = KDefaultTestNumber;
   440 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_GETTESTNUMBER_2, "Using the default test number. testNumber=%d", aTestNumber);
   434 		LOGPHONE2("Using the default test number. testNumber=%d", aTestNumber);
   441 		}
   435 		}
   442 
   436 
   443 	return KErrNone;
   437 	return KErrNone;
   444 	}
   438 	}
   445 
   439 
   451 	{
   445 	{
   452 	TInt  ret = RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumberInUse, aTestNumber);
   446 	TInt  ret = RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumberInUse, aTestNumber);
   453 
   447 
   454 	if (ret == KErrNone)
   448 	if (ret == KErrNone)
   455 		{
   449 		{
   456 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_SETTESTNUMBERINUSE_1, "Set system property KUidPSSimTsyCategory/KPSSimTsyTestNumberInUse. testNumber=%d", aTestNumber);
   450 		LOGPHONE2("Set system property KUidPSSimTsyCategory/KPSSimTsyTestNumberInUse. testNumber=%d", aTestNumber);
   457 		}
   451 		}
   458 
   452 
   459 	return ret;
   453 	return ret;
   460 	}
   454 	}
   461 
   455 
   564 	
   558 	
   565 	delete iReduceTimers;
   559 	delete iReduceTimers;
   566 	delete iTestNumberObserver;
   560 	delete iTestNumberObserver;
   567 	
   561 	
   568 	CSimTsyMode::FreeMode();
   562 	CSimTsyMode::FreeMode();
   569 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_DTOR_1, "CSimPhone Destroyed");
   563 	LOGPHONE1("CSimPhone Destroyed");
   570 	}
   564 	}
   571 
   565 
   572 void CSimPhone::InitPhoneStatus()
   566 void CSimPhone::InitPhoneStatus()
   573 	{
   567 	{
   574 	const CTestConfigItem* item = NULL;
   568 	const CTestConfigItem* item = NULL;
   575 	TInt ret = KErrNone;
   569 	TInt ret = KErrNone;
   576 
   570 
   577 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_INITPHONESTATUS_1, "Starting to Load and Parse Phone Config parameters");
   571 	LOGPHONE1("Starting to Load and Parse Phone Config parameters");
   578 
   572 
   579 	item = CfgFile()->Item(KPhoneStatus);
   573 	item = CfgFile()->Item(KPhoneStatus);
   580 	if(!item)
   574 	if(!item)
   581 		return;
   575 		return;
   582 
   576 
   597 	{
   591 	{
   598 	TInt count=CfgFile()->ItemCount(KPhBkStore);
   592 	TInt count=CfgFile()->ItemCount(KPhBkStore);
   599 	const CTestConfigItem* item=NULL;
   593 	const CTestConfigItem* item=NULL;
   600 	TInt ret=KErrNone;
   594 	TInt ret=KErrNone;
   601 
   595 
   602 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_1, "Starting to Load and Parse PhoneBookStore Config parameters");
   596 	LOGPHONE1("Starting to Load and Parse PhoneBookStore Config parameters");
   603 	TInt i;
   597 	TInt i;
   604 	for(i=0;i<count;i++)
   598 	for(i=0;i<count;i++)
   605 		{
   599 		{
   606 		item=CfgFile()->Item(KPhBkStore,i);
   600 		item=CfgFile()->Item(KPhBkStore,i);
   607 		if(!item)
   601 		if(!item)
   610 		TPtrC8 phonebookName;
   604 		TPtrC8 phonebookName;
   611 		TInt maxNumSlots, telNumMaxLen, alphaTagMaxLen;
   605 		TInt maxNumSlots, telNumMaxLen, alphaTagMaxLen;
   612 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,phonebookName);
   606 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,phonebookName);
   613 		if(ret!=KErrNone)
   607 		if(ret!=KErrNone)
   614 			{
   608 			{
   615 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_2, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKNAME returned %d (element no. %d) from tag %s.",ret,0,KPhBkStore);
   609 			LOGPARSERR("phonebookName",ret,0,&KPhBkStore);
   616 			continue;
   610 			continue;
   617 			}
   611 			}
   618 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,maxNumSlots);
   612 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,maxNumSlots);
   619 		if(ret!=KErrNone)
   613 		if(ret!=KErrNone)
   620 			{
   614 			{
   621 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_3, "WARNING - CONFIGURATION FILE PARSING - Reading element MAXNUMSLOTS returned %d (element no. %d) from tag %s.",ret,1,KPhBkStore);
   615 			LOGPARSERR("maxNumSlots",ret,1,&KPhBkStore);
   622 			continue;
   616 			continue;
   623 			}
   617 			}
   624 
   618 
   625 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,telNumMaxLen);
   619 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,telNumMaxLen);
   626 		if(ret!=KErrNone)
   620 		if(ret!=KErrNone)
   627 			{
   621 			{
   628 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_4, "WARNING - CONFIGURATION FILE PARSING - Reading element TELNUMMAXLEN returned %d (element no. %d) from tag %s.",ret,2,KPhBkStore);
   622 			LOGPARSERR("telNumMaxLen",ret,2,&KPhBkStore);
   629 			continue;
   623 			continue;
   630 			}
   624 			}
   631 
   625 
   632 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,alphaTagMaxLen);
   626 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,alphaTagMaxLen);
   633 		if(ret!=KErrNone)
   627 		if(ret!=KErrNone)
   634 			{
   628 			{
   635 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_5, "WARNING - CONFIGURATION FILE PARSING - Reading element ALPHATAGMAXLEN returned %d (element no. %d) from tag %s.",ret,3,KPhBkStore);
   629 			LOGPARSERR("alphaTagMaxLen",ret,3,&KPhBkStore);
   636 			continue;
   630 			continue;
   637 			}
   631 			}
   638 
   632 
   639 
   633 
   640 		CSimPhBkStore* phBkStore=CSimPhBkStore::NewL(this,phonebookName,maxNumSlots,telNumMaxLen,alphaTagMaxLen);
   634 		CSimPhBkStore* phBkStore=CSimPhBkStore::NewL(this,phonebookName,maxNumSlots,telNumMaxLen,alphaTagMaxLen);
   645 		}
   639 		}
   646 
   640 
   647 
   641 
   648 	count=CfgFile()->ItemCount(KPhBkUSimStore);
   642 	count=CfgFile()->ItemCount(KPhBkUSimStore);
   649 
   643 
   650 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_6, "Starting to Load and Parse USim PhoneBookStore Config parameters");
   644 	LOGPHONE1("Starting to Load and Parse USim PhoneBookStore Config parameters");
   651 
   645 
   652 	for(i=0;i<count;i++)
   646 	for(i=0;i<count;i++)
   653 		{
   647 		{
   654 		item=CfgFile()->Item(KPhBkUSimStore,i);
   648 		item=CfgFile()->Item(KPhBkUSimStore,i);
   655 		if(!item)
   649 		if(!item)
   660 		TInt additional, maxEmail, maxAdditionalTelNumLen, maxAdditionalTextLen;
   654 		TInt additional, maxEmail, maxAdditionalTelNumLen, maxAdditionalTextLen;
   661 
   655 
   662 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,phonebookStore);
   656 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,phonebookStore);
   663 		if(ret!=KErrNone)
   657 		if(ret!=KErrNone)
   664 			{
   658 			{
   665 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_7, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKSTORE returned %d (element no. %d) from tag %s.",ret,0,KPhBkUSimStore);
   659 			LOGPARSERR("phonebookStore",ret,0,&KPhBkUSimStore);
   666 			continue;
   660 			continue;
   667 			}
   661 			}
   668 
   662 
   669 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,phonebookName);
   663 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,phonebookName);
   670 		if(ret!=KErrNone)
   664 		if(ret!=KErrNone)
   671 			{
   665 			{
   672 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_8, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKNAME returned %d (element no. %d) from tag %s.",ret,1,KPhBkUSimStore);
   666 			LOGPARSERR("phonebookName",ret,1,&KPhBkUSimStore);
   673 			continue;
   667 			continue;
   674 			}
   668 			}
   675 
   669 
   676 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,maxNumSlots);
   670 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,maxNumSlots);
   677 		if(ret!=KErrNone)
   671 		if(ret!=KErrNone)
   678 			{
   672 			{
   679 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_9, "WARNING - CONFIGURATION FILE PARSING - Reading element MAXNUMSLOTS returned %d (element no. %d) from tag %s.",ret,2,KPhBkUSimStore);
   673 			LOGPARSERR("maxNumSlots",ret,2,&KPhBkUSimStore);
   680 			continue;
   674 			continue;
   681 			}
   675 			}
   682 
   676 
   683 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,telNumMaxLen);
   677 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,telNumMaxLen);
   684 		if(ret!=KErrNone)
   678 		if(ret!=KErrNone)
   685 			{
   679 			{
   686 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_10, "WARNING - CONFIGURATION FILE PARSING - Reading element TELNUMMAXLEN returned %d (element no. %d) from tag %s.",ret,3,KPhBkUSimStore);
   680 			LOGPARSERR("telNumMaxLen",ret,3,&KPhBkUSimStore);
   687 			continue;
   681 			continue;
   688 			}
   682 			}
   689 
   683 
   690 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,alphaTagMaxLen);
   684 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,alphaTagMaxLen);
   691 		if(ret!=KErrNone)
   685 		if(ret!=KErrNone)
   692 			{
   686 			{
   693 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_11, "WARNING - CONFIGURATION FILE PARSING - Reading element ALPHATAGMAXLEN returned %d (element no. %d) from tag %s.",ret,4,KPhBkUSimStore);
   687 			LOGPARSERR("alphaTagMaxLen",ret,4,&KPhBkUSimStore);
   694 			continue;
   688 			continue;
   695 			}
   689 			}
   696 
   690 
   697 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,5,additional);
   691 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,5,additional);
   698 		if(ret!=KErrNone)
   692 		if(ret!=KErrNone)
   699 			{
   693 			{
   700 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_12, "WARNING - CONFIGURATION FILE PARSING - Reading element ADDITIONAL returned %d (element no. %d) from tag %s.",ret,5,KPhBkUSimStore);
   694 			LOGPARSERR("additional",ret,5,&KPhBkUSimStore);
   701 			continue;
   695 			continue;
   702 			}
   696 			}
   703 
   697 
   704 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,6,maxEmail);
   698 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,6,maxEmail);
   705 		if(ret!=KErrNone)
   699 		if(ret!=KErrNone)
   706 			{
   700 			{
   707 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_13, "WARNING - CONFIGURATION FILE PARSING - Reading element MAXEMAIL returned %d (element no. %d) from tag %s.",ret,6,KPhBkUSimStore);
   701 			LOGPARSERR("maxEmail",ret,6,&KPhBkUSimStore);
   708 			continue;
   702 			continue;
   709 			}
   703 			}
   710 
   704 
   711 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,7,maxAdditionalTelNumLen);
   705 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,7,maxAdditionalTelNumLen);
   712 		if(ret!=KErrNone)
   706 		if(ret!=KErrNone)
   713 			{
   707 			{
   714 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_14, "WARNING maxAdditionalTelNumLen missing, defaulting to telNumMaxLen");
   708 			LOGPHONE1("WARNING maxAdditionalTelNumLen missing, defaulting to telNumMaxLen");
   715 			maxAdditionalTelNumLen = telNumMaxLen;
   709 			maxAdditionalTelNumLen = telNumMaxLen;
   716 			}
   710 			}
   717 	
   711 	
   718 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,8,maxAdditionalTextLen);
   712 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,8,maxAdditionalTextLen);
   719 		if(ret!=KErrNone)
   713 		if(ret!=KErrNone)
   720 			{
   714 			{
   721 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_15, "WARNING maxAdditionalTextLen missing, defaulting to alphaTagMaxLen");
   715 			LOGPHONE1("WARNING maxAdditionalTextLen missing, defaulting to alphaTagMaxLen");
   722 			maxAdditionalTextLen = alphaTagMaxLen;
   716 			maxAdditionalTextLen = alphaTagMaxLen;
   723 			}
   717 			}
   724 
   718 
   725 		TInt countStores = iPhBkUSimStores->Count();
   719 		TInt countStores = iPhBkUSimStores->Count();
   726 		TBool found=EFalse;
   720 		TBool found=EFalse;
   739 					break;
   733 					break;
   740 					}
   734 					}
   741 			}
   735 			}
   742 			if(foundShort) //warn but not fail!
   736 			if(foundShort) //warn but not fail!
   743 				{
   737 				{
   744 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_16, "WARNING! PhBkUSimStore and PhBkStore duplicate phonebook configuration");
   738 				LOGPHONE1("WARNING! PhBkUSimStore and PhBkStore duplicate phonebook configuration");
   745 				}
   739 				}
   746 		}
   740 		}
   747 		for(TInt j=0; j < countStores; j++)
   741 		for(TInt j=0; j < countStores; j++)
   748 			{
   742 			{
   749 				CSimPhBkUSimStore* phBkStore = iPhBkUSimStores->At(j);
   743 				CSimPhBkUSimStore* phBkStore = iPhBkUSimStores->At(j);
   774 		}
   768 		}
   775 	for(i=0;i<iPhBkUSimStores->Count();i++)
   769 	for(i=0;i<iPhBkUSimStores->Count();i++)
   776 		{
   770 		{
   777 		iPhBkUSimStores->At(i)->PopulateStoreFromConfigFileL();
   771 		iPhBkUSimStores->At(i)->PopulateStoreFromConfigFileL();
   778 		}
   772 		}
   779 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_FINDANDCREATEPHBKSTORESL_17, "Finished parsing PhBkStores config parameters");
   773 	LOGPHONE1("Finished parsing PhBkStores config parameters");
   780 	}
   774 	}
   781 
   775 
   782 void CSimPhone::CreateONStoreL()
   776 void CSimPhone::CreateONStoreL()
   783 	{
   777 	{
   784 	const CTestConfigItem* item=NULL;
   778 	const CTestConfigItem* item=NULL;
   785 	TInt ret=KErrNone;
   779 	TInt ret=KErrNone;
   786 
   780 
   787 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CREATEONSTOREL_1, "Starting to Load and Parse Own Number Config parameters");
   781 	LOGPHONE1("Starting to Load and Parse Own Number Config parameters");
   788 
   782 
   789 	TInt i=0;
   783 	TInt i=0;
   790 	item=CfgFile()->Item(KONStore,i);
   784 	item=CfgFile()->Item(KONStore,i);
   791 	if(!item)
   785 	if(!item)
   792 		return;
   786 		return;
   793 
   787 
   794 	TInt maxNumSlots, telNumMaxLen, alphaTagMaxLen;
   788 	TInt maxNumSlots, telNumMaxLen, alphaTagMaxLen;
   795 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,maxNumSlots);
   789 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,maxNumSlots);
   796 	if(ret!=KErrNone)
   790 	if(ret!=KErrNone)
   797 		{
   791 		{
   798 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CREATEONSTOREL_2, "WARNING - CONFIGURATION FILE PARSING - Reading element MAXNUMSLOTS returned %d (element no. %d) from tag %s.",ret,1,KONStore);
   792 		LOGPARSERR("maxNumSlots",ret,1,&KONStore);
   799 		return;
   793 		return;
   800 		}
   794 		}
   801 
   795 
   802 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,telNumMaxLen);
   796 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,telNumMaxLen);
   803 	if(ret!=KErrNone)
   797 	if(ret!=KErrNone)
   804 		{
   798 		{
   805 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CREATEONSTOREL_3, "WARNING - CONFIGURATION FILE PARSING - Reading element TELNUMMAXLEN returned %d (element no. %d) from tag %s.",ret,2,KONStore);
   799 		LOGPARSERR("telNumMaxLen",ret,2,&KONStore);
   806 		return;
   800 		return;
   807 		}
   801 		}
   808 
   802 
   809 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,alphaTagMaxLen);
   803 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,alphaTagMaxLen);
   810 	if(ret!=KErrNone)
   804 	if(ret!=KErrNone)
   811 		{
   805 		{
   812 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CREATEONSTOREL_4, "WARNING - CONFIGURATION FILE PARSING - Reading element ALPHATAGMAXLEN returned %d (element no. %d) from tag %s.",ret,3,KONStore);
   806 		LOGPARSERR("alphaTagMaxLen",ret,3,&KONStore);
   813 		return;
   807 		return;
   814 		}
   808 		}
   815 
   809 
   816 	iONStore=CSimONStore::NewL(this,maxNumSlots,telNumMaxLen,alphaTagMaxLen);
   810 	iONStore=CSimONStore::NewL(this,maxNumSlots,telNumMaxLen,alphaTagMaxLen);
   817 
   811 
   818 // Populate the Own Number Store 
   812 // Populate the Own Number Store 
   819 	iONStore->PopulateStoreFromConfigFileL();
   813 	iONStore->PopulateStoreFromConfigFileL();
   820 
   814 
   821 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CREATEONSTOREL_5, "Finished parsing Own Number Store config parameters");
   815 	LOGPHONE1("Finished parsing Own Number Store config parameters");
   822 	}
   816 	}
   823 
   817 
   824 TInt CSimPhone::ExtFunc(const TTsyReqHandle aReqHandle, const TInt aIpc, const TDataPackage& aPckg)
   818 TInt CSimPhone::ExtFunc(const TTsyReqHandle aReqHandle, const TInt aIpc, const TDataPackage& aPckg)
   825 /**
   819 /**
   826 * ExtFunc is called by the server when it has a "extended", i.e. non-core ETel request
   820 * ExtFunc is called by the server when it has a "extended", i.e. non-core ETel request
  1472 * @param aName the name of the line object to be opened
  1466 * @param aName the name of the line object to be opened
  1473 * @return CTelObject pointer to the phone object created
  1467 * @return CTelObject pointer to the phone object created
  1474 * @leave Leaves if incorrect phone name
  1468 * @leave Leaves if incorrect phone name
  1475 */
  1469 */
  1476 	{
  1470 	{
  1477 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_OPENNEWOBJECTBYNAMEL_1, ">>CSimPhone::OpenNewObjectByNameL");
  1471 	LOGPHONE1(">>CSimPhone::OpenNewObjectByNameL");
  1478 
  1472 
  1479 // Is it a voice line?
  1473 // Is it a voice line?
  1480 	if (aName.CompareF(KVoiceLineName) == 0)
  1474 	if (aName.CompareF(KVoiceLineName) == 0)
  1481 		{
  1475 		{
  1482 		__ASSERT_ALWAYS(iVoiceLine!=NULL,SimPanic(ELineNotPreInstantiated));
  1476 		__ASSERT_ALWAYS(iVoiceLine!=NULL,SimPanic(ELineNotPreInstantiated));
  1542 
  1536 
  1543 		CTelObject* phoneScEap = iPhoneScEapMan->CreateScEapSubSessionL(tempAID, eapType);
  1537 		CTelObject* phoneScEap = iPhoneScEapMan->CreateScEapSubSessionL(tempAID, eapType);
  1544 
  1538 
  1545 		if (phoneScEap == NULL)
  1539 		if (phoneScEap == NULL)
  1546 			{
  1540 			{
  1547 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_OPENNEWOBJECTBYNAMEL_2, "ERROR CSimSmartCardEap object not created, returning KErrGeneral");
  1541 			LOGPHONE1("ERROR CSimSmartCardEap object not created, returning KErrGeneral");
  1548 			User::Leave(KErrGeneral);
  1542 			User::Leave(KErrGeneral);
  1549 			}
  1543 			}
  1550 
  1544 
  1551 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_OPENNEWOBJECTBYNAMEL_3, "CSimPhone::OpenNewObjectByNameL CSimSmartCardEap object created [0x%08x]", phoneScEap);
  1545 		LOGPHONE2("CSimPhone::OpenNewObjectByNameL CSimSmartCardEap object created [0x%08x]", phoneScEap);
  1552 		return phoneScEap;
  1546 		return phoneScEap;
  1553 		} // End of opening Smart Card EAP sub-session
  1547 		} // End of opening Smart Card EAP sub-session
  1554 	else if (aName.CompareF(KETelOwnNumberStore) == 0)
  1548 	else if (aName.CompareF(KETelOwnNumberStore) == 0)
  1555 		{
  1549 		{
  1556 		if(iONStore==NULL)
  1550 		if(iONStore==NULL)
  1557 			{
  1551 			{
  1558 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_OPENNEWOBJECTBYNAMEL_4, "ERROR CSimONStore object not found. Please check config file.");
  1552 			LOGPHONE1("ERROR CSimONStore object not found. Please check config file.");
  1559 			User::Leave(KErrNotFound);
  1553 			User::Leave(KErrNotFound);
  1560 			}
  1554 			}
  1561 		else
  1555 		else
  1562 			{
  1556 			{
  1563 			(void)iONStore->Open();
  1557 			(void)iONStore->Open();
  2257 	__ASSERT_ALWAYS(iMode!=RPhone::EModeUnknown,SimPanic(EPhoneModeUnknownIllegal));
  2251 	__ASSERT_ALWAYS(iMode!=RPhone::EModeUnknown,SimPanic(EPhoneModeUnknownIllegal));
  2258 	__ASSERT_ALWAYS(iNtwkMode!=RMobilePhone::ENetworkModeUnknown,SimPanic(ENetworkModeUnknownIllegal));
  2252 	__ASSERT_ALWAYS(iNtwkMode!=RMobilePhone::ENetworkModeUnknown,SimPanic(ENetworkModeUnknownIllegal));
  2259 
  2253 
  2260 // If there is no active line defined, then any state changes are fine.  However,
  2254 // If there is no active line defined, then any state changes are fine.  However,
  2261 // we need to watch for a shift to an "active" status.
  2255 // we need to watch for a shift to an "active" status.
  2262 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_VALIDATECHANGESTATE_1, ">>CSimPhone::ValidateChangeState");
  2256 	LOGPHONE1(">>CSimPhone::ValidateChangeState");
  2263 	if(!iActiveLine)
  2257 	if(!iActiveLine)
  2264 		{
  2258 		{
  2265 		iMode=ConvertStateToMode(aState);
  2259 		iMode=ConvertStateToMode(aState);
  2266 		if(IsStateActive(aState))
  2260 		if(IsStateActive(aState))
  2267 			iActiveLine=aOriginatingLine;
  2261 			iActiveLine=aOriginatingLine;
  2288 
  2282 
  2289 	if((aState==RMobileCall::EStatusRinging) ||
  2283 	if((aState==RMobileCall::EStatusRinging) ||
  2290 	   (aState==RMobileCall::EStatusIdle))
  2284 	   (aState==RMobileCall::EStatusIdle))
  2291 		return KErrNone;
  2285 		return KErrNone;
  2292 
  2286 
  2293 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_VALIDATECHANGESTATE_2, "<<CSimPhone::ValidateChangeState");
  2287 	LOGPHONE1("<<CSimPhone::ValidateChangeState");
  2294 	return KErrGeneral;
  2288 	return KErrGeneral;
  2295 	}
  2289 	}
  2296 
  2290 
  2297 TInt CSimPhone::FindActiveVoiceCall(CSimVoiceCall*& aCall)
  2291 TInt CSimPhone::FindActiveVoiceCall(CSimVoiceCall*& aCall)
  2298 /**
  2292 /**
  2314 * @param aOriginatingLine pointer to the line requesting for the change of state
  2308 * @param aOriginatingLine pointer to the line requesting for the change of state
  2315 * @param aState the state the aOriginatingLine wants to change to
  2309 * @param aState the state the aOriginatingLine wants to change to
  2316 * @return Error indicates whether the change of state is successful or not
  2310 * @return Error indicates whether the change of state is successful or not
  2317 */
  2311 */
  2318 	{
  2312 	{
  2319 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_VALIDATECHANGESTATE1_1, ">>CSimPhone::ValidateChangeState packet");
  2313 	LOGPHONE1(">>CSimPhone::ValidateChangeState packet");
  2320 	__ASSERT_ALWAYS(iMode!=RPhone::EModeUnknown,SimPanic(EPhoneModeUnknownIllegal));
  2314 	__ASSERT_ALWAYS(iMode!=RPhone::EModeUnknown,SimPanic(EPhoneModeUnknownIllegal));
  2321 	__ASSERT_ALWAYS(iNtwkMode!=RMobilePhone::ENetworkModeUnknown,SimPanic(ENetworkModeUnknownIllegal));
  2315 	__ASSERT_ALWAYS(iNtwkMode!=RMobilePhone::ENetworkModeUnknown,SimPanic(ENetworkModeUnknownIllegal));
  2322 	__ASSERT_ALWAYS(iPacketService->MSClass()!=RPacketService::EMSClassUnknown,SimPanic(EPacketMSClassUnKnown));
  2316 	__ASSERT_ALWAYS(iPacketService->MSClass()!=RPacketService::EMSClassUnknown,SimPanic(EPacketMSClassUnKnown));
  2323 
  2317 
  2324 //we must know the type of class the phone supports in order to determine what action to take.
  2318 //we must know the type of class the phone supports in order to determine what action to take.
  2417 	const CTestConfigItem* item=CfgFile()->Item(KPhoneId);
  2411 	const CTestConfigItem* item=CfgFile()->Item(KPhoneId);
  2418 	if (item)
  2412 	if (item)
  2419 		{
  2413 		{
  2420 		TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,manufacturer);
  2414 		TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,manufacturer);
  2421 		if(ret!=KErrNone)
  2415 		if(ret!=KErrNone)
  2422 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_GETPHONEIDANDCAPS_1, "WARNING - CONFIGURATION FILE PARSING - Reading element MANUFACTURER returned %d (element no. %d) from tag %s.",ret,0,KPhoneId);
  2416 			LOGPARSERR("manufacturer",ret,0,&KPhoneId);
  2423 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,1,model);
  2417 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,1,model);
  2424 		if(ret!=KErrNone)
  2418 		if(ret!=KErrNone)
  2425 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_GETPHONEIDANDCAPS_2, "WARNING - CONFIGURATION FILE PARSING - Reading element MODEL returned %d (element no. %d) from tag %s.",ret,1,KPhoneId);
  2419 			LOGPARSERR("model",ret,1,&KPhoneId);
  2426 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,2,revision);
  2420 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,2,revision);
  2427 		if(ret!=KErrNone)
  2421 		if(ret!=KErrNone)
  2428 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_GETPHONEIDANDCAPS_3, "WARNING - CONFIGURATION FILE PARSING - Reading element REVISION returned %d (element no. %d) from tag %s.",ret,2,KPhoneId);
  2422 			LOGPARSERR("revision",ret,2,&KPhoneId);
  2429 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,3,imei);
  2423 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,3,imei);
  2430 		if(ret!=KErrNone)
  2424 		if(ret!=KErrNone)
  2431 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_GETPHONEIDANDCAPS_4, "WARNING - CONFIGURATION FILE PARSING - Reading element IMEI returned %d (element no. %d) from tag %s.",ret,3,KPhoneId);
  2425 			LOGPARSERR("imei",ret,3,&KPhoneId);
  2432 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,4,iPhoneId.iError);
  2426 		ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,4,iPhoneId.iError);
  2433 
  2427 
  2434 		iPhoneId.iManufacturerId.Copy(manufacturer);
  2428 		iPhoneId.iManufacturerId.Copy(manufacturer);
  2435 		iPhoneId.iModelId.Copy(model);
  2429 		iPhoneId.iModelId.Copy(model);
  2436 		iPhoneId.iRevisionId.Copy(revision);
  2430 		iPhoneId.iRevisionId.Copy(revision);
  3059 	Implementation of MTimerCallback::TimerCallBack
  3053 	Implementation of MTimerCallback::TimerCallBack
  3060 	Simply completes the suspend call processing request after the delay
  3054 	Simply completes the suspend call processing request after the delay
  3061 */
  3055 */
  3062 void CSimPhone::CNetworkModeTimerCallBack::TimerCallBack(TInt /*aId*/)
  3056 void CSimPhone::CNetworkModeTimerCallBack::TimerCallBack(TInt /*aId*/)
  3063 	{
  3057 	{
  3064 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CNETWORKMODETIMERCALLBACK_TIMERCALLBACK_1, ">>CSimPhone::CNetworkModeTimerCallBack::TimerCallBack");
  3058 	LOGPACKET1(">>CSimPhone::CNetworkModeTimerCallBack::TimerCallBack");
  3065 	iPhone->TimerCallBackNetworkMode();
  3059 	iPhone->TimerCallBackNetworkMode();
  3066 	}
  3060 	}
  3067 
  3061 
  3068 TInt CSimPhone::NotifyModeChange(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TMobilePhoneNetworkMode* aCaps)
  3062 TInt CSimPhone::NotifyModeChange(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TMobilePhoneNetworkMode* aCaps)
  3069 	{
  3063 	{
  3070 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_NOTIFYMODECHANGE_1, "CSimPhone::NotifyModeChange called");
  3064 	LOGPACKET1("CSimPhone::NotifyModeChange called");
  3071 	__ASSERT_ALWAYS(!iNotifyNetworkModeChange.iNotifyPending,SimPanic(ENotificationAlreadyPending));
  3065 	__ASSERT_ALWAYS(!iNotifyNetworkModeChange.iNotifyPending,SimPanic(ENotificationAlreadyPending));
  3072  
  3066  
  3073 	if (iNetworkModeArray->Count() == 0)
  3067 	if (iNetworkModeArray->Count() == 0)
  3074 		{
  3068 		{
  3075 		ReqCompleted(aTsyReqHandle,KErrNotSupported);
  3069 		ReqCompleted(aTsyReqHandle,KErrNotSupported);
  3088 * @param aTsyReqHandle Tsy Request handle for the client cancel request
  3082 * @param aTsyReqHandle Tsy Request handle for the client cancel request
  3089 * @return KErrNone
  3083 * @return KErrNone
  3090 */
  3084 */
  3091 TInt CSimPhone::NotifyModeChangeCancel(const TTsyReqHandle aTsyReqHandle)
  3085 TInt CSimPhone::NotifyModeChangeCancel(const TTsyReqHandle aTsyReqHandle)
  3092 	{
  3086 	{
  3093 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_NOTIFYMODECHANGECANCEL_1, "CSimPhone::NotifyModeChangeCancel called");
  3087 	LOGPACKET1("CSimPhone::NotifyModeChangeCancel called");
  3094 	if( (iNotifyNetworkModeChange.iNotifyPending) && (aTsyReqHandle == iNotifyNetworkModeChange.iNotifyHandle))
  3088 	if( (iNotifyNetworkModeChange.iNotifyPending) && (aTsyReqHandle == iNotifyNetworkModeChange.iNotifyHandle))
  3095 		{
  3089 		{
  3096 		iNotifyNetworkModeChange.iNotifyPending=EFalse;
  3090 		iNotifyNetworkModeChange.iNotifyPending=EFalse;
  3097 		ReqCompleted(aTsyReqHandle,KErrCancel);
  3091 		ReqCompleted(aTsyReqHandle,KErrCancel);
  3098 		}
  3092 		}
  3334     return self;
  3328     return self;
  3335     }
  3329     }
  3336 
  3330 
  3337 void CSimPhone::CSimTestNumberObserver::ConstructL()
  3331 void CSimPhone::CSimTestNumberObserver::ConstructL()
  3338     {
  3332     {
  3339     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CSIMTESTNUMBEROBSERVER_CONSTRUCTL_1, "CSimPhone::CSimPhoneObserver::ConstructL");
  3333     LOGPHONE1("CSimPhone::CSimPhoneObserver::ConstructL");
  3340     User::LeaveIfError(iProperty.Attach(KUidPSSimTsyCategory, KPSSimTsyTestNumber));
  3334     User::LeaveIfError(iProperty.Attach(KUidPSSimTsyCategory, KPSSimTsyTestNumber));
  3341     Start();
  3335     Start();
  3342     }
  3336     }
  3343 
  3337 
  3344 void CSimPhone::CSimTestNumberObserver::Start()
  3338 void CSimPhone::CSimTestNumberObserver::Start()
  3345     {
  3339     {
  3346     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CSIMTESTNUMBEROBSERVER_START_1, "CSimPhone::CSimPhoneObserver::Start");
  3340     LOGPHONE1("CSimPhone::CSimPhoneObserver::Start");
  3347     iProperty.Subscribe(iStatus);
  3341     iProperty.Subscribe(iStatus);
  3348     SetActive();
  3342     SetActive();
  3349     }
  3343     }
  3350 
  3344 
  3351 void CSimPhone::CSimTestNumberObserver::RunL()
  3345 void CSimPhone::CSimTestNumberObserver::RunL()
  3352     {
  3346     {
  3353     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CSIMTESTNUMBEROBSERVER_RUNL_1, "CSimPhone::CSimPhoneObserver::RunL [iStatus=%d]", iStatus.Int());
  3347     LOGPHONE2("CSimPhone::CSimPhoneObserver::RunL [iStatus=%d]", iStatus.Int());
  3354     TInt err = iSimPhone.CheckConfigFile();
  3348     TInt err = iSimPhone.CheckConfigFile();
  3355     if( err == KErrNone )
  3349     if( err == KErrNone )
  3356         {
  3350         {
  3357         iSimPhone.HandleTestNumberChangedL();
  3351         iSimPhone.HandleTestNumberChangedL();
  3358         }
  3352         }
  3360     Start();
  3354     Start();
  3361     }
  3355     }
  3362 
  3356 
  3363 void CSimPhone::CSimTestNumberObserver::DoCancel()
  3357 void CSimPhone::CSimTestNumberObserver::DoCancel()
  3364     {
  3358     {
  3365     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONE_CSIMTESTNUMBEROBSERVER_DOCANCEL_1, "CSimPhone::CSimPhoneObserver::DoCancel");
  3359     LOGPHONE1("CSimPhone::CSimPhoneObserver::DoCancel");
  3366     iProperty.Cancel();
  3360     iProperty.Cancel();
  3367     }
  3361     }
  3368 
  3362