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