telephonyserver/etelmultimode/TETEL/te_EtelMM/TE_mmNotifyMtlr.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2006-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 // TE_MMLNOTIFYMTLR.CPP
       
    15 // 
       
    16 //
       
    17 
       
    18 #include <e32test.h>
       
    19 
       
    20 #include "TE_EtelMMTestStepBase.h"
       
    21 #include "TE_mmNotifyMtlr.h"
       
    22 #include "testdef.h"
       
    23 
       
    24 enum TVerdict CTestNotifyMtlr::doTestStepL()
       
    25 	{
       
    26 	INFO_PRINTF1(_L("Successful MT-LR request"));
       
    27 
       
    28  	TRequestStatus mtlrStatus;
       
    29 	TRequestStatus mcontrolStatus;
       
    30 	TRequestStatus reqStatus;
       
    31     TInt notificationTypeReceived = 0;
       
    32     
       
    33 	TInt expectedNotificationType;
       
    34 	GetIntFromConfig(ConfigSection(), _L("expectedNotificationType"), expectedNotificationType);
       
    35 
       
    36 	TInt dataCodingScheme ;
       
    37 	GetIntFromConfig(ConfigSection(), _L("DataCodingScheme"), dataCodingScheme);
       
    38 
       
    39 	TInt invalidCliendIdFlag ;
       
    40 	TBool existsInvalidCliendIdFlag = GetIntFromConfig(ConfigSection(), _L("InvalidCliendIdFlag"), invalidCliendIdFlag);
       
    41 
       
    42 	iNotifyMtlr.iLocationInfo.iLcsClientName.iLcsDataCodingScheme = dataCodingScheme;
       
    43 	
       
    44     RMobileLocationServices::TNotifyMtlrV7Pckg  notifyMtlrPckg(iNotifyMtlr);
       
    45  
       
    46      //  Notify Mtlr request
       
    47     iLocationSvc.NotifyMtlr(mtlrStatus,notifyMtlrPckg);
       
    48     User::WaitForRequest(mtlrStatus);
       
    49     TEST(mtlrStatus == KErrNone);
       
    50      
       
    51 	//notificationtype ENotifyLocationAllowed
       
    52 	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE1 )
       
    53 		{
       
    54 			notificationTypeReceived = 1; 
       
    55 		}
       
    56 	// notificationtype ENotifyAndVerify_LocationAllowedIfNoResponse		
       
    57 	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE2 )
       
    58 		{
       
    59 			notificationTypeReceived = 2; 
       
    60 		}
       
    61 	// notificationtype ENotifyAndVerify_LocationNotAllowedIfNoResponse				
       
    62 	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE3 )
       
    63 		{
       
    64 			notificationTypeReceived = 3; 
       
    65 		}
       
    66 	// notificationtype ELocationPrivacyOverride				
       
    67 	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE4 )
       
    68 		{
       
    69 			notificationTypeReceived = 4; 
       
    70 		}
       
    71 	// notificationtype ELocationNotAllowed				
       
    72 	if(iNotifyMtlr.iNotificationType == DMMTSY_NOTIFICATION_TYPE5 )
       
    73 		{
       
    74 			notificationTypeReceived = 5; 
       
    75 		}
       
    76 
       
    77 	if(existsInvalidCliendIdFlag)
       
    78 		{
       
    79 		TEST(iNotifyMtlr.iLocationInfo.iLcsClientID == DMMTSY_INVALID_EXTERNAL_CLIENT_ID);
       
    80 		}
       
    81 	else
       
    82 		{
       
    83 	    TEST(expectedNotificationType == notificationTypeReceived);
       
    84 		}
       
    85 		
       
    86 	INFO_PRINTF2(_L("Test %d - RMobileLocationServices::NotifyMtlr passed"), iTestCount++);
       
    87 
       
    88 	return TestStepResult();
       
    89 	}