69 zero.iLac = 0xFFFF; |
74 zero.iLac = 0xFFFF; |
70 zero.iCellId = 0xFFFF; |
75 zero.iCellId = 0xFFFF; |
71 iViagDynamicCache->AppendL( zero, ( KPhEngMaxViagHomeZones * |
76 iViagDynamicCache->AppendL( zero, ( KPhEngMaxViagHomeZones * |
72 KPhEngMaxCacheId ) ); |
77 KPhEngMaxCacheId ) ); |
73 iViagHomeZoneCacheReady = EFalse; |
78 iViagHomeZoneCacheReady = EFalse; |
74 TFLOGSTRING("TSY: CMmSIMTsy::ConstructL: o2 HomeZone dynamic cache array created."); |
79 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CONSTRUCTL_3, "TSY: CMmSIMTsy::ConstructL: o2 HomeZone dynamic cache array created."); |
75 } |
80 } |
76 } |
81 } |
77 |
82 |
78 CMmSIMTsy* CMmSIMTsy::NewL( |
83 CMmSIMTsy* CMmSIMTsy::NewL( |
79 CMmCustomTsy* aMmCustomTsy ) |
84 CMmCustomTsy* aMmCustomTsy ) |
80 { |
85 { |
81 TFLOGSTRING("TSY: CMmSIMTsy::NewL"); |
86 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_NEWL_1, "TSY: CMmSIMTsy::NewL"); |
82 CMmSIMTsy* self = new (ELeave) CMmSIMTsy(); |
87 CMmSIMTsy* self = new (ELeave) CMmSIMTsy(); |
83 |
88 |
84 CleanupStack::PushL( self ); |
89 CleanupStack::PushL( self ); |
85 self->ConstructL( aMmCustomTsy ); |
90 self->ConstructL( aMmCustomTsy ); |
86 CleanupStack::Pop( self ); |
91 CleanupStack::Pop( self ); |
148 TInt CMmSIMTsy::DoExtFuncL( |
153 TInt CMmSIMTsy::DoExtFuncL( |
149 const TTsyReqHandle aTsyReqHandle, |
154 const TTsyReqHandle aTsyReqHandle, |
150 const TInt aIpc, |
155 const TInt aIpc, |
151 const TDataPackage& aPackage ) |
156 const TDataPackage& aPackage ) |
152 { |
157 { |
153 TFLOGSTRING3("TSY: CMmSIMTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle); |
158 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_DOEXTFUNCL_1, "TSY: CMmSIMTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle); |
154 TInt ret( KErrGeneral ); |
159 TInt ret( KErrGeneral ); |
155 |
160 |
156 // Ensure the ReqHandleType is unset. |
161 // Ensure the ReqHandleType is unset. |
157 // This will detect cases where this method indirectly calls itself |
162 // This will detect cases where this method indirectly calls itself |
158 // (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost). |
163 // (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost). |
417 // (other items were commented in a header). |
422 // (other items were commented in a header). |
418 // --------------------------------------------------------------------------- |
423 // --------------------------------------------------------------------------- |
419 // |
424 // |
420 void CMmSIMTsy::CheckViagHomezoneParamsL() |
425 void CMmSIMTsy::CheckViagHomezoneParamsL() |
421 { |
426 { |
422 TFLOGSTRING("TSY: CMmSIMTsy::CheckViagHomezoneParamsL"); |
427 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CHECKVIAGHOMEZONEPARAMSL_1, "TSY: CMmSIMTsy::CheckViagHomezoneParamsL"); |
423 // Check if the request is pending |
428 // Check if the request is pending |
424 if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle( |
429 if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle( |
425 ESIMRequestTypeReadParams ) && iViagParamsReadRequested ) |
430 ESIMRequestTypeReadParams ) && iViagParamsReadRequested ) |
426 { |
431 { |
427 // Ensure that we wont flood SIM with mupltiple VIAG params |
432 // Ensure that we wont flood SIM with mupltiple VIAG params |
428 // read requests, set flag to EFalse. |
433 // read requests, set flag to EFalse. |
429 iViagParamsReadRequested = EFalse; |
434 iViagParamsReadRequested = EFalse; |
430 |
435 |
431 TFLOGSTRING("TSY: CMmSIMTsy::CheckViagHomezoneParamsL - Sending request" ); |
436 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CHECKVIAGHOMEZONEPARAMSL_2, "TSY: CMmSIMTsy::CheckViagHomezoneParamsL - Sending request" ); |
432 // send request to DOS (no parameters) |
437 // send request to DOS (no parameters) |
433 // Void return value, there is nothing to be done if request fails. |
438 // Void return value, there is nothing to be done if request fails. |
434 (void) iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( |
439 (void) iMmCustomTsy->Phone()->MessageManager()->HandleRequestL( |
435 EReadViagHomeZoneParamsIPC ); |
440 EReadViagHomeZoneParamsIPC ); |
436 } |
441 } |
437 else |
442 else |
438 { |
443 { |
439 TFLOGSTRING("TSY: CMmSIMTsy::CheckViagHomezoneParamsL - VIAG homezone params not requested"); |
444 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CHECKVIAGHOMEZONEPARAMSL_3, "TSY: CMmSIMTsy::CheckViagHomezoneParamsL - VIAG homezone params not requested"); |
440 } |
445 } |
441 |
446 |
442 StartDynamicCachingL(); |
447 StartDynamicCachingL(); |
443 } |
448 } |
444 |
449 |
452 void CMmSIMTsy::CompleteReadViagHomeZoneParamsResp( |
457 void CMmSIMTsy::CompleteReadViagHomeZoneParamsResp( |
453 RMmCustomAPI::TViagParams* aParams, |
458 RMmCustomAPI::TViagParams* aParams, |
454 RMmCustomAPI::TViagElements* aElems, |
459 RMmCustomAPI::TViagElements* aElems, |
455 TInt aError ) |
460 TInt aError ) |
456 { |
461 { |
457 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - aError: %d", aError ); |
462 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_1, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - aError: %d", aError ); |
458 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
463 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( |
459 ESIMRequestTypeReadParams ); |
464 ESIMRequestTypeReadParams ); |
460 if ( ESIMTsyReqHandleUnknown != reqHandle ) |
465 if ( ESIMTsyReqHandleUnknown != reqHandle ) |
461 { |
466 { |
462 if ( aError == KErrNone && iViagParams && iViagElems ) |
467 if ( aError == KErrNone && iViagParams && iViagElems ) |
463 { |
468 { |
464 *iViagParams = *aParams; |
469 *iViagParams = *aParams; |
465 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSmsC: %S", &iViagParams->iSmsC ); |
470 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_2, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSmsC: %S", iViagParams->iSmsC ); |
466 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iScp: %S", &iViagParams->iScp ); |
471 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_3, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iScp: %S", iViagParams->iScp ); |
467 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSubscribedZoneAndVersion: %d", iViagParams->iSubscribedZoneAndVersion ); |
472 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_4, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSubscribedZoneAndVersion: %d", iViagParams->iSubscribedZoneAndVersion ); |
468 |
473 |
469 for ( TUint8 i = 0; i < RMmCustomAPI::KViagElementCount; i++ ) |
474 for ( TUint8 i = 0; i < RMmCustomAPI::KViagElementCount; i++ ) |
470 { |
475 { |
471 iViagElems[ i ].iCoordinates.iX = aElems->At(i).iCoordinates.iX; |
476 iViagElems[ i ].iCoordinates.iX = aElems->At(i).iCoordinates.iX; |
472 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iX: %d", i, aElems->At(i).iCoordinates.iX ); |
477 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_5, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iX: %d", i, aElems->At(i).iCoordinates.iX ); |
473 |
478 |
474 iViagElems[ i ].iCoordinates.iY = aElems->At(i).iCoordinates.iY; |
479 iViagElems[ i ].iCoordinates.iY = aElems->At(i).iCoordinates.iY; |
475 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iY: %d", i, aElems->At(i).iCoordinates.iY ); |
480 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_6, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iY: %d", i, aElems->At(i).iCoordinates.iY ); |
476 |
481 |
477 iViagElems[ i ].iCoordinates.iR2 = aElems-> |
482 iViagElems[ i ].iCoordinates.iR2 = aElems-> |
478 At(i).iCoordinates.iR2; |
483 At(i).iCoordinates.iR2; |
479 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iR2: %d", i, aElems->At(i).iCoordinates.iR2 ); |
484 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_7, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iR2: %d", i, aElems->At(i).iCoordinates.iR2 ); |
480 |
485 |
481 iViagElems[ i ].iCoordinates.iZoneId = aElems-> |
486 iViagElems[ i ].iCoordinates.iZoneId = aElems-> |
482 At(i).iCoordinates.iZoneId; |
487 At(i).iCoordinates.iZoneId; |
483 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iZoneId: %d", i, aElems->At(i).iCoordinates.iZoneId ); |
488 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_8, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iZoneId: %d", i, aElems->At(i).iCoordinates.iZoneId ); |
484 |
489 |
485 iViagElems[ i ].iName.Copy( aElems->At(i).iName ); |
490 iViagElems[ i ].iName.Copy( aElems->At(i).iName ); |
486 iViagElems[ i ].iActiveFlag = aElems->At(i).iActiveFlag; |
491 iViagElems[ i ].iActiveFlag = aElems->At(i).iActiveFlag; |
487 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iActiveFlag: %d", i, aElems->At(i).iActiveFlag ); |
492 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_9, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iActiveFlag: %d", i, aElems->At(i).iActiveFlag ); |
488 } |
493 } |
489 } |
494 } |
490 iMmCustomTsy->ReqCompleted( reqHandle, aError ); |
495 iMmCustomTsy->ReqCompleted( reqHandle, aError ); |
491 } |
496 } |
492 } |
497 } |
584 // ==> A[c][r] = A[((c-1)*rMax)+r] |
589 // ==> A[c][r] = A[((c-1)*rMax)+r] |
585 TInt arrayIndex = |
590 TInt arrayIndex = |
586 ( ( iCurrentlyRetrievedCache->iCacheId - 1 ) * 21 ) + |
591 ( ( iCurrentlyRetrievedCache->iCacheId - 1 ) * 21 ) + |
587 iCurrentlyRetrievedCache->iRecordId; |
592 iCurrentlyRetrievedCache->iRecordId; |
588 iViagDynamicCache->At( arrayIndex ) = *aViagRecord; |
593 iViagDynamicCache->At( arrayIndex ) = *aViagRecord; |
589 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Entry at cacheId=%d, recordId=%d read.", iCurrentlyRetrievedCache->iCacheId,iCurrentlyRetrievedCache->iRecordId); |
594 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_2, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Entry at cacheId=%d, recordId=%d read.", iCurrentlyRetrievedCache->iCacheId,iCurrentlyRetrievedCache->iRecordId); |
590 |
595 |
591 TRAP_IGNORE( |
596 TRAP_IGNORE( |
592 // loop. loop four caches times 21 entries! |
597 // loop. loop four caches times 21 entries! |
593 if ( 20 > iCurrentlyRetrievedCache->iRecordId ) |
598 if ( 20 > iCurrentlyRetrievedCache->iRecordId ) |
594 { |
599 { |
616 { |
621 { |
617 // caching done |
622 // caching done |
618 delete iCurrentlyRetrievedCache; |
623 delete iCurrentlyRetrievedCache; |
619 iCurrentlyRetrievedCache = NULL; |
624 iCurrentlyRetrievedCache = NULL; |
620 iViagHomeZoneCacheReady = ETrue; |
625 iViagHomeZoneCacheReady = ETrue; |
621 TFLOGSTRING("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Caching completed successfully!"); |
626 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_3, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Caching completed successfully!"); |
622 |
627 |
623 if( 0 < iReadViagHomeZoneCacheRequests.Count() ) |
628 if( 0 < iReadViagHomeZoneCacheRequests.Count() ) |
624 { |
629 { |
625 |
630 |
626 for ( TInt i=0; i <iReadViagHomeZoneCacheRequests.Count() ; i++ ) |
631 for ( TInt i=0; i <iReadViagHomeZoneCacheRequests.Count() ; i++ ) |
627 { |
632 { |
628 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i); |
633 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_4, "TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i); |
629 TReadViagHomeZoneCacheRequest* req = |
634 TReadViagHomeZoneCacheRequest* req = |
630 iReadViagHomeZoneCacheRequests[ i ]; |
635 iReadViagHomeZoneCacheRequests[ i ]; |
631 |
636 |
632 // copy data from dynamic cache to client |
637 // copy data from dynamic cache to client |
633 // some arithmetics: |
638 // some arithmetics: |
653 else |
658 else |
654 { |
659 { |
655 // caching aborted |
660 // caching aborted |
656 delete iCurrentlyRetrievedCache; |
661 delete iCurrentlyRetrievedCache; |
657 iCurrentlyRetrievedCache = NULL; |
662 iCurrentlyRetrievedCache = NULL; |
658 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:There was a problem reading cache values from SIM, error=%d", aError); |
663 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_5, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:There was a problem reading cache values from SIM, error=%d", aError); |
659 //iViagHomeZoneCacheReady = ETrue; |
664 //iViagHomeZoneCacheReady = ETrue; |
660 TFLOGSTRING("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL: Caching completed unsuccessfully!"); |
665 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_6, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL: Caching completed unsuccessfully!"); |
661 |
666 |
662 for (TInt i = 0; i < iReadViagHomeZoneCacheRequests.Count(); i++) |
667 for (TInt i = 0; i < iReadViagHomeZoneCacheRequests.Count(); i++) |
663 { |
668 { |
664 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i); |
669 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_7, "TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i); |
665 TReadViagHomeZoneCacheRequest* req = |
670 TReadViagHomeZoneCacheRequest* req = |
666 iReadViagHomeZoneCacheRequests[i]; |
671 iReadViagHomeZoneCacheRequests[i]; |
667 iMmCustomTsy->ReqCompleted(req->iReqHandle, aError); |
672 iMmCustomTsy->ReqCompleted(req->iReqHandle, aError); |
668 } |
673 } |
669 iReadViagHomeZoneCacheRequests.ResetAndDestroy(); |
674 iReadViagHomeZoneCacheRequests.ResetAndDestroy(); |
678 // --------------------------------------------------------------------------- |
683 // --------------------------------------------------------------------------- |
679 // |
684 // |
680 TInt CMmSIMTsy::ReadViagHomeZoneCacheCancel( |
685 TInt CMmSIMTsy::ReadViagHomeZoneCacheCancel( |
681 const TTsyReqHandle aTsyReqHandle ) |
686 const TTsyReqHandle aTsyReqHandle ) |
682 { |
687 { |
683 TFLOGSTRING("TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel"); |
688 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHECANCEL_1, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel"); |
684 TFLOGSTRING2("TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Handle:%d",aTsyReqHandle); |
689 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHECANCEL_2, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Handle:%d",aTsyReqHandle); |
685 // Reset the pointer to client space |
690 // Reset the pointer to client space |
686 iViagReadCacheRecord = NULL; |
691 iViagReadCacheRecord = NULL; |
687 |
692 |
688 // Check if request handle already exists |
693 // Check if request handle already exists |
689 TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( |
694 TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( |
712 iReadViagHomeZoneCacheRequests[ i ]; |
717 iReadViagHomeZoneCacheRequests[ i ]; |
713 |
718 |
714 if (aTsyReqHandle == req->iReqHandle) |
719 if (aTsyReqHandle == req->iReqHandle) |
715 { |
720 { |
716 // Complete the request if the request handle is found |
721 // Complete the request if the request handle is found |
717 TFLOGSTRING3("TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Complete with Cancel from array Handle:%d Id=%d ", req->iReqHandle,i); |
722 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHECANCEL_4, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Complete with Cancel from array Handle:%d Id=%d ", req->iReqHandle,i); |
718 iMmCustomTsy->ReqCompleted( req->iReqHandle, KErrCancel ); |
723 iMmCustomTsy->ReqCompleted( req->iReqHandle, KErrCancel ); |
719 delete iReadViagHomeZoneCacheRequests[ i ]; |
724 delete iReadViagHomeZoneCacheRequests[ i ]; |
720 iReadViagHomeZoneCacheRequests.Remove(i); |
725 iReadViagHomeZoneCacheRequests.Remove(i); |
721 break; |
726 break; |
722 } |
727 } |
735 TInt CMmSIMTsy::ReadDynamicViagHomeZoneCacheL( |
740 TInt CMmSIMTsy::ReadDynamicViagHomeZoneCacheL( |
736 const TTsyReqHandle aTsyReqHandle, |
741 const TTsyReqHandle aTsyReqHandle, |
737 RMmCustomAPI::TViagCacheRecordId* aViagRecordId, |
742 RMmCustomAPI::TViagCacheRecordId* aViagRecordId, |
738 RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent ) |
743 RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent ) |
739 { |
744 { |
740 TFLOGSTRING2("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache:Is ViagHomeZoneCache Ready =%d", iViagHomeZoneCacheReady); |
745 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_1, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache:Is ViagHomeZoneCache Ready =%d", iViagHomeZoneCacheReady); |
741 TFLOGSTRING3("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId ); |
746 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_2, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId ); |
742 TInt err = KErrNone; |
747 TInt err = KErrNone; |
743 // KPhEngMaxViagHomeZones(4) * KPhEngMaxCacheId(21) |
748 // KPhEngMaxViagHomeZones(4) * KPhEngMaxCacheId(21) |
744 if ( 1 > aViagRecordId->iCacheId || 4 < aViagRecordId->iCacheId || |
749 if ( 1 > aViagRecordId->iCacheId || 4 < aViagRecordId->iCacheId || |
745 0 > aViagRecordId->iRecordId || 20 < aViagRecordId->iRecordId ) |
750 0 > aViagRecordId->iRecordId || 20 < aViagRecordId->iRecordId ) |
746 { |
751 { |
747 err = KErrArgument; |
752 err = KErrArgument; |
748 } |
753 } |
749 else if ( iViagDynamicCache && iViagHomeZoneCacheReady ) |
754 else if ( iViagDynamicCache && iViagHomeZoneCacheReady ) |
750 { |
755 { |
751 TFLOGSTRING("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is ready, Reading cache possible"); |
756 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_3, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is ready, Reading cache possible"); |
752 // copy data from dynamic cache to client |
757 // copy data from dynamic cache to client |
753 // some arithmetics: |
758 // some arithmetics: |
754 // cache ids range 1..4 |
759 // cache ids range 1..4 |
755 // record ids range 0..20 |
760 // record ids range 0..20 |
756 // array indexes range 0..83 |
761 // array indexes range 0..83 |
759 aViagRecordId->iRecordId; |
764 aViagRecordId->iRecordId; |
760 *aViagRecordContent = iViagDynamicCache->At( arrayIndex ); |
765 *aViagRecordContent = iViagDynamicCache->At( arrayIndex ); |
761 } |
766 } |
762 else if ( !iViagHomeZoneCacheReady ) |
767 else if ( !iViagHomeZoneCacheReady ) |
763 { |
768 { |
764 TFLOGSTRING("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is NOT ready, Reading cache NOT possible"); |
769 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_4, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is NOT ready, Reading cache NOT possible"); |
765 //The request is already in processing because of previous request |
770 //The request is already in processing because of previous request |
766 //Complete request with status value informing the client about |
771 //Complete request with status value informing the client about |
767 TReadViagHomeZoneCacheRequest* req = |
772 TReadViagHomeZoneCacheRequest* req = |
768 new (ELeave) TReadViagHomeZoneCacheRequest(); |
773 new (ELeave) TReadViagHomeZoneCacheRequest(); |
769 req->iReqHandle = aTsyReqHandle; |
774 req->iReqHandle = aTsyReqHandle; |
794 // |
799 // |
795 TInt CMmSIMTsy::WriteViagHomeZoneCacheL( |
800 TInt CMmSIMTsy::WriteViagHomeZoneCacheL( |
796 RMmCustomAPI::TViagCacheRecordId* aViagRecordId, |
801 RMmCustomAPI::TViagCacheRecordId* aViagRecordId, |
797 RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent ) |
802 RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent ) |
798 { |
803 { |
799 TFLOGSTRING3("TSY: CCMmSIMTsy::WriteViagHomeZoneCacheL iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId ); |
804 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_WRITEVIAGHOMEZONECACHEL_1, "TSY: CCMmSIMTsy::WriteViagHomeZoneCacheL iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId ); |
800 TInt ret( KErrGeneral ); |
805 TInt ret( KErrGeneral ); |
801 |
806 |
802 if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle( |
807 if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle( |
803 ESIMRequestTypeWriteCache ) ) |
808 ESIMRequestTypeWriteCache ) ) |
804 { |
809 { |
906 // (other items were commented in a header). |
911 // (other items were commented in a header). |
907 // --------------------------------------------------------------------------- |
912 // --------------------------------------------------------------------------- |
908 // |
913 // |
909 void CMmSIMTsy::StartDynamicCachingL() |
914 void CMmSIMTsy::StartDynamicCachingL() |
910 { |
915 { |
911 TFLOGSTRING("TSY: CMmSIMTsy::StartDynamicCachingL"); |
916 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_1, "TSY: CMmSIMTsy::StartDynamicCachingL"); |
912 iLastViagHomeZoneCacheError = KErrNone; |
917 iLastViagHomeZoneCacheError = KErrNone; |
913 // Make sure there are no ongoing dynamic caching requests.. |
918 // Make sure there are no ongoing dynamic caching requests.. |
914 if( iCurrentlyRetrievedCache ) |
919 if( iCurrentlyRetrievedCache ) |
915 { |
920 { |
916 TFLOGSTRING("TSY: CMmSIMTsy::StartDynamicCachingL - iCurrentlyRetrievedCache already exists - no new request done"); |
921 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_2, "TSY: CMmSIMTsy::StartDynamicCachingL - iCurrentlyRetrievedCache already exists - no new request done"); |
917 return; |
922 return; |
918 } |
923 } |
919 |
924 |
920 TInt trapError; |
925 TInt trapError; |
921 TRAP( trapError, iCurrentlyRetrievedCache = new (ELeave) |
926 TRAP( trapError, iCurrentlyRetrievedCache = new (ELeave) |
922 RMmCustomAPI::TViagCacheRecordId(); ); |
927 RMmCustomAPI::TViagCacheRecordId(); ); |
923 if ( trapError ) |
928 if ( trapError ) |
924 { |
929 { |
925 TFLOGSTRING2("TSY: CMmSIMTsy::StartDynamicCachingL:Could not start caching, error=%d", trapError); |
930 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_3, "TSY: CMmSIMTsy::StartDynamicCachingL:Could not start caching, error=%d", trapError); |
926 return; |
931 return; |
927 } |
932 } |
928 TFLOGSTRING("TSY: CMmSIMTsy::StartDynamicCachingL:Starting caching now."); |
933 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_4, "TSY: CMmSIMTsy::StartDynamicCachingL:Starting caching now."); |
929 iCurrentlyRetrievedCache->iCacheId = 1; // caches range from 1 to 4 |
934 iCurrentlyRetrievedCache->iCacheId = 1; // caches range from 1 to 4 |
930 iCurrentlyRetrievedCache->iRecordId = 0; // records range from 0 to 20 |
935 iCurrentlyRetrievedCache->iRecordId = 0; // records range from 0 to 20 |
931 // send request to DOS |
936 // send request to DOS |
932 // packed parameter: RMmCustomAPI::TViagCacheRecordId |
937 // packed parameter: RMmCustomAPI::TViagCacheRecordId |
933 CMmDataPackage dataPackage; |
938 CMmDataPackage dataPackage; |