telephonyserverplugins/common_tsy/commontsy/src/mmcustomtsy/CMmPacketTsy.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
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".
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 
    17 
    18 #include <ctsy/tflogger.h>
    18 
       
    19 #include "OstTraceDefinitions.h"
       
    20 #ifdef OST_TRACE_COMPILER_IN_USE
       
    21 #include "CMmPacketTsyTraces.h"
       
    22 #endif
    19 
    23 
    20 #include "CMmCustomTsy.h"
    24 #include "CMmCustomTsy.h"
    21 #include "CMmPacketTsy.h"
    25 #include "CMmPacketTsy.h"
    22 #include "Cmmpacketcontexttsy.h"
    26 #include "Cmmpacketcontexttsy.h"
    23 #include "Cmmpacketcontextlist.h"
    27 #include "Cmmpacketcontextlist.h"
    45 
    49 
    46 CMmPacketTsy* CMmPacketTsy::NewL(
    50 CMmPacketTsy* CMmPacketTsy::NewL(
    47     CMmCustomTsy* aMmCustomTsy, 
    51     CMmCustomTsy* aMmCustomTsy, 
    48     CMmPhoneTsy* aMmPhone )
    52     CMmPhoneTsy* aMmPhone )
    49     {
    53     {
    50 TFLOGSTRING( "CustomTSY: CMmPacketTsy::NewL" );
    54 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_NEWL_1,  "CustomTSY: CMmPacketTsy::NewL" );
    51     CMmPacketTsy* mmPacketTsy = new ( ELeave ) CMmPacketTsy();
    55     CMmPacketTsy* mmPacketTsy = new ( ELeave ) CMmPacketTsy();
    52     CleanupStack::PushL( mmPacketTsy );
    56     CleanupStack::PushL( mmPacketTsy );
    53     mmPacketTsy->iMmCustomTsy = aMmCustomTsy;
    57     mmPacketTsy->iMmCustomTsy = aMmCustomTsy;
    54     mmPacketTsy->iMmPhone = aMmPhone;
    58     mmPacketTsy->iMmPhone = aMmPhone;
    55     mmPacketTsy->ConstructL();
    59     mmPacketTsy->ConstructL();
    58     return mmPacketTsy;
    62     return mmPacketTsy;
    59     }
    63     }
    60 
    64 
    61 CMmPacketTsy::~CMmPacketTsy()
    65 CMmPacketTsy::~CMmPacketTsy()
    62     {
    66     {
    63 TFLOGSTRING( "CustomTSY: CMmPacketTsy::~CMmPacketTsy" );
    67 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_DTOR_1,  "CustomTSY: CMmPacketTsy::~CMmPacketTsy" );
    64     delete iTsyReqHandleStore;
    68     delete iTsyReqHandleStore;
    65     }
    69     }
    66 
    70 
    67 // ---------------------------------------------------------------------------
    71 // ---------------------------------------------------------------------------
    68 // CMmPacketTsy::Init
    72 // CMmPacketTsy::Init
   158 TInt CMmPacketTsy::DoExtFuncL(
   162 TInt CMmPacketTsy::DoExtFuncL(
   159     const TTsyReqHandle aTsyReqHandle, 
   163     const TTsyReqHandle aTsyReqHandle, 
   160     const TInt aIpc, 
   164     const TInt aIpc, 
   161     const TDataPackage& aPackage )
   165     const TDataPackage& aPackage )
   162     {
   166     {
   163 TFLOGSTRING3( "CustomTSY: CMmPacketTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle );
   167 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_DOEXTFUNCL_1,  "CustomTSY: CMmPacketTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle );
   164     TInt ret( KErrNotSupported );
   168     TInt ret( KErrNotSupported );
   165 
   169 
   166     switch ( aIpc )
   170     switch ( aIpc )
   167         {
   171         {
   168         case ECustomNotifyEGprsInfoChange:
   172         case ECustomNotifyEGprsInfoChange:
   170             break;
   174             break;
   171         case ECustomGetEGprsInfo:
   175         case ECustomGetEGprsInfo:
   172             ret = GetEGprsInfo( aTsyReqHandle, aPackage.Des1n() );
   176             ret = GetEGprsInfo( aTsyReqHandle, aPackage.Des1n() );
   173             break;
   177             break;
   174         case ECustomSetAlwaysOnMode:
   178         case ECustomSetAlwaysOnMode:
   175 TFLOGSTRING( "TSY:CMmPacketTsy::DoExtFuncL ECustomSetAlwaysOnMode");
   179 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_DOEXTFUNCL_2,  "TSY:CMmPacketTsy::DoExtFuncL ECustomSetAlwaysOnMode");
   176             ret = SetAlwaysOnL( aTsyReqHandle,
   180             ret = SetAlwaysOnL( aTsyReqHandle,
   177                ( REINTERPRET_CAST( RMmCustomAPI::TSetAlwaysOnMode*,
   181                ( REINTERPRET_CAST( RMmCustomAPI::TSetAlwaysOnMode*,
   178                               					aPackage.Ptr1() ) ) );
   182                               					aPackage.Ptr1() ) ) );
   179         default:
   183         default:
   180             break;
   184             break;
   276 //
   280 //
   277 TInt CMmPacketTsy::CancelService(
   281 TInt CMmPacketTsy::CancelService(
   278     const TInt aIpc, 
   282     const TInt aIpc, 
   279     const TTsyReqHandle aTsyReqHandle )
   283     const TTsyReqHandle aTsyReqHandle )
   280     {
   284     {
   281 TFLOGSTRING2( "CustomTSY: CMmPacketTsy::CancelService IPC:%d", aIpc );
   285 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_CANCELSERVICE_1,  "CustomTSY: CMmPacketTsy::CancelService IPC:%d", aIpc );
   282     TInt ret( KErrNone );
   286     TInt ret( KErrNone );
   283 
   287 
   284     // Req handle type
   288     // Req handle type
   285     TPacketRequestType reqHandletype( 
   289     TPacketRequestType reqHandletype( 
   286         EMultimodePacketContextReqHandleUnknown );
   290         EMultimodePacketContextReqHandleUnknown );
   332 //
   336 //
   333 void CMmPacketTsy::ReqCompleted(
   337 void CMmPacketTsy::ReqCompleted(
   334     const TTsyReqHandle aTsyReqHandle, 
   338     const TTsyReqHandle aTsyReqHandle, 
   335     const TInt aError )
   339     const TInt aError )
   336     {
   340     {
   337 TFLOGSTRING3( "CustomTSY: CMmPacketTsy::ReqCompleted Handle:%d Error:%d", aTsyReqHandle, aError );
   341 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_REQCOMPLETED_1,  "CustomTSY: CMmPacketTsy::ReqCompleted Handle:%d Error:%d", aTsyReqHandle, aError );
   338     iMmCustomTsy->ReqCompleted( aTsyReqHandle, aError );
   342     iMmCustomTsy->ReqCompleted( aTsyReqHandle, aError );
   339     }
   343     }
   340 
   344 
   341 // ---------------------------------------------------------------------------
   345 // ---------------------------------------------------------------------------
   342 // CMmPacketTsy::NotifyEGprsInfoChange
   346 // CMmPacketTsy::NotifyEGprsInfoChange
   346 //
   350 //
   347 TInt CMmPacketTsy::NotifyEGprsInfoChange(
   351 TInt CMmPacketTsy::NotifyEGprsInfoChange(
   348     const TTsyReqHandle aTsyReqHandle, 
   352     const TTsyReqHandle aTsyReqHandle, 
   349     TDes8* aGprsInformation )
   353     TDes8* aGprsInformation )
   350     {
   354     {
   351 TFLOGSTRING( "CustomTSY: CMmPacketTsy::NotifyEGprsInfoChange" );
   355 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_NOTIFYEGPRSINFOCHANGE_1,  "CustomTSY: CMmPacketTsy::NotifyEGprsInfoChange" );
   352 
   356 
   353     RMmCustomAPI::TGprsInformation temp;
   357     RMmCustomAPI::TGprsInformation temp;
   354 	RMmCustomAPI::TGprsInformationPckg tempPckg(temp);
   358 	RMmCustomAPI::TGprsInformationPckg tempPckg(temp);
   355 
   359 
   356 	TInt expectedLength = tempPckg.MaxLength();
   360 	TInt expectedLength = tempPckg.MaxLength();
   380 //
   384 //
   381 TInt CMmPacketTsy::GetEGprsInfo(
   385 TInt CMmPacketTsy::GetEGprsInfo(
   382     const TTsyReqHandle aTsyReqHandle, 
   386     const TTsyReqHandle aTsyReqHandle, 
   383     TDes8* aGprsInformation )
   387     TDes8* aGprsInformation )
   384     {
   388     {
   385 TFLOGSTRING( "CustomTSY: CMmPacketTsy::GetEGprsInfo" );
   389 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_GETEGPRSINFO_1,  "CustomTSY: CMmPacketTsy::GetEGprsInfo" );
   386 
   390 
   387     RMmCustomAPI::TGprsInformation temp;
   391     RMmCustomAPI::TGprsInformation temp;
   388 	RMmCustomAPI::TGprsInformationPckg tempPckg(temp);
   392 	RMmCustomAPI::TGprsInformationPckg tempPckg(temp);
   389 
   393 
   390 	TInt expectedLength = tempPckg.MaxLength();
   394 	TInt expectedLength = tempPckg.MaxLength();
   417 	        }
   421 	        }
   418 
   422 
   419 	    // if gprsSupportInCell is ETrue -> cell is supporting EGPRS connection 
   423 	    // if gprsSupportInCell is ETrue -> cell is supporting EGPRS connection 
   420 	    if ( edgeGprsSupportInCell )
   424 	    if ( edgeGprsSupportInCell )
   421 	        {
   425 	        {
   422 	TFLOGSTRING( "CustomTSY: CMmPacketTsy::GetEGprsInfo  RMmCustomAPI::EEdgeGprs" );
   426 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_GETEGPRSINFO_2,  "CustomTSY: CMmPacketTsy::GetEGprsInfo  RMmCustomAPI::EEdgeGprs" );
   423 	        gprsInformation.iGprsInfo = RMmCustomAPI::EEdgeGprs; 
   427 	        gprsInformation.iGprsInfo = RMmCustomAPI::EEdgeGprs; 
   424 	        }
   428 	        }
   425 
   429 
   426 	    // else EGPRS connection is not supported
   430 	    // else EGPRS connection is not supported
   427 	    else 
   431 	    else 
   428 	        {
   432 	        {
   429 	TFLOGSTRING( "CustomTSY: CMmPacketTsy::GetEGprsInfo  RMmCustomAPI::EGprs" );
   433 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_GETEGPRSINFO_3,  "CustomTSY: CMmPacketTsy::GetEGprsInfo  RMmCustomAPI::EGprs" );
   430 	        gprsInformation.iGprsInfo = RMmCustomAPI::EGprs;
   434 	        gprsInformation.iGprsInfo = RMmCustomAPI::EGprs;
   431 	        }
   435 	        }
   432 
   436 
   433 		ret = KErrNone;
   437 		ret = KErrNone;
   434 		
   438 		
   446 // ---------------------------------------------------------------------------
   450 // ---------------------------------------------------------------------------
   447 //
   451 //
   448 void CMmPacketTsy::CompleteNotifyEGprsInfoChange(
   452 void CMmPacketTsy::CompleteNotifyEGprsInfoChange(
   449     const TBool aGprsSupportInCell )
   453     const TBool aGprsSupportInCell )
   450     {
   454     {
   451 TFLOGSTRING( "CustomTSY: CMmPacketTsy::CompleteNotifyEGprsInfoChange" );
   455 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_COMPLETENOTIFYEGPRSINFOCHANGE_1,  "CustomTSY: CMmPacketTsy::CompleteNotifyEGprsInfoChange" );
   452     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   456     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   453         EMultimodePacketContextNotifyEGprsInfoChange );
   457         EMultimodePacketContextNotifyEGprsInfoChange );
   454 
   458 
   455     if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
   459     if ( EMultimodePacketContextReqHandleUnknown != reqHandle )
   456         {
   460         {
   459             ( *iGprsInformationPckg )();
   463             ( *iGprsInformationPckg )();
   460 
   464 
   461         // if aGprsSupportInCell is ETrue -> cell is supporting edge GPRS
   465         // if aGprsSupportInCell is ETrue -> cell is supporting edge GPRS
   462         if ( aGprsSupportInCell )
   466         if ( aGprsSupportInCell )
   463             {
   467             {
   464 TFLOGSTRING( "CustomTSY: CMmPacketTsy::CompleteNotifyEGprsInfoChange  RMmCustomAPI::EEdgeGprs" );
   468 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_COMPLETENOTIFYEGPRSINFOCHANGE_2,  "CustomTSY: CMmPacketTsy::CompleteNotifyEGprsInfoChange  RMmCustomAPI::EEdgeGprs" );
   465             gprsInformation.iGprsInfo = RMmCustomAPI::EEdgeGprs;
   469             gprsInformation.iGprsInfo = RMmCustomAPI::EEdgeGprs;
   466             }
   470             }
   467 
   471 
   468         // if aGprsSupportInCell is EFalse -> cell is not supporting edge GPRS
   472         // if aGprsSupportInCell is EFalse -> cell is not supporting edge GPRS
   469         else 
   473         else 
   470             {
   474             {
   471 TFLOGSTRING( "CustomTSY: CMmPacketTsy::CompleteNotifyEGprsInfoChange  RMmCustomAPI::EGprs" );
   475 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_COMPLETENOTIFYEGPRSINFOCHANGE_3,  "CustomTSY: CMmPacketTsy::CompleteNotifyEGprsInfoChange  RMmCustomAPI::EGprs" );
   472             gprsInformation.iGprsInfo = RMmCustomAPI::EGprs;
   476             gprsInformation.iGprsInfo = RMmCustomAPI::EGprs;
   473             }
   477             }
   474                     
   478                     
   475         iGprsInformationPckg = NULL;
   479         iGprsInformationPckg = NULL;
   476 
   480 
   487 //
   491 //
   488 TInt CMmPacketTsy::SetAlwaysOnL( 
   492 TInt CMmPacketTsy::SetAlwaysOnL( 
   489 	TTsyReqHandle aTsyReqHandle,
   493 	TTsyReqHandle aTsyReqHandle,
   490 	RMmCustomAPI::TSetAlwaysOnMode* aMode )
   494 	RMmCustomAPI::TSetAlwaysOnMode* aMode )
   491     {
   495     {
   492 TFLOGSTRING2( "CMmPacketTsy::SetAlwaysOn Reg Handle = %d", aTsyReqHandle );
   496 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_SETALWAYSONL_1,  "CMmPacketTsy::SetAlwaysOn Reg Handle = %d", aTsyReqHandle );
   493 	
   497 	
   494 	TInt ret( KErrGeneral );
   498 	TInt ret( KErrGeneral );
   495 	
   499 	
   496 											
   500 											
   497 	//Save requested mode 
   501 	//Save requested mode 
   504         //request set allways on
   508         //request set allways on
   505         ret = packetDataSession->SetAlwaysOnL( aTsyReqHandle, iAllwaysOnMode );
   509         ret = packetDataSession->SetAlwaysOnL( aTsyReqHandle, iAllwaysOnMode );
   506         }
   510         }
   507     else
   511     else
   508         {
   512         {
   509 TFLOGSTRING( "CMmPacketTsy::SetAlwaysOn packetDataSession is NULL " );		
   513 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_SETALWAYSONL_2,  "CMmPacketTsy::SetAlwaysOn packetDataSession is NULL " );
   510         }	
   514         }	
   511 		
   515 		
   512     return ret;
   516     return ret;
   513     }
   517     }
   514 
   518 
   520 //
   524 //
   521 void CMmPacketTsy::CompleteSetAlwaysOn( 
   525 void CMmPacketTsy::CompleteSetAlwaysOn( 
   522 	TTsyReqHandle aReqHandle, 
   526 	TTsyReqHandle aReqHandle, 
   523 	TInt aError )
   527 	TInt aError )
   524     {
   528     {
   525 TFLOGSTRING( "CMmPacketTsy::CompleteSetAlwaysOn" );
   529 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_COMPLETESETALWAYSON_1,  "CMmPacketTsy::CompleteSetAlwaysOn" );
   526 
   530 
   527 	ReqCompleted( aReqHandle, aError );
   531 	ReqCompleted( aReqHandle, aError );
   528 
   532 
   529     }
   533     }
   530 
   534 
   534 // (other items were commented in a header).
   538 // (other items were commented in a header).
   535 //-----------------------------------------------------------------------------
   539 //-----------------------------------------------------------------------------
   536 //
   540 //
   537 void CMmPacketTsy::CancelSetAlwaysOn( TTsyReqHandle aReqHandle )
   541 void CMmPacketTsy::CancelSetAlwaysOn( TTsyReqHandle aReqHandle )
   538 	{
   542 	{
   539 TFLOGSTRING( "CMmPacketTsy::CancelSetAlwaysOn" );
   543 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPACKETTSY_CANCELSETALWAYSON_1,  "CMmPacketTsy::CancelSetAlwaysOn" );
   540 	
   544 	
   541 	//Direct request to Service Tsy
   545 	//Direct request to Service Tsy
   542 	iMmPhone->PacketDataSession()->CancelSetAlwaysOn( aReqHandle );
   546 	iMmPhone->PacketDataSession()->CancelSetAlwaysOn( aReqHandle );
   543 	
   547 	
   544 	}
   548 	}