cbsref/telephonyrefplugins/atltsy/integrationtest/src/testltsysmssend.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
child 21 4814c5a49428
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 //
       
     2 // testltsysmssend.cpp
       
     3 //
       
     4 // Copyright (c) Symbian Software Ltd. Your copyright notice.  All rights reserved.
       
     5 //
       
     6 
       
     7 //user include
       
     8 #include "testltsysmssend.h"
       
     9 #include "testltsysmsatutil.h"
       
    10 //constant defination
       
    11 _LIT8(KSmsMessagingData,"11000D91683156211075f6000800064F60597D0021");
       
    12 _LIT(KSmsSCA,"8613800100500");  
       
    13 
       
    14 CTestLtsySmsSend::CTestLtsySmsSend(CTestLtsyModel& aTestModel)
       
    15 	: CTestLtsySmsBase(aTestModel)
       
    16 	{
       
    17 
       
    18 	}
       
    19 
       
    20 CTestLtsySmsSend::~CTestLtsySmsSend()
       
    21 	{
       
    22 	}
       
    23 
       
    24 CTestLtsySmsSend* CTestLtsySmsSend::NewLC(CTestLtsyModel& aTestModel)
       
    25 	{
       
    26 	CTestLtsySmsSend* self = new (ELeave)CTestLtsySmsSend(aTestModel);
       
    27 	CleanupStack::PushL(self);
       
    28 	self->ConstructL();
       
    29 	return self;
       
    30 	}
       
    31 
       
    32 CTestLtsySmsSend* CTestLtsySmsSend::NewL(CTestLtsyModel& aTestModel)
       
    33 	{
       
    34 	CTestLtsySmsSend* self=CTestLtsySmsSend::NewLC(aTestModel);
       
    35 	CleanupStack::Pop(self);
       
    36 	return self;
       
    37 	}
       
    38 
       
    39 void CTestLtsySmsSend::ConstructL()
       
    40 	{
       
    41 
       
    42 	}
       
    43 
       
    44 TVerdict CTestLtsySmsSend::doTestStepPreambleL()
       
    45 	{
       
    46 	INFO_PRINTF1(_L("CTestLtsySmsSend::doTestStepPreambleL called"));
       
    47 	SetTestStepResult(EPass);
       
    48 	return TestStepResult();
       
    49 	}
       
    50 
       
    51 TVerdict CTestLtsySmsSend::doTestStepL()
       
    52 	{
       
    53 	INFO_PRINTF1(_L("CTestLtsySmsSend::doTestStepL called"));
       
    54 	TRAPD(err,SendSmsL());
       
    55 	if(err != KErrNone)
       
    56 		{
       
    57 		INFO_PRINTF2(_L("The error was returned %d!! when send message"),err);
       
    58 	    SetTestStepResult(EFail);
       
    59 		}
       
    60 	return TestStepResult();
       
    61 	}
       
    62 
       
    63 TVerdict CTestLtsySmsSend::doTestStepPostambleL()
       
    64 	{
       
    65 	INFO_PRINTF1(_L("CTestLtsySmsSend::doTestStepPostambleL called"));
       
    66 	return TestStepResult();
       
    67 	}
       
    68 
       
    69 void CTestLtsySmsSend::SendSmsL()
       
    70 	{
       
    71 	TRequestStatus status;
       
    72 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg smsAttPckg(iSmsAttr);
       
    73 	TPtrC8 smsAsciiPdu(KSmsMessagingData);
       
    74 	TBuf8<200>  smsPdu;
       
    75 	SmsAtUtil::ConvertAsciiToBinary(smsAsciiPdu,smsPdu);
       
    76 	FillSmsAttibutes(KSmsSCA());
       
    77 	Sms().SendMessage(status,smsPdu,smsAttPckg);   
       
    78 	User::WaitForRequest(status);
       
    79 	TInt r = status.Int();
       
    80 	INFO_PRINTF2(_L("SendMessage() request status = %d"),r);
       
    81 	}
       
    82 
       
    83 void CTestLtsySmsSend::FillSmsAttibutes(const TDesC& aTelNumber)
       
    84 	{
       
    85 	_LIT8(KSubmit, "Submit");
       
    86     iSmsAttr.iGsmServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber;
       
    87     iSmsAttr.iGsmServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan;
       
    88     iSmsAttr.iGsmServiceCentre.iTelNumber.Copy(aTelNumber);
       
    89     iSmsAttr.iCdmaServiceCategory = 0;
       
    90     iSmsAttr.iCdmaTeleservice = 0;
       
    91     iSmsAttr.iDataFormat = RMobileSmsMessaging::EFormatGsmTpdu;
       
    92     iSmsAttr.iFlags = 0;
       
    93     iSmsAttr.iMsgRef = 0;
       
    94     iSmsAttr.iSubmitReport = KSubmit;
       
    95     iSmsAttr.iMore = EFalse;
       
    96 	}
       
    97 
       
    98 //End of file