lbstest/lbstestproduct/lbsclock/src/ctlbsclockstep.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     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 // @file ctlbsclockstep.cpp
       
    15 // This is the class implementation for the LBS Client Test Step Base
       
    16 // 
       
    17 //
       
    18 
       
    19 #include "ctlbsclockstep.h"
       
    20 
       
    21 
       
    22 const TInt KAssistanceDataProviderPluginUidValue = 0x10281D77;
       
    23 
       
    24 #define REFPOS_LAT				2
       
    25 #define REFPOS_LONG				3
       
    26 #define REFPOS_ALT				10
       
    27 #define REFPOS_HORZ_ACCURACY	100
       
    28 #define REFPOS_VERT_ACCURACY	100
       
    29 
       
    30 
       
    31 CT_LbsClockStep::~CT_LbsClockStep()
       
    32 	{
       
    33 	}
       
    34 
       
    35 
       
    36 CT_LbsClockStep::CT_LbsClockStep(CT_LbsClockServer& aParent) : CTestStep(), iParent(aParent)
       
    37 	{
       
    38 	}
       
    39 
       
    40 void CT_LbsClockStep::ConstructL()
       
    41 	{
       
    42 	}
       
    43 
       
    44 
       
    45 TInt CT_LbsClockStep::OpenNetSim()
       
    46 	{
       
    47 	// Connect to net sim.
       
    48 	TInt err = iNetSim.ConnectL(NULL);
       
    49 	if (err)
       
    50 		{
       
    51 		return err;
       
    52 		}
       
    53 
       
    54 
       
    55 	// Set the reference position, which also be used for any required verification.
       
    56 	iRefPos.SetCoordinate(REFPOS_LAT, REFPOS_LONG, REFPOS_ALT);
       
    57 	iRefPos.SetAccuracy(REFPOS_HORZ_ACCURACY, REFPOS_VERT_ACCURACY);
       
    58 	iRefPos.SetCurrentTime();
       
    59 
       
    60 	if (!iNetSim.SetReferenceLocation(iRefPos))
       
    61 		{
       
    62 		iNetSim.Close();
       
    63 
       
    64 		return KErrGeneral;
       
    65 		}	
       
    66 		
       
    67 
       
    68 	// Set plugin to use.
       
    69 	TUid pluginUid = TUid::Uid(KAssistanceDataProviderPluginUidValue);
       
    70 	if (!iNetSim.SetAssistanceDataProvider(pluginUid))
       
    71 		{
       
    72 		iNetSim.Close();
       
    73 
       
    74 		return KErrGeneral;
       
    75 		}
       
    76 		
       
    77 	return err;
       
    78 	}
       
    79 
       
    80 
       
    81 void CT_LbsClockStep::CloseNetSim()
       
    82 	{
       
    83 	iNetSim.Close();	
       
    84 	}	
       
    85