lbstest/lbstestproduct/common/src/ctlbsstepconfignpppsy.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2007-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 // This implements a test step for configuring the NPP PSY.
       
    15 // The following settings are read from the specified ini file section and
       
    16 // used to configure the PSY:
       
    17 
       
    18 // * PsyList = <frozen> <UID1> <UID2> ... <UIDn>
       
    19 //
       
    20 //   <frozen> : either 0 or 1, specifying whether the list is frozen or not.
       
    21 //   <UIDx> : Implementation UIDs of PSY to attempt to use, in hexadecimal form
       
    22 //            with no leading "0x".
       
    23 //
       
    24 //   This specifies an ordered list of implementation UIDs for PSYs that the 
       
    25 //   NPP PSY should attempt to use.
       
    26 //
       
    27 //   e.g. 
       
    28 //   PsyList=0 101fe98e 20026FB7
       
    29 // 
       
    30 //   This specifies an unfrozen list containing the SUPL PSY and the Network PSY. 
       
    31 //
       
    32  
       
    33 #include <centralrepository.h>
       
    34 #include "ctlbsstepconfignpppsy.h"
       
    35 #include <lbs/test/tlbsutils.h>
       
    36 
       
    37 _LIT(KSettingPsyList, "PsyList");
       
    38 
       
    39 const TUint32 KNppPsyRepository = 0x10206915;
       
    40 const TUint32 KNppPsyPsyList = 0x10000001;
       
    41 
       
    42 /**
       
    43  * Constructor
       
    44  */
       
    45 CT_LbsStep_ConfigNppPsy::CT_LbsStep_ConfigNppPsy(CT_LbsServer& aParent)
       
    46     : CT_LbsStep(aParent)
       
    47 	{
       
    48 	SetTestStepName(KLbsStep_ConfigNppPsy);
       
    49 	}
       
    50 
       
    51 
       
    52 /**
       
    53 Static Constructor
       
    54 */
       
    55 CT_LbsStep_ConfigNppPsy* CT_LbsStep_ConfigNppPsy::New(CT_LbsServer& aParent)
       
    56 	{
       
    57 	return new CT_LbsStep_ConfigNppPsy(aParent);
       
    58 	// Note the lack of ELeave.
       
    59 	// This means that having insufficient memory will return NULL;
       
    60 	}
       
    61 
       
    62 
       
    63 /**
       
    64  * @return - TVerdict code
       
    65  * Override of base class virtual
       
    66  */
       
    67 TVerdict CT_LbsStep_ConfigNppPsy::doTestStepPreambleL()
       
    68 	{
       
    69 	INFO_PRINTF1(_L("Test Preamble. CT_LbsStep_ConfigNppPsy"));
       
    70 	SetTestStepResult(EPass);
       
    71 	return TestStepResult();
       
    72 	}
       
    73 
       
    74 
       
    75 /**
       
    76  * @return - TVerdict code
       
    77  * Override of base class pure virtual
       
    78  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    79  * not leave. That being the case, the current test result value will be EPass.
       
    80  */
       
    81 TVerdict CT_LbsStep_ConfigNppPsy::doTestStepL()
       
    82 	{
       
    83 	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_ConfigNppPsy::doTestStepL()"));
       
    84 
       
    85     CRepository* repos = CRepository::NewL(TUid::Uid(KNppPsyRepository));
       
    86     CleanupStack::PushL(repos);
       
    87 
       
    88     TPtrC settingPsyList;
       
    89     if (GetStringFromConfig(ConfigSection(), KSettingPsyList, settingPsyList))
       
    90         {
       
    91         INFO_PRINTF2(_L("Setting NPPs PSY List to '%S'"),&settingPsyList);
       
    92         User::LeaveIfError(repos->Set(KNppPsyPsyList, settingPsyList));
       
    93         }
       
    94     
       
    95     CleanupStack::PopAndDestroy(repos);
       
    96         
       
    97 	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_ConfigNppPsy::doTestStepL()"));
       
    98 	return TestStepResult();
       
    99 	}
       
   100 
       
   101 
       
   102 /**
       
   103  * @return - TVerdict code
       
   104  * Override of base class virtual
       
   105  */
       
   106 TVerdict CT_LbsStep_ConfigNppPsy::doTestStepPostambleL()
       
   107     {
       
   108     INFO_PRINTF1(_L("Test Postamble. CT_LbsStep_ConfigNppPsy"));
       
   109     return TestStepResult();
       
   110     }