130 resource ID |
135 resource ID |
131 @capability WriteUserData |
136 @capability WriteUserData |
132 */ |
137 */ |
133 EXPORT_C void CSmsEventLogger::ChangeEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage, const TTime* aTime, const TLogSmsPduData& aData, TInt* aStatusId) |
138 EXPORT_C void CSmsEventLogger::ChangeEvent(TRequestStatus& aStatus,const CSmsMessage& aSmsMessage, const TTime* aTime, const TLogSmsPduData& aData, TInt* aStatusId) |
134 { |
139 { |
135 LOGSMSU1("CSmsEventLogger::ChangeEvent"); |
140 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CSMSEVENTLOGGER_CHANGEEVENT_1, "CSmsEventLogger::ChangeEvent"); |
136 |
141 |
137 __ASSERT_DEBUG(iState==ESmsEventLoggerIdle,SmsuPanic(KSmsuPanicUnexpectedState)); |
142 __ASSERT_DEBUG(iState==ESmsEventLoggerIdle,SmsuPanic(KSmsuPanicUnexpectedState)); |
138 __ASSERT_DEBUG(aSmsMessage.LogServerId()==iLogEvent->Id(),SmsuPanic(KSmsuPanicWrongLogServerId)); |
143 __ASSERT_DEBUG(aSmsMessage.LogServerId()==iLogEvent->Id(),SmsuPanic(KSmsuPanicWrongLogServerId)); |
139 __ASSERT_DEBUG(iSmsPDUData.iType==aSmsMessage.Type(),SmsuPanic(ESmsuUnexpectedSmsPDUType)); |
144 __ASSERT_DEBUG(iSmsPDUData.iType==aSmsMessage.Type(),SmsuPanic(ESmsuUnexpectedSmsPDUType)); |
140 iState=ESmsEventLoggerChangingEvent; |
145 iState=ESmsEventLoggerChangingEvent; |
300 switch (aSmsMessage.Type()) |
305 switch (aSmsMessage.Type()) |
301 { |
306 { |
302 // Incoming SMS |
307 // Incoming SMS |
303 case CSmsPDU::ESmsDeliver: |
308 case CSmsPDU::ESmsDeliver: |
304 { |
309 { |
305 LOGSMSU1("DoAddEventL ESmsDeliver"); |
310 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_DOADDEVENTL_2, "DoAddEventL ESmsDeliver"); |
306 GetStringL(direction,R_LOG_DIR_IN); |
311 GetStringL(direction,R_LOG_DIR_IN); |
307 break; |
312 break; |
308 } |
313 } |
309 case CSmsPDU::ESmsStatusReport: |
314 case CSmsPDU::ESmsStatusReport: |
310 { |
315 { |
311 LOGSMSU1("DoAddEventL ESmsStatusReport"); |
316 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_DOADDEVENTL_3, "DoAddEventL ESmsStatusReport"); |
312 GetStringL(direction,R_LOG_DIR_IN); |
317 GetStringL(direction,R_LOG_DIR_IN); |
313 break; |
318 break; |
314 } |
319 } |
315 // Outgoing SMS |
320 // Outgoing SMS |
316 case CSmsPDU::ESmsSubmit: |
321 case CSmsPDU::ESmsSubmit: |
317 { |
322 { |
318 LOGSMSU1("DoAddEventL ESmsSubmit"); |
323 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_DOADDEVENTL_4, "DoAddEventL ESmsSubmit"); |
319 GetStringL(direction,R_LOG_DIR_OUT); |
324 GetStringL(direction,R_LOG_DIR_OUT); |
320 break; |
325 break; |
321 } |
326 } |
322 case CSmsPDU::ESmsCommand: |
327 case CSmsPDU::ESmsCommand: |
323 { |
328 { |
324 LOGSMSU1("DoAddEventL ESmsCommand"); |
329 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_DOADDEVENTL_5, "DoAddEventL ESmsCommand"); |
325 GetStringL(direction,R_LOG_DIR_OUT); |
330 GetStringL(direction,R_LOG_DIR_OUT); |
326 break; |
331 break; |
327 } |
332 } |
328 default: |
333 default: |
329 { |
334 { |
330 LOGSMSU1("DoAddEventL ESmsuUnexpectedSmsPDUType"); |
335 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_DOADDEVENTL_6, "DoAddEventL ESmsuUnexpectedSmsPDUType"); |
331 SmsuPanic(ESmsuUnexpectedSmsPDUType); |
336 SmsuPanic(ESmsuUnexpectedSmsPDUType); |
332 } |
337 } |
333 } |
338 } |
334 |
339 |
335 Event().SetDirection(direction); |
340 Event().SetDirection(direction); |
368 // Incoming SMS |
373 // Incoming SMS |
369 case CSmsPDU::ESmsDeliver: |
374 case CSmsPDU::ESmsDeliver: |
370 { |
375 { |
371 if (iSmsPDUData.iTotal==iSmsPDUData.iReceived) |
376 if (iSmsPDUData.iTotal==iSmsPDUData.iReceived) |
372 { |
377 { |
373 LOGSMSU1("SetDataL ESmsDeliver R_LOG_DEL_DONE"); |
378 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_2, "SetDataL ESmsDeliver R_LOG_DEL_DONE"); |
374 GetStringL(status,R_LOG_DEL_DONE); |
379 GetStringL(status,R_LOG_DEL_DONE); |
375 } |
380 } |
376 else if (iSmsPDUData.iTotal>iSmsPDUData.iReceived) |
381 else if (iSmsPDUData.iTotal>iSmsPDUData.iReceived) |
377 { |
382 { |
378 LOGSMSU1("SetDataL ESmsDeliver R_LOG_DEL_PENDING"); |
383 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_3, "SetDataL ESmsDeliver R_LOG_DEL_PENDING"); |
379 GetStringL(status,R_LOG_DEL_PENDING); |
384 GetStringL(status,R_LOG_DEL_PENDING); |
380 } |
385 } |
381 break; |
386 break; |
382 } |
387 } |
383 case CSmsPDU::ESmsStatusReport: |
388 case CSmsPDU::ESmsStatusReport: |
384 { |
389 { |
385 if (iSmsPDUData.iTotal==iSmsPDUData.iReceived) |
390 if (iSmsPDUData.iTotal==iSmsPDUData.iReceived) |
386 { |
391 { |
387 LOGSMSU1("SetDataL ESmsStatusReport R_LOG_DEL_DONE"); |
392 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_4, "SetDataL ESmsStatusReport R_LOG_DEL_DONE"); |
388 GetStringL(status,R_LOG_DEL_DONE); |
393 GetStringL(status,R_LOG_DEL_DONE); |
389 } |
394 } |
390 else if (iSmsPDUData.iTotal>iSmsPDUData.iReceived) |
395 else if (iSmsPDUData.iTotal>iSmsPDUData.iReceived) |
391 { |
396 { |
392 LOGSMSU1("SetDataL ESmsStatusReport R_LOG_DEL_PENDING"); |
397 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_5, "SetDataL ESmsStatusReport R_LOG_DEL_PENDING"); |
393 GetStringL(status,R_LOG_DEL_PENDING); |
398 GetStringL(status,R_LOG_DEL_PENDING); |
394 } |
399 } |
395 break; |
400 break; |
396 } |
401 } |
397 // Outgoing SMS |
402 // Outgoing SMS |
413 { |
418 { |
414 if (iSmsPDUData.iSent==0) |
419 if (iSmsPDUData.iSent==0) |
415 { |
420 { |
416 // None sent yet |
421 // None sent yet |
417 GetStringL(status,R_LOG_DEL_NOT_SENT); |
422 GetStringL(status,R_LOG_DEL_NOT_SENT); |
418 LOGSMSU1("SetDataL ESmsSubmit R_LOG_DEL_NOT_SENT SR"); |
423 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_6, "SetDataL ESmsSubmit R_LOG_DEL_NOT_SENT SR"); |
419 } |
424 } |
420 else if (iSmsPDUData.iTotal==iSmsPDUData.iDelivered) |
425 else if (iSmsPDUData.iTotal==iSmsPDUData.iDelivered) |
421 { |
426 { |
422 // All have been delivered |
427 // All have been delivered |
423 LOGSMSU2("SetDataL ESmsSubmit R_LOG_DEL_DONE SR iSmsPDUData.iDelivered=%d", iSmsPDUData.iDelivered); |
428 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_7, "SetDataL ESmsSubmit R_LOG_DEL_DONE SR iSmsPDUData.iDelivered=%d", iSmsPDUData.iDelivered); |
424 GetStringL(status,R_LOG_DEL_DONE); |
429 GetStringL(status,R_LOG_DEL_DONE); |
425 } |
430 } |
426 else if (iSmsPDUData.iSent<=iSmsPDUData.iTotal && iSmsPDUData.iFailed==0) |
431 else if (iSmsPDUData.iSent<=iSmsPDUData.iTotal && iSmsPDUData.iFailed==0) |
427 { |
432 { |
428 // One or more sent but not all, no failures |
433 // One or more sent but not all, no failures |
429 LOGSMSU3("SetDataL ESmsSubmit R_LOG_DEL_PENDING SR iSmsPDUData.iSent==%d, iSmsPDUData.iTotal==%d, iFailed==0", iSmsPDUData.iSent, iSmsPDUData.iTotal); |
434 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_8, "SetDataL ESmsSubmit R_LOG_DEL_PENDING SR iSmsPDUData.iSent==%d, iSmsPDUData.iTotal==%d, iFailed==0", iSmsPDUData.iSent, iSmsPDUData.iTotal); |
430 GetStringL(status,R_LOG_DEL_PENDING); |
435 GetStringL(status,R_LOG_DEL_PENDING); |
431 } |
436 } |
432 else |
437 else |
433 { |
438 { |
434 // One or more failures or corruption of iSmsPDUData values |
439 // One or more failures or corruption of iSmsPDUData values |
435 LOGSMSU1("SetDataL ESmsSubmit R_LOG_DEL_FAILED SR"); |
440 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_9, "SetDataL ESmsSubmit R_LOG_DEL_FAILED SR"); |
436 LOGSMSU3(" Total: %d, Sent: %d",iSmsPDUData.iTotal, iSmsPDUData.iSent ); |
441 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_10, " Total: %d, Sent: %d",iSmsPDUData.iTotal, iSmsPDUData.iSent ); |
437 LOGSMSU3(" Failed: %d, Delivered: %d",iSmsPDUData.iFailed, iSmsPDUData.iDelivered ); |
442 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_11, " Failed: %d, Delivered: %d",iSmsPDUData.iFailed, iSmsPDUData.iDelivered ); |
438 GetStringL(status,R_LOG_DEL_FAILED); |
443 GetStringL(status,R_LOG_DEL_FAILED); |
439 } |
444 } |
440 if (aDischargeTime != NULL) |
445 if (aDischargeTime != NULL) |
441 { |
446 { |
442 iLogEvent->SetTime(*aDischargeTime); |
447 iLogEvent->SetTime(*aDischargeTime); |
443 } |
448 } |
444 } |
449 } |
445 else |
450 else |
446 { |
451 { |
447 if (iSmsPDUData.iSent<iSmsPDUData.iTotal) |
452 if (iSmsPDUData.iSent<iSmsPDUData.iTotal) |
448 { |
453 { |
449 // IF not all PDUs sent, state is "NOT SENT". |
454 // IF not all PDUs sent, state is "NOT SENT". |
450 LOGSMSU1("SetDataL ESmsSubmit R_LOG_DEL_NOT_SENT NOSR"); |
455 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_12, "SetDataL ESmsSubmit R_LOG_DEL_NOT_SENT NOSR"); |
451 LOGSMSU3(" Total: %d, Sent: %d", iSmsPDUData.iTotal, iSmsPDUData.iSent ); |
456 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_13, " Total: %d, Sent: %d", iSmsPDUData.iTotal, iSmsPDUData.iSent ); |
452 GetStringL(status,R_LOG_DEL_NOT_SENT); |
457 GetStringL(status,R_LOG_DEL_NOT_SENT); |
453 } |
458 } |
454 else if (iSmsPDUData.iTotal==iSmsPDUData.iSent) |
459 else if (iSmsPDUData.iTotal==iSmsPDUData.iSent) |
455 { |
460 { |
456 // All sent |
461 // All sent |
457 LOGSMSU1("SetDataL ESmsSubmit R_LOG_DEL_SENT NOSR"); |
462 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_14, "SetDataL ESmsSubmit R_LOG_DEL_SENT NOSR"); |
458 GetStringL(status,R_LOG_DEL_SENT); |
463 GetStringL(status,R_LOG_DEL_SENT); |
459 } |
464 } |
460 else |
465 else |
461 { |
466 { |
462 // The iSmsPDUData values have become corrupt |
467 // The iSmsPDUData values have become corrupt |
463 LOGSMSU1("SetDataL ESmsSubmit R_LOG_DEL_FAILED NOSR"); |
468 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_15, "SetDataL ESmsSubmit R_LOG_DEL_FAILED NOSR"); |
464 LOGSMSU3(" Total: %d, Sent: %d",iSmsPDUData.iTotal, iSmsPDUData.iSent ); |
469 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_16, " Total: %d, Sent: %d",iSmsPDUData.iTotal, iSmsPDUData.iSent ); |
465 LOGSMSU3(" Failed: %d, Delivered: %d",iSmsPDUData.iFailed, iSmsPDUData.iDelivered ); |
470 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_17, " Failed: %d, Delivered: %d",iSmsPDUData.iFailed, iSmsPDUData.iDelivered ); |
466 GetStringL(status,R_LOG_DEL_FAILED); |
471 GetStringL(status,R_LOG_DEL_FAILED); |
467 } |
472 } |
468 } |
473 } |
469 LOGSMSU2("SetDataL [status string=%S]",&status); |
474 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_18, "SetDataL [status string=%S]",status); |
470 break; |
475 break; |
471 } |
476 } |
472 default: |
477 default: |
473 { |
478 { |
474 LOGSMSU1("SetDataL ESmsuUnexpectedSmsPDUType"); |
479 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_19, "SetDataL ESmsuUnexpectedSmsPDUType"); |
475 SmsuPanic(ESmsuUnexpectedSmsPDUType); |
480 SmsuPanic(ESmsuUnexpectedSmsPDUType); |
476 } |
481 } |
477 } |
482 } |
478 } |
483 } |
479 else |
484 else |