cbsatplugin/atmisccmdplugin/src/atmisccmdplugin.cpp
branchRCL_3
changeset 24 269724087bed
parent 21 0ba996a9b75d
equal deleted inserted replaced
23:9386f31cc85b 24:269724087bed
    22 #include "cpincommandhandler.h"
    22 #include "cpincommandhandler.h"
    23 #include "cusdcommandhandler.h"
    23 #include "cusdcommandhandler.h"
    24 #include "cnumcommandhandler.h"
    24 #include "cnumcommandhandler.h"
    25 #include "cfuncommandhandler.h"
    25 #include "cfuncommandhandler.h"
    26 #include "cbccommandhandler.h"
    26 #include "cbccommandhandler.h"
    27 #ifdef PROTOCOL_TDSCDMA
       
    28 #include "hvercommandhandler.h"
    27 #include "hvercommandhandler.h"
    29 #include "cgsncommandhandler.h"
    28 #include "cgsncommandhandler.h"
    30 #include "cgmrcommandhandler.h"
    29 #include "cgmrcommandhandler.h"
    31 #include "cgmicommandhandler.h"
    30 #include "cgmicommandhandler.h"
    32 #include "cmgwcommandhandler.h"
    31 #include "cmgwcommandhandler.h"
    33 #include "cmgdcommandhandler.h"
    32 #include "cmgdcommandhandler.h"
    34 #include "telephonywrapper.h"
    33 #include "telephonywrapper.h"
    35 #include "cgmmcommandhandler.h"
    34 #include "cgmmcommandhandler.h"
    36 #include "scpbrcommandhandler.h"
    35 #include "scpbrcommandhandler.h"
    37 #include "scpbwcommandhandler.h"
    36 #include "scpbwcommandhandler.h"
    38 #endif
       
    39 
       
    40 
    37 
    41 #include "atmisccmdpluginconsts.h"
    38 #include "atmisccmdpluginconsts.h"
    42 #include "cmserror.h"
    39 #include "cmserror.h"
    43 #include "debug.h"
    40 #include "debug.h"
    44 
    41 
    84     delete iCPINHandler;
    81     delete iCPINHandler;
    85     delete iCUSDHandler;
    82     delete iCUSDHandler;
    86     delete iCNUMHandler;
    83     delete iCNUMHandler;
    87     delete iCFUNHandler;
    84     delete iCFUNHandler;
    88     delete iCBCHandler;
    85     delete iCBCHandler;
    89 #ifdef PROTOCOL_TDSCDMA
       
    90 	delete iHVERHandler;
    86 	delete iHVERHandler;
    91 	delete iCGSNHandler;
    87 	delete iCGSNHandler;
    92     delete iCGMRHandler;
    88     delete iCGMRHandler;
    93     delete iCGMIHandler;
    89     delete iCGMIHandler;
    94     delete iCMGWHandler;
    90     delete iCMGWHandler;
    95     delete iCMGDHandler;
    91     delete iCMGDHandler;
    96     delete iCGMMHandler;
    92     delete iCGMMHandler;
    97 	delete iSCPBRHandler;
    93 	delete iSCPBRHandler;
    98     delete iSCPBWHandler;
    94     delete iSCPBWHandler;  
    99 #endif    
       
   100 	
    95 	
   101     iPhone.Close();
    96     iPhone.Close();
   102     iTelServer.Close();
    97     iTelServer.Close();
   103 	}
    98 	}
   104 
    99 
   117     iCUSDHandler = CCUSDCommandHandler::NewL(this, iCommandParser, iPhone);
   112     iCUSDHandler = CCUSDCommandHandler::NewL(this, iCommandParser, iPhone);
   118     iCPINHandler = CCPINCommandHandler::NewL(this, iCommandParser, iPhone);
   113     iCPINHandler = CCPINCommandHandler::NewL(this, iCommandParser, iPhone);
   119     iCNUMHandler = CCNUMCommandHandler::NewL(this, iCommandParser, iPhone, iTelServer);
   114     iCNUMHandler = CCNUMCommandHandler::NewL(this, iCommandParser, iPhone, iTelServer);
   120     iCFUNHandler = CCFUNCommandHandler::NewL(this, iCommandParser, iPhone);
   115     iCFUNHandler = CCFUNCommandHandler::NewL(this, iCommandParser, iPhone);
   121     iCBCHandler = CCBCCommandHandler::NewL(this, iCommandParser, iPhone);
   116     iCBCHandler = CCBCCommandHandler::NewL(this, iCommandParser, iPhone);
   122     
       
   123 #ifdef PROTOCOL_TDSCDMA
       
   124 	iHVERHandler = CHVERCommandHandler::NewL(this, iCommandParser, iPhone);
   117 	iHVERHandler = CHVERCommandHandler::NewL(this, iCommandParser, iPhone);
   125     iCGSNHandler = CCGSNCommandHandler::NewL(this, iCommandParser, iPhone);
   118     iCGSNHandler = CCGSNCommandHandler::NewL(this, iCommandParser, iPhone);
   126     iCGMRHandler = CCGMRCommandHandler::NewL(this, iCommandParser, iPhone);
   119     iCGMRHandler = CCGMRCommandHandler::NewL(this, iCommandParser, iPhone);
   127     iCGMIHandler = CCGMICommandHandler::NewL(this, iCommandParser, iPhone);
   120     iCGMIHandler = CCGMICommandHandler::NewL(this, iCommandParser, iPhone);
   128     iCMGWHandler = CCMGWCommandHandler::NewL(this, iCommandParser, iPhone);
   121     iCMGWHandler = CCMGWCommandHandler::NewL(this, iCommandParser, iPhone);
   150         static_cast<CCGSNCommandHandler*>(iCGSNHandler)->SetTelephonyError(result);
   143         static_cast<CCGSNCommandHandler*>(iCGSNHandler)->SetTelephonyError(result);
   151         static_cast<CCGMICommandHandler*>(iCGMIHandler)->SetTelephonyError(result);
   144         static_cast<CCGMICommandHandler*>(iCGMIHandler)->SetTelephonyError(result);
   152         static_cast<CCGMMCommandHandler*>(iCGMMHandler)->SetTelephonyError(result);
   145         static_cast<CCGMMCommandHandler*>(iCGMMHandler)->SetTelephonyError(result);
   153         }
   146         }
   154     delete telephonyWrapper;
   147     delete telephonyWrapper;
   155 #endif    
       
   156     
   148     
   157     TRACE_FUNC_EXIT
   149     TRACE_FUNC_EXIT
   158    	}
   150    	}
   159 
   151 
   160 /**
   152 /**
   224         case (TAtCommandParser::ECmdAtCmee):
   216         case (TAtCommandParser::ECmdAtCmee):
   225             {
   217             {
   226             iCurrentHandler = NULL;	
   218             iCurrentHandler = NULL;	
   227             break;
   219             break;
   228 			}
   220 			}
   229 #ifdef PROTOCOL_TDSCDMA
       
   230         case (TAtCommandParser::ECmdAtHver):
   221         case (TAtCommandParser::ECmdAtHver):
   231             {
   222             {
   232             iCurrentHandler = iHVERHandler;
   223             iCurrentHandler = iHVERHandler;
   233             break;
   224             break;
   234             }
   225             }
   285 		case (TAtCommandParser::ECmdAtScpbw):
   276 		case (TAtCommandParser::ECmdAtScpbw):
   286             {
   277             {
   287             iCurrentHandler = iSCPBWHandler;
   278             iCurrentHandler = iSCPBWHandler;
   288             break;
   279             break;
   289             }
   280             }
   290 #endif
       
   291         case (TAtCommandParser::EUnknown):
   281         case (TAtCommandParser::EUnknown):
   292         default:
   282         default:
   293             {
   283             {
   294             supported = EFalse;
   284             supported = EFalse;
   295             break;
   285             break;
   312 	if(iCommandParser.Command() == TAtCommandParser::ECmdAtCmee)
   302 	if(iCommandParser.Command() == TAtCommandParser::ECmdAtCmee)
   313 	    {
   303 	    {
   314         HandleCMEECommand();
   304         HandleCMEECommand();
   315         HandleCommandCompleted( KErrNone, EReplyTypeOk);
   305         HandleCommandCompleted( KErrNone, EReplyTypeOk);
   316 	    }
   306 	    }
   317 #ifdef PROTOCOL_TDSCDMA
       
   318 	else if (iCommandParser.Command() == TAtCommandParser::ECmdAtCmgf)
   307 	else if (iCommandParser.Command() == TAtCommandParser::ECmdAtCmgf)
   319 	    {
   308 	    {
   320         HandleCMGFCommand();
   309         HandleCMGFCommand();
   321         HandleCommandCompleted( KErrNone, EReplyTypeOk);
   310         HandleCommandCompleted( KErrNone, EReplyTypeOk);
   322 	    }
   311 	    }
   323 #endif
       
   324 	else if (iCurrentHandler != NULL)
   312 	else if (iCurrentHandler != NULL)
   325 	    {
   313 	    {
   326 	    iHcCmd = &aCmd;
   314 	    iHcCmd = &aCmd;
   327 	    iHcReply = &aReply;
   315 	    iHcReply = &aReply;
   328 	    // No need to parse the command again as assumed that
   316 	    // No need to parse the command again as assumed that
   487     Trace(KDebugPrintD, "aReplyType: ", aReplyType);
   475     Trace(KDebugPrintD, "aReplyType: ", aReplyType);
   488     switch ( aReplyType )
   476     switch ( aReplyType )
   489         {
   477         {
   490         case EReplyTypeOther:
   478         case EReplyTypeOther:
   491             break;
   479             break;
   492 #ifdef PROTOCOL_TDSCDMA
       
   493         case EReplyTypeEditor:
   480         case EReplyTypeEditor:
   494             CreateEditModeBuffer( iReplyBuffer );
   481             CreateEditModeBuffer( iReplyBuffer );
   495             break;
   482             break;
   496 #endif
       
   497         case EReplyTypeOk:
   483         case EReplyTypeOk:
   498             CreateOkOrErrorReply( iReplyBuffer, ETrue );
   484             CreateOkOrErrorReply( iReplyBuffer, ETrue );
   499             break;
   485             break;
   500         case EReplyTypeError:
   486         case EReplyTypeError:
   501             CreateOkOrErrorReply( iReplyBuffer, EFalse );
   487             CreateOkOrErrorReply( iReplyBuffer, EFalse );
   875 
   861 
   876 void CATMiscCmdPlugin::HandleCMGFCommand()
   862 void CATMiscCmdPlugin::HandleCMGFCommand()
   877     {
   863     {
   878     TRACE_FUNC_ENTRY
   864     TRACE_FUNC_ENTRY
   879     
   865     
   880 #ifdef PROTOCOL_TDSCDMA    
       
   881     TAtCommandParser::TCommandHandlerType cmdHandlerType = iCommandParser.CommandHandlerType();
   866     TAtCommandParser::TCommandHandlerType cmdHandlerType = iCommandParser.CommandHandlerType();
   882     
   867     
   883     if (cmdHandlerType == TAtCommandParser::ECmdHandlerTypeSet)
   868     if (cmdHandlerType == TAtCommandParser::ECmdHandlerTypeSet)
   884         {
   869         {
   885         TInt msgFormat = 0;
   870         TInt msgFormat = 0;
   887         if(ret == KErrNone && iCMGWHandler)
   872         if(ret == KErrNone && iCMGWHandler)
   888             {
   873             {
   889             static_cast<CCMGWCommandHandler*> (iCMGWHandler)->SetMessageFormat(msgFormat);
   874             static_cast<CCMGWCommandHandler*> (iCMGWHandler)->SetMessageFormat(msgFormat);
   890             }
   875             }
   891         }
   876         }
   892 #endif  
       
   893     
   877     
   894     TRACE_FUNC_EXIT
   878     TRACE_FUNC_EXIT
   895     }
   879     }
   896   
   880   
   897 
   881