apicompatanamdw/bcdrivers/os/cellularsrv/IsvTelephonyTest/inc/IsvTelephonyTestEngine.h
changeset 2 0cb2248d0edc
equal deleted inserted replaced
1:61e9400fe245 2:0cb2248d0edc
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  A class that wraps the CTelephony class.
       
    15 *  Copyright (c) 2005 Nokia. All rights reserved.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef ISVTELEPHONYTESTENGINE_H
       
    22 #define ISVTELEPHONYTESTENGINE_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <etel3rdparty.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CTelephony;
       
    30 
       
    31 // CLASS DEFINITIONS
       
    32 
       
    33 /**
       
    34 * CIsvTelephonyTest: This class derives from CActive and wraps the 
       
    35 * CTelephony class. Provides a command table based execution for 
       
    36 * telephony commands with command specific parsing capabilities.
       
    37 */
       
    38 class CIsvTelephonyTestEngine : public CActive
       
    39     {
       
    40     public:
       
    41     
       
    42 	  /**
       
    43 	   * Command Table.
       
    44 	   */
       
    45 	   enum TETelApiCmd 
       
    46 		   	{
       
    47 	        /** 
       
    48 	        Get Phone Identity.
       
    49 	        */
       
    50 	        EGetPhoneId = 0,
       
    51 	        /** 
       
    52 	        Get SubscriberId.
       
    53 	        */
       
    54 	        EGetSubscriberId,
       
    55 			/**
       
    56 	        Get CurrentNetworkInfo.
       
    57 	        */
       
    58 	        EGetCurrentNetworkInfo,
       
    59 			/**
       
    60 	        Get CurrentNetworkName.
       
    61 	        */
       
    62 	        EGetCurrentNetworkName,
       
    63 	        /** 
       
    64 	        Get Flight Mode.
       
    65 	        */
       
    66 	        EGetFlightMode,
       
    67 	        /** 
       
    68 	        Get Indicator.
       
    69 	        */
       
    70 	        EGetIndicator,
       
    71 	        /** 
       
    72 	        Get Signal Strength.
       
    73 	        */
       
    74 	        EGetSignalStrength,
       
    75 	        /** 
       
    76 	        Get Lock Info.
       
    77 	        */
       
    78 	        EGetLockInfo,            
       
    79 	        /** 
       
    80 	        Send DTMF Tones
       
    81 	        */
       
    82 	        ESendDTMFTones,     
       
    83 	        /** 
       
    84 	        Get line status 
       
    85 	        */
       
    86 	        EGetLineStatus,     
       
    87 	        /** 
       
    88 	        Get call info
       
    89 	        */
       
    90 			EGetCallInfo, 
       
    91 	        /** 
       
    92 	        Get Operator Name.
       
    93 	        */
       
    94 	        EGetOperatorName,      
       
    95 	        /** 
       
    96 	        Get Call Forwarding Status. 
       
    97 	        */
       
    98 	        EGetCallForwardingStatus,                  
       
    99 	        /** 
       
   100 	        Get Network registration status.
       
   101 	        */
       
   102 	        ENwRegistrationStatus,
       
   103 	        /**
       
   104 	        Get Battery Info.
       
   105 	        */
       
   106 	        EGetBatteryInfo,
       
   107 	        /** 
       
   108 	        Get Call barring status.
       
   109 	        */
       
   110 	        EGetBarringStatus,
       
   111 	        /** 
       
   112 	        Get Call waiting status.
       
   113 	        */
       
   114 	        EGetWaitingStatus,
       
   115 	        /** 
       
   116 	        Get identity status.
       
   117 	        */
       
   118 	        EGetIdentityStatus,
       
   119 	        /** 
       
   120 	        Dial new call.
       
   121 	        */
       
   122 	        EDialNewCall,
       
   123 	        /** 
       
   124 	        Get call dynamic caps.
       
   125 	        */
       
   126 	        EGetCallDynamicCaps,	 
       
   127 	        /** 
       
   128 	        Get call status.
       
   129 	        */
       
   130 	        EGetCallStatus,	 	        	               
       
   131 	        /** 
       
   132 	        Hold.
       
   133 	        */
       
   134 	        EHold,
       
   135 	        /** 
       
   136 	        Resume.
       
   137 	        */
       
   138 	        EResume,
       
   139 	        /** 
       
   140 	        Swap.
       
   141 	        */
       
   142 	        ESwap,
       
   143 	        /** 
       
   144 	        Hangup.
       
   145 	        */
       
   146 	        EHangup,	        
       
   147 	        /** 
       
   148 	        AnswerIncomingCall.
       
   149 	        */
       
   150 	        EAnswerIncomingCall,
       
   151 	        /** 
       
   152 	        Notify change.
       
   153 	        */
       
   154 			ENotifyChange,
       
   155 	        /** 
       
   156 			Find device status.
       
   157 	        */
       
   158 			EFindDeviceStatus,
       
   159 	        /** 
       
   160 			Establish data call.
       
   161 	        */
       
   162 			EEstablishDataCall,
       
   163 	        /** 
       
   164 			Terminate data call.
       
   165 	        */
       
   166 			ETerminateDataCall,
       
   167 	        /** 
       
   168 			Receive data call.
       
   169 	        */
       
   170 			EReceiveDataCall,
       
   171 	        /** 
       
   172 			Cancel establish data call.
       
   173 	        */
       
   174 			ECancelEstablishDataCall,
       
   175 	        /** 
       
   176 			Cancel receive data call.
       
   177 	        */
       
   178 			ECancelReceiveDataCall, 
       
   179 	        /** 
       
   180 	        Maximum number of commands.
       
   181 	        */
       
   182 	        EMaxCommands,
       
   183 	        /**
       
   184 	        Command None
       
   185 	        */
       
   186 	        ECommandNone
       
   187 	        };    
       
   188 	        
       
   189     public:  // Constructors and destructor
       
   190     
       
   191         /**
       
   192         * Two-phased constructor.
       
   193         */
       
   194         static CIsvTelephonyTestEngine* NewL();
       
   195         
       
   196         /**
       
   197         * Destructor.
       
   198         */
       
   199         virtual ~CIsvTelephonyTestEngine();
       
   200 
       
   201     public:	// Test functions for individual commands
       
   202         
       
   203 		/**
       
   204         * Sets internal cancel async flag, causing async function 
       
   205         * tests to be cancelled with CancelAsync() 
       
   206         */
       
   207 		void SetCancelAsyncs( TBool aSetting );
       
   208 
       
   209         /**
       
   210         * Function for calling CTelephony::Version
       
   211         */
       
   212 		TInt TestGetVersion( TVersion& aVersion );
       
   213 
       
   214         /**
       
   215         * Function for calling CTelephony::GetPhoneId
       
   216         */
       
   217 		TInt TestGetPhoneId( 
       
   218 			CTelephony::TPhoneIdV1& aPhoneId );
       
   219 
       
   220         /**
       
   221         * Function for calling CTelephony::GetSubscriberId
       
   222         */
       
   223 		TInt TestGetSubscriberId( 
       
   224 			CTelephony::TSubscriberIdV1& aSubscriberId );
       
   225 
       
   226         /**
       
   227         * Function for calling CTelephony::GetFlightMode
       
   228         */
       
   229 		TInt TestGetFlightMode( 
       
   230 			CTelephony::TFlightModeV1& aFlightMode );
       
   231 
       
   232         /**
       
   233         * Function for calling CTelephony::GetIndicator
       
   234         */
       
   235 		TInt TestGetIndicator( 
       
   236 			CTelephony::TIndicatorV1& aIndicator );
       
   237 
       
   238         /**
       
   239         * Function for calling CTelephony::GetBatteryInfo
       
   240         */
       
   241         TInt TestGetBatteryInfo( 
       
   242         	CTelephony::TBatteryInfoV1& aBatteryInfo );
       
   243 
       
   244         /**
       
   245         * Function for calling CTelephony::GetSignalStrength
       
   246         */
       
   247         TInt TestGetSignalStrength( 
       
   248         	CTelephony::TSignalStrengthV1& aSignalStrength );
       
   249 
       
   250         /**
       
   251         * Function for calling CTelephony::GetLockInfo
       
   252         */
       
   253         TInt TestGetLockInfo(
       
   254         	CTelephony::TIccLock& aLock, 
       
   255         	CTelephony::TIccLockInfoV1& aLockInfo );
       
   256 
       
   257         /**
       
   258         * Function for calling CTelephony::SendDTMFTones
       
   259         */
       
   260         TInt TestSendDTMFTones(
       
   261         	const TDesC& aDTMFTones );
       
   262 
       
   263         /**
       
   264         * Function for calling CTelephony::GetLineStatus
       
   265         */
       
   266         TInt TestGetLineStatus(
       
   267         	CTelephony::TPhoneLine& aPhoneLine,
       
   268     		CTelephony::TCallStatusV1& aCallStatus );
       
   269 
       
   270         /**
       
   271         * Function for calling CTelephony::GetCallInfo
       
   272         */
       
   273         TInt TestGetCallInfo( 
       
   274  			CTelephony::TCallSelectionV1& aCallSelection, 
       
   275  			CTelephony::TCallInfoV1& aCallInfo, 
       
   276  			CTelephony::TRemotePartyInfoV1& aRemotePartyInfo );    
       
   277 
       
   278         /**
       
   279         * Function for calling CTelephony::GetNetworkRegistrationStatus
       
   280         */
       
   281         TInt TestGetNetworkRegistrationStatus(
       
   282         	CTelephony::TNetworkRegistrationV1& aNetworkRegistration );
       
   283 
       
   284         /**
       
   285         * Function for calling CTelephony::GetCurrentNetworkInfo
       
   286         */
       
   287         TInt TestGetCurrentNetworkInfo( 
       
   288         	CTelephony::TNetworkInfoV1& aNetworkInfo );
       
   289 
       
   290         /**
       
   291         * Function for calling CTelephony::GetCurrentNetworkName
       
   292         */
       
   293         TInt TestGetCurrentNetworkName( 
       
   294         	CTelephony::TNetworkNameV1& aNetworkName );
       
   295 						
       
   296         /**
       
   297         * Function for calling CTelephony::GetOperatorName
       
   298         */
       
   299         TInt TestGetOperatorName( 
       
   300         	CTelephony::TOperatorNameV1& aOperatorName );
       
   301         	
       
   302         /**
       
   303         * Function for calling CTelephony::GetCallForwardingStatus
       
   304         */
       
   305         TInt TestGetCallForwardingStatus( 
       
   306 		 	CTelephony::TCallForwardingCondition& aCallForwardingCondition, 		 	
       
   307 		 	CTelephony::TCallForwardingSupplServicesV1& aCallForwardingStatus,
       
   308 		 	CTelephony::TServiceGroup& aServiceGroup );  
       
   309 
       
   310         /**
       
   311         * Function for calling CTelephony::GetCallBarringStatus
       
   312         */
       
   313         TInt TestGetCallBarringStatus( 
       
   314 		 	CTelephony::TCallBarringCondition& aCallBarringCondition, 		 	
       
   315 		 	CTelephony::TCallBarringSupplServicesV1& aCallBarringStatus,
       
   316 		 	CTelephony::TServiceGroup& aServiceGroup );  
       
   317 		
       
   318         /**
       
   319         * Function for calling CTelephony::GetCallWaitingStatus
       
   320         */
       
   321         TInt TestGetCallWaitingStatus( 		 	
       
   322 		 	CTelephony::TCallWaitingSupplServicesV1& aCallWaitingStatus,
       
   323 		 	CTelephony::TServiceGroup& aServiceGroup );  
       
   324 
       
   325         /**
       
   326         * Function for calling CTelephony::GetIdentityServiceStatus
       
   327         */
       
   328         TInt TestGetIdentityServiceStatus( 		 	
       
   329 		 	CTelephony::TIdentityService& aIdentityService,
       
   330 		 	CTelephony::TIdentityServiceV1& aIdentityServiceStatus );
       
   331  	
       
   332         /**
       
   333         * Function for calling CTelephony::DialNewCall
       
   334         */
       
   335         TInt TestDialNewCall( 
       
   336 		 	CTelephony::TCallParamsV1& aCallParams, 
       
   337 		 	CTelephony::TTelNumber& aTelNumber, 
       
   338 			CTelephony::TCallId& aCallId, 
       
   339 			CTelephony::TPhoneLine& aPhoneLine ); 
       
   340 	 	
       
   341         /**
       
   342         * Function for calling CTelephony::GetCallDynamicCaps
       
   343         */
       
   344         TInt TestGetCallDynamicCaps( 		 	
       
   345 			CTelephony::TCallId& aCallId, 
       
   346 			CTelephony::TCallCapsV1& aCallCaps ); 
       
   347 
       
   348         /**
       
   349         * Function for calling CTelephony::GetCallStatus
       
   350         */
       
   351         TInt TestGetCallStatus( 		 	
       
   352 			CTelephony::TCallId& aCallId, 
       
   353 			CTelephony::TCallStatusV1& aCallStatus ); 	 		 	
       
   354 
       
   355         /**
       
   356         * Function for calling CTelephony::Hold
       
   357         */
       
   358         TInt TestHold( 
       
   359         	CTelephony::TCallId& aCallId ); 	 		 	
       
   360 	
       
   361         /**
       
   362         * Function for calling CTelephony::Resume
       
   363         */
       
   364         TInt TestResume( 
       
   365         	CTelephony::TCallId& aCallId ); 	 		 	
       
   366 
       
   367         /**
       
   368         * Function for calling CTelephony::Swap
       
   369         */
       
   370         TInt TestSwap( 
       
   371         	CTelephony::TCallId& aCallId1,
       
   372         	CTelephony::TCallId& aCallId2 ); 	 		 	
       
   373 
       
   374         /**
       
   375         * Function for calling CTelephony::Hangup
       
   376         */
       
   377         TInt TestHangup( 
       
   378         	CTelephony::TCallId& aCallId ); 	 		 	
       
   379 
       
   380         /**
       
   381         * Function for calling CTelephony::AnswerIncomingCall
       
   382         */
       
   383         TInt TestAnswerIncomingCall( 		 	
       
   384 			CTelephony::TCallId& aCallId, 
       
   385 			CTelephony::TPhoneLine& aPhoneLine ); 	 		 	
       
   386 
       
   387         /**
       
   388         * Function for calling CTelephony::NotifyChange
       
   389         */
       
   390         TInt TestNotifyChangeVoiceLineStatus ( 
       
   391         	CTelephony::TNotificationEvent aNotificationEvent, 
       
   392         	TDes8& aNotificationPckg );
       
   393 		
       
   394         /**
       
   395         * Function for calling CTelephony::FindDeviceStatus
       
   396         */
       
   397 		TInt TestFindDeviceStatus();		
       
   398 
       
   399         /**
       
   400         * Function for calling CTelephony::EstablishDataCall
       
   401         */
       
   402 		TInt TestEstablishDataCall();		
       
   403 
       
   404         /**
       
   405         * Function for calling CTelephony::EstablishDataCall
       
   406         */
       
   407 		TInt TestEstablishDataCallAsync();		
       
   408 
       
   409         /**
       
   410         * Function for calling CTelephony::TerminateDataCall
       
   411         */
       
   412 		TInt TestTerminateDataCall();		
       
   413 
       
   414         /**
       
   415         * Function for calling CTelephony::ReceiveDataCall
       
   416         */
       
   417 		TInt TestReceiveDataCall();		
       
   418 
       
   419         /**
       
   420         * Function for calling CTelephony::ReceiveDataCall
       
   421         */
       
   422 		TInt TestReceiveDataCallAsync();		
       
   423 
       
   424         /**
       
   425         * Function for calling CTelephony::CancelEstablishDataCall
       
   426         */
       
   427 		TInt TestCancelEstablishDataCall();		
       
   428 
       
   429         /**
       
   430         * Function for calling CTelephony::CancelReceiveDataCall
       
   431         */
       
   432 		TInt TestCancelReceiveDataCall();	
       
   433 				
       
   434     protected:
       
   435     
       
   436         /**
       
   437         * From CActive, RunL.
       
   438         * Handles the active object’s request completion event.
       
   439         */
       
   440         void RunL();
       
   441         
       
   442         /**
       
   443         * From CActive, DoCancel.
       
   444         * Implements cancellation of an outstanding request.
       
   445         */
       
   446         void DoCancel();
       
   447 
       
   448         /**
       
   449         * Starts the active scheduler wait after testing if it 
       
   450         * is already started.
       
   451         */                                                        
       
   452         void StartWait();
       
   453 
       
   454 	private: 
       
   455 
       
   456         /**
       
   457         * Default constructor.
       
   458         */
       
   459         CIsvTelephonyTestEngine();
       
   460         
       
   461         /**
       
   462         * Second-phase constructor.
       
   463         */
       
   464         void ConstructL();
       
   465 
       
   466     private:    // Data
       
   467         // Instance of command table    
       
   468         TETelApiCmd iTelApiCmd; 
       
   469         
       
   470         // Instance of scheduler wait class
       
   471         CActiveSchedulerWait iWait; 
       
   472 
       
   473         // Pointer to CTelephony class 
       
   474         // which contains the Telephony ISV 3rd party API
       
   475         CTelephony* iTelephony;      
       
   476 
       
   477        	// Notification event
       
   478        	CTelephony::TNotificationEvent iNotificationEvent;
       
   479        	
       
   480        	// Cancel Async flag
       
   481        	TBool iCancelAsyncs;
       
   482        	
       
   483     };
       
   484 
       
   485 #endif // ISVTELEPHONYTESTENGINE_H