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 "CSimSmsStoreTraces.h" |
|
27 #endif |
|
28 |
22 #include <mmlist.h> |
29 #include <mmlist.h> |
23 #include <mmretrieve.h> |
30 #include <mmretrieve.h> |
24 #include <testconfigfileparser.h> |
31 #include <testconfigfileparser.h> |
25 #include "CSimSmsStore.h" |
32 #include "CSimSmsStore.h" |
26 #include "csimsmsmess.h" |
33 #include "csimsmsmess.h" |
27 #include "Simlog.h" |
|
28 #include "CSimTsyMode.h" |
34 #include "CSimTsyMode.h" |
29 |
35 |
30 const TInt KSmsStoreGranularity=2; |
36 const TInt KSmsStoreGranularity=2; |
31 const TInt KCorruptPDU=9999; |
37 const TInt KCorruptPDU=9999; |
32 _LIT(KNullTelephoneNumber,"0"); |
38 _LIT(KNullTelephoneNumber,"0"); |
124 { |
130 { |
125 iGsmSmsStoreEntries=new(ELeave) RMobileSmsStore::TMobileGsmSmsEntryV1[aMaxNumSlots+1];//index 0 is not used |
131 iGsmSmsStoreEntries=new(ELeave) RMobileSmsStore::TMobileGsmSmsEntryV1[aMaxNumSlots+1];//index 0 is not used |
126 iSmsMaxNumSlots=aMaxNumSlots; |
132 iSmsMaxNumSlots=aMaxNumSlots; |
127 iSmsStoreName.Copy(aName); |
133 iSmsStoreName.Copy(aName); |
128 iSmsReadAll=new(ELeave) CArrayPtrFlat<CListReadAllAttempt>(KSmsStoreGranularity); |
134 iSmsReadAll=new(ELeave) CArrayPtrFlat<CListReadAllAttempt>(KSmsStoreGranularity); |
129 LOGSMS1("Starting to parse SMS Store config parameters..."); |
135 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_CONSTRUCTL_1, "Starting to parse SMS Store config parameters..."); |
130 iSmsIndividualPause=CfgFileSection()->ItemValue(KSmsStoreIndividualReqPause,KDefaultSmsStoreIndividualReqPause); |
136 iSmsIndividualPause=CfgFileSection()->ItemValue(KSmsStoreIndividualReqPause,KDefaultSmsStoreIndividualReqPause); |
131 iSmsBatchPause=CfgFileSection()->ItemValue(KSmsStoreBatchReqPause,KDefaultSmsStoreBatchReqPause); |
137 iSmsBatchPause=CfgFileSection()->ItemValue(KSmsStoreBatchReqPause,KDefaultSmsStoreBatchReqPause); |
132 |
138 |
133 const CTestConfigItem* item0=NULL; |
139 const CTestConfigItem* item0=NULL; |
134 item0=CfgFileSection()->Item(KSmsPhoneStoreCaps,0); |
140 item0=CfgFileSection()->Item(KSmsPhoneStoreCaps,0); |
168 * |
174 * |
169 * The store entries comply to the following format: |
175 * The store entries comply to the following format: |
170 * "SmsStoreEntry = <store name>, <slot number>, <entry status>, <pdu>" |
176 * "SmsStoreEntry = <store name>, <slot number>, <entry status>, <pdu>" |
171 */ |
177 */ |
172 { |
178 { |
173 LOGSMS1("Starting reading SMS Store entries..."); |
179 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_POPULATESTOREFROMCONFIGFILE_1, "Starting reading SMS Store entries..."); |
174 TInt count=CfgFileSection()->ItemCount(KSmsStoreEntry); |
180 TInt count=CfgFileSection()->ItemCount(KSmsStoreEntry); |
175 const CTestConfigItem* item=NULL; |
181 const CTestConfigItem* item=NULL; |
176 TInt ret=KErrNone; |
182 TInt ret=KErrNone; |
177 |
183 |
178 for(TInt i=0;i<count;i++) |
184 for(TInt i=0;i<count;i++) |
183 |
189 |
184 TPtrC8 storeName; |
190 TPtrC8 storeName; |
185 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,storeName); |
191 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,storeName); |
186 if(ret!=KErrNone) |
192 if(ret!=KErrNone) |
187 { |
193 { |
188 LOGPARSERR("storeName",ret,0,&KSmsStoreEntry); |
194 OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_POPULATESTOREFROMCONFIGFILE_2, "WARNING - CONFIGURATION FILE PARSING - Reading element STORENAME returned %d (element no. %d) from tag %s.",ret,0,KSmsStoreEntry); |
189 continue; |
195 continue; |
190 } |
196 } |
191 if(storeName.MatchF(iSmsStoreName)!=0) |
197 if(storeName.MatchF(iSmsStoreName)!=0) |
192 continue; // Not this store |
198 continue; // Not this store |
193 |
199 |
194 TInt index,stat; |
200 TInt index,stat; |
195 TPtrC8 pdu; |
201 TPtrC8 pdu; |
196 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,index); |
202 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,index); |
197 if((ret!=KErrNone)||(index>=iSmsMaxNumSlots)) |
203 if((ret!=KErrNone)||(index>=iSmsMaxNumSlots)) |
198 { |
204 { |
199 LOGPARSERR("index",ret,1,&KSmsStoreEntry); |
205 OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_POPULATESTOREFROMCONFIGFILE_3, "WARNING - CONFIGURATION FILE PARSING - Reading element INDEX returned %d (element no. %d) from tag %s.",ret,1,KSmsStoreEntry); |
200 continue; |
206 continue; |
201 } |
207 } |
202 |
208 |
203 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,stat); |
209 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,stat); |
204 if(ret!=KErrNone) |
210 if(ret!=KErrNone) |
205 { |
211 { |
206 LOGPARSERR("stat",ret,2,&KSmsStoreEntry); |
212 OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_POPULATESTOREFROMCONFIGFILE_4, "WARNING - CONFIGURATION FILE PARSING - Reading element STAT returned %d (element no. %d) from tag %s",ret,2,KSmsStoreEntry); |
207 continue; |
213 continue; |
208 } |
214 } |
209 |
215 |
210 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,pdu); |
216 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,pdu); |
211 if(ret!=KErrNone) |
217 if(ret!=KErrNone) |
212 { |
218 { |
213 LOGPARSERR("pdu",ret,3,&KSmsStoreEntry); |
219 OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_POPULATESTOREFROMCONFIGFILE_5, "WARNING - CONFIGURATION FILE PARSING - Reading element PDU returned %d (element no. %d) from tag %s.",ret,3,KSmsStoreEntry); |
214 continue; |
220 continue; |
215 } |
221 } |
216 |
222 |
217 TPtrC8 sca; |
223 TPtrC8 sca; |
218 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,sca); |
224 ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,sca); |
219 if(ret!=KErrNone) |
225 if(ret!=KErrNone) |
220 { |
226 { |
221 LOGPARSERR("sca",ret,4,&KSmsStoreEntry); |
227 OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_POPULATESTOREFROMCONFIGFILE_6, "WARNING - CONFIGURATION FILE PARSING - Reading element SCA returned %d (element no. %d) from tag %s.",ret,4,KSmsStoreEntry); |
222 continue; |
228 continue; |
223 } |
229 } |
224 iGsmSmsStoreEntries[index].iIndex=index; |
230 iGsmSmsStoreEntries[index].iIndex=index; |
225 iGsmSmsStoreEntries[index].iMsgStatus=(RMobileSmsStore::TMobileSmsStoreStatus)stat; |
231 iGsmSmsStoreEntries[index].iMsgStatus=(RMobileSmsStore::TMobileSmsStoreStatus)stat; |
226 ConvertAsciiSms(pdu,iGsmSmsStoreEntries[index].iMsgData); |
232 ConvertAsciiSms(pdu,iGsmSmsStoreEntries[index].iMsgData); |
227 RecordSca(sca, index); |
233 RecordSca(sca, index); |
228 } |
234 } |
229 |
235 |
230 LOGSMS1("...Finished reading SMS Store entries"); |
236 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMSMSSTORE_POPULATESTOREFROMCONFIGFILE_7, "...Finished reading SMS Store entries"); |
231 } |
237 } |
232 |
238 |
233 |
239 |
234 |
240 |
235 void CSimSmsStore::RecordSca(const TDesC8& aAsciiAddr, TInt aIndex) |
241 void CSimSmsStore::RecordSca(const TDesC8& aAsciiAddr, TInt aIndex) |