# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1282119106 -10800 # Node ID 95c570bf4a053de871221f004147294036182c2e # Parent 15a2125aa2f3e3c1d9a299357aaebd8f11bd1230 Revision: 201033 Kit: 201033 diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/bwins/te_lbsgenericpsytestu.def --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/bwins/te_lbsgenericpsytestu.def Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/bwins/te_lbsgenericpsytestu.def Wed Aug 18 11:11:46 2010 +0300 @@ -55,4 +55,6 @@ ?ReallyDoTestStepImpL@CTe_LbsPsyPowerAdviceStep@@MAEXXZ @ 54 NONAME ; void CTe_LbsPsyPowerAdviceStep::ReallyDoTestStepImpL(void) ?ExpectDefaultStatusRequest@CTe_PsyRequest@@QAEXXZ @ 55 NONAME ; void CTe_PsyRequest::ExpectDefaultStatusRequest(void) ?NotifyPsyRequest@CTe_PsyRequest@@QAEXXZ @ 56 NONAME ; void CTe_PsyRequest::NotifyPsyRequest(void) + ?DefineLbsPropertiesL@CTe_SystemStarter@@SAXXZ @ 57 NONAME ; void CTe_SystemStarter::DefineLbsPropertiesL(void) + ?DeleteLbsPropertiesL@CTe_SystemStarter@@SAXXZ @ 58 NONAME ; void CTe_SystemStarter::DeleteLbsPropertiesL(void) diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/eabi/te_lbsgenericpsytestu.def --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/eabi/te_lbsgenericpsytestu.def Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/eabi/te_lbsgenericpsytestu.def Wed Aug 18 11:11:46 2010 +0300 @@ -91,4 +91,8 @@ _ZTV34CTe_LbsNotifyPositionUpdateErrStep @ 90 NONAME _ZTV37CTe_LbsNotifyPositionUpdateTimingStep @ 91 NONAME _ZThn3196_N15CTe_PsyBaseStep10OnRunLCallERK10CTe_Active @ 92 NONAME + _ZN17CTe_SystemStarter20DefineLbsPropertiesLEv @ 93 NONAME + _ZN17CTe_SystemStarter20DeleteLbsPropertiesLEv @ 94 NONAME + _ZTI20CTe_LbsIniFileReader @ 95 NONAME + _ZTV20CTe_LbsIniFileReader @ 96 NONAME diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/group/te_lbsgenericpsytest.mmp --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/group/te_lbsgenericpsytest.mmp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/group/te_lbsgenericpsytest.mmp Wed Aug 18 11:11:46 2010 +0300 @@ -33,6 +33,12 @@ USERINCLUDE ../../../../../../locationmgmt/locationcore/LbsPartnerCommon/inc USERINCLUDE ../../../../../../locationmgmt/locationcore/LbsCommonInternalDataTypes/inc USERINCLUDE ../../../../../../locationmgmt/locationcore/Lbsreffnpint/inc + + +USERINCLUDE ../../../../../../locationmgmt/locationcore/LbsADataCache/inc +USERINCLUDE ../../../../../../locationmgmt/locationcore/LbsNgNlmInt/inc +USERINCLUDE ../../../../../../locationmgmt/locationcore/LbsRefFnpInt/inc +USERINCLUDE ../../../../../../locationmgmt/locationcore/LbsNetRegStatusInt/inc OS_LAYER_SYSTEMINCLUDE_SYMBIAN SOURCEPATH ../src @@ -46,7 +52,8 @@ SOURCE te_lbspsyposupdatetimingstep.cpp SOURCE te_lbspsypoweradvicestep.cpp SOURCE te_lbspsystaticdata.cpp -SOURCE te_lbspsyutils.cpp +SOURCE te_lbspsyutils.cpp +SOURCE te_lbsinifilereader.cpp @@ -67,11 +74,19 @@ LIBRARY lbslocdatasource.lib LIBRARY lbsreffnpint.lib LIBRARY lbscommoninternaldatatypes.lib +LIBRARY efsrv.lib + +LIBRARY lbsngnlmint.lib +LIBRARY lbsadatacache.lib +LIBRARY lbsnetregstatusint.lib +LIBRARY bafl.lib DEBUGLIBRARY flogger.lib +#ifdef SYMBIAN_FEATURE_MANAGER +LIBRARY featdiscovery.lib +#endif SMPSAFE - diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbsinifilereader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbsinifilereader.h Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Duplicate of lbsmoduleinfoparser.h from lbsroot +* +*/ +/** +@InternalComponent +@released +*/ +#ifndef __TE_LBSMODULEINFOPARSER_H__ +#define __TE_LBSMODULEINFOPARSER_H__ + +#include + +#include +#include +#include "LbsExtendModuleInfo.h" + +_LIT(KLbsNetPsyTestPanic, "NetPSY TestSuite"); + +const TInt KIniLoadMaxFileName = 256; +const TInt KIniLoadMidFileName = 128; + +class CTe_LbsIniFileReader : public CBase + { +public: + static CTe_LbsIniFileReader* NewL(RFs& aFs, const TDesC& aIniLoadFileName); + virtual ~CTe_LbsIniFileReader(); + + TBool SetNextPoint(); + TInt GetDataPoint(); + TInt GetDataIndex(); + void ResetPoint(); + TBool FindNextSection(); + + static TBool CheckExistFile(TDesC& aDirPath, TDesC& aFileName); + + TBool FindVar(const TDesC& aVarName, TPtrC& aResult) const; + TBool FindVar(const TDesC& aVarName, TInt& aResult) const; + TBool FindVar(const TDesC& aVarName, TVersion& aResult) const; +// TBool FindVar(const TDesC& aVarName, TUint& aResult, TRadix aRadix) const; +// TBool FindVar(const TDesC& aVarName, TReal64& aResult) const; + TBool FindVar(const TDesC& aVarName, TReal32& aResult) const; + TBool FindVar(const TDesC& aVarName, TInt64& aResult) const; + +public: + void ReadPosQualityCriteria(TPositionQuality& aPosQuality); + void ReadModuleInfoL(TPositionModuleInfo& aModuleInfo); + void ReadPlugInUid(TUid& aDataSourcePluginId); + void ReadExecutableNameL(TDes& aExecutableName); + void ReadDeviceCapabilities(TPositionModuleInfoExtended::TDeviceGpsModeCapabilities& aDeviceCapabilities); + + +protected: + CTe_LbsIniFileReader(const TDesC& aIniLoadFileName); + void ConstructL(RFs& aFs); + +private: + TInt DecimalToBitmask(TInt aDecimalValue); + TInt GetNextVersionPart(TLex& aLex) const; + +public: + enum + { + ELbsPanicNoIniFile, // no .cre file found at startup + // invalid values found when loading module info + ELbsPanicBadFirstFixValue, + ELbsPanicBadNextFixValue, + KLbsPanicSystemStartFailure, + // Invalid lbsprofile.ini contents + ELbsPanicInvalidProfileIniFile, + // Invalid CenRep contents on startup + ELbsPanicInvalidCenRepContents + }; + +protected: + TPtr iPtr; + TInt iPoint; + TInt iIndex; + + TPtrC iSection; + TInt iSectionEnd; + + TBuf iIniLoadFileName; + }; + +#endif // __TE_LBSMODULEINFOPARSER_H__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbspsyutils.h --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbspsyutils.h Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbspsyutils.h Wed Aug 18 11:11:46 2010 +0300 @@ -24,6 +24,10 @@ #include #include +#include "lbsqualityprofile.h" +#include "LbsExtendModuleInfo.h" + +const TInt KMaxInfoModules = 5; // LBS includes #include @@ -35,6 +39,17 @@ IMPORT_C void RestartLbs_RootOnlyL(TBuf8& aFirstExe); IMPORT_C void RestartLbs_NormalL(TBuf8aFirstExe); + IMPORT_C static void DefineLbsPropertiesL(); + IMPORT_C static void DeleteLbsPropertiesL(); + +private: + static void InitializeQualityProfileInfoL(); + static void GetQualityProfileInfoL(RFs& aFs, RArray& aQualityArray, + const TDesC& aFileName); + + static void GetModuleInfoL(RFs& aFs, TPositionModuleInfoExtended& aExtendedModuleInfo, + const TDesC& aFileName); + static void InitializeModuleInfoL(); private: TUid iServerId; diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbsinifilereader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbsinifilereader.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,610 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: [Duplicate of lbsmoduleinfoparser.cpp from lbsroot] +// Class to read and retrieve static module information +// +// + +/** + @file + @internalTechnology + @released +*/ + +#include "te_lbsinifilereader.h" + +CTe_LbsIniFileReader::CTe_LbsIniFileReader + ( + const TDesC& aIniLoadFileName + ) + : + iPtr(NULL, 0), + iPoint(0), + iIndex(1), + iSection(NULL, 0), + iSectionEnd(0) + { + iIniLoadFileName.Zero(); + iIniLoadFileName.Append(aIniLoadFileName); + } + +CTe_LbsIniFileReader::~CTe_LbsIniFileReader() + { + delete (TText*)iPtr.Ptr(); + } + +CTe_LbsIniFileReader* CTe_LbsIniFileReader::NewL(RFs& aFs, const TDesC& aIniLoadFileName) + { + CTe_LbsIniFileReader* self=new(ELeave) CTe_LbsIniFileReader(aIniLoadFileName); + CleanupStack::PushL(self); + self->ConstructL(aFs); + CleanupStack::Pop(); + return self; + } + +void CTe_LbsIniFileReader::ConstructL(RFs& aFs) + { + TInt data_size =0; + + TAutoClose file; + User::LeaveIfError(file.iObj.Open(aFs, iIniLoadFileName, EFileStreamText|EFileRead)); + file.PushL(); + User::LeaveIfError(file.iObj.Size(data_size)); + + TUint8* rawBuff = (TUint8*) User::AllocLC(data_size * sizeof(TText)); + TPtr8 rawTPtr(rawBuff, data_size * sizeof(TText)); + User::LeaveIfError(file.iObj.Read(rawTPtr)); + + TText* dstPtr = (TText*) rawBuff; + for(TInt i = data_size - 1; i >= 0; --i) + { + dstPtr[i] = rawBuff[i]; + /* + * + * It's possible that values will be entered in any of the following + * formats : + * HorizontalAccuracy=20 + * HorizontalAccuracy 20 + * HorizontalAccuracy= 20 + * HorizontalAccuracy = 20 + * HorizontalAccuracy =20 + * + * which is a bit of a headache for TLex parsing, as it deals with + * character sequences. Fortunately, '=' isn't valid as part of any + * of the settings, so the easiest thing to do is replace any + * instances with a space, thus converting all the above formats into + * the first one. + */ + const TText KEqualsCharacter = '='; + const TText KSpaceCharacter = ' '; + + if(dstPtr[i] == KEqualsCharacter) + { + dstPtr[i] = KSpaceCharacter; + } + } + + iPtr.Set((TText*) rawBuff, data_size, data_size); + + CleanupStack::Pop(rawBuff); + + CleanupStack::PopAndDestroy();//file + } + +TBool CTe_LbsIniFileReader::FindVar(const TDesC &aVarName, TPtrC &aResult) const + { + TInt pos = iSection.Find(TPtrC(aVarName)); + if (pos==KErrNotFound) + { + return(EFalse); + } + + TLex lex(iSection.Mid(pos)); + lex.SkipCharacters(); + lex.SkipSpaceAndMark(); + lex.SkipCharacters(); + + aResult.Set(lex.MarkedToken().Ptr(),lex.MarkedToken().Length()); + return(ETrue); + } + +TBool CTe_LbsIniFileReader::FindVar(const TDesC &aVarName, TInt &aResult) const + { + TPtrC ptr(NULL,0); + if (FindVar(aVarName,ptr)) + { + TLex lex(ptr); + if (lex.Val(aResult)==KErrNone) + return(ETrue); + } + return(EFalse); + } + +TBool CTe_LbsIniFileReader::FindVar(const TDesC &aVarName, TInt64 &aResult) const + { + TPtrC ptr(NULL,0); + if (FindVar(aVarName,ptr)) + { + TLex lex(ptr); + if (lex.Val(aResult)==KErrNone) + return(ETrue); + } + return(EFalse); + } + +TBool CTe_LbsIniFileReader::FindVar(const TDesC &aVarName, TReal32 &aResult) const + { + TPtrC ptr(NULL,0); + if (FindVar(aVarName,ptr)) + { + TLex lex(ptr); + if (lex.Val(aResult)==KErrNone) + return(ETrue); + } + return(EFalse); + } + +TBool CTe_LbsIniFileReader::FindVar(const TDesC &aVarName, TVersion &aVersion) const + { + TPtrC ptr(NULL,0); + TUint number; + if (FindVar(aVarName,ptr)) + { + TLex lex(ptr); + if (lex.Val(number)==KErrNone) + { + aVersion.iMajor = number; + aVersion.iMinor = GetNextVersionPart(lex); + aVersion.iBuild = GetNextVersionPart(lex); + // Return OK even if only one number was found. + return(ETrue); + } + } + return(EFalse); + } + +TBool CTe_LbsIniFileReader::SetNextPoint() + { + iIndex++; + + TBuf16<128> findText; + + findText.Zero(); + findText.Append(_L("[")); + findText.AppendNum(iIndex); + findText.Append(_L("]")); + + iPoint = iPtr.Find(findText); + + if (iPoint == KErrNotFound) + { + return(EFalse); + } + + return(ETrue); + } + +TInt CTe_LbsIniFileReader::GetDataPoint() + { + return iPoint; + } + +TInt CTe_LbsIniFileReader::GetDataIndex() + { + return iIndex; + } + +void CTe_LbsIniFileReader::ResetPoint() + { + iPoint = 0; + iIndex = 1; + } + +TBool CTe_LbsIniFileReader::FindNextSection() + { + _LIT(KSectionHeaderStart, "["); + _LIT(KSectionHeaderEnd, "]"); + + // Clear the previous section information. + iSection.Set(KNullDesC); + + // Early check to see if we have already searched + // to the end of the file. + if (iSectionEnd == iPtr.Length()) + { + return (EFalse); + } + + // Begin searching from the end of the last section. + TPtrC ptrSection = iPtr.Mid(iSectionEnd); + + // Search for the section header '[]'. + TInt sectionHeaderEnd(KErrNotFound); + TInt sectionHeaderStart = ptrSection.Find(KSectionHeaderStart); + if (sectionHeaderStart == KErrNotFound) + { + // No match, so no more sections in the file. + iSectionEnd = iPtr.Length(); + return (EFalse); + } + else + { + sectionHeaderEnd = ptrSection.Find(KSectionHeaderEnd); + if ((sectionHeaderEnd == KErrNotFound) + || (sectionHeaderEnd < sectionHeaderStart)) + { + // Parsing error - the section header was not closed properly + iSectionEnd = iPtr.Length(); + return (EFalse); + } + else if (sectionHeaderEnd == ptrSection.Length()) + { + // Parsing error - the section header ends at the end + // of the file, so the section is empty! + iSectionEnd = iPtr.Length(); + return (EFalse); + } + } + iSection.Set(ptrSection.Mid(sectionHeaderEnd + 1)); + + // Search for the start of the next section + // - take this to be the end of the current section. + TInt sectionEnd = iSection.Find(KSectionHeaderStart); + if (sectionEnd != KErrNotFound) + { + iSection.Set(iSection.Left(sectionEnd)); + iSectionEnd += (sectionHeaderStart + sectionEnd + 1); + } + else + { + // No more sections after this one, so set the index to the end. + iSectionEnd = iPtr.Length(); + } + + return (ETrue); + } + +// +// ModuleInfo specific functions + +// +// READ QUALITY CRITERIA +// + +_LIT(KTimeToFirstFixStr, "TimeToFirstFix"); +_LIT(KTimeToNextFixStr, "TimeToNextFix"); +_LIT(KHorizontalAccuracyStr, "HorizontalAccuracy"); +_LIT(KVerticalAccuracyStr, "VerticalAccuracy"); +_LIT(KCostIndicatorStr, "CostIndicator"); +_LIT(KPowerConsumptionStr, "PowerConsumption"); +const TInt KMilliSecToMicroSecConverter = 1000; + +void CTe_LbsIniFileReader::ReadPosQualityCriteria(TPositionQuality& aPosQuality) + { + TInt intValue; + TInt64 int64Value; + TReal32 real32Value; + + // Get the Time To First Fix + FindVar(KTimeToFirstFixStr,int64Value); + __ASSERT_ALWAYS( int64Value <= KMaxTInt, User::Panic(KLbsNetPsyTestPanic, ELbsPanicBadFirstFixValue)); + if(int64Value>=0) + { + int64Value *= KMilliSecToMicroSecConverter; + aPosQuality.SetTimeToFirstFix(int64Value); + } + else + { + aPosQuality.SetTimeToFirstFix(0); + } + + // Get the Time To Next Fix + FindVar(KTimeToNextFixStr,int64Value); + __ASSERT_ALWAYS( int64Value <= KMaxTInt, User::Panic(KLbsNetPsyTestPanic, ELbsPanicBadNextFixValue)); + if(int64Value>=0) + { + int64Value *= KMilliSecToMicroSecConverter; + aPosQuality.SetTimeToNextFix(int64Value); + } + else + { + aPosQuality.SetTimeToNextFix(0); + } + + // Get the Horizontal Accuracy + FindVar(KHorizontalAccuracyStr,real32Value); + if(real32Value>=0) + { + aPosQuality.SetHorizontalAccuracy(real32Value); + } + else + { + aPosQuality.SetHorizontalAccuracy(0); + } + + // Get the Vertical Accuracy + FindVar(KVerticalAccuracyStr,real32Value); + if(real32Value>=0) + { + aPosQuality.SetVerticalAccuracy(real32Value); + } + else + { + aPosQuality.SetVerticalAccuracy(0); + } + + // Get the cost indicator + FindVar(KCostIndicatorStr,intValue); + + TPositionQuality::TCostIndicator costIndicator; + switch(intValue) + { + case 1: + costIndicator = TPositionQuality::ECostZero; + break; + case 2: + costIndicator = TPositionQuality::ECostPossible; + break; + case 3: + costIndicator = TPositionQuality::ECostCharge; + break; + default: + costIndicator = TPositionQuality::ECostUnknown; + break; + } + aPosQuality.SetCostIndicator(costIndicator); + + // Get the power consumption + FindVar(KPowerConsumptionStr,intValue); + + TPositionQuality::TPowerConsumption powerConsumption; + switch(intValue) + { + case 1: + powerConsumption = TPositionQuality::EPowerZero; + break; + case 2: + powerConsumption = TPositionQuality::EPowerLow; + break; + case 3: + powerConsumption = TPositionQuality::EPowerMedium; + break; + case 4: + powerConsumption = TPositionQuality::EPowerHigh; + break; + default: + powerConsumption = TPositionQuality::EPowerUnknown; + break; + } + + aPosQuality.SetPowerConsumption(powerConsumption); + + } + + +_LIT(KTechnologyTypeStr, "TechnologyType"); +_LIT(KClassesSupportedStr, "ClassesSupported"); +_LIT(KCapabilitiesStr, "Capabilities"); +_LIT(KModuleNameStr, "ModuleName"); +_LIT(KModuleIdStr, "ModuleId"); +_LIT(KDeviceLocationStr, "DeviceLocation"); +_LIT(KVersionStr, "Version"); +_LIT(KDataSrcPluginIdStr, "DataSourceId"); +_LIT(KExecutableNameStr, "ExecutableName"); +_LIT(KDeviceGpsModeCapabilitiesStr, "DeviceGpsModeCaps"); + +const TInt KPositionModuleMaxNameLength = 50; + + +void CTe_LbsIniFileReader::ReadPlugInUid(TUid& aDataSourcePluginId) + { + TInt intValue=0; + + FindVar(KDataSrcPluginIdStr, intValue); + + if(intValue>0) + { + aDataSourcePluginId = (TUid::Uid(intValue)); + } + else + { + aDataSourcePluginId = TUid::Uid(0); + } + + } + + + + +void CTe_LbsIniFileReader::ReadExecutableNameL(TDes& aExecutableName) + { + TUint16* buffer = new (ELeave) TUint16[KPositionModuleMaxNameLength]; + CleanupStack::PushL(buffer); + + TPtrC16 namePtr(reinterpret_cast(buffer),KPositionModuleMaxNameLength); + TBool success = FindVar(KExecutableNameStr, namePtr); + + TBuf executableName; + + if(success) + { + aExecutableName.Copy(namePtr); + } + else + { + aExecutableName.Copy(KNullDesC); + } + + CleanupStack::PopAndDestroy(buffer); + + } + +void CTe_LbsIniFileReader::ReadDeviceCapabilities(TPositionModuleInfoExtended::TDeviceGpsModeCapabilities& aDeviceCapabilities) + { + //An ini file is expected to contain the line DeviceGpsModeCaps if this is missing, populate aDeviceCapabilities + //We assume the value is TPositionModuleInfoExtended::EDeviceGpsModeSimultaneousTATB when .ini parameter is missing + TInt intValue = 100; //EDeviceGpsModeSimultaneousTATB + + //An ini file is expected to contain the line DeviceGpsModeCaps + //if this is missing, populate aDeviceCapabilities with default + FindVar(KDeviceGpsModeCapabilitiesStr, intValue); + + aDeviceCapabilities = DecimalToBitmask(intValue); + } + + + +/* Read in ModuleInfo from an .ini file +*/ +void CTe_LbsIniFileReader::ReadModuleInfoL(TPositionModuleInfo& aModuleInfo) + { + TInt intValue; + TBool success; + + // Technology-type - this is a binary bitmap. + FindVar(KTechnologyTypeStr, intValue); + TPositionModuleInfo::TTechnologyType technologyType = DecimalToBitmask(intValue); + aModuleInfo.SetTechnologyType(technologyType); + + // Classes Supported - this is a binary bitmap, but support for each class + // has to be set individually. + FindVar(KClassesSupportedStr, intValue); + TInt supportedClasses = DecimalToBitmask(intValue); + + TPositionClassFamily currentClass = EPositionInfoFamily; + while(currentClass <= EPositionUpdateOptionsFamily) + { + aModuleInfo.SetClassesSupported(currentClass, supportedClasses & 1); + supportedClasses >>= 1; + currentClass = static_cast(static_cast(currentClass) + 1); + } + + // Capabilities - this is a binary bitmap. + FindVar(KCapabilitiesStr, intValue); + TPositionModuleInfo::TCapabilities capabilities = DecimalToBitmask(intValue); + aModuleInfo.SetCapabilities(capabilities); + + // Module Name + TUint16* buffer = new (ELeave) TUint16[KPositionModuleMaxNameLength]; + CleanupStack::PushL(buffer); + + TPtrC16 modulePtr(reinterpret_cast(buffer),KPositionModuleMaxNameLength); + success = FindVar(KModuleNameStr, modulePtr); + + TBuf moduleName; + if(success) + { + moduleName.Copy(modulePtr); + } + else + { + moduleName.Copy(KNullDesC); + } + // Get rid of any delimiting " characters. + TInt length = moduleName.Length(); + if(length > 0) + { + TInt lastPos = length - 1; + TChar quote('\"'); + if(moduleName[lastPos] == quote) + { + moduleName.Delete(lastPos, 1); + } + if(modulePtr[0] == quote) + { + moduleName.Delete(0, 1); + } + } + aModuleInfo.SetModuleName(moduleName); + CleanupStack::PopAndDestroy(buffer); + + // Module Id + TUid moduleUid = TUid::Uid(0); + FindVar(KModuleIdStr,intValue); + if(intValue>0) + { + moduleUid = (TUid::Uid(intValue)); + } + aModuleInfo.SetModuleId(moduleUid); + + // Module Version + TVersion version(0,0,0); + FindVar(KVersionStr,version); + aModuleInfo.SetVersion(version); + + // Device Location + TPositionModuleInfo::TDeviceLocation deviceLocation; + FindVar(KDeviceLocationStr,intValue); + switch(intValue) + { + case 1: + deviceLocation = TPositionModuleInfo::EDeviceInternal; + break; + case 2: + deviceLocation = TPositionModuleInfo::EDeviceExternal; + break; + default: + deviceLocation = TPositionModuleInfo::EDeviceUnknown; + break; + } + aModuleInfo.SetDeviceLocation(deviceLocation); + + // IsAvailable - to be read from .ini file but for now ... + aModuleInfo.SetIsAvailable(ETrue); + + } + +// UTILITIES +/** + * Used for extracting the latter components of a TVersion from a string of the + * form 1.2.3 + * Before reading checks that the end of the string has not yet been reached, + * then steps past the first character (assumed to be '.' and attempts to read + * an integer from the following character(s). + * Any error in version length or missing components (e.g. if the version is "1") + * reports 0 for thet missing part(s). + */ +TInt CTe_LbsIniFileReader::GetNextVersionPart(TLex& aLex) const + { + TInt number = 0; + if(!aLex.Eos()) + { + aLex.Inc(); + if(!aLex.Eos()) + { + aLex.Val(number); + } + } + return(number); + } + +TInt CTe_LbsIniFileReader::DecimalToBitmask(TInt aDecimalValue) + { + TInt bitMask = 0; + TInt bitCount = 0; + /* + * The bitmap "101" will be read in as the decimal value 101. + * Convert this to the binary value 0101 by masking. + */ + while(aDecimalValue) + { + if(aDecimalValue & 1) + { + bitMask |= 1 << bitCount; + } + aDecimalValue /= 10; + ++bitCount; + } + return(bitMask); + } + diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsypositioner.cpp --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsypositioner.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsypositioner.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -72,8 +72,10 @@ CTe_PsyPositioner::~CTe_PsyPositioner() { + INFO_PRINTF1(_L("CTe_PsyPositioner::~CTe_PsyPositioner()")); Cancel(); delete iGenericInfo; + INFO_PRINTF1(_L("->CPositioner::~CPositioner()")); delete iPositioner; } @@ -90,8 +92,16 @@ void CTe_PsyPositioner::RunL() { - CTe_Active::RunL(); - iPosUpdateReceived = ETrue; + CTe_Active::RunL(); + iPosUpdateReceived = ETrue; // Note this just means the the original request got completed and not necessarily a valid pos update has been received. + if (iStatus.Int() == KErrNone) + { + INFO_PRINTF2(_L("A position update has been received successfully for positioner %d"),iPositionerId); + } + else + { + INFO_PRINTF3(_L("The position update request for positioner %d has been completed with the error %d"), iPositionerId, iStatus.Int()); + } } void CTe_PsyPositioner::DoCancel() @@ -153,13 +163,21 @@ } iPosUpdateReceived = EFalse; - if(!aLbsResponse.Compare(PosInfo())) - { - ERR_PRINTF2(_L("The position update received is not equal to the sent one for positioner"), - iPositionerId); - User::Leave(EFail); - } - INFO_PRINTF2(_L("The expected position update is received for positioner %d"), iPositionerId); + if ( (iStatus.Int() == KErrNone) || (iStatus.Int() == KPositionPartialUpdate) ) + { + if (!aLbsResponse.Compare(PosInfo())) + { + ERR_PRINTF2(_L("The position update received is not equal to the sent one for positioner"), + iPositionerId); + User::Leave(EFail); + } + INFO_PRINTF2(_L("The expected position update is received for positioner %d"), iPositionerId); + } + else + { + ERR_PRINTF3(_L("The position update request for positioner %d has been completed with error %d"), iPositionerId, iStatus.Int()); + User::Leave(EFail); + } } EXPORT_C void CTe_PsyPositioner::CheckPosUpdateNotReceivedL() diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsyutils.cpp --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsyutils.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsyutils.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -20,6 +20,30 @@ #include "te_lbspsyutils.h" #include "lbssystemcontroller.h" #include "lbsrootcenrepdefs.h" +#include "te_lbsinifilereader.h" +#include "lbsinternalinterface.h" + +#include "lbsnetinternalapi.h" +#include "lbsassistancedatacacheapi.h" +#include "lbsngnlmint.h" +#include "lbsreffnpint.h" +#include "lbsnetregstatusint.h" + +#include +#include + +#ifdef SYMBIAN_FEATURE_MANAGER + #include + #include +#endif + +// Locations and paths used when parsing .ini files +_LIT(KLbsDir, "lbs"); +_LIT(KModuleIniDir, "locmods"); +_LIT(KIniWildCard, "*.ini"); +_LIT(KQualityProfileIniName, "lbsprofile.ini"); + +const TInt KSecToMicroSecTransfer = 1000*1000; EXPORT_C CTe_SystemStarter::CTe_SystemStarter(TUid aServerId) /** Constructor. @@ -65,6 +89,339 @@ CleanupStack::PopAndDestroy(&lbsSysController); } + +void CTe_SystemStarter::GetQualityProfileInfoL(RFs& aFs, + RArray& aQualityArray, + const TDesC& aFileName) + { + // Check the file is present. + TUint att; + TInt err = aFs.Att(aFileName, att); + if(err != KErrNone) + { + User::Leave(err); + } + + // Open the .ini file reader + CTe_LbsIniFileReader* fileReader = CTe_LbsIniFileReader::NewL(aFs, aFileName); + CleanupStack::PushL(fileReader); + + _LIT(KKeyProfileID, "ProfileID"); + _LIT(KKeyMaxTime, "MaxTime"); + _LIT(KKeyHorizontalAccuracy, "HorizontalAccuracy"); + _LIT(KKeyVerticalAccuracy, "VerticalAccuracy"); + _LIT(KKeyMeasurementInitialTime, "MeasurementInitialTime"); + _LIT(KKeyMeasurementIntermediateTime, "MeasurementIntermediateTime"); + _LIT(KFinalNetPositionLag, "FinalNetPositionLag"); + + // Read in all the quality profile info, section by section. + while (fileReader->FindNextSection()) + { + TInt result; + TBool foundVar = fileReader->FindVar(KKeyProfileID, result); + if (foundVar) + { + TQualityProfile qualityProfile; +#ifdef _DEBUG + // Validate the Profile ID to ensure not a duplicate + // (UDEB builds only) + TInt count = aQualityArray.Count(); + for (TInt i = 0; iELbsPanicInvalidProfileIniFile); + } + } +#endif // _DEBUG + + // Set the profile Id + qualityProfile.SetQualityProfileId(result); + + // Set the request quality + foundVar = fileReader->FindVar(KKeyMaxTime, result); + if (foundVar) + { + TTimeIntervalMicroSeconds microseconds = static_cast(result) * KSecToMicroSecTransfer; + qualityProfile.SetMaxFixTime(microseconds); + } + + TReal32 resultReal32; + foundVar = fileReader->FindVar(KKeyHorizontalAccuracy, resultReal32); + if (foundVar) + { + qualityProfile.SetMinHorizontalAccuracy(resultReal32); + } + + foundVar = fileReader->FindVar(KKeyVerticalAccuracy, resultReal32); + if (foundVar) + { + qualityProfile.SetMinVerticalAccuracy(resultReal32); + } + + foundVar = fileReader->FindVar(KKeyMeasurementInitialTime, result); + if (foundVar) + { + TTimeIntervalMicroSeconds microseconds = static_cast(result) * KSecToMicroSecTransfer; + qualityProfile.SetMeasurementInitialFixTime(microseconds); + } + + foundVar = fileReader->FindVar(KKeyMeasurementIntermediateTime, result); + if (foundVar) + { + TTimeIntervalMicroSeconds microseconds = static_cast(result) * KSecToMicroSecTransfer; + qualityProfile.SetMeasurementIntermediateFixTime(microseconds); + } + + foundVar = fileReader->FindVar(KFinalNetPositionLag, result); + if (foundVar) + { + TTimeIntervalMicroSeconds microseconds = static_cast(result) * KSecToMicroSecTransfer; + qualityProfile.SetFinalNetPositionLag(microseconds); + } + + // Add the quality profile to the list + User::LeaveIfError(aQualityArray.Append(qualityProfile)); + } + } + + CleanupStack::PopAndDestroy(fileReader); + } + +void CTe_SystemStarter::InitializeQualityProfileInfoL() + { + RFs fs; + User::LeaveIfError(fs.Connect()); + CleanupClosePushL(fs); + + TBuf<32> privatePath; + User::LeaveIfError(fs.PrivatePath(privatePath)); + + TParse parse; + parse.Set(privatePath, NULL, NULL); + parse.AddDir(KLbsDir); + + RArray qualityArray; + CleanupClosePushL(qualityArray); + + qualityArray.Reserve(5); + + // Only want to use the first file that is found. + // The way TFindFile::FindByDir works, it will search + // C: and D: before Z:, which is what we want. + TFindFile findFile(fs); + TInt err = findFile.FindByDir(KQualityProfileIniName, parse.Path()); + if (err == KErrNone) + { + GetQualityProfileInfoL(fs, qualityArray, findFile.File()); + } + + // Publish the quality profile info + LbsQualityProfile::InitializeL(qualityArray); + + CleanupStack::PopAndDestroy(&qualityArray); + CleanupStack::PopAndDestroy(&fs); + } + + +void CTe_SystemStarter::GetModuleInfoL(RFs& aFs, TPositionModuleInfoExtended& aExtendedModuleInfo, + const TDesC& aFileName) + { + TPositionQuality posQuality; + + // Check the file is present. + TUint att; + TInt err = aFs.Att(aFileName, att); + if(err != KErrNone) + { + User::Leave(err); + } + + CTe_LbsIniFileReader* fileReader = CTe_LbsIniFileReader::NewL(aFs, aFileName); + CleanupStack::PushL(fileReader); + + fileReader->FindNextSection(); + + fileReader->ReadPosQualityCriteria(posQuality); + + TPositionModuleInfo tempPositionModuleInfo; + TUint8* endAddr2 = Mem::Copy(&aExtendedModuleInfo.iPositionModuleInfoBytes[0], + &tempPositionModuleInfo, + sizeof(TPositionModuleInfo)); + + + TPositionModuleInfo* posModeInfo = (TPositionModuleInfo*) &aExtendedModuleInfo.iPositionModuleInfoBytes[0]; + + posModeInfo->SetPositionQuality(posQuality); + + fileReader->ReadModuleInfoL(*posModeInfo); + fileReader->ReadPlugInUid(aExtendedModuleInfo.iDataSourcePluginId); + fileReader->ReadExecutableNameL(aExtendedModuleInfo.iExecutableName); + fileReader->ReadDeviceCapabilities(aExtendedModuleInfo.iDeviceGpsModeCapabilities); + + aExtendedModuleInfo.iModuleId = posModeInfo->ModuleId(); + + CleanupStack::PopAndDestroy(fileReader); + } + +void CTe_SystemStarter::InitializeModuleInfoL() + { + RFs fs; + User::LeaveIfError(fs.Connect()); + CleanupClosePushL(fs); + + TBuf<32> privatePath; + User::LeaveIfError(fs.PrivatePath(privatePath)); + + TParse parse; + parse.Set(privatePath, NULL, NULL); + parse.AddDir(KLbsDir); + parse.AddDir(KModuleIniDir); + + TFindFile findFile(fs); + TInt moduleCount = 0; + CDesCArray* nameArray = new(ELeave) CDesCArrayFlat(KMaxInfoModules); + CleanupStack::PushL(nameArray); + CDir* dir = NULL; + TInt err = findFile.FindWildByDir(KIniWildCard, parse.Path(), dir); + + TPositionModuleInfoExtended moduleInfoArray[KMaxInfoModules]; + + while (err == KErrNone) + { + CleanupStack::PushL(dir); + TInt fileCount = dir->Count(); + + // Add each module to array + for (TInt i = 0; i < fileCount; i++) + { + // Extract the data and put it in the moduleInfo.... + // First work out the full path and name for this file + parse.Set((*dir)[i].iName, &findFile.File(), NULL); + // Check if module already exists + TInt nameIndex; + if (nameArray->Find(parse.Name(), nameIndex) != 0) + { + // Now extract the data into the module info instance + GetModuleInfoL(fs, moduleInfoArray[moduleCount], parse.FullName()); + nameArray->AppendL(parse.Name()); + moduleCount++; + if (moduleCount > KMaxInfoModules) + { + User::Leave(KErrTooBig); + } + } + } + CleanupStack::PopAndDestroy(dir); + dir = NULL; + // Find next file + err = findFile.FindWild(dir); + } + CleanupStack::PopAndDestroy(nameArray); + CleanupStack::PopAndDestroy(&fs); + + const TPositionModuleInfoExtended* duplicateModuleInfoArray[] = + { + &moduleInfoArray[0], + &moduleInfoArray[1], + &moduleInfoArray[2], + &moduleInfoArray[3], + &moduleInfoArray[4], + &moduleInfoArray[5] + }; + + LbsModuleInfo::InitializeL(duplicateModuleInfoArray, moduleCount); + } + + +EXPORT_C void CTe_SystemStarter::DefineLbsPropertiesL() + { + +#ifdef SYMBIAN_FEATURE_MANAGER + TBool locationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); +#else + TBool locationManagementSupported(ETrue); +#endif + + /* + * Define the properties used by the Lbs Internal API + */ + if(locationManagementSupported) + { + InitializeModuleInfoL(); + } + + InitializeQualityProfileInfoL(); + + RLbsPositionUpdateRequests::InitializeL(); + TPositionExtendedSatelliteInfo posSatInfo; + RLbsPositionUpdates::InitializeL(posSatInfo); + + if(locationManagementSupported) + { + TPositionModuleStatus positionModuleStatus; + RLbsModuleStatus::InitializeL(positionModuleStatus); + RLbsSystemModuleEvent::InitializeL(); + } + + RLbsGpsMeasurementUpdates::InitializeL(); + + /* + * Define the properties used by the API for the + * transport of assistance data. + */ + if(locationManagementSupported) + { + RAssistanceDataCache::InitializeL(); + } + + /* + * Define the properties used by the API for the + * Network Request Handler <-> Network Gateway interface + * AGPS manager <-> Network Gateway interface. + */ + RLbsNetChannel::InitializeL(RLbsNetChannel::EChannelNG2NRH); + RLbsNetChannel::InitializeL(RLbsNetChannel::EChannelNRH2NG); + if(locationManagementSupported) + { + RLbsNetChannel::InitializeL(RLbsNetChannel::EChannelNG2AGPS); + RLbsNetChannel::InitializeL(RLbsNetChannel::EChannelAGPS2NG); + RLbsNetworkLocationRequests::InitializeL(); + RLbsNetworkLocationResponses::InitializeL(); + } + RLbsNetworkPositionUpdates::InitializeL(); + RLbsNetworkRegistrationStatus::InitializeL(); + RLbsNetChannel::InitializeL(RLbsNetChannel::EChannelNG2SUPLPSY); + RLbsNetChannel::InitializeL(RLbsNetChannel::EChannelSUPLPSY2NG); + + } + +EXPORT_C void CTe_SystemStarter::DeleteLbsPropertiesL() + { + // LBS Internal API + LbsModuleInfo::ShutDownL(); + RLbsPositionUpdateRequests::ShutDownL(); + RLbsPositionUpdates::ShutDownL(); + RLbsModuleStatus::ShutDownL(); + RLbsSystemModuleEvent::ShutDownL(); + LbsQualityProfile::ShutDownL(); + + // LBS Assistance Data + RAssistanceDataCache::ShutDownL(); + + // LBS Net Internal API + RLbsNetChannel::ShutDownL(RLbsNetChannel::EChannelNG2NRH); + RLbsNetChannel::ShutDownL(RLbsNetChannel::EChannelNRH2NG); + RLbsNetChannel::ShutDownL(RLbsNetChannel::EChannelNG2AGPS); + RLbsNetChannel::ShutDownL(RLbsNetChannel::EChannelAGPS2NG); + RLbsNetChannel::ShutDownL(RLbsNetChannel::EChannelNG2SUPLPSY); + RLbsNetChannel::ShutDownL(RLbsNetChannel::EChannelSUPLPSY2NG); + RLbsNetworkLocationRequests::ShutDownL(); + RLbsNetworkLocationResponses::ShutDownL(); + RLbsNetworkPositionUpdates::ShutDownL(); + RLbsNetworkRegistrationStatus::ShutDownL(); + } EXPORT_C void CTe_SystemStarter::RestartLbs_NormalL(TBuf8aFirstExe) { //We need to shutdown the whole LBS (including the root process) so any subsequent tests are able to start diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/src/cagpsenvironment.cpp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/src/cagpsenvironment.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/src/cagpsenvironment.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -34,10 +34,10 @@ { Dll::SetTls(NULL); - delete iPositionerQ; delete iRequestHandler; delete iResponseHandler; delete iModStatusHandler; + delete iPositionerQ; //Should only be deleted after iRequestHandler } /** diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/bld.inf --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/bld.inf Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/bld.inf Wed Aug 18 11:11:46 2010 +0300 @@ -22,6 +22,8 @@ ../testdata/te_lbsagpspsy_devicecaps_simultaneous.ini c:/testdata/configs/te_lbsagpspsy_devicecaps_simultaneous.ini ../testdata/te_lbsagpspsy_devicecaps_ta.ini c:/testdata/configs/te_lbsagpspsy_devicecaps_ta.ini ../testdata/te_lbsagpspsy_devicecaps_tb.ini c:/testdata/configs/te_lbsagpspsy_devicecaps_tb.ini +../testdata/te_lbsagpspsy_lbsprofile.ini c:/testdata/configs/te_lbsagpspsy_lbsprofile.ini +../testdata/te_lbsagpspsy_agpsintegmodule.ini c:/testdata/configs/te_lbsagpspsy_agpsintegmodule.ini PRJ_TESTMMPFILES te_lbsagpspsysuite.mmp diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/te_lbsagpspsysuite.mmp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/te_lbsagpspsysuite.mmp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/te_lbsagpspsysuite.mmp Wed Aug 18 11:11:46 2010 +0300 @@ -37,7 +37,7 @@ USERINCLUDE ../../../../../locationmgmt/locationcore/LbsPartnerCommon/inc USERINCLUDE ../../../../../locationmgmt/locationcore/LbsCommonInternalDataTypes/inc USERINCLUDE ../../../../../locationmgmt/locationcore/LbsRefFnpInt/inc - +USERINCLUDE ../inc OS_LAYER_SYSTEMINCLUDE_SYMBIAN diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsyposupdateerrstep.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsyposupdateerrstep.h Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,44 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// The test step testing the agps-specific notify position update scenarios with errors. +// +// + +#if (!defined __TE_LBSAGPSPSYPOSUPDATEERR_STEP__) +#define __TE_LBSAGPSPSYPOSUPDATEERR_STEP__ + +#include +#include + +#include "te_lbspsyposupdateerrstep.h" + +/** +The test step testing simple notify position update scenarios. +*/ +class CTe_LbsAgpsNotifyPositionUpdateErrStep : public CTe_LbsNotifyPositionUpdateErrStep + { +public: + IMPORT_C static CTe_LbsAgpsNotifyPositionUpdateErrStep* NewL(MTe_LbsPsyStaticData* aPsyStaticData); + IMPORT_C virtual ~CTe_LbsAgpsNotifyPositionUpdateErrStep(); + +protected: + virtual void ReallyDoTestStepImpL(); + +private: + CTe_LbsAgpsNotifyPositionUpdateErrStep(MTe_LbsPsyStaticData* aPsyStaticData); + + }; + + +#endif //__TE_LBSAGPSPSYPOSUPDATEERR_STEP__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsyposupdatemodestep.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsyposupdatemodestep.h Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,42 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// The test step testing simple notify position update scenarios for the AGPS PSY. +// +// + +#if (!defined __TE_LBSAGPSPSYPOSUPDATEMODE_STEP__) +#define __TE_LBSAGPSPSYPOSUPDATEMODE_STEP__ + +#include "te_lbspsybasestep.h" + +_LIT(KLbsNotifyPositionUpdateModeStep, "NotifyPositionUpdateMode"); + +/** +The test step testing simple notify position update scenarios for the AGPS PSY. +*/ +class CTe_LbsAgpsPsyPosUpdateModeStep : public CTe_PsyBaseStep + { +public: + static CTe_LbsAgpsPsyPosUpdateModeStep* NewL(MTe_LbsPsyStaticData* aPsyStaticData); + +protected: + virtual void ReallyDoTestStepImpL(); + +private: + CTe_LbsAgpsPsyPosUpdateModeStep(MTe_LbsPsyStaticData* aPsyStaticData); + + }; + + +#endif //__TE_LBSAGPSPSYPOSUPDATEMODE_STEP__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsyposupdatestep.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsyposupdatestep.h Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,40 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// The test step testing simple notify position update scenarios for the AGPS PSY. +// +// + +#if (!defined __TE_LBSAGPSPSYPOSUPDATE_STEP__) +#define __TE_LBSAGPSPSYPOSUPDATE_STEP__ + +#include "te_lbspsyposupdatestep.h" + +/** +The test step testing simple notify position update scenarios for the AGPS PSY. +*/ +class CTe_LbsAgpsPsyPosUpdateStep : public CTe_LbsNotifyPositionUpdateStep + { +public: + static CTe_LbsAgpsPsyPosUpdateStep* NewL(MTe_LbsPsyStaticData* aPsyStaticData); + +protected: + virtual void ReallyDoTestStepImpL(); + +private: + CTe_LbsAgpsPsyPosUpdateStep(MTe_LbsPsyStaticData* aPsyStaticData); + + }; + + +#endif //__TE_LBSAGPSPSYPOSUPDATE_STEP__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsysuite.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/inc/te_lbsagpspsysuite.h Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,54 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// This is the test server for Lbs AGPS PSY tests. +// +// + +#if (!defined __TE_LBSAGPSPSYSUITE_H__) +#define __TE_LBSAGPSPSYSUITE_H__ + +#include + +#include "te_lbspsystaticdata.h" +#include "LbsInternalInterface.h" + +/** +This is the test server for Lbs AGPS PSY tests. +*/ +class CTe_LbsAgpsPsySuite : public CTestServer, public MTe_LbsPsyStaticData + { +public: + static CTe_LbsAgpsPsySuite* NewL(); + virtual ~CTe_LbsAgpsPsySuite(); + + virtual CTestStep* CreateTestStep(const TDesC& aStepName); + + //From MTe_PsySpecificData + virtual TUid ModuleUid() const; + virtual const RLbsPositionUpdateRequests::TChannelIdentifer& UpdateReqChanId() const; + virtual TUint CountPositioner(); + virtual CTestExecuteLogger& Logger() const; + +protected: + void ConstructL(); + +private: + CTestStep* CreateTestStepL(const TDesC& aStepName); + + TBuf8 iFirstExe; + TUint iPositionerCount; + CTestStep* iCurrentStep; + }; + +#endif //__TE_LBSAGPSPSYSUITE_H__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/scripts/te_lbsagpspsysuite.script --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/scripts/te_lbsagpspsysuite.script Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/scripts/te_lbsagpspsysuite.script Wed Aug 18 11:11:46 2010 +0300 @@ -19,11 +19,20 @@ //! @SYMTestSuiteName LBS-AgpsPsySuite //! @SYMScriptTestEnvironment TestExecute using te_lbsagpspsysuite.script +//The quality profile and the internalapi buses are directly initialized from the test +//without starting lbsroot [so lbsprofile.ini & agpsintegmodule.ini have to be copied to the private folder of the test process] +PREFIX RUN_UTILS +MkDir c:\private\10285acb +MkDir c:\private\10285acb\lbs +MkDir c:\private\10285acb\lbs\locmods +DeleteFile c:\private\10285acb\lbs\lbsprofile.ini +DeleteFile c:\private\10285acb\lbs\locmods\agpsintegmodule.ini +CopyFile c:\testdata\configs\te_lbsagpspsy_lbsprofile.ini c:\private\10285acb\lbs\lbsprofile.ini +CopyFile c:\testdata\configs\te_lbsagpspsy_agpsintegmodule.ini c:\private\10285acb\lbs\locmods\agpsintegmodule.ini +REMOVE_PREFIX -//While loading the suite, we shutdown the whole LBS leaving the root process only. LOAD_SUITE te_lbsagpspsysuite - PRINT RUN ALL te_lbsagpspsysuite TESTS @@ -492,20 +501,10 @@ END_TESTCASE LBS-AgpsPsySuite-PowerAdvice-Section0 -// Create dir for new device caps file in case it doesn't already exist -RUN_UTILS MkDir c:\private\10282253\ -RUN_UTILS MkDir c:\private\10282253\lbs\ -RUN_UTILS MkDir c:\private\10282253\lbs\locmods\ -RUN_UTILS MkDir c:\private\10282253\lbs\locmods\temp -// copy current device caps file if there is one, to replace when finished -RUN_UTILS CopyFile c:\private\10282253\lbs\locmods\agpsintegmodule.ini c:\private\10282253\lbs\locmods\temp\sirfdatasource_original.ini -RUN_UTILS DeleteFile c:\private\10282253\lbs\locmods\*.ini - - //------------------------------- Device Caps TB ONLY // Set up the device caps (lbs is restarted by test case so caps are re-parsed): -RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_TB.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini +RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_TB.ini c:\private\10285acb\lbs\locmods\agpsintegmodule.ini START_TESTCASE LBS-AgpsPsySuite-NPUDModeMerge-CapsTB-0-A //! @SYMTestCaseID LBS-AgpsPsySuite-NPUDModeMerge-CapsTB-0-A @@ -724,7 +723,7 @@ //------------------------------- Device Caps TA -RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_ta.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini +RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_ta.ini c:\private\10285acb\lbs\locmods\agpsintegmodule.ini START_TESTCASE LBS-AgpsPsySuite-NPUDModeMerge-CapsTA-0-A //! @SYMTestCaseID LBS-AgpsPsySuite-NPUDModeMerge-CapsTA-0-A @@ -867,7 +866,7 @@ //------------------------------- Device Caps TA || TB -RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_exclusive.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini +RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_exclusive.ini c:\private\10285acb\lbs\locmods\agpsintegmodule.ini START_TESTCASE LBS-AgpsPsySuite-NPUDModeMerge-CapsTAORTB-0-A //! @SYMTestCaseID LBS-AgpsPsySuite-NPUDModeMerge-CapsTAORTB-0-A @@ -1167,7 +1166,7 @@ //------------------------------- Device Caps TB && TA -RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_simultaneous.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini +RUN_UTILS CopyFile c:\testdata\configs\te_lbsagpspsy_devicecaps_simultaneous.ini c:\private\10285acb\lbs\locmods\agpsintegmodule.ini START_TESTCASE LBS-AgpsPsySuite-NPUDModeMerge-CapsTBANDTA-0-A //! @SYMTestCaseID LBS-AgpsPsySuite-NPUDModeMerge-CapsTBANDTA-0-A @@ -1463,10 +1462,8 @@ RUN_TEST_STEP 300 te_lbsagpspsysuite NotifyPositionUpdateMode c:\testdata\configs\te_lbsagpspsy.ini SectionMerge-CAPSTBANDTA-A-TA END_TESTCASE LBS-AgpsPsySuite-NPUDModeMerge-CapsTBANDTA-A-TA - -// TidyUp: -RUN_UTILS DeleteFile c:\private\10282253\lbs\locmods\agpsintegmodule.ini -RUN_UTILS CopyFile c:\private\10282253\lbs\locmods\temp\sirfdatasource_original.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini +RUN_UTILS DeleteFile c:\private\10285acb\lbs\lbsprofile.ini +RUN_UTILS DeleteFile c:\private\10285acb\lbs\locmods\agpsintegmodule.ini PRINT COMPLETE ALL te_lbsagpspsysuite TESTS diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdateerrstep.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdateerrstep.h Wed Jun 23 19:48:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// The test step testing the agps-specific notify position update scenarios with errors. -// -// - -#if (!defined __TE_LBSAGPSPSYPOSUPDATEERR_STEP__) -#define __TE_LBSAGPSPSYPOSUPDATEERR_STEP__ - -#include -#include - -#include "te_lbspsyposupdateerrstep.h" - -/** -The test step testing simple notify position update scenarios. -*/ -class CTe_LbsAgpsNotifyPositionUpdateErrStep : public CTe_LbsNotifyPositionUpdateErrStep - { -public: - IMPORT_C static CTe_LbsAgpsNotifyPositionUpdateErrStep* NewL(MTe_LbsPsyStaticData* aPsyStaticData); - IMPORT_C virtual ~CTe_LbsAgpsNotifyPositionUpdateErrStep(); - -protected: - virtual void ReallyDoTestStepImpL(); - -private: - CTe_LbsAgpsNotifyPositionUpdateErrStep(MTe_LbsPsyStaticData* aPsyStaticData); - - }; - - -#endif //__TE_LBSAGPSPSYPOSUPDATEERR_STEP__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.cpp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -35,7 +35,7 @@ _LIT(KExpectError, "ExpectError"); // lrm TODO - this is ugly, step shouldn't need to know about suite, try to think of alternative: -const TUid KServerUid = {0x10285ACB}; +//const TUid KServerUid = {0x10285ACB}; const TInt KPosAGPSPSYImpl = 0x101fe98c; const TInt KPosGPSPSYImpl = 0x101fe98a; @@ -56,12 +56,10 @@ void CTe_LbsAgpsPsyPosUpdateModeStep::ReallyDoTestStepImpL() { INFO_PRINTF1(_L("CTe_LbsAgpsPsyPosUpdateModeStep::ReallyDoTestStepImpL()")); - // Restart LBS so device caps are refreshed: - CTe_SystemStarter starter(KServerUid); - TBuf8 firstExe; - starter.RestartLbs_RootOnlyL(firstExe); // lrm TODO - have a separate test step for this to avoid doing for every test case! - - INFO_PRINTF1(_L("Lbs restarted successfully")); + // Close and re-define the internal buses and quality profile so that device caps are refreshed: + + CTe_SystemStarter::DeleteLbsPropertiesL(); + CTe_SystemStarter::DefineLbsPropertiesL(); // Get settings from config TPositionModuleInfo::TTechnologyType currMode = 0, newMode, newModeToManager = 0; @@ -249,7 +247,6 @@ CleanupStack::PopAndDestroy(admin); CleanupStack::PopAndDestroy(updateRequest); - TRAP_IGNORE(starter.RestartLbs_NormalL(firstExe)); INFO_PRINTF1(_L("CTe_LbsAgpsPsyPosUpdateModeStep::ReallyDoTestStepL() end")); diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.h Wed Jun 23 19:48:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// The test step testing simple notify position update scenarios for the AGPS PSY. -// -// - -#if (!defined __TE_LBSAGPSPSYPOSUPDATEMODE_STEP__) -#define __TE_LBSAGPSPSYPOSUPDATEMODE_STEP__ - -#include "te_lbspsybasestep.h" - -_LIT(KLbsNotifyPositionUpdateModeStep, "NotifyPositionUpdateMode"); - -/** -The test step testing simple notify position update scenarios for the AGPS PSY. -*/ -class CTe_LbsAgpsPsyPosUpdateModeStep : public CTe_PsyBaseStep - { -public: - static CTe_LbsAgpsPsyPosUpdateModeStep* NewL(MTe_LbsPsyStaticData* aPsyStaticData); - -protected: - virtual void ReallyDoTestStepImpL(); - -private: - CTe_LbsAgpsPsyPosUpdateModeStep(MTe_LbsPsyStaticData* aPsyStaticData); - - }; - - -#endif //__TE_LBSAGPSPSYPOSUPDATEMODE_STEP__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatestep.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatestep.h Wed Jun 23 19:48:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// The test step testing simple notify position update scenarios for the AGPS PSY. -// -// - -#if (!defined __TE_LBSAGPSPSYPOSUPDATE_STEP__) -#define __TE_LBSAGPSPSYPOSUPDATE_STEP__ - -#include "te_lbspsyposupdatestep.h" - -/** -The test step testing simple notify position update scenarios for the AGPS PSY. -*/ -class CTe_LbsAgpsPsyPosUpdateStep : public CTe_LbsNotifyPositionUpdateStep - { -public: - static CTe_LbsAgpsPsyPosUpdateStep* NewL(MTe_LbsPsyStaticData* aPsyStaticData); - -protected: - virtual void ReallyDoTestStepImpL(); - -private: - CTe_LbsAgpsPsyPosUpdateStep(MTe_LbsPsyStaticData* aPsyStaticData); - - }; - - -#endif //__TE_LBSAGPSPSYPOSUPDATE_STEP__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.cpp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -34,7 +34,7 @@ _LIT(KServerName, "te_lbsagpspsysuite"); /** The UID of the unit test suite*/ -const TUid KServerUid = {0x10285ACB}; +//const TUid KServerUid = {0x10285ACB}; const RLbsPositionUpdateRequests::TChannelIdentifer KChannelIdentifierLS2GpsLocManager = { @@ -69,18 +69,12 @@ //ConstructL of the base class CTestServer::ConstructL(KServerName); - CTe_SystemStarter starter(KServerUid); - - starter.RestartLbs_RootOnlyL(iFirstExe); - + CTe_SystemStarter::DefineLbsPropertiesL(); } CTe_LbsAgpsPsySuite::~CTe_LbsAgpsPsySuite() { - CTe_SystemStarter starter(KServerUid); - - TRAP_IGNORE(starter.RestartLbs_NormalL(iFirstExe)); - + TRAP_IGNORE(CTe_SystemStarter::DeleteLbsPropertiesL()); } /** diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.h Wed Jun 23 19:48:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// This is the test server for Lbs AGPS PSY tests. -// -// - -#if (!defined __TE_LBSAGPSPSYSUITE_H__) -#define __TE_LBSAGPSPSYSUITE_H__ - -#include - -#include "te_lbspsystaticdata.h" -#include "LbsInternalInterface.h" - -/** -This is the test server for Lbs AGPS PSY tests. -*/ -class CTe_LbsAgpsPsySuite : public CTestServer, public MTe_LbsPsyStaticData - { -public: - static CTe_LbsAgpsPsySuite* NewL(); - virtual ~CTe_LbsAgpsPsySuite(); - - virtual CTestStep* CreateTestStep(const TDesC& aStepName); - - //From MTe_PsySpecificData - virtual TUid ModuleUid() const; - virtual const RLbsPositionUpdateRequests::TChannelIdentifer& UpdateReqChanId() const; - virtual TUint CountPositioner(); - virtual CTestExecuteLogger& Logger() const; - -protected: - void ConstructL(); - -private: - CTestStep* CreateTestStepL(const TDesC& aStepName); - - TBuf8 iFirstExe; - TUint iPositionerCount; - CTestStep* iCurrentStep; - }; - -#endif //__TE_LBSAGPSPSYSUITE_H__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/testdata/te_lbsagpspsy_agpsintegmodule.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/testdata/te_lbsagpspsy_agpsintegmodule.ini Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,61 @@ +# agpsnpeintegmodule.ini (exported to agpsintegmodule.ini) +# Ini file with the module information for the NPE AGPS integration module + +[1] +Version= 0.2.1 # +ModuleId= 271064388 # dec +ModuleName= "NPE_Loc_AGPS_Module" # +TechnologyType= 0101 # binary +DeviceLocation= 1 # binary +Capabilities= 11111 # binary +ClassesSupported= 111111 # binary +TimeToFirstFix= 90000 # ms +TimeToNextFix= 1000 # ms +HorizontalAccuracy= 5.4 # real +VerticalAccuracy= 5.4 # real +CostIndicator= 2 # dec +PowerConsumption= 2 # dec +DataSourceId= 271086051 # dec +ExecutableName= "lbsgpslocmanager.exe" + + + + +#positioning capabilities of an AGPS Integration Module intended to be used as a bitmask. +# +#Currently only the following combinations are supported: +# - EDeviceGpsModeTerminalBased +# - EDeviceGpsModeTerminalAssisted +# - EDeviceGpsModeTerminalBased | EDeviceGpsModeTerminalAssisted +# - EDeviceGpsModeSimultaneousTATB +# +#Specifying a bitmask with more than one mode enabled means that all the modes are supported, but not simultaneously. +#For example “EDeviceGpsModeTerminalBased | EDeviceGpsModeTerminalAssisted” means that a module can support both, +#Terminal Assisted and Terminal Based positioning, but only one at a time. +# +#No capabilities. Also used to initialise variables: +#EDeviceGpsModeNone = 0x0, +# +#Device supports Terminal Based positioning and is also able to +#calculate position autonomously if assistance data is unavailable, +#or does not arrive on time (e.g. a fix is obtained before assistance data +#delivery). +#EDeviceGpsModeTerminalBased = 0x0001, +# +#Device supports Terminal Assisted positioning. +#The module may, but does not have to be able to calculate position autonomously +#if Terminal Assisted positioning does not succeed (e.g. network is unavailable): +#EDeviceGpsModeTerminalAssisted = 0x0002, +# +#Device can perform Terminal Assisted and Terminal Based positioning at the same time. +#It is also able to calculate position autonomously if assistance data is unavailable (e.g. network error), +#or does not arrive on time (e.g. a fix is obtained before assistance data delivery). +#NOTE: If you set this bit then it is not necessary to set either of the previous 2 bits as they are implied: +#EDeviceGpsModeSimultaneousTATB = 0x0004, +# +#Device supports autonomous mode. +#This value is currently not supported and has no effect on the behaviour of the LBS subsystem: +#EDeviceGpsModeAutonomous = 0x0008, + + +DeviceGpsModeCaps=0100 # EDeviceGpsModeSimultaneousTATB diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/testdata/te_lbsagpspsy_lbsprofile.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/testdata/te_lbsagpspsy_lbsprofile.ini Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,20 @@ +# +# Quality Profiles for LBS services +# + +[1] +ProfileID= 0 +MaxTime= 130 +HorizontalAccuracy= 50 +VerticalAccuracy= 1000 +MeasurementInitialTime= 15 +MeasurementIntermediateTime= 5 +FinalNetPositionLag= 0 + +[2] +ProfileID= 1 +MaxTime= 120 +HorizontalAccuracy= 20 +VerticalAccuracy= 1000 +MeasurementInitialTime= 15 +MeasurementIntermediateTime= 5 diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/bld.inf --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/bld.inf Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/bld.inf Wed Aug 18 11:11:46 2010 +0300 @@ -16,8 +16,10 @@ // PRJ_TESTEXPORTS -../scripts/te_lbsgpspsysuite.script c:/testdata/scripts/te_lbsgpspsysuite.script -../testdata/te_lbsgpspsy.ini c:/testdata/configs/te_lbsgpspsy.ini +../scripts/te_lbsgpspsysuite.script c:/testdata/scripts/te_lbsgpspsysuite.script +../testdata/te_lbsgpspsy.ini c:/testdata/configs/te_lbsgpspsy.ini +../testdata/te_lbsgpspsy_agpsintegmodule.ini c:/testdata/configs/te_lbsgpspsy_agpsintegmodule.ini +../testdata/te_lbsgpspsy_lbsprofile.ini c:/testdata/configs/te_lbsgpspsy_lbsprofile.ini PRJ_TESTMMPFILES diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/te_lbsgpspsysuite.mmp --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/te_lbsgpspsysuite.mmp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/te_lbsgpspsysuite.mmp Wed Aug 18 11:11:46 2010 +0300 @@ -35,6 +35,7 @@ USERINCLUDE ../../../../../locationmgmt/locationcore/LbsNetInternalApi/inc USERINCLUDE ../../../../../locationmgmt/locationcore/LbsPartnerCommon/inc USERINCLUDE ../../../../../locationmgmt/locationcore/LbsCommonInternalDataTypes/inc +USERINCLUDE ../inc OS_LAYER_SYSTEMINCLUDE_SYMBIAN diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/inc/te_lbsgpspsysuite.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/inc/te_lbsgpspsysuite.h Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,53 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// This is the test server for Lbs Gps PSY tests. +// +// + +#if (!defined __TE_LBSGPSPSYSUITE_H__) +#define __TE_LBSGPSPSYSUITE_H__ + +#include + +#include "te_lbspsystaticdata.h" + +/** +This is the test server for Lbs Net PSY tests. +*/ +class CTe_LbsGpsPsySuite : public CTestServer, public MTe_LbsPsyStaticData + { +public: + static CTe_LbsGpsPsySuite* NewL(); + virtual ~CTe_LbsGpsPsySuite(); + + virtual CTestStep* CreateTestStep(const TDesC& aStepName); + + //From MTe_PsySpecificData + virtual TUid ModuleUid() const; + virtual const RLbsPositionUpdateRequests::TChannelIdentifer& UpdateReqChanId() const; + virtual TUint CountPositioner(); + virtual CTestExecuteLogger& Logger() const; + +protected: + void ConstructL(); + +private: + CTestStep* CreateTestStepL(const TDesC& aStepName); + + TBuf8 iFirstExe; + TUint iPositionerCount; + CTestStep* iCurrentStep; + }; + +#endif //__TE_LBSGPSPSYSUITE_H__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/scripts/te_lbsgpspsysuite.script --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/scripts/te_lbsgpspsysuite.script Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/scripts/te_lbsgpspsysuite.script Wed Aug 18 11:11:46 2010 +0300 @@ -19,10 +19,19 @@ //! @SYMTestSuiteName LBS-GpsPsySuite //! @SYMScriptTestEnvironment TestExecute using te_lbsgpspsysuite.script +PREFIX RUN_UTILS +MkDir c:\private\102869c5 +MkDir c:\private\102869c5\lbs +MkDir c:\private\102869c5\lbs\locmods +DeleteFile c:\private\102869c5\lbs\lbsprofile.ini +DeleteFile c:\private\102869c5\lbs\locmods\agpsintegmodule.ini +CopyFile c:\testdata\configs\te_lbsgpspsy_lbsprofile.ini c:\private\102869c5\lbs\lbsprofile.ini +CopyFile c:\testdata\configs\te_lbsgpspsy_agpsintegmodule.ini c:\private\102869c5\lbs\locmods\agpsintegmodule.ini +REMOVE_PREFIX + //While loading the suite, we shutdown the whole LBS leaving the root process only. LOAD_SUITE te_lbsgpspsysuite - PRINT RUN ALL te_lbsgpspsysuite TESTS @@ -370,6 +379,8 @@ RUN_TEST_STEP 300 te_lbsgpspsysuite PowerAdvice c:\testdata\configs\te_lbsgpspsy.ini Section0 END_TESTCASE LBS-GpsPsySuite-PowerAdvice-Section0 +RUN_UTILS DeleteFile c:\private\102869c5\lbs\lbsprofile.ini +RUN_UTILS DeleteFile c:\private\102869c5\lbs\locmods\agpsintegmodule.ini PRINT COMPLETE ALL te_lbsgpspsysuite TESTS diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.cpp --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -34,7 +34,7 @@ _LIT(KServerName, "te_lbsgpspsysuite"); /** The UID of the unit test suite*/ -const TUid KServerUid = {0x102869C5}; +//const TUid KServerUid = {0x102869C5}; // TODO - put this somewhere that the gps and agps test suites can share it? const RLbsPositionUpdateRequests::TChannelIdentifer KChannelIdentifierLS2GpsLocManager = @@ -70,16 +70,12 @@ //ConstructL of the base class CTestServer::ConstructL(KServerName); - CTe_SystemStarter starter(KServerUid); - - starter.RestartLbs_RootOnlyL(iFirstExe); + CTe_SystemStarter::DefineLbsPropertiesL(); } CTe_LbsGpsPsySuite::~CTe_LbsGpsPsySuite() { - CTe_SystemStarter starter(KServerUid); - - TRAP_IGNORE(starter.RestartLbs_NormalL(iFirstExe)); + TRAP_IGNORE(CTe_SystemStarter::DeleteLbsPropertiesL()); } /** diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.h --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.h Wed Jun 23 19:48:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// This is the test server for Lbs Gps PSY tests. -// -// - -#if (!defined __TE_LBSGPSPSYSUITE_H__) -#define __TE_LBSGPSPSYSUITE_H__ - -#include - -#include "te_lbspsystaticdata.h" - -/** -This is the test server for Lbs Net PSY tests. -*/ -class CTe_LbsGpsPsySuite : public CTestServer, public MTe_LbsPsyStaticData - { -public: - static CTe_LbsGpsPsySuite* NewL(); - virtual ~CTe_LbsGpsPsySuite(); - - virtual CTestStep* CreateTestStep(const TDesC& aStepName); - - //From MTe_PsySpecificData - virtual TUid ModuleUid() const; - virtual const RLbsPositionUpdateRequests::TChannelIdentifer& UpdateReqChanId() const; - virtual TUint CountPositioner(); - virtual CTestExecuteLogger& Logger() const; - -protected: - void ConstructL(); - -private: - CTestStep* CreateTestStepL(const TDesC& aStepName); - - TBuf8 iFirstExe; - TUint iPositionerCount; - CTestStep* iCurrentStep; - }; - -#endif //__TE_LBSGPSPSYSUITE_H__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/testdata/te_lbsgpspsy_agpsintegmodule.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/testdata/te_lbsgpspsy_agpsintegmodule.ini Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,61 @@ +# agpsnpeintegmodule.ini (exported to agpsintegmodule.ini) +# Ini file with the module information for the NPE AGPS integration module + +[1] +Version= 0.2.1 # +ModuleId= 271064388 # dec +ModuleName= "NPE_Loc_AGPS_Module" # +TechnologyType= 0101 # binary +DeviceLocation= 1 # binary +Capabilities= 11111 # binary +ClassesSupported= 111111 # binary +TimeToFirstFix= 90000 # ms +TimeToNextFix= 1000 # ms +HorizontalAccuracy= 5.4 # real +VerticalAccuracy= 5.4 # real +CostIndicator= 2 # dec +PowerConsumption= 2 # dec +DataSourceId= 271086051 # dec +ExecutableName= "lbsgpslocmanager.exe" + + + + +#positioning capabilities of an AGPS Integration Module intended to be used as a bitmask. +# +#Currently only the following combinations are supported: +# - EDeviceGpsModeTerminalBased +# - EDeviceGpsModeTerminalAssisted +# - EDeviceGpsModeTerminalBased | EDeviceGpsModeTerminalAssisted +# - EDeviceGpsModeSimultaneousTATB +# +#Specifying a bitmask with more than one mode enabled means that all the modes are supported, but not simultaneously. +#For example “EDeviceGpsModeTerminalBased | EDeviceGpsModeTerminalAssisted” means that a module can support both, +#Terminal Assisted and Terminal Based positioning, but only one at a time. +# +#No capabilities. Also used to initialise variables: +#EDeviceGpsModeNone = 0x0, +# +#Device supports Terminal Based positioning and is also able to +#calculate position autonomously if assistance data is unavailable, +#or does not arrive on time (e.g. a fix is obtained before assistance data +#delivery). +#EDeviceGpsModeTerminalBased = 0x0001, +# +#Device supports Terminal Assisted positioning. +#The module may, but does not have to be able to calculate position autonomously +#if Terminal Assisted positioning does not succeed (e.g. network is unavailable): +#EDeviceGpsModeTerminalAssisted = 0x0002, +# +#Device can perform Terminal Assisted and Terminal Based positioning at the same time. +#It is also able to calculate position autonomously if assistance data is unavailable (e.g. network error), +#or does not arrive on time (e.g. a fix is obtained before assistance data delivery). +#NOTE: If you set this bit then it is not necessary to set either of the previous 2 bits as they are implied: +#EDeviceGpsModeSimultaneousTATB = 0x0004, +# +#Device supports autonomous mode. +#This value is currently not supported and has no effect on the behaviour of the LBS subsystem: +#EDeviceGpsModeAutonomous = 0x0008, + + +DeviceGpsModeCaps=0100 # EDeviceGpsModeSimultaneousTATB diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/testdata/te_lbsgpspsy_lbsprofile.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/testdata/te_lbsgpspsy_lbsprofile.ini Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,20 @@ +# +# Quality Profiles for LBS services +# + +[1] +ProfileID= 0 +MaxTime= 130 +HorizontalAccuracy= 50 +VerticalAccuracy= 1000 +MeasurementInitialTime= 15 +MeasurementIntermediateTime= 5 +FinalNetPositionLag= 0 + +[2] +ProfileID= 1 +MaxTime= 120 +HorizontalAccuracy= 20 +VerticalAccuracy= 1000 +MeasurementInitialTime= 15 +MeasurementIntermediateTime= 5 diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/group/bld.inf --- a/datasourcemodules/networkpositioningmodule/test/group/bld.inf Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/group/bld.inf Wed Aug 18 11:11:46 2010 +0300 @@ -18,7 +18,8 @@ PRJ_TESTEXPORTS ../scripts/te_lbsnetpsysuite.script c:/testdata/scripts/te_lbsnetpsysuite.script ../testdata/te_lbsnetpsy.ini c:/testdata/configs/te_lbsnetpsy.ini - +../testdata/te_lbsnetpsy_lbsprofile.ini c:/testdata/configs/te_lbsnetpsy_lbsprofile.ini +../testdata/te_lbsnetpsy_agpsintegmodule.ini c:/testdata/configs/te_lbsnetpsy_agpsintegmodule.ini PRJ_TESTMMPFILES te_lbsnetpsysuite.mmp diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/group/te_lbsnetpsysuite.mmp --- a/datasourcemodules/networkpositioningmodule/test/group/te_lbsnetpsysuite.mmp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/group/te_lbsnetpsysuite.mmp Wed Aug 18 11:11:46 2010 +0300 @@ -25,9 +25,7 @@ ProtServ PowerMgmt TrustedUI SurroundingsDD UserEnvironment - -USERINCLUDE ../../../../locationmgmt/locationcore/lbsrootapi/inc -USERINCLUDE ../../../../locationmgmt/locationcore/lbsroot/inc +USERINCLUDE ../inc USERINCLUDE ../../../../datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc USERINCLUDE ../../../../lbstest/lbstestproduct/internal/lbstestutils/inc USERINCLUDE ../../../../datasourceadaptation/gpsdatasourceadaptation/inc @@ -44,7 +42,6 @@ LIBRARY euser.lib LIBRARY testexecuteutils.lib LIBRARY centralrepository.lib -LIBRARY te_lbstestutils.lib LIBRARY epospluginfw.lib LIBRARY lbs.lib LIBRARY lbsadmin.lib @@ -53,9 +50,11 @@ LIBRARY lbsassistancedata.lib LIBRARY lbsinternalapi.lib LIBRARY lbsnetinternalapi.lib -LIBRARY lbsrootapi.lib LIBRARY lbslocdatasource.lib +LIBRARY lbscommoninternaldatatypes.lib LIBRARY te_lbsgenericpsytest.lib -LIBRARY lbscommoninternaldatatypes.lib +LIBRARY te_lbstestutils.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib SMPSAFE diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/inc/te_lbsnetpsysuite.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/networkpositioningmodule/test/inc/te_lbsnetpsysuite.h Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,57 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// This is the test server for Lbs Net PSY tests. +// +// + +#if (!defined __TE_LBSNETPSYSUITE_H__) +#define __TE_LBSNETPSYSUITE_H__ + +#include + +#include "te_lbspsystaticdata.h" + +/** +This is the test server for Lbs Net PSY tests. +*/ +class CTe_LbsNetPsySuite : public CTestServer, public MTe_LbsPsyStaticData + { +public: + static CTe_LbsNetPsySuite* NewL(); + virtual ~CTe_LbsNetPsySuite(); + + virtual CTestStep* CreateTestStep(const TDesC& aStepName); + + //From MTe_PsySpecificData + virtual TUid ModuleUid() const; + virtual const RLbsPositionUpdateRequests::TChannelIdentifer& UpdateReqChanId() const; + virtual TUint CountPositioner(); + virtual CTestExecuteLogger& Logger() const; + +protected: + void ConstructL(); + +private: + void InitializeQualityProfileInfoL(); + void GetQualityProfileInfoL(RFs& aFs, RArray& aQualityArray, + const TDesC& aFileName); +private: + CTestStep* CreateTestStepL(const TDesC& aStepName); + + TBuf8 iFirstExe; + TUint iPositionerCount; + CTestStep* iCurrentStep; + }; + +#endif //__TE_LBSNETPSYSUITE_H__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/scripts/te_lbsnetpsysuite.script --- a/datasourcemodules/networkpositioningmodule/test/scripts/te_lbsnetpsysuite.script Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/scripts/te_lbsnetpsysuite.script Wed Aug 18 11:11:46 2010 +0300 @@ -19,13 +19,22 @@ //! @SYMTestSuiteName LBS-NetPsySuite //! @SYMScriptTestEnvironment TestExecute using te_lbsnetpsysuite.script -//While loading the suite, we shutdown the whole LBS leaving the root process only. +//The quality profile and the internalapi buses are directly initialized from the test +//without starting lbsroot [so lbsprofile.ini & agpsintegmodule.ini have to be copied to the private folder of the test process] +PREFIX RUN_UTILS +MkDir c:\private\102869c3 +MkDir c:\private\102869c3\lbs +MkDir c:\private\102869c3\lbs\locmods +DeleteFile c:\private\102869c3\lbs\lbsprofile.ini +DeleteFile c:\private\102869c3\lbs\locmods\agpsintegmodule.ini +CopyFile c:\testdata\configs\te_lbsnetpsy_lbsprofile.ini c:\private\102869c3\lbs\lbsprofile.ini +CopyFile c:\testdata\configs\te_lbsnetpsy_agpsintegmodule.ini c:\private\102869c3\lbs\locmods\agpsintegmodule.ini +REMOVE_PREFIX + LOAD_SUITE te_lbsnetpsysuite - PRINT RUN ALL te_lbsnetpsysuite TESTS - START_TESTCASE LBS-NetPsySuite-NotifyPositionUpdate-Section0 //! @SYMTestCaseID LBS-NetPsySuite-NotifyPositionUpdate-Section0 //! @SYMTestCaseDesc Runs several pos update scenarios, which completes normally. @@ -356,7 +365,8 @@ RUN_TEST_STEP 300 te_lbsnetpsysuite NotifyPositionUpdateErr c:\testdata\configs\te_lbsnetpsy.ini Section2 END_TESTCASE LBS-NetPsySuite-NotifyPositionUpdateErr-Section2 - +RUN_UTILS DeleteFile c:\private\102869c3\lbs\lbsprofile.ini +RUN_UTILS DeleteFile c:\private\102869c3\lbs\locmods\agpsintegmodule.ini PRINT COMPLETE ALL te_lbsnetpsysuite TESTS diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.cpp --- a/datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -19,9 +19,6 @@ #include #include -#include "lbssystemcontroller.h" -#include "lbsrootcenrepdefs.h" - #include "te_lbspsyutils.h" #include "te_lbsnetpsysuite.h" #include "te_lbspsyposupdatestep.h" @@ -29,11 +26,13 @@ #include "te_lbspsyposupdateerrstep.h" #include "te_lbspsymodinfostep.h" +#include "te_lbsinifilereader.h" + /** The string name of the test suite */ _LIT(KServerName, "te_lbsnetpsysuite"); /** The UID of the unit test suite*/ -const TUid KServerUid = {0x10285ACB}; +//const TUid KServerUid = {0x10285ACB}; const RLbsPositionUpdateRequests::TChannelIdentifer KChannelIdentifierLS2NetLocManager = { @@ -60,24 +59,19 @@ /** 2nd phase constructor. Calls the base class method passing the name of the suite. - +Also initializes the lbsqualityprofile and the internal buses used for position requests and updates @leave If a error happens, it leaves with one of the system error codes. */ void CTe_LbsNetPsySuite::ConstructL() { //ConstructL of the base class CTestServer::ConstructL(KServerName); - - CTe_SystemStarter starter(KServerUid); - - starter.RestartLbs_RootOnlyL(iFirstExe); + CTe_SystemStarter::DefineLbsPropertiesL(); } CTe_LbsNetPsySuite::~CTe_LbsNetPsySuite() { - CTe_SystemStarter starter(KServerUid); - - TRAP_IGNORE(starter.RestartLbs_NormalL(iFirstExe)); + TRAP_IGNORE(CTe_SystemStarter::DeleteLbsPropertiesL()); } /** diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.h --- a/datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.h Wed Jun 23 19:48:34 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// This is the test server for Lbs Net PSY tests. -// -// - -#if (!defined __TE_LBSNETPSYSUITE_H__) -#define __TE_LBSNETPSYSUITE_H__ - -#include - -#include "te_lbspsystaticdata.h" - -/** -This is the test server for Lbs Net PSY tests. -*/ -class CTe_LbsNetPsySuite : public CTestServer, public MTe_LbsPsyStaticData - { -public: - static CTe_LbsNetPsySuite* NewL(); - virtual ~CTe_LbsNetPsySuite(); - - virtual CTestStep* CreateTestStep(const TDesC& aStepName); - - //From MTe_PsySpecificData - virtual TUid ModuleUid() const; - virtual const RLbsPositionUpdateRequests::TChannelIdentifer& UpdateReqChanId() const; - virtual TUint CountPositioner(); - virtual CTestExecuteLogger& Logger() const; - -protected: - void ConstructL(); - -private: - CTestStep* CreateTestStepL(const TDesC& aStepName); - - TBuf8 iFirstExe; - TUint iPositionerCount; - CTestStep* iCurrentStep; - }; - -#endif //__TE_LBSNETPSYSUITE_H__ diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/testdata/te_lbsnetpsy_agpsintegmodule.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/networkpositioningmodule/test/testdata/te_lbsnetpsy_agpsintegmodule.ini Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,61 @@ +# agpsnpeintegmodule.ini (exported to agpsintegmodule.ini) +# Ini file with the module information for the NPE AGPS integration module + +[1] +Version= 0.2.1 # +ModuleId= 271064388 # dec +ModuleName= "NPE_Loc_AGPS_Module" # +TechnologyType= 0101 # binary +DeviceLocation= 1 # binary +Capabilities= 11111 # binary +ClassesSupported= 111111 # binary +TimeToFirstFix= 90000 # ms +TimeToNextFix= 1000 # ms +HorizontalAccuracy= 5.4 # real +VerticalAccuracy= 5.4 # real +CostIndicator= 2 # dec +PowerConsumption= 2 # dec +DataSourceId= 271086051 # dec +ExecutableName= "lbsgpslocmanager.exe" + + + + +#positioning capabilities of an AGPS Integration Module intended to be used as a bitmask. +# +#Currently only the following combinations are supported: +# - EDeviceGpsModeTerminalBased +# - EDeviceGpsModeTerminalAssisted +# - EDeviceGpsModeTerminalBased | EDeviceGpsModeTerminalAssisted +# - EDeviceGpsModeSimultaneousTATB +# +#Specifying a bitmask with more than one mode enabled means that all the modes are supported, but not simultaneously. +#For example “EDeviceGpsModeTerminalBased | EDeviceGpsModeTerminalAssisted” means that a module can support both, +#Terminal Assisted and Terminal Based positioning, but only one at a time. +# +#No capabilities. Also used to initialise variables: +#EDeviceGpsModeNone = 0x0, +# +#Device supports Terminal Based positioning and is also able to +#calculate position autonomously if assistance data is unavailable, +#or does not arrive on time (e.g. a fix is obtained before assistance data +#delivery). +#EDeviceGpsModeTerminalBased = 0x0001, +# +#Device supports Terminal Assisted positioning. +#The module may, but does not have to be able to calculate position autonomously +#if Terminal Assisted positioning does not succeed (e.g. network is unavailable): +#EDeviceGpsModeTerminalAssisted = 0x0002, +# +#Device can perform Terminal Assisted and Terminal Based positioning at the same time. +#It is also able to calculate position autonomously if assistance data is unavailable (e.g. network error), +#or does not arrive on time (e.g. a fix is obtained before assistance data delivery). +#NOTE: If you set this bit then it is not necessary to set either of the previous 2 bits as they are implied: +#EDeviceGpsModeSimultaneousTATB = 0x0004, +# +#Device supports autonomous mode. +#This value is currently not supported and has no effect on the behaviour of the LBS subsystem: +#EDeviceGpsModeAutonomous = 0x0008, + + +DeviceGpsModeCaps=0100 # EDeviceGpsModeSimultaneousTATB diff -r 15a2125aa2f3 -r 95c570bf4a05 datasourcemodules/networkpositioningmodule/test/testdata/te_lbsnetpsy_lbsprofile.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/networkpositioningmodule/test/testdata/te_lbsnetpsy_lbsprofile.ini Wed Aug 18 11:11:46 2010 +0300 @@ -0,0 +1,20 @@ +# +# Quality Profiles for LBS services +# + +[1] +ProfileID= 0 +MaxTime= 130 +HorizontalAccuracy= 50 +VerticalAccuracy= 1000 +MeasurementInitialTime= 15 +MeasurementIntermediateTime= 5 +FinalNetPositionLag= 0 + +[2] +ProfileID= 1 +MaxTime= 120 +HorizontalAccuracy= 20 +VerticalAccuracy= 1000 +MeasurementInitialTime= 15 +MeasurementIntermediateTime= 5 diff -r 15a2125aa2f3 -r 95c570bf4a05 lbsapitest/lbshaitest/lbsclient/group/t_lbsclient.mmp --- a/lbsapitest/lbshaitest/lbsclient/group/t_lbsclient.mmp Wed Jun 23 19:48:34 2010 +0300 +++ b/lbsapitest/lbshaitest/lbsclient/group/t_lbsclient.mmp Wed Aug 18 11:11:46 2010 +0300 @@ -33,7 +33,8 @@ USERINCLUDE ../../common/inc USERINCLUDE ../lbsapi/inc -SYSTEMINCLUDE /epoc32/include +OS_LAYER_SYSTEMINCLUDE + SYSTEMINCLUDE /epoc32/include/oem SYSTEMINCLUDE /epoc32/include/test SYSTEMINCLUDE /epoc32/include/kernel diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp --- a/lbstest/lbstestproduct/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -201,7 +201,14 @@ CleanupStack::PopAndDestroy(&server2); } break; - + //Test case LBS-ConnectClose-0010 + case 10: + { + // this test only valid on variant2 api: + __ASSERT_DEBUG(iExpectedApiBehaviour == EApiVariant2, User::Panic(_L("Unrecognised 'Expected Api Behaviour'"), 1)); + INFO_PRINTF1(_L("LBsroot has been started by EPosserver in this mode. ")); + } + break; default: User::Leave(KErrArgument); break; diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplconnectionmanagersuite/testexecuteservers/te_suplconnectionmanagersuite.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplconnectionmanagersuite/testexecuteservers/te_suplconnectionmanagersuite.xml Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplconnectionmanagersuite/testexecuteservers/te_suplconnectionmanagersuite.xml Wed Aug 18 11:11:46 2010 +0300 @@ -4,14 +4,14 @@ te_suplconnectionmanagersuite.mmp - networkprotocolmodules\suplprotocolmodule\suplconnectionmanager\test\te_suplconnectionmanager\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplconnectionmanager_test\te_suplconnectionmanager\group\bld.inf suplspoofserver.dll c:\system\libs\suplspoofserver.dll suplspoofserver.mmp - networkprotocolmodules\suplprotocolmodule\test\suplspoofserver\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplspoofserver\group\bld.inf diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplprotocolsuite/testexecuteservers/te_suplprotocolsuite.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplprotocolsuite/testexecuteservers/te_suplprotocolsuite.xml Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplprotocolsuite/testexecuteservers/te_suplprotocolsuite.xml Wed Aug 18 11:11:46 2010 +0300 @@ -15,19 +15,19 @@ LbsSuplRRLP_test.dll c:\system\libs\lbssuplrrlp_test.dll LbsSuplRRLP_test.mmp - networkprotocolmodules\suplcontrolplaneprotocols\common\suplrrlpprotocol\test\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplrrlpprotocol_test\lbssuplrrlp_test\group\bld.inf suplrrlptestmessages.dll c:\system\libs\suplrrlptestmessages.dll rrlptestmessage.mmp - networkprotocolmodules\suplcontrolplaneprotocols\common\test\suplrrlptestmessages\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplrrlptestmessages\group\bld.inf suplspoofserver.dll c:\system\libs\suplspoofserver.dll suplspoofserver.mmp - networkprotocolmodules\common\test\suplspoofserver\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplspoofserver\group\bld.inf diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpasn1suite/testexecuteservers/te_suplrrlpasnsuite.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpasn1suite/testexecuteservers/te_suplrrlpasnsuite.xml Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpasn1suite/testexecuteservers/te_suplrrlpasnsuite.xml Wed Aug 18 11:11:46 2010 +0300 @@ -2,14 +2,14 @@ te_suplrrlpasnsuite te_suplrrlpasnsuite.mmp - networkprotocolmodules\suplprotocolmodule\SuplRrlpAsn1\test\te_suplrrlpasn\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplrrlpasn1_test\te_suplrrlpasn\group\bld.inf suplspoofserver.dll c:\system\libs\suplspoofserver.dll suplspoofserver.mmp - networkprotocolmodules\suplprotocolmodule\test\suplspoofserver\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplspoofserver\group\bld.inf diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpsuite/testexecuteservers/te_suplrrlpsuite.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpsuite/testexecuteservers/te_suplrrlpsuite.xml Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpsuite/testexecuteservers/te_suplrrlpsuite.xml Wed Aug 18 11:11:46 2010 +0300 @@ -9,14 +9,14 @@ suplrrlptestmessages.dll c:\system\libs\suplrrlptestmessages.dll rrlptestmessage.mmp - networkprotocolmodules\suplprotocolmodule\test\suplrrlptestmessages\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplrrlptestmessages\group\bld.inf lbssuplrrlp_test.dll c:\system\libs\lbssuplrrlp_test.dll lbssuplrrlp_test.mmp - networkprotocolmodules\suplprotocolmodule\SuplRrlpProtocol\test\lbssuplrrlp_test\group\bld.inf + networkprotocolmodules\networkpmasn1_plat\test\suplrrlpprotocol_test\lbssuplrrlp_test\group\bld.inf diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsagpspsysuite/te_lbsagpspsytest.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsagpspsysuite/te_lbsagpspsytest.xml Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsagpspsysuite/te_lbsagpspsytest.xml Wed Aug 18 11:11:46 2010 +0300 @@ -22,21 +22,29 @@ c:\testdata\configs\te_lbsagpspsy.ini - datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_exclusive.ini - c:\testdata\configs\te_lbsagpspsy_devicecaps_exclusive.ini + datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_exclusive.ini + c:\testdata\configs\te_lbsagpspsy_devicecaps_exclusive.ini - datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_simultaneous.ini - c:\testdata\configs\te_lbsagpspsy_devicecaps_simultaneous.ini + datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_simultaneous.ini + c:\testdata\configs\te_lbsagpspsy_devicecaps_simultaneous.ini + + + datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_ta.ini + c:\testdata\configs\te_lbsagpspsy_devicecaps_ta.ini - datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_ta.ini - c:\testdata\configs\te_lbsagpspsy_devicecaps_ta.ini - + datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_tb.ini + c:\testdata\configs\te_lbsagpspsy_devicecaps_tb.ini + - datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_devicecaps_tb.ini - c:\testdata\configs\te_lbsagpspsy_devicecaps_tb.ini - + datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_lbsprofile.ini + c:\testdata\configs\te_lbsagpspsy_lbsprofile.ini + + + datasourcemodules\gpspositioningmodule\lbsagpspsy\test\testdata\te_lbsagpspsy_agpsintegmodule.ini + c:\testdata\configs\te_lbsagpspsy_agpsintegmodule.ini + diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsgpspsysuite/te_lbsgpspsytest.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsgpspsysuite/te_lbsgpspsytest.xml Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsgpspsysuite/te_lbsgpspsytest.xml Wed Aug 18 11:11:46 2010 +0300 @@ -21,6 +21,14 @@ datasourcemodules\gpspositioningmodule\lbsgpspsy\test\testdata\te_lbsgpspsy.ini c:\testdata\configs\te_lbsgpspsy.ini + + datasourcemodules\gpspositioningmodule\lbsgpspsy\test\testdata\te_lbsgpspsy_agpsintegmodule.ini + c:\testdata\configs\te_lbsgpspsy_agpsintegmodule.ini + + + datasourcemodules\gpspositioningmodule\lbsgpspsy\test\testdata\te_lbsgpspsy_lbsprofile.ini + c:\testdata\configs\te_lbsgpspsy_lbsprofile.ini + diff -r 15a2125aa2f3 -r 95c570bf4a05 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsnetpsysuite/te_lbsnetpsytest.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsnetpsysuite/te_lbsnetpsytest.xml Wed Jun 23 19:48:34 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsnetpsysuite/te_lbsnetpsytest.xml Wed Aug 18 11:11:46 2010 +0300 @@ -21,6 +21,14 @@ datasourcemodules\networkpositioningmodule\test\testdata\te_lbsnetpsy.ini c:\testdata\configs\te_lbsnetpsy.ini + + datasourcemodules\networkpositioningmodule\test\testdata\te_lbsnetpsy_lbsprofile.ini + c:\testdata\configs\te_lbsnetpsy_lbsprofile.ini + + + datasourcemodules\networkpositioningmodule\test\testdata\te_lbsnetpsy_agpsintegmodule.ini + c:\testdata\configs\te_lbsnetpsy_agpsintegmodule.ini + diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locationcore/LbsClient/LbsApi/inc/LbsErrors.h --- a/locationmgmt/locationcore/LbsClient/LbsApi/inc/LbsErrors.h Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/inc/LbsErrors.h Wed Aug 18 11:11:46 2010 +0300 @@ -124,6 +124,16 @@ */ const TInt KPositionAssistanceDataReset = 5; + +/** +Code indicating that a position is not currently available. The status code is used +as part of the status notification of the LbsLocator API. + +@publishedAll +@released + */ +const TInt KPositionNotAvailable = 6; + /** Lbs specific error codes. diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locationcore/LbsClient/LbsApi/src/LbsAreaInfo.cpp --- a/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsAreaInfo.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsAreaInfo.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -17,7 +17,7 @@ #include -#include +#include #include diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositioner.cpp --- a/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositioner.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositioner.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "lbslocservermessageenums.h" #include "LbsPtrHolder.h" diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locationcore/LbsPartnerCommon/src/lbsdevlogger.cpp --- a/locationmgmt/locationcore/LbsPartnerCommon/src/lbsdevlogger.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locationcore/LbsPartnerCommon/src/lbsdevlogger.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -428,6 +428,8 @@ aName = vars.localProcess.FileName(); vars.pos = aName.LocateReverse('\\') + 1; aName = aName.Mid(vars.pos); + vars.localProcess.Close(); + vars.localThread.Close(); } EXPORT_C void LbsDevLogger::OverWrite(const TDesC8& aFmt) diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locationcore/conf/locationsettings.confml Binary file locationmgmt/locationcore/conf/locationsettings.confml has changed diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locationcore/conf/locationsettings_10282266.crml Binary file locationmgmt/locationcore/conf/locationsettings_10282266.crml has changed diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locationcore/lbsroot/src/lbsroot.cpp --- a/locationmgmt/locationcore/lbsroot/src/lbsroot.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locationcore/lbsroot/src/lbsroot.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -393,11 +393,15 @@ */ RLbsProcessSupervisor::InitializeL(); +#if defined __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + TBool locationManagementSupported(EFalse); +#else #ifdef SYMBIAN_FEATURE_MANAGER TBool locationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); #else TBool locationManagementSupported(ETrue); -#endif +#endif //SYMBIAN_FEATURE_MANAGER +#endif // __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC /* * Define the properties used by the Lbs Internal API diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/locmonitor/lbslocmonitorserver/src/clbslocmonitorconversionhandler.cpp --- a/locationmgmt/locmonitor/lbslocmonitorserver/src/clbslocmonitorconversionhandler.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/src/clbslocmonitorconversionhandler.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include "clbslocmonitorconversionhandler.h" #include "lbslocmonitorclientconsts.h" diff -r 15a2125aa2f3 -r 95c570bf4a05 locationmgmt/networkgateway/src/netgateway.cpp --- a/locationmgmt/networkgateway/src/netgateway.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/networkgateway/src/netgateway.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -152,11 +152,16 @@ iAdmin = CLbsAdmin::NewL(); +#if defined __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + TBool locationManagementSupported(EFalse); +#else #ifdef SYMBIAN_FEATURE_MANAGER TBool locationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); #else TBool locationManagementSupported(ETrue); -#endif +#endif // SYMBIAN_FEATURE_MANAGER +#endif // __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + if(locationManagementSupported) { iNetworkLocationChannel = CNetworkLocationChannel::NewL(*this); diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/locationserver/inc/EPos_CPosModulesStatus.h --- a/locationrequestmgmt/locationserver/inc/EPos_CPosModulesStatus.h Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/locationserver/inc/EPos_CPosModulesStatus.h Wed Aug 18 11:11:46 2010 +0300 @@ -95,7 +95,8 @@ TInt DoTimerCallback(); void RequestComplete(const RMessage2& aMessage, TInt aCompleteCode); void NotifyEventToSubscriber(TPositionModuleStatusEvent& aOccurredEvent, const CPosModulesStatus::TPosSubscriber& aSubscriber); - + void NotifyPosModuleStatusToSubscriber(const TPositionModuleId& aImplementationUid, const TPositionModuleStatus& aStatus); + private: // Data CPosModules& iModules; RPointerArray< MPosModuleStatusListener > iListenerArray; @@ -104,7 +105,8 @@ TInt iSequenceNo; CPeriodic* iTimer; TTimeIntervalMicroSeconds32 iTimerInterval; - + TUid iPosStatusCategory; + RArray iActivePosModuleArray; }; #endif // CPOSMODULESSTATUS_H diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/locationserver/inc/EPos_CPositionRequest.h --- a/locationrequestmgmt/locationserver/inc/EPos_CPositionRequest.h Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/locationserver/inc/EPos_CPositionRequest.h Wed Aug 18 11:11:46 2010 +0300 @@ -141,7 +141,6 @@ // CPosLocMonitorReqHandlerHub& iLastPositionHandler; CPosLocMonitorReqHandlerHub& iLocMonitorReqHandler; CPosModuleSettings& iModuleSettings; - TUid iPosStatusCategory; }; #endif // CPOSITIONREQUEST_H diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/locationserver/src/EPos_CPosModulesStatus.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPosModulesStatus.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPosModulesStatus.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -17,6 +17,8 @@ // INCLUDE FILES #include +#include +#include #include #include #include "epos_mposmodulestatuslistener.h" @@ -24,6 +26,8 @@ #include "EPos_CPosModulesStatus.h" #include "EPos_Global.h" #include "EPos_ServerPanic.h" +#include "lbsrootcenrepdefs.h" +#include "lbspositioningstatusprops.h" // CONSTANTS #ifdef _DEBUG @@ -131,7 +135,17 @@ User::LeaveIfError(iModuleStatusArray.Append(module)); } CleanupStack::PopAndDestroy(idList); + iActivePosModuleArray.Reset(); + // Get the CategoryUid from the cenrep file owned by LbsRoot. + CRepository* rep = CRepository::NewLC(KLbsCenRepUid); + TInt posStatusCategory; + DEBUG_TRACE("Opening Status API Settings...", __LINE__) + User::LeaveIfError(rep->Get(KMoPositioningStatusAPIKey, posStatusCategory)); + DEBUG_TRACE("Opened Status API Settings...", __LINE__) + CleanupStack::PopAndDestroy(rep); + iPosStatusCategory = TUid::Uid(posStatusCategory); + iTimer = CPeriodic::NewL(EPriorityLow); } @@ -447,6 +461,8 @@ return; } + NotifyPosModuleStatusToSubscriber(aImplementationUid, aStatus); + TPosModule& storedModule = iModuleStatusArray[index]; TPositionModuleStatus::TDeviceStatus storedDeviceStatus = storedModule.iStatus.DeviceStatus(); @@ -472,7 +488,7 @@ storedModule.iDataQualityTimeStamp = iSequenceNo; event.SetOccurredEvents(KEventQuality | (event.OccurredEvents())); } - + // Has any event occurred? if (event.OccurredEvents()) { @@ -694,6 +710,44 @@ } /** + * Notify event to subscriber + */ +void CPosModulesStatus::NotifyPosModuleStatusToSubscriber(const TPositionModuleId& aImplementationUid, const TPositionModuleStatus& aStatus) + { + //1. Search for uid in the list of active uids + //2. If uid doesnt exist, and status is active - add uid in the list + //3. If uid exists and status is inactive - remove it from the list + + TPositionModuleStatus::TDeviceStatus devStatus = aStatus.DeviceStatus(); + TInt item = iActivePosModuleArray.Find(aImplementationUid); + if(item == KErrNotFound) + { + if(devStatus == TPositionModuleStatus::EDeviceActive || devStatus == TPositionModuleStatus::EDeviceReady) + { + //Ignoring error as RArray by default creates array of Granularity 8 + iActivePosModuleArray.Append(aImplementationUid); + } + } + else + { + if(!(devStatus == TPositionModuleStatus::EDeviceActive || devStatus == TPositionModuleStatus::EDeviceReady)) + { + iActivePosModuleArray.Remove(item); + } + } + + TInt itemCount = iActivePosModuleArray.Count(); + if(itemCount > 0) + { + RProperty::Set(iPosStatusCategory, KLbsMoPositioningStatusKey, itemCount); + } + else + { + RProperty::Set(iPosStatusCategory, KLbsMoPositioningStatusKey, 0); + } + } + +/** * Timer callback */ TInt CPosModulesStatus::TimerCallback(TAny* aModulesStatus) diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -135,17 +135,50 @@ */ void CPosServer::ConstructL() { - TBool LocationManagementSupported = EFalse; +#if defined __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + TBool LocationManagementSupported = EFalse; +#else #ifdef SYMBIAN_FEATURE_MANAGER - LocationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); + TBool LocationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); #else __ASSERT_ALWAYS(EFalse, User::Invariant()); // Would happen on older versions of symbian OS if this code ever backported -#endif - // make sure that root process is running - if(LocationManagementSupported && !FindRootProcess()) - { - User::Leave(KErrNotReady); - } +#endif // SYMBIAN_FEATURE_MANAGER +#endif // __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + + +#if defined __WINSCW__ + if(LocationManagementSupported && !FindRootProcess()) + { + _LIT(KLbsRootFileName, "\\sys\\bin\\lbsroot.exe"); + _LIT(KLbsRootProcessName, "lbsroot.exe"); + _LIT(KLbsCommandLine, ""); + RProcess process; + TInt r=process.Create(KLbsRootProcessName,KLbsCommandLine); + if (r!=KErrNone) + { + User::Leave(r); + } + TRequestStatus stat; + process.Rendezvous(stat); + if (stat!=KRequestPending) + { + process.Kill(0); + } + else + { + process.Resume(); + } + User::WaitForRequest(stat); + r=(process.ExitType()==EExitPanic) ? KErrGeneral : stat.Int(); + + process.Close(); + if (r!=KErrNone) + { + User::Leave(r); + } + } +#endif // WINSCW + // Backup listener DEBUG_TRACE("Checking for backup or restore...", __LINE__) iBackupListener = CPosBackupListener::NewL(); diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/locationserver/src/EPos_CPosSubSession.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPosSubSession.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPosSubSession.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -106,12 +106,16 @@ SetPsyDefaultUpdateTimeOut(iPsyDefaultUpdateTimeOut); iLocMonitorReqHandlerHub = &aLocMonitorReqHandlerHub; - + +#if defined __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + iLocationManagementSupported = EFalse; +#else #ifdef SYMBIAN_FEATURE_MANAGER iLocationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); #else __ASSERT_ALWAYS(EFalse, User::Invariant()); // Would happen on older versions of symbian OS if this code ever backported -#endif +#endif // SYMBIAN_FEATURE_MANAGER +#endif // __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC if(iLocationManagementSupported) { diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/locationserver/src/EPos_CPositionRequest.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPositionRequest.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPositionRequest.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -21,7 +21,6 @@ #include #include #include -#include #include "lbsdevloggermacros.h" #include "EPos_ServerPanic.h" #include "EPos_Global.h" @@ -35,9 +34,6 @@ #ifdef OST_TRACE_COMPILER_IN_USE #include "EPos_CPositionRequestTraces.h" #endif -#include "lbsrootcenrepdefs.h" -#include "lbspositioningstatusprops.h" - @@ -105,14 +101,6 @@ User::Leave(KErrNotFound); } - // Get the CategoryUid from the cenrep file owned by LbsRoot. - CRepository* rep = CRepository::NewLC(KLbsCenRepUid); - TInt posStatusCategory; - TInt err = rep->Get(KMoPositioningStatusAPIKey, posStatusCategory); - User::LeaveIfError(err); - CleanupStack::PopAndDestroy(rep); - iPosStatusCategory = TUid::Uid(posStatusCategory); - LoadPositionerL(); } @@ -178,21 +166,6 @@ __ASSERT_DEBUG(iPositioner, DebugPanic(EPosServerPanicPositionerNotInitialized)); - //Increment the StatusKeyValue for Positioning Indicator clients - if(iTrackingState == EPosNoTracking || iTrackingState == EPosFirstTrackingRequest) - { - TInt count, err; - err = RProperty::Get(iPosStatusCategory, KLbsMoPositioningStatusKey, count); - if(err == KErrNone) - { - err = RProperty::Set(iPosStatusCategory, KLbsMoPositioningStatusKey, count+1); - } - if(err != KErrNone) - { - DEBUG_TRACE("CPositionRequest::MakeRequestL() - Error in setting or getting Positioning Status", __LINE__) - } - } - iMessage = aMessage; // Store parameter here in case of leave. // Clear previous position data @@ -531,25 +504,6 @@ LBS_RDEBUG_ARGINT("LBS","Client", "RunL", aReason); iMessage.Complete(aReason); } - //Decrement the StatusKeyValue for Positioning Indicator clients - if(iTrackingState == EPosNoTracking) - { - TInt count, err; - err = RProperty::Get(iPosStatusCategory, KLbsMoPositioningStatusKey, count); - if(err == KErrNone && count > 0) - { - err = RProperty::Set(iPosStatusCategory, KLbsMoPositioningStatusKey, count-1); - } - - if(err != KErrNone) - { - DEBUG_TRACE("CPositionRequest::StopTracking() - error in getting or setting Positioning Status", __LINE__) - } - else if (count <=0) - { - DEBUG_TRACE("CPositionRequest::StopTracking() - Incorrect Positioning Status tracking count", __LINE__) - } - } } void CPositionRequest::CompleteRequest(TInt aReason) @@ -749,23 +703,6 @@ iTrackingState = EPosNoTracking; StopPsyTracking(); - - //Set PositionIndicator Off - TInt count, err; - err = RProperty::Get(iPosStatusCategory, KLbsMoPositioningStatusKey, count); - if(err == KErrNone && count > 0) - { - err = RProperty::Set(iPosStatusCategory, KLbsMoPositioningStatusKey, count-1); - } - - if(err != KErrNone) - { - DEBUG_TRACE("CPositionRequest::StopTracking() - error in getting or setting Positioning Status", __LINE__) - } - else if (count <=0) - { - DEBUG_TRACE("CPositionRequest::StopTracking() - Incorrect Positioning Status tracking count", __LINE__) - } } void CPositionRequest::StopPsyTracking() diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/locationserver/test/testLocServer/group/testlocserver.mmp --- a/locationrequestmgmt/locationserver/test/testLocServer/group/testlocserver.mmp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/locationserver/test/testLocServer/group/testlocserver.mmp Wed Aug 18 11:11:46 2010 +0300 @@ -63,6 +63,9 @@ USERINCLUDE ../inc USERINCLUDE ../../../inc USERINCLUDE ../../../resource +USERINCLUDE ../../../../../locationmgmt/locationcore/lbsroot/inc +USERINCLUDE ../../../../../locationmgmt/locationcore/lbsrootapi/inc +USERINCLUDE ../../../../../locationmgmt/locationcore/LbsInternalApi/inc // for the lbspositioningstatusprops.h USERINCLUDE ../../../../../locationmgmt/locationcore/LbsNetInternalApi/inc // for the lbsnetinternalapi.h USERINCLUDE ../../../../../locationmgmt/locationcore/LbsPartnerCommon/inc USERINCLUDE ../../../../../locationmgmt/locationcore/LbsNetRegStatusInt/inc @@ -83,6 +86,7 @@ LIBRARY bafl.lib LIBRARY efsrv.lib LIBRARY ecom.lib +LIBRARY centralrepository.lib LIBRARY lbsadmin.lib LIBRARY lbsnetinternalapi.lib LIBRARY lbsnetregstatusint.lib diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/networkrequesthandler/inc/EPos_CPosDialogCtrl.h --- a/locationrequestmgmt/networkrequesthandler/inc/EPos_CPosDialogCtrl.h Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/inc/EPos_CPosDialogCtrl.h Wed Aug 18 11:11:46 2010 +0300 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "EPos_PrivacyInternal.h" #include diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/networkrequesthandler/src/lbsnetworkrequesthandler.cpp --- a/locationrequestmgmt/networkrequesthandler/src/lbsnetworkrequesthandler.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/src/lbsnetworkrequesthandler.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -92,12 +92,17 @@ iNetRegStatus); iNrhServer->SetPrivacyServerObserver(iPrivLocHandler->PrivacyHandler()); - + +#if defined __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + TBool locationManagementSupported(EFalse); +#else #ifdef SYMBIAN_FEATURE_MANAGER TBool locationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); #else TBool locationManagementSupported(ETrue); -#endif +#endif // SYMBIAN_FEATURE_MANAGER +#endif // __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + if(locationManagementSupported) { iX3pHandler = CX3pHandler::NewL(*iNgMessageSwitch, iPrivLocHandler->X3pStatusHandler(), *iAdmin); diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/networkrequesthandler/src/lbsnrhx3pserver.cpp --- a/locationrequestmgmt/networkrequesthandler/src/lbsnrhx3pserver.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/src/lbsnrhx3pserver.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -314,6 +314,7 @@ RThread client; aMessage.Client(client); iClientUid = client.SecureId(); + client.Close(); } } } diff -r 15a2125aa2f3 -r 95c570bf4a05 locationrequestmgmt/networkrequesthandler/src/privacyandlocationrequesthandler.cpp --- a/locationrequestmgmt/networkrequesthandler/src/privacyandlocationrequesthandler.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/src/privacyandlocationrequesthandler.cpp Wed Aug 18 11:11:46 2010 +0300 @@ -173,12 +173,16 @@ } LBSLOG2(ELogP3, "Using KLbsSpecialFeatureIntermediateFutileUpdate = %d", specialFeature); iSpecialFeatureIntermediateFutileUpdate = (specialFeature == CLbsAdmin::ESpecialFeatureOn) ? ETrue : EFalse; - + +#if defined __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC + iLocationManagementSupported = EFalse; +#else #ifdef SYMBIAN_FEATURE_MANAGER iLocationManagementSupported = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KLocationManagement); #else __ASSERT_ALWAYS(EFalse, User::Invariant()); // Would happen on older versions of symbian OS if this code ever backported -#endif +#endif // SYMBIAN_FEATURE_MANAGER +#endif // __WINSCW__ && defined SYMBIAN_CELLMO_CENTRIC // Get the CategoryUid from the cenrep file owned by LbsRoot for accessing Positioning Status P&S Keys CRepository* rep = CRepository::NewLC(KLbsCenRepUid); diff -r 15a2125aa2f3 -r 95c570bf4a05 networkprotocolmodules/privacyprotocolmodule/ClientAPI/NetworkPrivacyAPI/inc/EPos_NetworkPrivacyPanicDeclaration.h --- a/networkprotocolmodules/privacyprotocolmodule/ClientAPI/NetworkPrivacyAPI/inc/EPos_NetworkPrivacyPanicDeclaration.h Wed Jun 23 19:48:34 2010 +0300 +++ b/networkprotocolmodules/privacyprotocolmodule/ClientAPI/NetworkPrivacyAPI/inc/EPos_NetworkPrivacyPanicDeclaration.h Wed Aug 18 11:11:46 2010 +0300 @@ -26,7 +26,7 @@ #ifndef NETWORKPRIVACYPANICDECLARATION_H #define NETWORKPRIVACYPANICDECLARATION_H -#include +#include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS