telephonyserverplugins/common_tsy/commontsy/src/mmsms/cmmbroadcasttsy.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 16 fe8b59ab9fa0
child 66 07a122eea281
child 69 b982c3e940f3
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-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".
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 
    17 
    18 // INCLUDE FILES
    18 // INCLUDE FILES
       
    19 
       
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "cmmbroadcasttsyTraces.h"
       
    23 #endif
       
    24 
    19 #include <mmlist.h>
    25 #include <mmlist.h>
    20 #include <etelmm.h>
    26 #include <etelmm.h>
    21 #include "cmmbroadcasttsy.h"
    27 #include "cmmbroadcasttsy.h"
    22 #include "cmmphonetsy.h"
    28 #include "cmmphonetsy.h"
    23 #include "CMmPrivateUtility.h"    // Read all list class 
    29 #include "CMmPrivateUtility.h"    // Read all list class 
    24 #include <ctsy/serviceapi/cmmsmsutility.h>
    30 #include <ctsy/serviceapi/cmmsmsutility.h>
    25 #include "MmTsy_numberOfSlots.h"
    31 #include "MmTsy_numberOfSlots.h"
    26 #include "cmmtsyreqhandlestore.h"
    32 #include "cmmtsyreqhandlestore.h"
    27 #include <ctsy/pluginapi/cmmdatapackage.h>
    33 #include <ctsy/pluginapi/cmmdatapackage.h>
    28 #include <ctsy/tflogger.h>
       
    29 #include "cmmnettsy.h"
    34 #include "cmmnettsy.h"
    30 
    35 
    31 // ======== MEMBER FUNCTIONS ========
    36 // ======== MEMBER FUNCTIONS ========
    32 
    37 
    33 CMmBroadcastTsy::CMmBroadcastTsy():
    38 CMmBroadcastTsy::CMmBroadcastTsy():
    44 	iWcdmaCbsMsgPageIndex = 0;
    49 	iWcdmaCbsMsgPageIndex = 0;
    45     }
    50     }
    46 
    51 
    47 void CMmBroadcastTsy::ConstructL()
    52 void CMmBroadcastTsy::ConstructL()
    48     {
    53     {
    49 TFLOGSTRING("TSY: CMmBroadcastTsy::ConstructL");
    54 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_CONSTRUCTL_1, "TSY: CMmBroadcastTsy::ConstructL");
    50 #ifdef REQHANDLE_TIMER   
    55 #ifdef REQHANDLE_TIMER   
    51     // create req handle store
    56     // create req handle store
    52     iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this, iMmPhone, 
    57     iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( this, iMmPhone, 
    53         EMultimodeBroadcastMaxNumOfRequests, iBroadcastReqHandles );
    58         EMultimodeBroadcastMaxNumOfRequests, iBroadcastReqHandles );
    54 #else
    59 #else
    80     return aMmBroadcastTsy;
    85     return aMmBroadcastTsy;
    81     }
    86     }
    82 
    87 
    83 CMmBroadcastTsy::~CMmBroadcastTsy()
    88 CMmBroadcastTsy::~CMmBroadcastTsy()
    84     {     
    89     {     
    85 TFLOGSTRING("TSY: CMmBroadcastTsy::~CMmBroadcastTsy");
    90 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_DTOR_1, "TSY: CMmBroadcastTsy::~CMmBroadcastTsy");
    86     if ( iMmPhone )
    91     if ( iMmPhone )
    87         {
    92         {
    88         // deregister tsy object from message manager
    93         // deregister tsy object from message manager
    89         iMmPhone->MessageManager()->DeregisterTsyObject(this);        
    94         iMmPhone->MessageManager()->DeregisterTsyObject(this);        
    90         }
    95         }
   467 #endif // __WINS__       
   472 #endif // __WINS__       
   468 
   473 
   469             // TSY supports only "accept all" and "reject all" filtering.
   474             // TSY supports only "accept all" and "reject all" filtering.
   470             cbsCaps.iFilterCaps = RMobileBroadcastMessaging::KCapsSimpleFilter;
   475             cbsCaps.iFilterCaps = RMobileBroadcastMessaging::KCapsSimpleFilter;
   471             
   476             
   472             TFLOGSTRING3("TSY:CMmBroadcastTsy::GetCaps:Mode caps=0x%x, Filter caps=0x%x",cbsCaps.iModeCaps,cbsCaps.iFilterCaps);
   477             OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_GETCAPS_1, "TSY:CMmBroadcastTsy::GetCaps:Mode caps=0x%08x, Filter caps=0x%08x",cbsCaps.iModeCaps,cbsCaps.iFilterCaps);
   473             
   478             
   474             ret = KErrNone;
   479             ret = KErrNone;
   475             ReqCompleted( aTsyReqHandle, ret );
   480             ReqCompleted( aTsyReqHandle, ret );
   476             }
   481             }
   477         }        
   482         }        
   526     		        ReqCompleted( aTsyReqHandle, KErrNone );
   531     		        ReqCompleted( aTsyReqHandle, KErrNone );
   527     		        }
   532     		        }
   528     		    else if ( !iCbRoutingActivated )
   533     		    else if ( !iCbRoutingActivated )
   529     		        {
   534     		        {
   530     		        // DOS's CB routing is not activated
   535     		        // DOS's CB routing is not activated
   531     		TFLOGSTRING("TSY:CMmBroadcastTsy::ReceiveMessageL:DOS's CB routing is not activated, sending activation request.");    
   536     		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_RECEIVEMESSAGEL_1, "TSY:CMmBroadcastTsy::ReceiveMessageL:DOS's CB routing is not activated, sending activation request.");
   532 
   537 
   533     		        //Create package
   538     		        //Create package
   534     		        CMmDataPackage package;
   539     		        CMmDataPackage package;
   535 
   540 
   536     		        TCbsCbmiAndLangAndFilter data;
   541     		        TCbsCbmiAndLangAndFilter data;
   555     		            ReqCompleted( aTsyReqHandle, error );
   560     		            ReqCompleted( aTsyReqHandle, error );
   556     		            }
   561     		            }
   557     		        }
   562     		        }
   558 		        else
   563 		        else
   559 		            {
   564 		            {
   560 		    TFLOGSTRING("TSY:CMmBroadcastTsy::ReceiveMessageL:DOS's CB routing is activated, waiting for messages.");    
   565 		    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_RECEIVEMESSAGEL_2, "TSY:CMmBroadcastTsy::ReceiveMessageL:DOS's CB routing is activated, waiting for messages.");
   561 		            // routing is active, wait for messages from DOS
   566 		            // routing is active, wait for messages from DOS
   562 		            iReqHandleType = EMultimodeBroadcastReceiveMessage;
   567 		            iReqHandleType = EMultimodeBroadcastReceiveMessage;
   563 					
   568 					
   564 					// currentpage set to zero - no pages to deliver
   569 					// currentpage set to zero - no pages to deliver
   565 		            iWcdmaCurrentPage = 0;
   570 		            iWcdmaCurrentPage = 0;
   578 // ---------------------------------------------------------------------------
   583 // ---------------------------------------------------------------------------
   579 //
   584 //
   580 void CMmBroadcastTsy::InternalCompleteCbRoutingRequest( 
   585 void CMmBroadcastTsy::InternalCompleteCbRoutingRequest( 
   581     TInt aError )
   586     TInt aError )
   582     {
   587     {
   583 TFLOGSTRING2("TSY:CMmBroadcastTsy::InternalCompleteCbRoutingRequest:error=%d.", aError);
   588 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_INTERNALCOMPLETECBROUTINGREQUEST_1, "TSY:CMmBroadcastTsy::InternalCompleteCbRoutingRequest:error=%d.", aError);
   584     if ( KErrNone == aError )
   589     if ( KErrNone == aError )
   585         {
   590         {
   586         iCbRoutingActivated = ETrue;
   591         iCbRoutingActivated = ETrue;
   587         }
   592         }
   588     else
   593     else
   615 // (other items were commented in a header).
   620 // (other items were commented in a header).
   616 // ---------------------------------------------------------------------------
   621 // ---------------------------------------------------------------------------
   617 //
   622 //
   618 void CMmBroadcastTsy::CompleteReceivedWcdmaCbsMessagePageLeft()
   623 void CMmBroadcastTsy::CompleteReceivedWcdmaCbsMessagePageLeft()
   619     {
   624     {
   620 TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceivedWcdmaCbsMessagePageLeft:Delivering page %d to client.", iWcdmaCbsMsgPageIndex);    
   625 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEDWCDMACBSMESSAGEPAGELEFT_1, "TSY:CMmBroadcastTsy::CompleteReceivedWcdmaCbsMessagePageLeft:Delivering page %d to client.", iWcdmaCbsMsgPageIndex);
   621 	RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg* 
   626 	RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg* 
   622 		attrPckg = reinterpret_cast
   627 		attrPckg = reinterpret_cast
   623 		< RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg* >
   628 		< RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg* >
   624 		( iReceiveCbMessageAttributesPtr );
   629 		( iReceiveCbMessageAttributesPtr );
   625 
   630 
   636 
   641 
   637 	// Number of pages
   642 	// Number of pages
   638 	cbAttrib.iNumberOfPages = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]
   643 	cbAttrib.iNumberOfPages = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]
   639 		->iNumberOfPages;
   644 		->iNumberOfPages;
   640 
   645 
   641 	TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: cbAttrib.iNumberOfPages %x .", cbAttrib.iNumberOfPages);
   646 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEDWCDMACBSMESSAGEPAGELEFT_2, "TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: cbAttrib.iNumberOfPages %d .", cbAttrib.iNumberOfPages);
   642 
   647 
   643 	// Message Type
   648 	// Message Type
   644 	cbAttrib.iMessageType = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]
   649 	cbAttrib.iMessageType = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]
   645 		->iMessageType;
   650 		->iMessageType;
   646 
   651 
   654 	cbAttrib.iDCS = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]->iDCS;
   659 	cbAttrib.iDCS = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]->iDCS;
   655 
   660 
   656 	iReceiveCbMessagePtr->Copy( ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]->iWcdmaCbsData.Ptr(), 
   661 	iReceiveCbMessagePtr->Copy( ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]->iWcdmaCbsData.Ptr(), 
   657 						( *iCbsMsg )[iWcdmaCbsMsgPageIndex]->iInfoLength );
   662 						( *iCbsMsg )[iWcdmaCbsMsgPageIndex]->iInfoLength );
   658 	
   663 	
   659 	TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceivedWcdmaCbsMessagePageLeft: AppendFormat in use iWcdmaCurrentPage: %d.", iWcdmaCurrentPage );
   664 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEDWCDMACBSMESSAGEPAGELEFT_3, "TSY:CMmBroadcastTsy::CompleteReceivedWcdmaCbsMessagePageLeft: AppendFormat in use iWcdmaCurrentPage: %d.", iWcdmaCurrentPage );
   660 	_LIT8(KFormat, "%c");
   665 	_LIT8(KFormat, "%c");
   661 
   666 
   662 	// Append pagenumber to end of CBS message     
   667 	// Append pagenumber to end of CBS message     
   663 	iReceiveCbMessagePtr->AppendFormat(KFormat, iWcdmaCurrentPage);
   668 	iReceiveCbMessagePtr->AppendFormat(KFormat, iWcdmaCurrentPage);
   664 
   669 
   688 //
   693 //
   689 void CMmBroadcastTsy::CompleteReceiveMessageGsmCbs( 
   694 void CMmBroadcastTsy::CompleteReceiveMessageGsmCbs( 
   690     TInt aError, 
   695     TInt aError, 
   691     CMmDataPackage* aDataPackage )
   696     CMmDataPackage* aDataPackage )
   692     {
   697     {
   693 TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageGsmCbs:error=%d.",aError);    
   698 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEMESSAGEGSMCBS_1, "TSY:CMmBroadcastTsy::CompleteReceiveMessageGsmCbs:error=%d.",aError);
   694     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   699     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   695         EMultimodeBroadcastReceiveMessage );
   700         EMultimodeBroadcastReceiveMessage );
   696 
   701 
   697     if ( reqHandle )
   702     if ( reqHandle )
   698         {
   703         {
   733 //
   738 //
   734 void CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs( 
   739 void CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs( 
   735     TInt aError, 
   740     TInt aError, 
   736     CMmDataPackage* aDataPackage )
   741     CMmDataPackage* aDataPackage )
   737     {
   742     {
   738 TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs:error=%d.", aError);    
   743 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEMESSAGEWCDMACBS_1, "TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs:error=%d.", aError);
   739 	TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   744 	TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   740         EMultimodeBroadcastReceiveMessage );
   745         EMultimodeBroadcastReceiveMessage );
   741 
   746 
   742 	// Reset array
   747 	// Reset array
   743 	iCbsMsg->Reset();
   748 	iCbsMsg->Reset();
   764 						}		
   769 						}		
   765 					);
   770 					);
   766 
   771 
   767 				if ( KErrNone == trapError )
   772 				if ( KErrNone == trapError )
   768 					{
   773 					{
   769 	TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: %d pages received.",iWcdmaPageNumber);    
   774 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEMESSAGEWCDMACBS_2, "TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: %d pages received.",iWcdmaPageNumber);
   770 					// first page. index is 0
   775 					// first page. index is 0
   771 					iWcdmaCbsMsgPageIndex = 0;
   776 					iWcdmaCbsMsgPageIndex = 0;
   772 					
   777 					
   773 					// currentpage is 1 at this state even if multipage cbs
   778 					// currentpage is 1 at this state even if multipage cbs
   774 					iWcdmaCurrentPage = 1;
   779 					iWcdmaCurrentPage = 1;
   792 
   797 
   793 					// Number of pages
   798 					// Number of pages
   794 					cbAttrib.iNumberOfPages = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]
   799 					cbAttrib.iNumberOfPages = ( *iCbsMsg )[iWcdmaCbsMsgPageIndex]
   795 						->iNumberOfPages;
   800 						->iNumberOfPages;
   796 
   801 
   797 					TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: cbAttrib.iNumberOfPages %x .", cbAttrib.iNumberOfPages);
   802 					OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEMESSAGEWCDMACBS_3, "TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: cbAttrib.iNumberOfPages %d.", cbAttrib.iNumberOfPages);
   798 				
   803 				
   799 					// Message Type
   804 					// Message Type
   800 					cbAttrib.iMessageType = ( *iCbsMsg )
   805 					cbAttrib.iMessageType = ( *iCbsMsg )
   801 						[iWcdmaCbsMsgPageIndex]->iMessageType;
   806 						[iWcdmaCbsMsgPageIndex]->iMessageType;
   802 					
   807 					
   815 						[iWcdmaCbsMsgPageIndex]->iWcdmaCbsData );
   820 						[iWcdmaCbsMsgPageIndex]->iWcdmaCbsData );
   816 
   821 
   817 					
   822 					
   818 					_LIT8(KFormat, "%c");
   823 					_LIT8(KFormat, "%c");
   819 
   824 
   820 					TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: 1st Page - AppendFormat in use iWcdmaCurrentPage: %d.", iWcdmaCurrentPage );
   825 					OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEMESSAGEWCDMACBS_4, "TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs: 1st Page - AppendFormat in use iWcdmaCurrentPage: %d.", iWcdmaCurrentPage );
   821 					// insert current pagenumber end of CBS message
   826 					// insert current pagenumber end of CBS message
   822 					iReceiveCbMessagePtr->AppendFormat(KFormat, iWcdmaCurrentPage);
   827 					iReceiveCbMessagePtr->AppendFormat(KFormat, iWcdmaCurrentPage);
   823 					
   828 					
   824 					// index of the pages begins at 0
   829 					// index of the pages begins at 0
   825 					if ( iWcdmaCbsMsgPageIndex == ( iWcdmaPageNumber -1 ) )
   830 					if ( iWcdmaCbsMsgPageIndex == ( iWcdmaPageNumber -1 ) )
   850 			else
   855 			else
   851 				{
   856 				{
   852 				aError = KErrCorrupt;
   857 				aError = KErrCorrupt;
   853 				}			
   858 				}			
   854 			}
   859 			}
   855 TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs:Completing with error=%d.", aError);    
   860 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEMESSAGEWCDMACBS_5, "TSY:CMmBroadcastTsy::CompleteReceiveMessageWcdmaCbs:Completing with error=%d.", aError);
   856 			
   861 			
   857 		ReqCompleted( reqHandle, aError );		
   862 		ReqCompleted( reqHandle, aError );		
   858 		}		
   863 		}		
   859     }
   864     }
   860     
   865     
   873     iTsyReqHandleStore->ResetTsyReqHandle(
   878     iTsyReqHandleStore->ResetTsyReqHandle(
   874         EMultimodeBroadcastReceiveMessage );
   879         EMultimodeBroadcastReceiveMessage );
   875 
   880 
   876     if ( iCbRoutingActivated )
   881     if ( iCbRoutingActivated )
   877         {
   882         {
   878 TFLOGSTRING("TSY:CMmBroadcastTsy::ReceiveMessageCancelL:Routing was active, sending de-activation request.");    
   883 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_RECEIVEMESSAGECANCELL_1, "TSY:CMmBroadcastTsy::ReceiveMessageCancelL:Routing was active, sending de-activation request.");
   879         // Create package
   884         // Create package
   880         CMmDataPackage package;
   885         CMmDataPackage package;
   881 
   886 
   882         TCbsCbmiAndLangAndFilter data;
   887         TCbsCbmiAndLangAndFilter data;
   883         data.iSetting = RMobileBroadcastMessaging::EBroadcastAcceptNone;
   888         data.iSetting = RMobileBroadcastMessaging::EBroadcastAcceptNone;
   914             ReqCompleted( aTsyReqHandle, ret );
   919             ReqCompleted( aTsyReqHandle, ret );
   915             }
   920             }
   916         }
   921         }
   917     else
   922     else
   918         {
   923         {
   919 TFLOGSTRING("TSY:CMmBroadcastTsy::ReceiveMessageCancelL:Routing was not active.");    
   924 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_RECEIVEMESSAGECANCELL_2, "TSY:CMmBroadcastTsy::ReceiveMessageCancelL:Routing was not active.");
   920         ReqCompleted( aTsyReqHandle, KErrCancel );
   925         ReqCompleted( aTsyReqHandle, KErrCancel );
   921         }
   926         }
   922 
   927 
   923     return KErrNone;
   928     return KErrNone;
   924     }
   929     }
   930 // ---------------------------------------------------------------------------
   935 // ---------------------------------------------------------------------------
   931 //
   936 //
   932 void CMmBroadcastTsy::CompleteReceiveMessageCancel( 
   937 void CMmBroadcastTsy::CompleteReceiveMessageCancel( 
   933     TInt aError )
   938     TInt aError )
   934     {
   939     {
   935 TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteReceiveMessageCancel:error=%d.",aError);    
   940 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETERECEIVEMESSAGECANCEL_1, "TSY:CMmBroadcastTsy::CompleteReceiveMessageCancel:error=%d.",aError);
   936     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   941     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   937         EMultimodeBroadcastReceiveMessageCancel );
   942         EMultimodeBroadcastReceiveMessageCancel );
   938 
   943 
   939     if ( reqHandle )
   944     if ( reqHandle )
   940         {
   945         {
   963 TInt CMmBroadcastTsy::GetFilterSetting( 
   968 TInt CMmBroadcastTsy::GetFilterSetting( 
   964     const TTsyReqHandle aTsyReqHandle, 
   969     const TTsyReqHandle aTsyReqHandle, 
   965     RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting )
   970     RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting )
   966     {
   971     {
   967     *aSetting = iCbFilterSetting;
   972     *aSetting = iCbFilterSetting;
   968 TFLOGSTRING2("TSY:CMmBroadcastTsy::GetFilterSetting:Filter setting=0x%x.",iCbFilterSetting);    
   973 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_GETFILTERSETTING_1, "TSY:CMmBroadcastTsy::GetFilterSetting:Filter setting=0x%08x.",iCbFilterSetting);
   969 
   974 
   970     ReqCompleted( aTsyReqHandle, KErrNone );
   975     ReqCompleted( aTsyReqHandle, KErrNone );
   971 
   976 
   972     return KErrNone;        
   977     return KErrNone;        
   973     }   
   978     }   
   981 //
   986 //
   982 TInt CMmBroadcastTsy::SetFilterSettingL( 
   987 TInt CMmBroadcastTsy::SetFilterSettingL( 
   983     const TTsyReqHandle aTsyReqHandle, 
   988     const TTsyReqHandle aTsyReqHandle, 
   984     RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter const* aSetting )
   989     RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter const* aSetting )
   985     {
   990     {
   986 TFLOGSTRING3("TSY:CMmBroadcastTsy::SetFilterSettingL:Old filter setting=0x%x, setting to 0x%x.",iCbFilterSetting,*aSetting);    
   991 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_SETFILTERSETTINGL_1, "TSY:CMmBroadcastTsy::SetFilterSettingL:Old filter setting=0x%08x, setting to 0x%08x.",iCbFilterSetting,(TUint)*aSetting);
   987     if ( ( RMobileBroadcastMessaging::EBroadcastAcceptAll == *aSetting ) ||
   992     if ( ( RMobileBroadcastMessaging::EBroadcastAcceptAll == *aSetting ) ||
   988          ( RMobileBroadcastMessaging::EBroadcastAcceptNone == *aSetting ) )
   993          ( RMobileBroadcastMessaging::EBroadcastAcceptNone == *aSetting ) )
   989        {
   994        {
   990         // We can complete this after response from DOS
   995         // We can complete this after response from DOS
   991         TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
   996         TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  1049 // ---------------------------------------------------------------------------
  1054 // ---------------------------------------------------------------------------
  1050 //
  1055 //
  1051 void CMmBroadcastTsy::CompleteSetFilterSetting( 
  1056 void CMmBroadcastTsy::CompleteSetFilterSetting( 
  1052     TInt aError )
  1057     TInt aError )
  1053     {
  1058     {
  1054 TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteSetFilterSetting:error=%d.",aError);    
  1059 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETESETFILTERSETTING_1, "TSY:CMmBroadcastTsy::CompleteSetFilterSetting:error=%d.",aError);
  1055     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  1060     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  1056         EMultimodeBroadcastSetFilterSetting );
  1061         EMultimodeBroadcastSetFilterSetting );
  1057 
  1062 
  1058     if( reqHandle )
  1063     if( reqHandle )
  1059         {
  1064         {
  1092 // ---------------------------------------------------------------------------
  1097 // ---------------------------------------------------------------------------
  1093 //
  1098 //
  1094 TInt CMmBroadcastTsy::NotifyFilterSettingChange( 
  1099 TInt CMmBroadcastTsy::NotifyFilterSettingChange( 
  1095     RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting )
  1100     RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting )
  1096     {
  1101     {
  1097 TFLOGSTRING("TSY:CMmBroadcastTsy::NotifyFilterSettingChange.");    
  1102 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_NOTIFYFILTERSETTINGCHANGE_1, "TSY:CMmBroadcastTsy::NotifyFilterSettingChange.");
  1098     iReqHandleType = EMultimodeBroadcastNotifyFilterSetting;
  1103     iReqHandleType = EMultimodeBroadcastNotifyFilterSetting;
  1099     iNotifyFilterSettingChangePtr = aSetting;
  1104     iNotifyFilterSettingChangePtr = aSetting;
  1100 
  1105 
  1101     return KErrNone;    
  1106     return KErrNone;    
  1102     }
  1107     }
  1109 // ---------------------------------------------------------------------------
  1114 // ---------------------------------------------------------------------------
  1110 //
  1115 //
  1111 TInt CMmBroadcastTsy::NotifyFilterSettingChangeCancel( 
  1116 TInt CMmBroadcastTsy::NotifyFilterSettingChangeCancel( 
  1112     const TTsyReqHandle aTsyReqHandle )
  1117     const TTsyReqHandle aTsyReqHandle )
  1113     {
  1118     {
  1114 TFLOGSTRING("TSY:CMmBroadcastTsy::NotifyFilterSettingChangeCancel.");    
  1119 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_NOTIFYFILTERSETTINGCHANGECANCEL_1, "TSY:CMmBroadcastTsy::NotifyFilterSettingChangeCancel.");
  1115     iTsyReqHandleStore->ResetTsyReqHandle( 
  1120     iTsyReqHandleStore->ResetTsyReqHandle( 
  1116         EMultimodeBroadcastNotifyFilterSetting );
  1121         EMultimodeBroadcastNotifyFilterSetting );
  1117     ReqCompleted( aTsyReqHandle, KErrCancel );
  1122     ReqCompleted( aTsyReqHandle, KErrCancel );
  1118 	iNotifyFilterSettingChangePtr = NULL; // reset pointer to client memory
  1123 	iNotifyFilterSettingChangePtr = NULL; // reset pointer to client memory
  1119 
  1124 
  1126 // (other items were commented in a header).
  1131 // (other items were commented in a header).
  1127 // ---------------------------------------------------------------------------
  1132 // ---------------------------------------------------------------------------
  1128 //
  1133 //
  1129 void CMmBroadcastTsy::CompleteNotifyFilterSettingChange()
  1134 void CMmBroadcastTsy::CompleteNotifyFilterSettingChange()
  1130     {
  1135     {
  1131 TFLOGSTRING("TSY:CMmBroadcastTsy::CompleteNotifyFilterSettingChange.");    
  1136 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETENOTIFYFILTERSETTINGCHANGE_1, "TSY:CMmBroadcastTsy::CompleteNotifyFilterSettingChange.");
  1132     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  1137     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  1133         EMultimodeBroadcastNotifyFilterSetting );
  1138         EMultimodeBroadcastNotifyFilterSetting );
  1134 
  1139 
  1135     if ( reqHandle )
  1140     if ( reqHandle )
  1136         {
  1141         {
  1137 		if ( iNotifyFilterSettingChangePtr )
  1142 		if ( iNotifyFilterSettingChangePtr )
  1138 			{
  1143 			{
  1139 			*iNotifyFilterSettingChangePtr = iCbFilterSetting;
  1144 			*iNotifyFilterSettingChangePtr = iCbFilterSetting;
  1140 TFLOGSTRING2("TSY:CMmBroadcastTsy::CompleteNotifyFilterSettingChange.New filter setting is 0x%x.",iCbFilterSetting);    
  1145 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_COMPLETENOTIFYFILTERSETTINGCHANGE_2, "TSY:CMmBroadcastTsy::CompleteNotifyFilterSettingChange.New filter setting is 0x%08x.",iCbFilterSetting);
  1141 			}
  1146 			}
  1142 
  1147 
  1143         ReqCompleted( reqHandle, KErrNone );
  1148         ReqCompleted( reqHandle, KErrNone );
  1144         }
  1149         }
  1145     }
  1150     }
  1155     const TTsyReqHandle , 
  1160     const TTsyReqHandle , 
  1156     CRetrieveMobilePhoneBroadcastIdList::TGetBroadcastIdRequest const* , 
  1161     CRetrieveMobilePhoneBroadcastIdList::TGetBroadcastIdRequest const* , 
  1157     TInt*  )
  1162     TInt*  )
  1158     {
  1163     {
  1159     // not supported.
  1164     // not supported.
  1160 TFLOGSTRING("TSY: CMmBroadcastTsy::GetBroadcastIdListPhase1L");    
  1165 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_GETBROADCASTIDLISTPHASE1L_1, "TSY: CMmBroadcastTsy::GetBroadcastIdListPhase1L");
  1161     return KErrNotSupported;
  1166     return KErrNotSupported;
  1162     }
  1167     }
  1163 
  1168 
  1164 //----------------------------------------------------------------------------
  1169 //----------------------------------------------------------------------------
  1165 // CMmBroadcastTsy::GetBroadcastIdListPhase2
  1170 // CMmBroadcastTsy::GetBroadcastIdListPhase2
  1172 TInt CMmBroadcastTsy::GetBroadcastIdListPhase2( 
  1177 TInt CMmBroadcastTsy::GetBroadcastIdListPhase2( 
  1173     const TTsyReqHandle , 
  1178     const TTsyReqHandle , 
  1174     RMobilePhone::TClientId const* , 
  1179     RMobilePhone::TClientId const* , 
  1175     TDes8*  )
  1180     TDes8*  )
  1176     {
  1181     {
  1177     TFLOGSTRING("TSY:CMmBroadcastTsy::GetBroadcastIdListPhase2.List returned to client.");    
  1182     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_GETBROADCASTIDLISTPHASE2_1, "TSY:CMmBroadcastTsy::GetBroadcastIdListPhase2.List returned to client.");
  1178     return KErrNotSupported;
  1183     return KErrNotSupported;
  1179     }
  1184     }
  1180 
  1185 
  1181 //----------------------------------------------------------------------------
  1186 //----------------------------------------------------------------------------
  1182 // CMmBroadcastTsy::StoreBroadcastIdListL
  1187 // CMmBroadcastTsy::StoreBroadcastIdListL
  1187 //
  1192 //
  1188 TInt CMmBroadcastTsy::StoreBroadcastIdListL( 
  1193 TInt CMmBroadcastTsy::StoreBroadcastIdListL( 
  1189     const TTsyReqHandle aTsyReqHandle, 
  1194     const TTsyReqHandle aTsyReqHandle, 
  1190     TDes8 const* /*aBuffer*/ )
  1195     TDes8 const* /*aBuffer*/ )
  1191     {
  1196     {
  1192 TFLOGSTRING("TSY:CMmBroadcastTsy::StoreBroadcastIdListL.");    
  1197 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMBROADCASTTSY_STOREBROADCASTIDLISTL_1, "TSY:CMmBroadcastTsy::StoreBroadcastIdListL.");
  1193     ReqCompleted( aTsyReqHandle, KErrNotSupported );
  1198     ReqCompleted( aTsyReqHandle, KErrNotSupported );
  1194 
  1199 
  1195     return KErrNone;
  1200     return KErrNone;
  1196     }
  1201     }
  1197 
  1202