2391 CleanupStack::PushL(object2); |
2391 CleanupStack::PushL(object2); |
2392 object2->SetStartPosition(33); |
2392 object2->SetStartPosition(33); |
2393 sendMessage->AddEMSInformationElementL(*object2); |
2393 sendMessage->AddEMSInformationElementL(*object2); |
2394 CleanupStack::PopAndDestroy(object2); |
2394 CleanupStack::PopAndDestroy(object2); |
2395 |
2395 |
2396 iSmsStackTestUtils->WaitForInitializeL(); // load wapprot |
|
2397 |
|
2398 // set SMS port addresing for 8 Bit ports |
2396 // set SMS port addresing for 8 Bit ports |
2399 CSmsPDU& pdu = sendMessage->SmsPDU(); |
2397 CSmsPDU& pdu = sendMessage->SmsPDU(); |
2400 pdu.SetApplicationPortAddressingL(ETrue, port8, port8, EFalse); |
2398 pdu.SetApplicationPortAddressingL(ETrue, port8, port8, EFalse); |
2401 |
2399 |
2402 // send EMS message |
2400 // send EMS message |
2485 CleanupStack::PushL(object2); |
2483 CleanupStack::PushL(object2); |
2486 object2->SetStartPosition(33); |
2484 object2->SetStartPosition(33); |
2487 sendMessage->AddEMSInformationElementL(*object2); |
2485 sendMessage->AddEMSInformationElementL(*object2); |
2488 CleanupStack::PopAndDestroy(object2); |
2486 CleanupStack::PopAndDestroy(object2); |
2489 |
2487 |
2490 iSmsStackTestUtils->WaitForInitializeL(); // load wapprot |
|
2491 |
|
2492 // set SMS port addresing for 8 Bit ports |
2488 // set SMS port addresing for 8 Bit ports |
2493 CSmsPDU& pdu = sendMessage->SmsPDU(); |
2489 CSmsPDU& pdu = sendMessage->SmsPDU(); |
2494 pdu.SetApplicationPortAddressingL(ETrue, port16, port16, ETrue); |
2490 pdu.SetApplicationPortAddressingL(ETrue, port16, port16, ETrue); |
2495 |
2491 |
2496 // send EMS message |
2492 // send EMS message |
3114 |
3110 |
3115 CleanupStack::PushL(smsMessage); |
3111 CleanupStack::PushL(smsMessage); |
3116 SendSmsL(smsMessage,socket); |
3112 SendSmsL(smsMessage,socket); |
3117 CleanupStack::PopAndDestroy(smsMessage); |
3113 CleanupStack::PopAndDestroy(smsMessage); |
3118 |
3114 |
3119 INFO_PRINTF1(_L("waiting for incoming SMS...") ); |
|
3120 WaitForRecvL(socket); |
3115 WaitForRecvL(socket); |
3121 smsMessage = RecvSmsL(socket); |
3116 smsMessage = RecvSmsL(socket); |
3122 |
|
3123 INFO_PRINTF1(_L("incoming SMS") ); |
|
3124 |
|
3125 CleanupStack::PushL(smsMessage); |
3117 CleanupStack::PushL(smsMessage); |
|
3118 |
3126 TestSmsContentsL(smsMessage,testText); |
3119 TestSmsContentsL(smsMessage,testText); |
3127 CleanupStack::PopAndDestroy(smsMessage); |
3120 CleanupStack::PopAndDestroy(smsMessage); |
3128 |
3121 |
3129 CleanupStack::PopAndDestroy(textBuf); |
3122 CleanupStack::PopAndDestroy(textBuf); |
3130 } |
3123 } |
5564 TEST(status.Int() == KErrNone); |
5557 TEST(status.Int() == KErrNone); |
5565 User::LeaveIfError(phonePowerProperty.Get(phonePowerCheck)); |
5558 User::LeaveIfError(phonePowerProperty.Get(phonePowerCheck)); |
5566 } |
5559 } |
5567 while (phonePowerCheck==ESAPhoneOff); |
5560 while (phonePowerCheck==ESAPhoneOff); |
5568 |
5561 |
5569 // Wait phone initializing |
|
5570 iSmsStackTestUtils->WaitForInitializeL(); |
|
5571 |
|
5572 INFO_PRINTF1(_L("Checking that Sms Stack will allow us to send an SMS")); |
5562 INFO_PRINTF1(_L("Checking that Sms Stack will allow us to send an SMS")); |
5573 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
5563 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
5574 TEST(ret==KErrNone); |
5564 TEST(ret==KErrNone); |
5575 |
5565 |
5576 WaitForRecvL(socket); |
5566 WaitForRecvL(socket); |
5611 TEST(status.Int() == KErrNone); |
5601 TEST(status.Int() == KErrNone); |
5612 User::LeaveIfError(phonePowerProperty.Get(phonePowerCheck)); |
5602 User::LeaveIfError(phonePowerProperty.Get(phonePowerCheck)); |
5613 } |
5603 } |
5614 while (phonePowerCheck==ESAPhoneOff); |
5604 while (phonePowerCheck==ESAPhoneOff); |
5615 |
5605 |
5616 // Wait phone initializing |
|
5617 iSmsStackTestUtils->WaitForInitializeL(); |
|
5618 |
|
5619 INFO_PRINTF1(_L("Checking that Sms Stack will allow us to send an SMS")); |
5606 INFO_PRINTF1(_L("Checking that Sms Stack will allow us to send an SMS")); |
5620 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
5607 TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket)); |
5621 TEST(ret==KErrNone); |
5608 TEST(ret==KErrNone); |
5622 |
5609 |
5623 WaitForRecvL(socket); |
5610 WaitForRecvL(socket); |
5692 ret = socket8.Open(socketServer, KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol); |
5679 ret = socket8.Open(socketServer, KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol); |
5693 TEST(ret==KErrNone); |
5680 TEST(ret==KErrNone); |
5694 ret = socketany.Open(socketServer, KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol); |
5681 ret = socketany.Open(socketServer, KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol); |
5695 TEST(ret==KErrNone); |
5682 TEST(ret==KErrNone); |
5696 |
5683 |
5697 // Wait phone initializing |
|
5698 iSmsStackTestUtils->WaitForInitializeL(); |
|
5699 |
|
5700 |
|
5701 // bind them to ports |
5684 // bind them to ports |
5702 ret = socket8.Bind(addr8); |
5685 ret = socket8.Bind(addr8); |
5703 TEST(ret==KErrNone); |
5686 TEST(ret==KErrNone); |
5704 |
5687 |
5705 ret = socketany.Bind(addrany); |
5688 ret = socketany.Bind(addrany); |
7095 * @param aRecipientNumber The supposed recipient number |
7078 * @param aRecipientNumber The supposed recipient number |
7096 * @param aSocket is used to stream the sms message from the socket server |
7079 * @param aSocket is used to stream the sms message from the socket server |
7097 */ |
7080 */ |
7098 { |
7081 { |
7099 //Receive SMS |
7082 //Receive SMS |
7100 INFO_PRINTF1(_L("waiting for incoming SMS...") ); |
|
7101 WaitForRecvL(aSocket); |
7083 WaitForRecvL(aSocket); |
7102 CSmsMessage* smsMessage = RecvSmsL(aSocket); |
7084 CSmsMessage* smsMessage = RecvSmsL(aSocket); |
7103 |
7085 CleanupStack::PushL(smsMessage); |
7104 INFO_PRINTF1(_L("incoming SMS") ); |
|
7105 |
7086 |
7106 //Check the status report |
7087 //Check the status report |
7107 CleanupStack::PushL(smsMessage); |
|
7108 TBool isSR = (smsMessage->Type()==CSmsPDU::ESmsStatusReport); |
7088 TBool isSR = (smsMessage->Type()==CSmsPDU::ESmsStatusReport); |
7109 |
|
7110 if (isSR) |
7089 if (isSR) |
7111 { |
7090 { |
7112 INFO_PRINTF1(_L("Received status report")); |
7091 INFO_PRINTF1(_L("Received status report")); |
7113 TSmsServiceCenterAddress telephoneNumber=smsMessage->ToFromAddress(); |
7092 TSmsServiceCenterAddress telephoneNumber=smsMessage->ToFromAddress(); |
7114 TEST(telephoneNumber==aRecipientNumber); |
7093 TEST(telephoneNumber==aRecipientNumber); |
7115 INFO_PRINTF2(_L("Message delivered to %S "),&telephoneNumber); |
7094 INFO_PRINTF2(_L("Message delivered to %S "),&telephoneNumber); |
7116 } |
7095 } |
7117 else |
7096 else |
7118 INFO_PRINTF1(_L("Received SMS is NOT a Status report!")); |
7097 INFO_PRINTF1(_L("Received SMS is NOT a Status report!")); |
7119 |
7098 |
7120 TEST(isSR==1); |
7099 TEST(isSR); |
7121 |
7100 |
7122 CleanupStack::PopAndDestroy(smsMessage); |
7101 CleanupStack::PopAndDestroy(smsMessage); |
7123 } |
7102 } |
7124 |
7103 |
7125 void CSmsInterTestStep::ReadSmsStoreL(RSocket& aSocket, RPointerArray<CSmsMessage>& aMessages) |
7104 void CSmsInterTestStep::ReadSmsStoreL(RSocket& aSocket, RPointerArray<CSmsMessage>& aMessages) |
7573 CSmsMessage* smsMessage=CreateSmsMessageL(aDes, aAlphabet); |
7552 CSmsMessage* smsMessage=CreateSmsMessageL(aDes, aAlphabet); |
7574 CleanupStack::PushL(smsMessage); |
7553 CleanupStack::PushL(smsMessage); |
7575 SendSmsL(smsMessage, aSocket); |
7554 SendSmsL(smsMessage, aSocket); |
7576 CleanupStack::PopAndDestroy(smsMessage); //destroyed because created again in RecvSmsL |
7555 CleanupStack::PopAndDestroy(smsMessage); //destroyed because created again in RecvSmsL |
7577 |
7556 |
7578 INFO_PRINTF1(_L("waiting for incoming SMS...") ); |
|
7579 WaitForRecvL( aSocket); |
7557 WaitForRecvL( aSocket); |
7580 smsMessage = RecvSmsL( aSocket); |
7558 smsMessage = RecvSmsL( aSocket); |
7581 |
|
7582 INFO_PRINTF1(_L("incoming SMS") ); |
|
7583 |
|
7584 CleanupStack::PushL(smsMessage); |
7559 CleanupStack::PushL(smsMessage); |
|
7560 |
7585 TestSmsContentsL(smsMessage,aDes); |
7561 TestSmsContentsL(smsMessage,aDes); |
7586 |
7562 |
7587 User::After(1000000); |
7563 User::After(1000000); |
7588 |
7564 |
7589 CleanupStack::PopAndDestroy(smsMessage); |
7565 CleanupStack::PopAndDestroy(smsMessage); |