telephonyserver/etelsimtoolkit/tetel/Te_EtelSat/TE_EtelSatpcmds1e.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Tests added for new functionality in 8.0
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 #include "Te_EtelSatTestStepBase.h"
       
    23 #include "TE_EtelSatpcmds1e.h"
       
    24 
       
    25 CTestSatPCmds1e::CTestSatPCmds1e()
       
    26 /** Each test step initialises it's own name
       
    27 */
       
    28 	{
       
    29 	// store the name of this test case
       
    30 	// this is the name that is used by the script file
       
    31 	SetTestStepName(_L("TestSatPCmds1e"));
       
    32 	}
       
    33 	
       
    34 enum TVerdict CTestSatPCmds1e::doTestStepL()
       
    35 	{
       
    36 	INFO_PRINTF1(_L("***********************************************"));
       
    37 	INFO_PRINTF1(_L("RSat Proactive Commands Functionality suite - 4"));
       
    38 	INFO_PRINTF1(_L("***********************************************"));
       
    39 	
       
    40 	TInt ret=phone.Open(iTelServer,DSATTSY_PHONE_NAME);
       
    41 	TEST(ret==KErrNone);
       
    42 
       
    43 	ret=sat.Open(phone);
       
    44     TEST(ret==KErrNone);
       
    45     
       
    46 	TRequestStatus reqStatus;
       
    47 	
       
    48 	//CB DOWNLOAD
       
    49 	
       
    50 	RSat::TCbDownloadV3 cbDownload;
       
    51 	RSat::TCbDownloadV3Pckg cbDownloadPckg(cbDownload);
       
    52 	
       
    53 	sat.NotifyCbDownload(reqStatus, cbDownloadPckg);
       
    54 	User::WaitForRequest(reqStatus);
       
    55 	TEST(reqStatus.Int()==KErrNone);	
       
    56 	TEST(cbDownload.iDeviceId==RSat::KEarPiece);
       
    57 	TEST(cbDownload.iPdu==DSATTSY_CB_PDU);
       
    58 	
       
    59 	//Cancel
       
    60 	sat.NotifyCbDownload(reqStatus, cbDownloadPckg);
       
    61 	sat.CancelAsyncRequest(ESatNotifyCbDownload);
       
    62 	User::WaitForRequest(reqStatus);
       
    63 	TEST(reqStatus.Int()==KErrCancel);
       
    64 	
       
    65 	
       
    66 	//SMS PP DOWNLOAD
       
    67 	
       
    68 	RSat::TSmsPpDownloadV3 smsPpDownload;
       
    69 	RSat::TSmsPpDownloadV3Pckg smsPpDownloadPckg(smsPpDownload);
       
    70 	
       
    71 	sat.NotifySmsPpDownload(reqStatus, smsPpDownloadPckg);
       
    72 	User::WaitForRequest(reqStatus);
       
    73 	TEST(reqStatus.Int()==KErrNone);	
       
    74 	TEST(smsPpDownload.iDeviceId=RSat::KEarPiece);
       
    75 	TEST(smsPpDownload.iRpAddress.iTypeOfNumber	== DSATTSY_TON);	
       
    76 	TEST(smsPpDownload.iRpAddress.iNumberPlan	== DSATTSY_NPI);
       
    77 	TEST(smsPpDownload.iRpAddress.iTelNumber	== DSATTSY_TEL_NUMBER);	
       
    78 	TEST(smsPpDownload.iPdu== DSATTSY_SMS_TPDU);
       
    79 	
       
    80 	//Cancel
       
    81 	sat.NotifySmsPpDownload(reqStatus, smsPpDownloadPckg);
       
    82 	sat.CancelAsyncRequest(ESatNotifySmsPpDownload);
       
    83 	User::WaitForRequest(reqStatus);
       
    84 	TEST(reqStatus.Int()==KErrCancel);
       
    85 	
       
    86 	//TIMER EXPIRATION
       
    87 	
       
    88 	RSat::TTimerExpirationV3 timerExpiration;
       
    89 	RSat::TTimerExpirationV3Pckg timerExpirationPckg(timerExpiration);
       
    90 	
       
    91 	sat.NotifyTimerExpiration(reqStatus, timerExpirationPckg);
       
    92 	
       
    93 	User::WaitForRequest(reqStatus);
       
    94 	TEST(reqStatus.Int()==KErrNone);	
       
    95 	TEST(timerExpiration.iTimerId == RSat::KTimer1);	
       
    96 	TEST(timerExpiration.iTimerValue.iTimeUnit == RSat::ESeconds);
       
    97 	
       
    98 	//Cancel
       
    99 	sat.NotifyTimerExpiration(reqStatus, timerExpirationPckg);
       
   100 	sat.CancelAsyncRequest(ESatNotifyTimerExpiration);
       
   101 	User::WaitForRequest(reqStatus);
       
   102 	TEST(reqStatus.Int()==KErrCancel);
       
   103 	
       
   104 	//LOCAL INFO
       
   105 	
       
   106 	RSat::TLocalInfoV3 localInfo;
       
   107 	RSat::TLocalInfoV3Pckg localInfoPckg(localInfo);
       
   108 	
       
   109 	sat.NotifyLocalInfoPCmd(reqStatus, localInfoPckg);
       
   110 
       
   111 	User::WaitForRequest(reqStatus);
       
   112 	TEST(reqStatus.Int()==KErrNone);	
       
   113 	TEST(localInfo.iDevideId == RSat::KKeypad);	
       
   114 	TEST(localInfo.iInfoType == RSat::KProvideLocalInfo);
       
   115 	
       
   116 	//Cancel
       
   117 	sat.NotifyLocalInfoPCmd(reqStatus, localInfoPckg);
       
   118 	sat.CancelAsyncRequest(ESatNotifyLocalInfoPCmd);
       
   119 	User::WaitForRequest(reqStatus);
       
   120 	TEST(reqStatus.Int()==KErrCancel);	
       
   121 	
       
   122 	//Response
       
   123 	RSat::TLocalInfoRspV3 localInfoRsp;
       
   124 	RSat::TLocalInfoRspV3Pckg localInfoRspPckg(localInfoRsp);	
       
   125 	localInfoRsp.SetPCmdNumber(DSATTSY_LOCAL_INFO_NUMBER);
       
   126 	localInfoRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
       
   127 	localInfoRsp.iInfoType=DSATTSY_INFO_TYPE;	
       
   128 	localInfoRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
       
   129 	
       
   130 	sat.NotifyLocalInfoPCmd(reqStatus, localInfoPckg);
       
   131 	User::WaitForRequest(reqStatus);
       
   132 	TEST(reqStatus.Int()==KErrNone);
       
   133 	
       
   134 	sat.TerminalRsp(reqStatus,RSat::ELocalInfo,localInfoRspPckg);
       
   135 	User::WaitForRequest(reqStatus);
       
   136 	TEST(reqStatus.Int()==KErrNone);
       
   137 	INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Local Infot - passed"),iTestCount++);	
       
   138 
       
   139 		
       
   140 	//POLLING INTERVAL
       
   141 	
       
   142 	RSat::TPollingIntervalV3 pollingIntv;
       
   143 	RSat::TPollingIntervalV3Pckg pollingIntvPckg(pollingIntv);
       
   144 	
       
   145 	sat.NotifyPollingIntervalPCmd(reqStatus, pollingIntvPckg);
       
   146 
       
   147 	User::WaitForRequest(reqStatus);
       
   148 	TEST(reqStatus.Int()==KErrNone);	
       
   149 	TEST(pollingIntv.iIntv.iTimeUnit == DSATTSY_TIME_UNIT);
       
   150 	TEST(pollingIntv.iIntv.iNumOfUnits == DSATTSY_NUM_OF_UNITS);
       
   151 	TEST(pollingIntv.iDestination == RSat::KEarPiece);
       
   152 	
       
   153 	//Cancel
       
   154 	sat.NotifyPollingIntervalPCmd(reqStatus, pollingIntvPckg);
       
   155 	sat.CancelAsyncRequest(ESatNotifyPollingIntervalPCmd);
       
   156 	User::WaitForRequest(reqStatus);
       
   157 	TEST(reqStatus.Int()==KErrCancel);
       
   158 	
       
   159 	//Response	
       
   160 	RSat::TPollingIntervalRspV3 pollingIntvRsp;
       
   161 	RSat::TPollingIntervalRspV3Pckg pollingIntvRspPckg(pollingIntvRsp);
       
   162 	pollingIntvRsp.SetPCmdNumber(DSATTSY_POLLING_INTERVAL_NUMBER);
       
   163 	pollingIntvRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
       
   164 	pollingIntvRsp.iInfoType=DSATTSY_INFO_TYPE;	
       
   165 	pollingIntvRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
       
   166 	
       
   167 	sat.NotifyPollingIntervalPCmd(reqStatus, pollingIntvPckg);
       
   168 	User::WaitForRequest(reqStatus);
       
   169 	TEST(reqStatus.Int()==KErrNone);	
       
   170 	
       
   171 	sat.TerminalRsp(reqStatus,RSat::EPollingInterval,pollingIntvRspPckg);
       
   172 	User::WaitForRequest(reqStatus);
       
   173 	TEST(reqStatus.Int()==KErrNone);
       
   174 	INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Polling Interval - passed"),iTestCount++);	
       
   175 	
       
   176 	//POLLING OFF
       
   177 	
       
   178 	RSat::TPollingOffV3 pollingOff;
       
   179 	RSat::TPollingOffV3Pckg pollingOffPckg(pollingOff);
       
   180 	
       
   181 	sat.NotifyPollingOffPCmd(reqStatus, pollingOffPckg);
       
   182 
       
   183 	User::WaitForRequest(reqStatus);	
       
   184 	TEST(reqStatus.Int()==KErrNone);
       
   185 	TEST(pollingOff.iIntv.iTimeUnit==RSat::ESeconds);
       
   186 	TEST(pollingOff.iIntv.iNumOfUnits == 20);
       
   187 	TEST(pollingOff.iDestination == RSat::KNetwork);
       
   188 	
       
   189 	//Cancel	
       
   190 	sat.NotifyPollingOffPCmd(reqStatus, pollingOffPckg);
       
   191 	sat.CancelAsyncRequest(ESatNotifyPollingOffPCmd);
       
   192 	User::WaitForRequest(reqStatus);
       
   193 	TEST(reqStatus.Int()==KErrCancel);
       
   194 	
       
   195 	//Response	
       
   196 	RSat::TPollingOffRspV3 pollingOffRsp;
       
   197 	RSat::TPollingOffRspV3Pckg pollingOffRspPckg(pollingOffRsp);	
       
   198 	pollingOffRsp.SetPCmdNumber(DSATTSY_POLLING_OFF_NUMBER);
       
   199 	pollingOffRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
       
   200 	pollingOffRsp.iInfoType=DSATTSY_INFO_TYPE;	
       
   201 	pollingOffRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
       
   202 	
       
   203 	sat.NotifyPollingOffPCmd(reqStatus, pollingOffPckg);
       
   204 	User::WaitForRequest(reqStatus);
       
   205 	TEST(reqStatus.Int()==KErrNone);	
       
   206 	
       
   207 	sat.TerminalRsp(reqStatus,RSat::EPollingOff,pollingOffRspPckg);
       
   208 	User::WaitForRequest(reqStatus);
       
   209 	TEST(reqStatus.Int()==KErrNone);
       
   210 	INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Polling Off - passed"),iTestCount++);	
       
   211 	
       
   212 	
       
   213 	
       
   214 	//TIMER MANAGEMENT
       
   215 	
       
   216 	RSat::TTimerMgmtV3		timerMngt;
       
   217 	RSat::TTimerMgmtV3Pckg	timerMngtPckg(timerMngt);
       
   218 
       
   219 	sat.NotifyTimerMgmtPCmd(reqStatus, timerMngtPckg);
       
   220 
       
   221 	User::WaitForRequest(reqStatus);
       
   222 	TEST(reqStatus.Int()==KErrNone);
       
   223 	TEST(timerMngt.iTimerId == RSat::KTimer1);	
       
   224 	TEST(timerMngt.iTimerValue.iTimeUnit==RSat::ESeconds);
       
   225 	TEST(timerMngt.iTimerValue.iNumOfUnits == 10);
       
   226 	TEST(timerMngt.iOperation ==RSat::EStartTimer);	
       
   227 	
       
   228     //Cancel	
       
   229 	sat.NotifyTimerMgmtPCmd(reqStatus, timerMngtPckg);
       
   230 	sat.CancelAsyncRequest(ESatNotifyTimerMgmtPCmd);
       
   231 	User::WaitForRequest(reqStatus);
       
   232 	TEST(reqStatus.Int()==KErrCancel);
       
   233     
       
   234     //Response
       
   235 	RSat::TTimerMgmtRspV3 timerMangtRsp;
       
   236 	RSat::TTimerMgmtRspV3Pckg timerMgmtRspPckg(timerMangtRsp);	
       
   237 	timerMangtRsp.SetPCmdNumber(DSATTSY_TIMER_MNGT_NUMBER);
       
   238 	timerMangtRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
       
   239 	timerMangtRsp.iInfoType=DSATTSY_INFO_TYPE;	
       
   240 	timerMangtRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
       
   241 	
       
   242 	sat.NotifyTimerMgmtPCmd(reqStatus, timerMngtPckg);
       
   243 	User::WaitForRequest(reqStatus);
       
   244 	TEST(reqStatus.Int()==KErrNone);	
       
   245 
       
   246 	sat.TerminalRsp(reqStatus,RSat::ETimerMngt,timerMgmtRspPckg);
       
   247 	User::WaitForRequest(reqStatus);
       
   248 	TEST(reqStatus.Int()==KErrNone);
       
   249 	INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Tmer Managt - passed"),iTestCount++);	
       
   250     
       
   251     
       
   252     
       
   253     
       
   254     sat.Close();
       
   255 	phone.Close();
       
   256 
       
   257 	return TestStepResult();
       
   258 	}