telephonyserverplugins/simtsy/src/CSimPhBkUsimStore.cpp
changeset 44 8b72faa1200f
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
39:2473f5e227f9 44:8b72faa1200f
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2001-2010 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 "CSimPhBkUsimStoreTraces.h"
       
    27 #endif
       
    28 
    22 #include "CSimPhBkUsimStore.h"
    29 #include "CSimPhBkUsimStore.h"
    23 #include "CSimPhone.h"
    30 #include "CSimPhone.h"
    24 #include "Simlog.h"
       
    25 #include <testconfigfileparser.h>
    31 #include <testconfigfileparser.h>
    26 
    32 
    27 const TUint16 KNpiTonInternational=145;		// < The Number Plan Identifier and Type of Number for an international telephone number.
    33 const TUint16 KNpiTonInternational=145;		// < The Number Plan Identifier and Type of Number for an international telephone number.
    28 const TUint16 KNpiTonNational=129;			// < The Number Plan Identifier and Type of Number for a national telephone number.
    34 const TUint16 KNpiTonNational=129;			// < The Number Plan Identifier and Type of Number for a national telephone number.
    29 const TInt KMaxGroups = 10;					// < The maximum allowed number of groups associated with a phonebook entry
    35 const TInt KMaxGroups = 10;					// < The maximum allowed number of groups associated with a phonebook entry
    87  * @param aMaxEmail		The maximum number of email addresses associated with an entry.
    93  * @param aMaxEmail		The maximum number of email addresses associated with an entry.
    88  * @param aMaxAdditionalTelNumLen	The maximum length of the an additional telephone number.
    94  * @param aMaxAdditionalTelNumLen	The maximum length of the an additional telephone number.
    89  * @param aMaxAdditionalTextLen		The maximum length of the alpha tag in an additional telephone number.
    95  * @param aMaxAdditionalTextLen		The maximum length of the alpha tag in an additional telephone number.
    90  */
    96  */
    91 	{
    97 	{
    92 	LOGPHBK1("Starting to parse Phonebook store additional config parameters...");
    98 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_1, "Starting to parse Phonebook store additional config parameters...");
    93 	__ASSERT_ALWAYS(aMaxNumLen<=KPhBkMaxTelNumSize,SimPanic(EPhonebookNameOrNumberTooLarge));
    99 	__ASSERT_ALWAYS(aMaxNumLen<=KPhBkMaxTelNumSize,SimPanic(EPhonebookNameOrNumberTooLarge));
    94 	__ASSERT_ALWAYS(aMaxTextLen<=KPhBkMaxAlphaTagSize,SimPanic(EPhonebookNameOrNumberTooLarge));
   100 	__ASSERT_ALWAYS(aMaxTextLen<=KPhBkMaxAlphaTagSize,SimPanic(EPhonebookNameOrNumberTooLarge));
    95 
   101 
    96 	iPhBkMaxNumSlots=aMaxNumSlots;
   102 	iPhBkMaxNumSlots=aMaxNumSlots;
    97 	iPhBkMaxTelNumLen=aMaxNumLen;
   103 	iPhBkMaxTelNumLen=aMaxNumLen;
   133 		TInt ipc, cnt, event;
   139 		TInt ipc, cnt, event;
   134 
   140 
   135 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,ipc);
   141 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,ipc);
   136 		if(ret!=KErrNone)
   142 		if(ret!=KErrNone)
   137 			{
   143 			{
   138 			LOGPARSERR("ipc",ret,0,&KTriggerEventIPC);
   144 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_2, "WARNING - CONFIGURATION FILE PARSING - Reading element IPC returned %d (element no. %d) from tag %s.",ret,0,KTriggerEventIPC);
   139 			}
   145 			}
   140 		else
   146 		else
   141 			iTriggerEventIPC.iIPC=ipc;
   147 			iTriggerEventIPC.iIPC=ipc;
   142 
   148 
   143 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,cnt);
   149 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,cnt);
   144 		if(ret!=KErrNone)
   150 		if(ret!=KErrNone)
   145 			{
   151 			{
   146 			LOGPARSERR("cnt",ret,1,&KTriggerEventIPC);
   152 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_3, "WARNING - CONFIGURATION FILE PARSING - Reading element CNT returned %d (element no. %d) from tag %s.",ret,1,KTriggerEventIPC);
   147 			}
   153 			}
   148 		else
   154 		else
   149 			iTriggerEventIPC.iIPCCnt=cnt;
   155 			iTriggerEventIPC.iIPCCnt=cnt;
   150 		
   156 		
   151 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,event);
   157 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,event);
   152 		if(ret!=KErrNone)
   158 		if(ret!=KErrNone)
   153 			{
   159 			{
   154 			LOGPARSERR("event",ret,2,&KTriggerEventIPC);
   160 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_4, "WARNING - CONFIGURATION FILE PARSING - Reading element EVENT returned %d (element no. %d) from tag %s.",ret,2,KTriggerEventIPC);
   155 			}
   161 			}
   156 		else
   162 		else
   157 			iTriggerEventIPC.iEvent=RMobilePhone::TMobilePhoneSecurityEvent(event);
   163 			iTriggerEventIPC.iEvent=RMobilePhone::TMobilePhoneSecurityEvent(event);
   158 
   164 
   159 		}
   165 		}
   177 
   183 
   178 				ret0=CTestConfig::GetElement(item0->Value(),KStdDelimiter,0,phonebookStore);
   184 				ret0=CTestConfig::GetElement(item0->Value(),KStdDelimiter,0,phonebookStore);
   179 				if(ret0!=KErrNone)
   185 				if(ret0!=KErrNone)
   180 					{
   186 					{
   181 					iPhBkStoreCaps=KDefaultPhBkPhoneStoreCaps;
   187 					iPhBkStoreCaps=KDefaultPhBkPhoneStoreCaps;
   182 					LOGPARSERR("Caps:PhonebookStore",ret,0,&KPhBkPhoneUSimStoreCaps);
   188 					OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_5, "WARNING - CONFIGURATION FILE PARSING - Reading element CAPS:PHONEBOOKSTORE returned %d (element no. %d) from tag %s.",ret,0,KPhBkPhoneUSimStoreCaps);
   183 					}	
   189 					}	
   184 
   190 
   185 				if(phonebookStore.MatchF(iPhBkStore)!=0)// Not this PhBkStore type
   191 				if(phonebookStore.MatchF(iPhBkStore)!=0)// Not this PhBkStore type
   186 					continue;
   192 					continue;
   187 
   193 
   188 				ret0=CTestConfig::GetElement(item0->Value(),KStdDelimiter,1,phonebookName);
   194 				ret0=CTestConfig::GetElement(item0->Value(),KStdDelimiter,1,phonebookName);
   189 				if(ret0!=KErrNone)
   195 				if(ret0!=KErrNone)
   190 					{
   196 					{
   191 					iPhBkStoreCaps=KDefaultPhBkPhoneStoreCaps;
   197 					iPhBkStoreCaps=KDefaultPhBkPhoneStoreCaps;
   192 					LOGPARSERR("phonebookName",ret,1,&KPhBkPhoneUSimStoreCaps);
   198 					OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_6, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKNAME returned %d (element no. %d) from tag %s.",ret,1,KPhBkPhoneUSimStoreCaps);
   193 					}	
   199 					}	
   194 				
   200 				
   195 				if(phonebookName.MatchF(iPhBkStoreName)!=0)// Not this PhBkStoreName type
   201 				if(phonebookName.MatchF(iPhBkStoreName)!=0)// Not this PhBkStoreName type
   196 					continue;
   202 					continue;
   197 				
   203 				
   198 				ret0=CTestConfig::GetElement(item0->Value(),KStdDelimiter,2,value0);
   204 				ret0=CTestConfig::GetElement(item0->Value(),KStdDelimiter,2,value0);
   199 				if(ret0!=KErrNone)
   205 				if(ret0!=KErrNone)
   200 					{
   206 					{
   201 					iPhBkStoreCaps=KDefaultPhBkPhoneStoreCaps;
   207 					iPhBkStoreCaps=KDefaultPhBkPhoneStoreCaps;
   202 					LOGPARSERR("caps",ret,2,&KPhBkPhoneUSimStoreCaps);
   208 					OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_7, "WARNING - CONFIGURATION FILE PARSING - Reading element CAPS returned %d (element no. %d) from tag %s.",ret,2,KPhBkPhoneUSimStoreCaps);
   203 					}	
   209 					}	
   204 				else
   210 				else
   205 					{
   211 					{
   206 					TUint32 intValue;
   212 					TUint32 intValue;
   207 					TInt ret = AsciiToNum(value0, intValue);
   213 					TInt ret = AsciiToNum(value0, intValue);
   215 					}
   221 					}
   216 				
   222 				
   217 				}
   223 				}
   218 			}
   224 			}
   219 	}
   225 	}
   220 	LOGPHBK1("...Finished parsing Phonebook store additional config parameters...");
   226 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CONSTRUCTL_8, "...Finished parsing Phonebook store additional config parameters...");
   221 	}
   227 	}
   222 
   228 
   223 void CSimPhBkUSimStore::PopulateStoreFromConfigFileL()
   229 void CSimPhBkUSimStore::PopulateStoreFromConfigFileL()
   224 /**
   230 /**
   225  * Populate the Phonebook Store from information in the configuration file.  This is performed
   231  * Populate the Phonebook Store from information in the configuration file.  This is performed
   229  *
   235  *
   230  * The store entries comply to the following format:
   236  * The store entries comply to the following format:
   231  * "PhBkStoreEntry = <store name>, <slot number>, <telephone number>, <alphatag>"
   237  * "PhBkStoreEntry = <store name>, <slot number>, <telephone number>, <alphatag>"
   232  */
   238  */
   233 	{
   239 	{
   234 	LOGPHBK1("Starting to read Phonebook store entries...");
   240 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_1, "Starting to read Phonebook store entries...");
   235 	iPhBkIndividualPause=CfgFile()->ItemValue(KPhBkStoreIndividualReqPause,KDefaultPhBkStoreIndividualReqPause);
   241 	iPhBkIndividualPause=CfgFile()->ItemValue(KPhBkStoreIndividualReqPause,KDefaultPhBkStoreIndividualReqPause);
   236 	iPhBkBatchPause=CfgFile()->ItemValue(KPhBkStoreBatchReqPause,KDefaultPhBkStoreBatchReqPause);
   242 	iPhBkBatchPause=CfgFile()->ItemValue(KPhBkStoreBatchReqPause,KDefaultPhBkStoreBatchReqPause);
   237 
   243 
   238 	const CTestConfigItem* item=NULL;
   244 	const CTestConfigItem* item=NULL;
   239 	TInt ret=KErrNone;
   245 	TInt ret=KErrNone;
   254 		TInt index;
   260 		TInt index;
   255 		TUint8 npiTon;
   261 		TUint8 npiTon;
   256 		ret=GetPhBkUSimEntry(item,parseIndex,phonebookStore,phonebookName,aid,index,telNum,alphaTag,npiTon,alphaTag2);
   262 		ret=GetPhBkUSimEntry(item,parseIndex,phonebookStore,phonebookName,aid,index,telNum,alphaTag,npiTon,alphaTag2);
   257 		if(ret!=KErrNone)
   263 		if(ret!=KErrNone)
   258 			{
   264 			{
   259 			LOGPARSERR("Phonebook Entry",ret,index,&KPhBkUSimStoreEntry);
   265 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_2, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOK ENTRY returned %d (element no. %d) from tag %s.",ret,index,KPhBkUSimStoreEntry);
   260 			continue;
   266 			continue;
   261 			}
   267 			}
   262 
   268 
   263 		if(phonebookStore.MatchF(iPhBkStore)!=0)// Not this PhBkStore type
   269 		if(phonebookStore.MatchF(iPhBkStore)!=0)// Not this PhBkStore type
   264 			continue;
   270 			continue;
   298 		iPhBkUSimStoreEntries[index].iAlphaTag2.Copy(alphaTag2);
   304 		iPhBkUSimStoreEntries[index].iAlphaTag2.Copy(alphaTag2);
   299 	
   305 	
   300 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,additional);
   306 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,additional);
   301 		if(ret!=KErrNone)
   307 		if(ret!=KErrNone)
   302 			{
   308 			{
   303 			LOGPARSERR("additional",ret,parseIndex,&KPhBkUSimStoreEntry);
   309 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_3, "WARNING - CONFIGURATION FILE PARSING - Reading element ADDITIONAL returned %d (element no. %d) from tag %s.",ret,parseIndex,KPhBkUSimStoreEntry);
   304 			}
   310 			}
   305 		else
   311 		else
   306 			{	
   312 			{	
   307 			TPtrC8 myName,myNum;
   313 			TPtrC8 myName,myNum;
   308 			TUint8 myTon;
   314 			TUint8 myTon;
   325 			}
   331 			}
   326 	
   332 	
   327 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,emails);
   333 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,emails);
   328 		if(ret!=KErrNone)
   334 		if(ret!=KErrNone)
   329 			{
   335 			{
   330 			LOGPARSERR("emails",ret,parseIndex,&KPhBkUSimStoreEntry);
   336 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_4, "WARNING - CONFIGURATION FILE PARSING - Reading element EMAILS returned %d (element no. %d) from tag %s.",ret,parseIndex,KPhBkUSimStoreEntry);
   331 			}
   337 			}
   332 		else
   338 		else
   333 		{	
   339 		{	
   334 			TPtrC8 myemail;
   340 			TPtrC8 myemail;
   335 			TInt myindex=0;
   341 			TInt myindex=0;
   346 		}
   352 		}
   347 
   353 
   348 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,groups);
   354 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,groups);
   349 		if(ret!=KErrNone)
   355 		if(ret!=KErrNone)
   350 			{
   356 			{
   351 			LOGPARSERR("groups",ret,parseIndex,&KPhBkUSimStoreEntry);
   357 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_5, "WARNING - CONFIGURATION FILE PARSING - Reading element GROUPS returned %d (element no. %d) from tag %s.",ret,parseIndex,KPhBkUSimStoreEntry);
   352 			}
   358 			}
   353 		else
   359 		else
   354 		{	
   360 		{	
   355 
   361 
   356 			TPtrC8 mygroup;
   362 			TPtrC8 mygroup;
   370 
   376 
   371 		TBool hidden;
   377 		TBool hidden;
   372 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,hidden);
   378 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,hidden);
   373 		if(ret!=KErrNone)
   379 		if(ret!=KErrNone)
   374 			{
   380 			{
   375 			LOGPARSERR("emails",ret,parseIndex,&KPhBkUSimStoreEntry);
   381 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_6, "WARNING - CONFIGURATION FILE PARSING - Reading element EMAILS returned %d (element no. %d) from tag %s.",ret,parseIndex,KPhBkUSimStoreEntry);
   376 			}
   382 			}
   377 		else
   383 		else
   378 			iPhBkUSimStoreEntries[index].iHiddenEntry=hidden;
   384 			iPhBkUSimStoreEntries[index].iHiddenEntry=hidden;
   379 
   385 
   380 		}
   386 		}
   392 		TPtrC8 phonebookName, phonebookStore;
   398 		TPtrC8 phonebookName, phonebookStore;
   393 
   399 
   394 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,count);
   400 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,count);
   395 		if(ret!=KErrNone)
   401 		if(ret!=KErrNone)
   396 			{
   402 			{
   397 			LOGPARSERR("count",ret,0,&KPhBkError);
   403 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_7, "WARNING - CONFIGURATION FILE PARSING - Reading element COUNT returned %d (element no. %d) from tag %s.",ret,0,KPhBkError);
   398 			continue;
   404 			continue;
   399 			}
   405 			}
   400 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,error);
   406 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,error);
   401 		if(ret!=KErrNone)
   407 		if(ret!=KErrNone)
   402 			{
   408 			{
   403 			LOGPARSERR("error",ret,1,&KPhBkError);
   409 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_8, "WARNING - CONFIGURATION FILE PARSING - Reading element ERROR returned %d (element no. %d) from tag %s.",ret,1,KPhBkError);
   404 			continue;
   410 			continue;
   405 			}
   411 			}
   406 		
   412 		
   407 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,phonebookName);
   413 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,phonebookName);
   408 		if(ret!=KErrNone)
   414 		if(ret!=KErrNone)
   409 			{
   415 			{
   410 			LOGPARSERR("phonebookName",ret,2,&KPhBkError);
   416 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_9, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKNAME returned %d (element no. %d) from tag %s.",ret,2,KPhBkError);
   411 			continue;
   417 			continue;
   412 			}
   418 			}
   413 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,phonebookStore);
   419 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,phonebookStore);
   414 		if(ret!=KErrNone)
   420 		if(ret!=KErrNone)
   415 			{
   421 			{
   416 			LOGPARSERR("phonebookStore",ret,3,&KPhBkError);
   422 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_10, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKSTORE returned %d (element no. %d) from tag %s.",ret,3,KPhBkError);
   417 			//global phonebook error
   423 			//global phonebook error
   418 			continue;
   424 			continue;
   419 			}
   425 			}
   420 		
   426 		
   421 		if(phonebookName.MatchF(iPhBkStoreName)!=0)// Not this phonebook
   427 		if(phonebookName.MatchF(iPhBkStoreName)!=0)// Not this phonebook
   428 		entry.iError=error;
   434 		entry.iError=error;
   429 		TRAP_IGNORE(iPhBkError->AppendL(entry));
   435 		TRAP_IGNORE(iPhBkError->AppendL(entry));
   430 		}
   436 		}
   431 	PopulateOOBWrite();
   437 	PopulateOOBWrite();
   432 	PopulateOOBDelete();
   438 	PopulateOOBDelete();
   433 	LOGPHBK1("...Finished reading Phonebook store entries...");
   439 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATESTOREFROMCONFIGFILEL_11, "...Finished reading Phonebook store entries...");
   434 
   440 
   435 	if(iPhBkOOBWriteDuration!=-1)
   441 	if(iPhBkOOBWriteDuration!=-1)
   436 		iOOBWriteTimer->Start(iPhBkOOBWriteDuration,this,ETimerIdPhBkUSimStorOOBWrite);
   442 		iOOBWriteTimer->Start(iPhBkOOBWriteDuration,this,ETimerIdPhBkUSimStorOOBWrite);
   437 	if(iPhBkOOBDeleteDuration!=-1)
   443 	if(iPhBkOOBDeleteDuration!=-1)
   438 		iOOBDeleteTimer->Start(iPhBkOOBDeleteDuration,this,ETimerIdPhBkUSimStorOOBDelete);
   444 		iOOBDeleteTimer->Start(iPhBkOOBDeleteDuration,this,ETimerIdPhBkUSimStorOOBDelete);
   454 
   460 
   455 	TInt count;
   461 	TInt count;
   456 	TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,count);
   462 	TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,count);
   457 	if(ret!=KErrNone)
   463 	if(ret!=KErrNone)
   458 		{
   464 		{
   459 		LOGPARSERR("count",ret,parseIndex,&KOOBPhBkUSimWrite);
   465 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBWRITE_1, "WARNING - CONFIGURATION FILE PARSING - Reading element COUNT returned %d (element no. %d) from tag %s.",ret,parseIndex,KOOBPhBkUSimWrite);
   460 		return;
   466 		return;
   461 		}
   467 		}
   462 
   468 
   463 	TPtrC8 phonebookStore,aid, phonebookName,alphaTag,telNum,alphaTag2,emails, groups, additional;
   469 	TPtrC8 phonebookStore,aid, phonebookName,alphaTag,telNum,alphaTag2,emails, groups, additional;
   464 	TInt index;
   470 	TInt index;
   465 	TUint8 npiTon;
   471 	TUint8 npiTon;
   466 	ret=GetPhBkUSimEntry(item,parseIndex,phonebookStore,phonebookName,aid,index,telNum,alphaTag,npiTon,alphaTag2);
   472 	ret=GetPhBkUSimEntry(item,parseIndex,phonebookStore,phonebookName,aid,index,telNum,alphaTag,npiTon,alphaTag2);
   467 	if(ret!=KErrNone)
   473 	if(ret!=KErrNone)
   468 		{
   474 		{
   469 		LOGPARSERR("Phonebook Entry",ret,parseIndex,&KOOBPhBkUSimWrite);
   475 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBWRITE_2, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOK ENTRY returned %d (element no. %d) from tag %s.",ret,parseIndex,KOOBPhBkUSimWrite);
   470 		return;
   476 		return;
   471 		}
   477 		}
   472 
   478 
   473 	if(phonebookStore.MatchF(iPhBkStore)!=0)// Not this PhBkStore type
   479 	if(phonebookStore.MatchF(iPhBkStore)!=0)// Not this PhBkStore type
   474 		return;
   480 		return;
   483 	iPhBkOOBWrite.iAlphaTag2.Copy(alphaTag2);
   489 	iPhBkOOBWrite.iAlphaTag2.Copy(alphaTag2);
   484 
   490 
   485 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,additional);
   491 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,additional);
   486 	if(ret!=KErrNone)
   492 	if(ret!=KErrNone)
   487 		{
   493 		{
   488 		LOGPARSERR("additional",ret,parseIndex,&KOOBPhBkUSimWrite);
   494 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBWRITE_3, "WARNING - CONFIGURATION FILE PARSING - Reading element ADDITIONAL returned %d (element no. %d) from tag %s.",ret,parseIndex,KOOBPhBkUSimWrite);
   489 		}
   495 		}
   490 	else
   496 	else
   491 	{	
   497 	{	
   492 		TPtrC8 myName,myNum;
   498 		TPtrC8 myName,myNum;
   493 		TUint8 myTon;
   499 		TUint8 myTon;
   510 	}
   516 	}
   511 
   517 
   512 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,groups);
   518 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,groups);
   513 	if(ret!=KErrNone)
   519 	if(ret!=KErrNone)
   514 		{
   520 		{
   515 		LOGPARSERR("groups",ret,parseIndex,&KOOBPhBkUSimWrite);
   521 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBWRITE_4, "WARNING - CONFIGURATION FILE PARSING - Reading element GROUPS returned %d (element no. %d) from tag %s.",ret,parseIndex,KOOBPhBkUSimWrite);
   516 		}
   522 		}
   517 	else
   523 	else
   518 	{	
   524 	{	
   519 		TPtrC8 mygroup;
   525 		TPtrC8 mygroup;
   520 		TInt myindex=0;
   526 		TInt myindex=0;
   533 	}
   539 	}
   534 
   540 
   535 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,emails);
   541 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,parseIndex++,emails);
   536 	if(ret!=KErrNone)
   542 	if(ret!=KErrNone)
   537 		{
   543 		{
   538 		LOGPARSERR("emails",ret,parseIndex,&KOOBPhBkUSimWrite);
   544 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBWRITE_5, "WARNING - CONFIGURATION FILE PARSING - Reading element EMAILS returned %d (element no. %d) from tag %s.",ret,parseIndex,KOOBPhBkUSimWrite);
   539 		}
   545 		}
   540 	else
   546 	else
   541 	{	
   547 	{	
   542 		TPtrC8 myemail;
   548 		TPtrC8 myemail;
   543 		TInt myindex=0;
   549 		TInt myindex=0;
   573 
   579 
   574 	TInt count;
   580 	TInt count;
   575 	TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,count);
   581 	TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,count);
   576 	if(ret!=KErrNone)
   582 	if(ret!=KErrNone)
   577 		{
   583 		{
   578 		LOGPARSERR("count",ret,0,&KOOBPhBkUSimDelete);
   584 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBDELETE_1, "WARNING - CONFIGURATION FILE PARSING - Reading element COUNT returned %d (element no. %d) from tag %s.",ret,0,KOOBPhBkUSimDelete);
   579 		return;
   585 		return;
   580 		}
   586 		}
   581 
   587 
   582 	TPtrC8 phonebookName, phonebookStore;
   588 	TPtrC8 phonebookName, phonebookStore;
   583 		
   589 		
   584 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,phonebookStore);
   590 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,phonebookStore);
   585 	if(ret!=KErrNone)
   591 	if(ret!=KErrNone)
   586 		{
   592 		{
   587 		LOGPARSERR("phonebookStore",ret,1,&KOOBPhBkUSimDelete);
   593 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBDELETE_2, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKSTORE returned %d (element no. %d) from tag %s.",ret,1,KOOBPhBkUSimDelete);
   588 		return;
   594 		return;
   589 		}
   595 		}
   590 
   596 
   591 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,phonebookName);
   597 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,phonebookName);
   592 	if(ret!=KErrNone)
   598 	if(ret!=KErrNone)
   593 		{
   599 		{
   594 		LOGPARSERR("phonebookName",ret,2,&KOOBPhBkUSimDelete);
   600 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBDELETE_3, "WARNING - CONFIGURATION FILE PARSING - Reading element PHONEBOOKNAME returned %d (element no. %d) from tag %s.",ret,2,KOOBPhBkUSimDelete);
   595 		return;
   601 		return;
   596 		}
   602 		}
   597 
   603 
   598 	if(phonebookStore.MatchF(iPhBkStore)!=0)
   604 	if(phonebookStore.MatchF(iPhBkStore)!=0)
   599 		return;						// Not this store
   605 		return;						// Not this store
   602 
   608 
   603 	TInt index;
   609 	TInt index;
   604 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,index);
   610 	ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,index);
   605 	if(ret!=KErrNone)
   611 	if(ret!=KErrNone)
   606 		{
   612 		{
   607 		LOGPARSERR("index",ret,3,&KOOBPhBkUSimDelete);
   613 		OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_POPULATEOOBDELETE_4, "WARNING - CONFIGURATION FILE PARSING - Reading element INDEX returned %d (element no. %d) from tag %s.",ret,3,KOOBPhBkUSimDelete);
   608 		return;
   614 		return;
   609 		}
   615 		}
   610 
   616 
   611 	iPhBkOOBDeleteDuration=count;
   617 	iPhBkOOBDeleteDuration=count;
   612 	iPhBkOOBDeleteIndex=index;
   618 	iPhBkOOBDeleteIndex=index;
  1542 			break;
  1548 			break;
  1543 
  1549 
  1544 		case RMobilePhoneBookStore::ETagPBText:
  1550 		case RMobilePhoneBookStore::ETagPBText:
  1545 			ret=iPhBkRwBuffer->GetValue(alphaTag);
  1551 			ret=iPhBkRwBuffer->GetValue(alphaTag);
  1546 
  1552 
  1547 			LOGPHBK2("alphaTag (ETagPBText) Length = (%d)",alphaTag.Length());
  1553 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_1, "alphaTag (ETagPBText) Length = (%d)",alphaTag.Length());
  1548 			LOGPHBK2("Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1554 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_2, "Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1549 
  1555 
  1550 			if(!additional && ret==KErrNone && (alphaTag.Length()<=iPhBkMaxTextLen))
  1556 			if(!additional && ret==KErrNone && (alphaTag.Length()<=iPhBkMaxTextLen))
  1551 				iPhBkUSimStoreEntries[index].iAlphaTag.Copy(alphaTag);
  1557 				iPhBkUSimStoreEntries[index].iAlphaTag.Copy(alphaTag);
  1552 			else if(additional && ret==KErrNone && (alphaTag.Length()<=iPhBkMaxAdditionalTextLen)
  1558 			else if(additional && ret==KErrNone && (alphaTag.Length()<=iPhBkMaxAdditionalTextLen)
  1553 					&& (additionalCount<iPhBkAdditional))
  1559 					&& (additionalCount<iPhBkAdditional))
  1559 			break;
  1565 			break;
  1560 
  1566 
  1561 		case RMobilePhoneBookStore::ETagPBSecondName:
  1567 		case RMobilePhoneBookStore::ETagPBSecondName:
  1562 			ret=iPhBkRwBuffer->GetValue(alphaTag2);
  1568 			ret=iPhBkRwBuffer->GetValue(alphaTag2);
  1563 
  1569 
  1564 			LOGPHBK2("alphaTag2 (ETagPBSecondName) Length = (%d)",alphaTag2.Length());
  1570 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_3, "alphaTag2 (ETagPBSecondName) Length = (%d)",alphaTag2.Length());
  1565 			LOGPHBK2("Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1571 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_4, "Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1566 
  1572 
  1567 			if(ret==KErrNone && (alphaTag2.Length()<=iPhBkMaxTextLen))
  1573 			if(ret==KErrNone && (alphaTag2.Length()<=iPhBkMaxTextLen))
  1568 				iPhBkUSimStoreEntries[index].iAlphaTag2.Copy(alphaTag2);
  1574 				iPhBkUSimStoreEntries[index].iAlphaTag2.Copy(alphaTag2);
  1569 			else
  1575 			else
  1570 				ret=EXTENDEDERROR(KErrOverflow, KErrPhonebookSecondNameTextOverflow);
  1576 				ret=EXTENDEDERROR(KErrOverflow, KErrPhonebookSecondNameTextOverflow);
  1571 			break;
  1577 			break;
  1572 
  1578 
  1573 		case RMobilePhoneBookStore::ETagPBNumber:
  1579 		case RMobilePhoneBookStore::ETagPBNumber:
  1574 			ret=iPhBkRwBuffer->GetValue(telNum);
  1580 			ret=iPhBkRwBuffer->GetValue(telNum);
  1575 
  1581 
  1576 			LOGPHBK2("telNum (ETagPBNumber) Length = (%d)",telNum.Length());
  1582 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_5, "telNum (ETagPBNumber) Length = (%d)",telNum.Length());
  1577 			LOGPHBK2("Phonebook Max Text Length = (%d)",iPhBkMaxTelNumLen);
  1583 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_6, "Phonebook Max Text Length = (%d)",iPhBkMaxTelNumLen);
  1578 
  1584 
  1579 			if(!additional && ret==KErrNone && (telNum.Length()<=iPhBkMaxTelNumLen))
  1585 			if(!additional && ret==KErrNone && (telNum.Length()<=iPhBkMaxTelNumLen))
  1580 				iPhBkUSimStoreEntries[index].iTelNum.Copy(telNum);
  1586 				iPhBkUSimStoreEntries[index].iTelNum.Copy(telNum);
  1581 			else if(additional && ret==KErrNone && (telNum.Length()<=iPhBkMaxAdditionalTelNumLen)
  1587 			else if(additional && ret==KErrNone && (telNum.Length()<=iPhBkMaxAdditionalTelNumLen)
  1582 					&& (additionalCount<iPhBkAdditional))
  1588 					&& (additionalCount<iPhBkAdditional))
  1611 			break;
  1617 			break;
  1612 
  1618 
  1613 		case RMobilePhoneBookStore::ETagPBGroupName:
  1619 		case RMobilePhoneBookStore::ETagPBGroupName:
  1614 			ret=iPhBkRwBuffer->GetValue(bufPtr);
  1620 			ret=iPhBkRwBuffer->GetValue(bufPtr);
  1615 
  1621 
  1616 			LOGPHBK2("bufPtr (ETagPBGroupName) Length = (%d)",bufPtr.Length());
  1622 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_7, "bufPtr (ETagPBGroupName) Length = (%d)",bufPtr.Length());
  1617 			LOGPHBK2("Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1623 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_8, "Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1618 
  1624 
  1619 			if(ret==KErrNone && (bufPtr.Length()<=iPhBkMaxTextLen)
  1625 			if(ret==KErrNone && (bufPtr.Length()<=iPhBkMaxTextLen)
  1620 				&& (iPhBkUSimStoreEntries[index].iGroups->Count() < KMaxGroups))
  1626 				&& (iPhBkUSimStoreEntries[index].iGroups->Count() < KMaxGroups))
  1621 			{
  1627 			{
  1622 				TRAP_IGNORE(iPhBkUSimStoreEntries[index].iGroups->AppendL(bufPtr));
  1628 				TRAP_IGNORE(iPhBkUSimStoreEntries[index].iGroups->AppendL(bufPtr));
  1626 			break;
  1632 			break;
  1627 
  1633 
  1628 		case RMobilePhoneBookStore::ETagPBEmailAddress:
  1634 		case RMobilePhoneBookStore::ETagPBEmailAddress:
  1629 			ret=iPhBkRwBuffer->GetValue(bufPtr);
  1635 			ret=iPhBkRwBuffer->GetValue(bufPtr);
  1630 
  1636 
  1631 			LOGPHBK2("bufPtr (ETagPBEmailAddress) Length = (%d)",bufPtr.Length());
  1637 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_9, "bufPtr (ETagPBEmailAddress) Length = (%d)",bufPtr.Length());
  1632 			LOGPHBK2("Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1638 			OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_WRITE_10, "Phonebook Max Text Length = (%d)",iPhBkMaxTextLen);
  1633 
  1639 
  1634 			if(ret==KErrNone && (bufPtr.Length()<=iPhBkMaxTextLen)
  1640 			if(ret==KErrNone && (bufPtr.Length()<=iPhBkMaxTextLen)
  1635 				&& (iPhBkUSimStoreEntries[index].iEmails->Count() < iPhBkMaxEmail))
  1641 				&& (iPhBkUSimStoreEntries[index].iEmails->Count() < iPhBkMaxEmail))
  1636 			{
  1642 			{
  1637 				TRAP_IGNORE(iPhBkUSimStoreEntries[index].iEmails->AppendL(bufPtr));
  1643 				TRAP_IGNORE(iPhBkUSimStoreEntries[index].iEmails->AppendL(bufPtr));
  2064 		//bad address 0xdededede (investigating)
  2070 		//bad address 0xdededede (investigating)
  2065 	
  2071 	
  2066 		TRAPD(err,iPhBkUSimStoreEntries[iPhBkOOBWriteIndex].iAdditional=new(ELeave) CArrayFixFlat<TPhBkStoreEntry>(iPhBkAdditional+1));
  2072 		TRAPD(err,iPhBkUSimStoreEntries[iPhBkOOBWriteIndex].iAdditional=new(ELeave) CArrayFixFlat<TPhBkStoreEntry>(iPhBkAdditional+1));
  2067 		if (err!=KErrNone)
  2073 		if (err!=KErrNone)
  2068 			{
  2074 			{
  2069 			LOGPHBK1("CSimPhBkUSimStore::TimerCallBack - Memory Allocation Failure");
  2075 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_TIMERCALLBACK_1, "CSimPhBkUSimStore::TimerCallBack - Memory Allocation Failure");
  2070 			return;
  2076 			return;
  2071 			}
  2077 			}
  2072 
  2078 
  2073 		for(idx=0;idx<count;idx++)
  2079 		for(idx=0;idx<count;idx++)
  2074 			{
  2080 			{
  2078 
  2084 
  2079 		
  2085 		
  2080 		TRAP(err,iPhBkUSimStoreEntries[iPhBkOOBWriteIndex].iGroups=new(ELeave) CArrayFixFlat<TPhBkUSimGroup>(KMaxGroups));
  2086 		TRAP(err,iPhBkUSimStoreEntries[iPhBkOOBWriteIndex].iGroups=new(ELeave) CArrayFixFlat<TPhBkUSimGroup>(KMaxGroups));
  2081 		if (err!=KErrNone)
  2087 		if (err!=KErrNone)
  2082 			{
  2088 			{
  2083 			LOGPHBK1("CSimPhBkUSimStore::TimerCallBack - Memory Allocation Failure");
  2089 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_TIMERCALLBACK_2, "CSimPhBkUSimStore::TimerCallBack - Memory Allocation Failure");
  2084 			return;
  2090 			return;
  2085 			}
  2091 			}
  2086 
  2092 
  2087 		for(idx=0;idx<count;idx++)
  2093 		for(idx=0;idx<count;idx++)
  2088 			{
  2094 			{
  2092 		
  2098 		
  2093 		count = iPhBkOOBWrite.iEmails->Count();
  2099 		count = iPhBkOOBWrite.iEmails->Count();
  2094 		TRAP(err,iPhBkUSimStoreEntries[iPhBkOOBWriteIndex].iEmails=new(ELeave) CArrayFixFlat<TPhBkUSimEmail>(iPhBkMaxEmail+1));	
  2100 		TRAP(err,iPhBkUSimStoreEntries[iPhBkOOBWriteIndex].iEmails=new(ELeave) CArrayFixFlat<TPhBkUSimEmail>(iPhBkMaxEmail+1));	
  2095 		if (err!=KErrNone)
  2101 		if (err!=KErrNone)
  2096 			{
  2102 			{
  2097 			LOGPHBK1("CSimPhBkUSimStore::TimerCallBack - Memory Allocation Failure");
  2103 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_TIMERCALLBACK_3, "CSimPhBkUSimStore::TimerCallBack - Memory Allocation Failure");
  2098 			return;
  2104 			return;
  2099 			}
  2105 			}
  2100 
  2106 
  2101 		for(idx=0;idx<count;idx++)
  2107 		for(idx=0;idx<count;idx++)
  2102 			{
  2108 			{
  2290 * Returns a pointer to the config file section
  2296 * Returns a pointer to the config file section
  2291 *
  2297 *
  2292 * @return CTestConfigSection a pointer to the configuration file data section
  2298 * @return CTestConfigSection a pointer to the configuration file data section
  2293 */
  2299 */
  2294 	{
  2300 	{
  2295 	LOGPHBK1(">>CSimPhBkUSimStore::CfgFile");
  2301 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHBKUSIMSTORE_CFGFILE_1, ">>CSimPhBkUSimStore::CfgFile");
  2296 	return iPhone->CfgFile();
  2302 	return iPhone->CfgFile();
  2297 	}
  2303 	}