# HG changeset patch # User hgs # Date 1279020328 -3600 # Node ID 81c9bee26a455ab825c48090791d0113b3439192 # Parent 2965a06983dcd25aa298f2c887cc55e187b8ad30 201025_02 diff -r 2965a06983dc -r 81c9bee26a45 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/bwins/te_lbsgenericpsytestu.def --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/bwins/te_lbsgenericpsytestu.def Mon May 03 13:50:32 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/bwins/te_lbsgenericpsytestu.def Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/eabi/te_lbsgenericpsytestu.def --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/eabi/te_lbsgenericpsytestu.def Mon May 03 13:50:32 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/eabi/te_lbsgenericpsytestu.def Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/group/te_lbsgenericpsytest.mmp --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/group/te_lbsgenericpsytest.mmp Mon May 03 13:50:32 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/group/te_lbsgenericpsytest.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbspsyutils.h --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbspsyutils.h Mon May 03 13:50:32 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/inc/te_lbspsyutils.h Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsypositioner.cpp --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsypositioner.cpp Mon May 03 13:50:32 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsypositioner.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsyutils.cpp --- a/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsyutils.cpp Mon May 03 13:50:32 2010 +0300 +++ b/datasourceadaptation/gpsdatasourceadaptation/common/test/lbsgenericpsytest/src/te_lbspsyutils.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourceadaptation/gpsdatasourceadaptation/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourceadaptation/gpsdatasourceadaptation/traces/OstTraceDefinitions.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ + +#include +#endif diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/bluetoothgpspositioningmodule/btgpsconfig/btgpsconfigapi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/bluetoothgpspositioningmodule/btgpsconfig/btgpsconfigapi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,21 @@ +// 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: +// + +// Main projects, in build order +PRJ_EXPORTS +../inc/lbsbtgpsconfig.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsbtgpsconfig.h) +../inc/lbsbtgpsconfigtypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsbtgpsconfigtypes.h) +../inc/lbsbtgpsconfigdatatypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsbtgpsconfigdatatypes.h) + diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/bluetoothgpspositioningmodule/btgpsconfig/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/bluetoothgpspositioningmodule/btgpsconfig/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +// 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: +// + +#include "../btgpsconfigapi/group/bld.inf" + +// Main projects, in build order +PRJ_EXPORTS +// Note: this file is for testing and techview purposes only. Not included in a device +102869C1.cre z:/private/10202be9/102869c1.cre + +PRJ_MMPFILES +lbsbtgpsconfig.mmp +//gnumakefile createlbsbtgpsconfigstore.mk + diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/bluetoothgpspositioningmodule/btgpspsy/data/nla_btgpspsy.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/bluetoothgpspositioningmodule/btgpspsy/data/nla_btgpspsy.loc Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,52 @@ +CHARACTER_SET UTF8 +// Copyright (c) 2005-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: +// LOCALISATION STRINGS +// d: Name of the Bluetooth GPS PSY represented to the user +// d: +// l: list_setting_pane_2 +// w: +// r: 3.0 +// + +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Name : Nla_btgpspsy.loc +// Part of : Mobile Location Framework/Generic Positioning Plug-ins/BTGPSPSY +// Defines the localised name for the Bluetooth GPS PSY +// Version : 1.0 +// This material, including documentation and any related +// computer programs, is protected by copyright controlled by +// Nokia Corporation. All rights are reserved. Copying, +// including reproducing, storing, adapting or translating, any +// or all of this material requires the prior written consent of +// Nokia Corporation. This material also contains confidential +// information which may not be disclosed to others without the +// prior written consent of Nokia Corporation. +// LOCALISATION STRINGS +// d: Name of the Bluetooth GPS PSY represented to the user +// d: +// l: list_set_graphic_pane_t1 +// w: +// r: 3.0 +// + + + +#define qtn_loc_psy_int_btgpspsy "Bluetooth GPS" +// End of File diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/src/cagpsenvironment.cpp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/src/cagpsenvironment.cpp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/src/cagpsenvironment.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/bld.inf --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/bld.inf Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/te_lbsagpspsysuite.mmp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/te_lbsagpspsysuite.mmp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/group/te_lbsagpspsysuite.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/scripts/te_lbsagpspsysuite.script --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/scripts/te_lbsagpspsysuite.script Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/scripts/te_lbsagpspsysuite.script Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdateerrstep.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdateerrstep.h Mon May 03 13:50:32 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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.cpp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.cpp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatemodestep.h Mon May 03 13:50:32 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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatestep.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsyposupdatestep.h Mon May 03 13:50:32 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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.cpp --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.cpp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.h --- a/datasourcemodules/gpspositioningmodule/lbsagpspsy/test/src/te_lbsagpspsysuite.h Mon May 03 13:50:32 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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/bld.inf --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/bld.inf Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/te_lbsgpspsysuite.mmp --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/te_lbsgpspsysuite.mmp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/group/te_lbsgpspsysuite.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/scripts/te_lbsgpspsysuite.script --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/scripts/te_lbsgpspsysuite.script Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/scripts/te_lbsgpspsysuite.script Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.cpp --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.cpp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.h --- a/datasourcemodules/gpspositioningmodule/lbsgpspsy/test/src/te_lbsgpspsysuite.h Mon May 03 13:50:32 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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/locationapesuplpsy/cenrep/20026fb7.txt Binary file datasourcemodules/locationapesuplpsy/cenrep/20026fb7.txt has changed diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/locationapesuplpsy/conf/ape_suplpsy_20026fb7.crml Binary file datasourcemodules/locationapesuplpsy/conf/ape_suplpsy_20026fb7.crml has changed diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/locationapesuplpsy/group/lbs_ape_supl_positioning_module.mrp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/locationapesuplpsy/group/lbs_ape_supl_positioning_module.mrp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2010 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: +# + +component lbs_ape_supl_positioning_module + +source \sf\os\lbs\datasourcemodules\locationapesuplpsy + +binary \sf\os\lbs\datasourcemodules\locationapesuplpsy\group all + +exports \sf\os\lbs\datasourcemodules\locationapesuplpsy\group + +notes_source \component_defs\release.src + +ipr E diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/locationapesuplpsy/group/nla_ape_suplpsy.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/locationapesuplpsy/group/nla_ape_suplpsy.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +/* +* 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: +* +*/ +#ifndef __LBS_APE_SUPLPSY_IBY__ +#define __LBS_APE_SUPLPSY_IBY__ + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) + +#ifdef _DEBUG +ECOM_PLUGIN_UDEB(nlaapesuplpsy.dll, nlaapesuplpsy.rsc) +#else +ECOM_PLUGIN(nlaapesuplpsy.dll, nlaapesuplpsy.rsc) +#endif //_DEBUG + +#endif + +#endif // __LBS_APE_SUPLPSY_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 datasourcemodules/networkpositioningmodule/test/group/bld.inf --- a/datasourcemodules/networkpositioningmodule/test/group/bld.inf Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/networkpositioningmodule/test/group/te_lbsnetpsysuite.mmp --- a/datasourcemodules/networkpositioningmodule/test/group/te_lbsnetpsysuite.mmp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/group/te_lbsnetpsysuite.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/networkpositioningmodule/test/scripts/te_lbsnetpsysuite.script --- a/datasourcemodules/networkpositioningmodule/test/scripts/te_lbsnetpsysuite.script Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/scripts/te_lbsnetpsysuite.script Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.cpp --- a/datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.cpp Mon May 03 13:50:32 2010 +0300 +++ b/datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.h --- a/datasourcemodules/networkpositioningmodule/test/src/te_lbsnetpsysuite.h Mon May 03 13:50:32 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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 lbsapitest/lbshaitest/lbsclient/group/t_lbsclient.mmp --- a/lbsapitest/lbshaitest/lbsclient/group/t_lbsclient.mmp Mon May 03 13:50:32 2010 +0300 +++ b/lbsapitest/lbshaitest/lbsclient/group/t_lbsclient.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp --- a/lbstest/lbstestproduct/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/lbsclient/src/ctlbsclientstepsrvconnectclose.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbshybridmolr/inc/ctlbshybridueassistednpudposstatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/lbshybridmolr/inc/ctlbshybridueassistednpudposstatus.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,70 @@ +// Copyright (c) 2007-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 contains the header file for MOLR UE Assisted GPS ok +// +// + +#ifndef CTLBSHYBRIDUEASSISTEDNPUDPOSSTATUS_H +#define CTLBSHYBRIDUEASSISTEDNPUDPOSSTATUS_H + +// LBS test includes. +#include "ctlbshybridmolrstep.h" +#include +#include "lbs/lbspositioningstatus.h" + +// Literals used +_LIT(KLbsHybridUEAssistedNpudPosStatus,"LbsHybridUEAssistedNpudPosStatus"); + + +class CT_LbsHybridUEAssistedNpudPosStatus: public CT_LbsHybridMOLRStep, /*public MLbsPrivacyObserver*/ public MPosServerObserver, public MLbsPositioningStatusObserver +{ +public: + static CT_LbsHybridUEAssistedNpudPosStatus* New(CT_LbsHybridMOLRServer& aParent); + enum TVerdict doTestStepL(); + ~CT_LbsHybridUEAssistedNpudPosStatus(); + +protected: +/* // from MLbsPrivacyObserver + void ProcessNetworkLocationRequest(TUint aRequestId, const TLbsExternalRequestInfo& aRequestInfo, const TNotificationType& aNotificationType); + void ProcessNetworkPositionUpdate(TUint aRequestId, const TPositionInfo& aPosInfo); + void ProcessRequestComplete(TUint aRequestId, TInt aReason); +*/ + // MPosServerObserver + void OnGetLastKnownPosition(TInt32 aErr, const TPositionInfoBase& aPosInfo); + void OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo); + + //MLbsPositioningStatusObserver + void OnPositioningStatusUpdate(const CLbsPositioningStatus::TLbsPositioningStatus& aPositioningStatus); + +protected: + CT_LbsHybridUEAssistedNpudPosStatus(CT_LbsHybridMOLRServer& aParent); + void ConstructL(); + +private: + enum TState + { + EInitializing, + EPrivacyCheckOk, + ERefLocReceived, + EGpsLocReceived + }; + + TState iState; + TLbsNetSessionId iSessionId; + TInt iPosStatusCount; + CLbsPositioningStatus::TLbsPositioningStatus iPositioningStatus; + CLbsPositioningStatus* iLbsPositioningStatus; +}; + +#endif // CTLBSHYBRIDUEASSISTEDNPUDPOSSTATUS_H diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbshybridmolr/scripts/hybrid_ueassisted_molr_posstatus.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/lbshybridmolr/scripts/hybrid_ueassisted_molr_posstatus.script Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,69 @@ +// Copyright (c) 2007-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: +// + +//! @File +//! @SYMTestSuiteName LBS-HybridMOLR-UEAssistedMOLR-PosStatus +//! @SYMScriptTestEnvironment TestExecute using hybrid_ueassisted_molr_posstatus.script + + +LOAD_SUITE LbsHybridMOLRTestServer -SharedData + +PRINT Run LbsHybridMOLRTestServer + + +// Before we start LBS, select the test A-GPS integration module to use. +// Make sure the default profile is used, rather than one from the c drive +PREFIX RUN_UTILS + DeleteFile c:\private\10282253\lbs\lbsprofile.ini + MkDir c:\private\10282253\ + MkDir c:\private\10282253\lbs\ + MkDir c:\private\10282253\lbs\locmods\ +// CopyFile c:\testdata\configs\xtestmodule.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini + CopyFile c:\testdata\configs\ctagpsnpetestmoduledatasource.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini + CopyFile c:\testdata\configs\lbstestconfig.txt c:\config.txt +REMOVE_PREFIX + +// Reset admin (reset will give us the EGpsPreferTerminalBased). +RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_ResetDefaultAdmin + +// Use hybrid protocol module +RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_SetupProtocolStub + +// Use hybrid protocol module +RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_SetupRoamSelfLocate + +RUN_TEST_STEP 030 LbsHybridMOLRTestServer LbsStep_StartLbs + +START_TESTCASE LBS-HybridMOLR-UEAssistedMOLR-PosStatus-0001 +//! @SYMTestCaseID LBS-HybridMOLR-UEAssistedMOLR-PosStatus-0001 +//! @SYMTestCaseDesc Client generates MOLR request +//! @SYMTestPriority Critical +//! @SYMTestActions See test step Sequence inline comments +//! @SYMTestExpectedResults Sequence as per specified by FSM and UML Seq diagram is Followed +//! @SYMTestType CIT +//! @SYMCreationDate 26/3/2010 +//! @SYMAuthor brsengar +RUN_TEST_STEP 010 LbsHybridMOLRTestServer LbsStep_InstallScheduler +RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_SetUpPsy c:\testdata\configs\lbs_molr.ini LBS-MOLR +// Configure Hybrid AGps module options +RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsStep_ConfigHybridModule c:\testdata\configs\lbs_molr.ini UEAssistedMOLRGpsOk +RUN_TEST_STEP 120 LbsHybridMOLRTestServer LbsHybridUEAssistedNpudPosStatus +END_TESTCASE LBS-HybridMOLR-UEAssistedMOLR-PosStatus-0001 + + +RUN_TEST_STEP 020 LbsHybridMOLRTestServer LbsStep_StopLbs + +RUN_UTILS DeleteFile c:\private\10282253\lbs\locmods\agpsintegmodule.ini + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbshybridmolr/src/ctlbshybridueassistednpudposstatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/lbshybridmolr/src/ctlbshybridueassistednpudposstatus.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,431 @@ +// Copyright (c) 2007-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 class implementation for the MO-LR - Accurate GPS Result scenario Tests +// +// + +// LBS includes. +#include +#include +#include + +// LBS test includes. +#include "ctlbshybridueassistednpudposstatus.h" +#include +#include "argutils.h" +#include + + +const TInt KN(2); // Number of times to send the measurement from GPS to NW + +/** +Static Constructor +*/ +CT_LbsHybridUEAssistedNpudPosStatus* CT_LbsHybridUEAssistedNpudPosStatus::New(CT_LbsHybridMOLRServer& aParent) + { + // Note that we do not use ELeave. + // This means that having insufficient memory will return NULL; + CT_LbsHybridUEAssistedNpudPosStatus* testStep = new CT_LbsHybridUEAssistedNpudPosStatus(aParent); + if (testStep) + { + TInt err = KErrNone; + + TRAP(err, testStep->ConstructL()); + if (err) + { + delete testStep; + testStep = NULL; + } + } + return testStep; + } + + +/** + * Constructor + */ +CT_LbsHybridUEAssistedNpudPosStatus::CT_LbsHybridUEAssistedNpudPosStatus(CT_LbsHybridMOLRServer& aParent) : CT_LbsHybridMOLRStep(aParent) + { + SetTestStepName(KLbsHybridUEAssistedNpudPosStatus); + iSessionId.SetSessionOwner(KRequestUid); + iSessionId.SetSessionNum(0x0005); + } + + +void CT_LbsHybridUEAssistedNpudPosStatus::ConstructL() + { + // Create the base class objects. + CT_LbsHybridMOLRStep::ConstructL(); + iLbsPositioningStatus = CLbsPositioningStatus::NewL(*this); + iPosStatusCount = 0; + } + + +/** + * Destructor + */ +CT_LbsHybridUEAssistedNpudPosStatus::~CT_LbsHybridUEAssistedNpudPosStatus() + { + delete iLbsPositioningStatus; + } + +// Hybrid - UE Assisted MO-LR GPS ok + +TVerdict CT_LbsHybridUEAssistedNpudPosStatus::doTestStepL() + { + INFO_PRINTF1(_L("CT_LbsHybridUEAssistedNpudPosStatus::doTestStepL()")); + + // Stop the test if the preable failed + TESTL(TestStepResult() == EPass); + + const TInt KTimeOut = 60*1000*1000; + + // Create Network Protocol Proxy + CNetProtocolProxy* proxy = CNetProtocolProxy::NewL(); + CleanupStack::PushL(proxy); + + // >> AdviceSystemStatus(0) - GetCurrentCapabilitiesResponse + TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgGetCurrentCapabilitiesResponse); + CLbsNetworkProtocolBase::TLbsSystemStatus status; + TInt cleanupCnt; + cleanupCnt = proxy->GetArgsLC(ENetMsgGetCurrentCapabilitiesResponse, &status); + TESTL(status == CLbsNetworkProtocolBase::ESystemStatusNone); + CleanupStack::PopAndDestroy(cleanupCnt); + + // Start Test Step + RPositionServer server; + TESTL(KErrNone == server.Connect()); + CleanupClosePushL(server); + + RPositioner pos; + TESTL(KErrNone == pos.Open(server)); + + CPosServerWatcher *pWatch = NULL; + TInt reason = KErrNone; + + CleanupClosePushL(pos); + // Set the max fix time for the client request to ensure the location server does not complete the request too soon during the test. + TPositionUpdateOptions posOpts(TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(KMOLRFixTime)); + pos.SetUpdateOptions(posOpts); + + pWatch = CPosServerWatcher::NewLC(pos, *this); + + // Request a self-locate MoLr. + pWatch->IssueNotifyPositionUpdate(); + CheckForObserverEventTestsL(KTimeOut, *this); + //We should get Positioning Indicator flag on and may be off after that + TESTL(iPosStatusCount==1); + TESTL(iPositioningStatus == CLbsPositioningStatus::ELbsPositioningStatusActive); + + // >> RequestSelfLocation() + TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestSelfLocation); + + // Process the response. + TLbsNetSessionId* sessionId = NULL; + TLbsNetPosRequestOptionsAssistance* opts = NULL; + + cleanupCnt = proxy->GetArgsLC(ENetMsgRequestSelfLocation, &sessionId, &opts); + + TBool qualitycheck = ArgUtils::CompareQuality( opts, + ETrue, + KMinHorizontalAcc, + KMinVerticalAcc, + KMOLRFixTime, + 0, + EAssistanceDataReferenceTime, + (TPositionModuleInfo::ETechnologyTerminal + | TPositionModuleInfo::ETechnologyAssisted) + ); + + TESTL(qualitycheck); + + iSessionId.SetSessionNum(sessionId->SessionNum()); + iSessionId.SetSessionOwner(sessionId->SessionOwner()); + + CleanupStack::PopAndDestroy(cleanupCnt); + sessionId = NULL; + opts = NULL; + + // << ProcessStatusUpdate(EServiceSelfLocation) + MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask = MLbsNetworkProtocolObserver::EServiceSelfLocation; + proxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask); + + // << ProcessLocationUpdate(SessionId, RefPosition) + TPositionInfo refPosInfo = ArgUtils::MolrReferencePositionInfo(); + proxy->CallL(ENetMsgProcessLocationUpdate, &iSessionId, &refPosInfo); + + // TEST: Get the ref pos app side. + CheckForObserverEventTestsL(KTimeOut, *this); + //Check for Position Status update - This event could be after reference position + //NOTE: Ref position and positioning indicator callback can be in any order + CheckForObserverEventTestsL(KTimeOut, *this); + TESTL(iPosStatusCount==2); + TESTL(iPositioningStatus == CLbsPositioningStatus::ELbsPositioningStatusNotActive); + + // << ProcessAssistanceData() + TLbsAsistanceDataGroup dataMask = EAssistanceDataReferenceTime; + RLbsAssistanceDataBuilderSet assistanceData; + ArgUtils::PopulateLC(assistanceData); + reason = KErrNone; + proxy->CallL(ENetMsgProcessAssistanceData, &dataMask, &assistanceData, &reason); + CleanupStack::PopAndDestroy(); // assistanceData + + // << ProcessLocationRequest(SessionId, HybridMode, alpha2) + TBool emergency = EFalse; + MLbsNetworkProtocolObserver::TLbsNetProtocolService service = MLbsNetworkProtocolObserver::EServiceSelfLocation; + TLbsNetPosRequestQuality quality = ArgUtils::Quality(); + quality.SetMaxFixTime(ArgUtils::Alpha2()); + TLbsNetPosRequestMethod method = ArgUtils::RequestHybridMethod(); + proxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method); + + // Now that the hybrid/alpha2 has been requested, record current time to verify alpha2 timer expires correctly. + TTime startTime; + startTime.HomeTime(); + + // >> RequestAssistanceData(0) + TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData); + cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask); + TESTL(dataMask == EAssistanceDataNone); + CleanupStack::PopAndDestroy(cleanupCnt); + + // << NotifyPositionUpdate() + pWatch->IssueNotifyPositionUpdate(); + + CheckForObserverEventTestsL(KTimeOut, *this); + //We should get Positioning Indicator flag on + TESTL(iPosStatusCount==3); + TESTL(iPositioningStatus == CLbsPositioningStatus::ELbsPositioningStatusActive); + + // >> RequestAssistanceData(0) + TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData); + + + cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask); + TESTL(dataMask == EAssistanceDataNone); + CleanupStack::PopAndDestroy(cleanupCnt); + // Determine the value to take off the alpha2 value. This is required because we had to wait for the assistance data response. + TTimeIntervalMicroSeconds microseconds; + TTime stopTime; + stopTime.HomeTime(); + microseconds = stopTime.MicroSecondsFrom(startTime); + TInt64 timeElapsed = microseconds.Int64(); + TInt delta = 2 * 1000 * 1000; // 2 secs. + + // >> RespondLocationRequest() + TESTL(proxy->WaitForResponse(ArgUtils::Alpha2() - timeElapsed - delta) == ENetMsgTimeoutExpired); + + // Wait for and process the response. + TESTL(proxy->WaitForResponse(2 * delta) == ENetMsgRespondLocationRequest); // DONT get because the measurement data bus has not been created... + + sessionId = NULL; + TPositionGpsMeasurementInfo* measurementInfo = NULL; + cleanupCnt = proxy->GetArgsLC(ENetMsgRespondLocationRequest, &sessionId, &reason, &measurementInfo); + TESTL(sessionId->SessionNum() == iSessionId.SessionNum()); + TESTL(reason == KErrNone); + CleanupStack::PopAndDestroy(cleanupCnt);//sessionId, measurementInfo + + // Recv -> RequestAssistanceData - we get an extra msg as the result of the A-GPS manager re-issueing a location request when it's + // max fix time timer expries. + TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData); + cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask); + TESTL(dataMask == EAssistanceDataNone); + CleanupStack::PopAndDestroy(cleanupCnt); + const TInt t = 8 * 1000 * 1000; // 8 secs. + quality.SetMaxFixTime(t); + + TPositionExtendedSatelliteInfo* positionInfo = NULL; + //TPositionInfo* positionInfo = NULL; + + for (TInt i = 0; i < KN; i++) + { + // << ProcessLocationRequest(SessionId, HybridMode, t) + proxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method); + + // >> RequestAssistanceData(0) + TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData); + cleanupCnt = proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask); + TESTL(dataMask == EAssistanceDataNone); + CleanupStack::PopAndDestroy(cleanupCnt); + + // >> RespondLocationRequest() - first measurement, second position. + TESTL(proxy->WaitForResponse(t + delta) == ENetMsgRespondLocationRequest); + + sessionId = NULL; + + // Expect measurement first time. + if (i < (KN-1)) + { + measurementInfo = NULL; + cleanupCnt = proxy->GetArgsLC(ENetMsgRespondLocationRequest, &sessionId, &reason, &measurementInfo); + + // Check it is measurement + TESTL(measurementInfo->PositionClassType() == EPositionGpsMeasurementInfoClass); + + // >> RequestAssistanceData - we get an extra msg as the result of the A-GPS manager re-issueing a location request when it's + // max fix time timer expries. + TESTL(proxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData); + + cleanupCnt += proxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataMask); + + TESTL(dataMask == EAssistanceDataNone); + TESTL(sessionId->SessionNum() == iSessionId.SessionNum()); + TESTL(reason == KErrNone); + } + + // Expect position second time. + else + { + cleanupCnt = proxy->GetArgsLC(ENetMsgRespondLocationRequest, &sessionId, &reason, &positionInfo); + + // check it is a position + TESTL(positionInfo->PositionClassType() == (EPositionInfoClass|EPositionCourseInfoClass|EPositionSatelliteInfoClass|EPositionExtendedSatelliteInfoClass)); + TESTL(sessionId->SessionNum() == iSessionId.SessionNum()); + TESTL(reason == KErrNone); + /* Check whether ExtendedSatelliteInfo data received by protocol module is the same as data fed to the GPS module or not. + Latitude(50.2454),Longitude(0.1668),Altitude(1.0),HorizontalAccuracy(10),VerticalAccuracy(10), speed(26.0),vertical speed(20.0),heading(25.0),course(30.0), + SPEED_ACCURACY(2.0),VERTICAL_SPEED_ACCURACY(3.0),HEADING_ACCURACY(10.0),COURSE_ACCURACY(4.0), + SD_OF_LONG_ERROR(5.0),SD_OF_LAT_ERROR(6.0),SD_OF_ALT_ERROR(7.0),SD_OF_SEMI_MAJOR_AXIS_ERROR(8.0), + SD_OF_SEMI_MINOR_AXIS_ERROR(9.0),ORIEN_OF_SEMI_MAJOR_AXIS_ERROR(10.0),RMS_VAL_OF_SD_OF_RANGE(11.0), + GEOIDAL_SEPARATION(12.0),MAGNETIC_VARIATION(13.0),COURSE_OVER_GROUND_MAGNETIC(14.0) + GPS_TIMING_OF_CELL_MsPart(16383),GPS_TIMING_OF_CELL_LsPart(4294967295),REFERENCE_IDENTITY(511) + SFN(4095)*/ + + TPosition gpsPos; + positionInfo->GetPosition(gpsPos); + TESTL(gpsPos.Latitude()==50.2454 && gpsPos.Longitude()== 0.1668 && gpsPos.Altitude()==1.0 + && gpsPos.HorizontalAccuracy()==10 && gpsPos.VerticalAccuracy()==10); + TCourse course; + positionInfo->GetCourse(course); + + TESTL(course.Speed()==26.0 && course.VerticalSpeed()==20.0 && course.Heading()==25.0 && course.Course()==30.0 && + course.SpeedAccuracy()==2.0 && course.VerticalSpeedAccuracy()==3.0 && course.HeadingAccuracy()==10.0 && + course.CourseAccuracy()==4.0); + + TDetailedErrorReport detErrRep; + positionInfo->GetDetailedErrorReport(detErrRep); + TESTL(detErrRep.StanDeviOfLongitudeError()==5.0 && detErrRep.StanDeviOfLatiitudeError()==6.0 && + detErrRep.StanDeviOfAltitudeError()==7.0 && detErrRep.StanDeviOfSemiMajorAxisError()==8.0 && + detErrRep.StanDeviOfSemiMinorAxisError()==9.0 && detErrRep.OrientationOfSemiMajorAxisError()==10.0 && + detErrRep.RmsValOfStanDeviOfRange()==11.0); + + TGpsTimingMeasurementData gpsTimingData; + positionInfo->GetGpsTimingData(gpsTimingData); + + TESTL(gpsTimingData.DataType()== TGpsTimingMeasurementData::EGpsTimingDataTypeUtran && + gpsTimingData.NetworkMode()== TGpsTimingMeasurementData::ENetworkModeFdd && + gpsTimingData.GPSTimingOfCellMsPart()==16383 && gpsTimingData.GPSTimingOfCellLsPart()==4294967295LL && + gpsTimingData.ReferenceIdentity()==511 && gpsTimingData.Sfn()==4095); + + + TESTL(positionInfo->GeoidalSeparation()==12.0 && positionInfo->MagneticVariation()==13.0 && + positionInfo->CourseOverGroundMagnetic()==14.0); + + + // Client recv - the gps position determined by the gps module. + CheckForObserverEventTestsL(KTimeOut, *this); + // Check Positioning Status Indicator callback - + //NOTE: GPS position and positioning indicator callback can be in any order + CheckForObserverEventTestsL(KTimeOut, *this); + //We should get Positioning Indicator flag off + TESTL(iPosStatusCount==4); + TESTL(iPositioningStatus == CLbsPositioningStatus::ELbsPositioningStatusNotActive); + + TESTL(iState == EGpsLocReceived); + + // << ProcessLocationUpdate(SessionId, FinalNetworkPosition) + // Return modules' position as FinalNetworkPosition + proxy->CallL(ENetMsgProcessLocationUpdate, &iSessionId, positionInfo); + } + CleanupStack::PopAndDestroy(cleanupCnt);// sessionId, measurementInfo/positionInfo + } + + // << ProcessSessionComplete(SessionId, KErrNone) + reason = KErrNone; + proxy->CallL(ENetMsgProcessSessionComplete, &iSessionId, &reason); + + // << ENetMsgProcessStatusUpdate() + MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask serviceMask = MLbsNetworkProtocolObserver::EServiceNone; + proxy->CallL(ENetMsgProcessStatusUpdate, &serviceMask); + + // Wait for 10 seconds to ensure no additional responses turn up. + delta = 10 * 1000 * 1000; + TNetProtocolResponseType mType = proxy->WaitForResponse(delta); + TESTL(mType == ENetMsgTimeoutExpired); + + // Done. Now cleanup... + CleanupStack::PopAndDestroy(pWatch); + CleanupStack::PopAndDestroy(); // pos + CleanupStack::PopAndDestroy(); // server + CleanupStack::PopAndDestroy(proxy); + + return TestStepResult(); + } + + +// MPosServerObserver +void CT_LbsHybridUEAssistedNpudPosStatus::OnGetLastKnownPosition(TInt32 /*aErr*/, const TPositionInfoBase& /*aPosInfo*/) + { + TEST(EFalse); // Shouldn't see this... + ReturnToTestStep(); + } + +void CT_LbsHybridUEAssistedNpudPosStatus::OnNotifyPositionUpdate(TInt32 aErr, const TPositionInfoBase& aPosInfo) + { + // Verify error. + if (aErr == KErrCancel) + { + iState = ERefLocReceived; + } + else + { + TEST(aErr == KErrNone); + + // Verify position. + TEST(aPosInfo.PositionClassType() == EPositionInfoClass); + + // Expecting ref pos. + if (iState == EInitializing) + { + iState = ERefLocReceived; + + TEST(aPosInfo.PositionMode() == TPositionModuleInfo::ETechnologyNetwork); + + // check for refpos details + const TPositionInfo posInfo = static_cast(aPosInfo); + TESTL(ArgUtils::ComparePositionInfoToMolrRefPos(posInfo)); + } + + // Expecting network pos. + else if (iState == ERefLocReceived) + { + iState = EGpsLocReceived; + + TEST(aPosInfo.PositionMode() == (TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted)); + } + + // Not expecting anything else. + else + { + TEST(EFalse); + } + } + ReturnToTestStep(); + } + +void CT_LbsHybridUEAssistedNpudPosStatus::OnPositioningStatusUpdate(const CLbsPositioningStatus::TLbsPositioningStatus& aPositioningStatus) + { + iPosStatusCount++; + iPositioningStatus = aPositioningStatus; + ReturnToTestStep(); + } diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbshybridmtlr/inc/ctlbshybridueassistedmtlrposstatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/lbshybridmtlr/inc/ctlbshybridueassistedmtlrposstatus.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,76 @@ +// Copyright (c) 2007-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 contains the header file for MTLR UE Assisted GPS ok +// +// + +#ifndef __CT_LBS_HYBRID_UEASSISTED_MTLR_POS_STATUS_H__ +#define __CT_LBS_HYBRID_UEASSISTED_MTLR_POS_STATUS_H__ + +// LBS includes. +#include +#include +#include +#include + +// LBS test includes. +#include "ctlbshybridmtlrstep.h" +#include +#include "lbs/lbspositioningstatus.h" + + +// Literals used +_LIT(KLbsHybridUEAssistedMTLRPosStatus,"LbsHybridUEAssistedMTLRPosStatus"); + +class CT_LbsHybridUEAssistedMTLRPosStatus: public CT_LbsHybridMTLRStep, public MLbsPrivacyObserver, public MLbsPositioningStatusObserver +{ +public: + static CT_LbsHybridUEAssistedMTLRPosStatus* New(CT_LbsHybridMTLRServer& aParent); + enum TVerdict doTestStepL(); + ~CT_LbsHybridUEAssistedMTLRPosStatus(); + +protected: + // from MLbsPrivacyObserver + void ProcessNetworkLocationRequest(TUint aRequestId, const TLbsExternalRequestInfo& aRequestInfo, const TNotificationType& aNotificationType); + void ProcessNetworkPositionUpdate(TUint aRequestId, const TPositionInfo& aPosInfo); + void ProcessRequestComplete(TUint aRequestId, TInt aReason); + + //MLbsPositioningStatusObserver + void OnPositioningStatusUpdate(const CLbsPositioningStatus::TLbsPositioningStatus& aPositioningStatus); + +protected: + CT_LbsHybridUEAssistedMTLRPosStatus(CT_LbsHybridMTLRServer& aParent); + void ConstructL(); + +private: + enum TState + { + EInitializing, + EPrivacyCheckOk, + ERefLocReceived, + EGpsLocReceived, + ERequestComplete + }; + + TState iState; + TLbsNetSessionId iSessionId; + CLbsPrivacyController* iController; + CNetProtocolProxy* iProxy; + + CLbsPositioningStatus* iLbsPostioningStatus; + TInt iPosStatusCount; + CLbsPositioningStatus::TLbsPositioningStatus iPositioningStatus; +}; + +#endif //__CT_LBS_HYBRID_UEASSISTED_MTLR_POS_STATUS_H__ diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbshybridmtlr/scripts/hybrid_ueassisted_mtlr_posstatus.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/lbshybridmtlr/scripts/hybrid_ueassisted_mtlr_posstatus.script Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,75 @@ +// Copyright (c) 2007-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: +// + +LOAD_SUITE LbsHybridMTLRTestServer -SharedData + +PRINT Run LbsHybridMTLRTestServer + + +// Before we start LBS, select the test A-GPS integration module to use. +PREFIX RUN_UTILS + MkDir c:\private\10282253\ + MkDir c:\private\10282253\lbs\ + MkDir c:\private\10282253\lbs\locmods\ +// CopyFile c:\testdata\configs\xtestmodule.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini + CopyFile c:\testdata\configs\ctagpsnpetestmoduledatasource.ini c:\private\10282253\lbs\locmods\agpsintegmodule.ini + CopyFile c:\testdata\configs\lbstestconfig.txt c:\config.txt +REMOVE_PREFIX + +// Reset admin (reset will give us the EGpsPreferTerminalBased). +RUN_TEST_STEP 010 LbsHybridMTLRTestServer LbsStep_ResetDefaultAdmin + +// Select MTLR privacy controller. +RUN_TEST_STEP 010 LbsHybridMTLRTestServer LbsStep_SetPrivacyHandler c:\testdata\configs\lbs_mtlr.ini PrivHandler + +// Use hybrid protocol module +RUN_TEST_STEP 010 LbsHybridMTLRTestServer LbsStep_SetupProtocolStub + +RUN_TEST_STEP 030 LbsHybridMTLRTestServer LbsStep_StartLbs + + + +START_TESTCASE LBS-HybridMTLR-UEAssistedMTLR-PosStatus-0001 +//!@SYMTestCaseID LBS-HybridMTLR-UEAssistedMTLR-PosStatus-0001 + +//!@SYMTestCaseDesc MTLR Request received +//! GPS Module generates an accurate position in UE Assisted Mode +//! See: lbshybridmtlr/documentation/mtlr.htm#HybridUEAssistedMTLRAccurate +//! +//! +//!@SYMTestActions +//! See test step Sequence inline comments +//! +//! +//!@SYMTestExpectedResults Sequence as per specified by FSM and UML Seq diagram is Followed +//!@SYMPREQ PREQ1624 +//!@SYMREQ REQ1624.xyz +//! +//!@SYMTestType CIT +//!@SYMTestPriority 1 +//!@SYMTestStatus Implemented. + +RUN_TEST_STEP 010 LbsHybridMTLRTestServer LbsStep_InstallScheduler + +// Configure Hybrid AGps module options +RUN_TEST_STEP 120 LbsHybridMTLRTestServer LbsStep_ConfigHybridModule c:\testdata\configs\lbs_mtlr.ini HybridUEAssistedMTLRGPSOK + +RUN_TEST_STEP 120 LbsHybridMTLRTestServer LbsHybridUEAssistedMTLRPosStatus + +END_TESTCASE LBS-HybridMTLR-UEAssistedMTLR-PosStatus-0001 + + + +RUN_TEST_STEP 020 LbsHybridMTLRTestServer LbsStep_StopLbs diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbshybridmtlr/src/ctlbshybridueassistedmtlrposstatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/lbshybridmtlr/src/ctlbshybridueassistedmtlrposstatus.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,282 @@ +// Copyright (c) 2007-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: +// + +// LBS includes. +#include +#include +#include + +// LBS test includes. +#include "ctlbshybridueassistedmtlrposstatus.h" +#include +#include "argutils.h" +#include + + + +/** +Static Constructor +*/ +CT_LbsHybridUEAssistedMTLRPosStatus* CT_LbsHybridUEAssistedMTLRPosStatus::New(CT_LbsHybridMTLRServer& aParent) + { + // Note that we do not use ELeave. + // This means that having insufficient memory will return NULL; + CT_LbsHybridUEAssistedMTLRPosStatus* testStep = new CT_LbsHybridUEAssistedMTLRPosStatus(aParent); + if (testStep) + { + TInt err = KErrNone; + + TRAP(err, testStep->ConstructL()); + if (err) + { + delete testStep; + testStep = NULL; + } + } + return testStep; + } + + +/** + * Constructor + */ +CT_LbsHybridUEAssistedMTLRPosStatus::CT_LbsHybridUEAssistedMTLRPosStatus(CT_LbsHybridMTLRServer& aParent) : CT_LbsHybridMTLRStep(aParent) + { + SetTestStepName(KLbsHybridUEAssistedMTLRPosStatus); + iState = EInitializing; + iSessionId.SetSessionOwner(KRequestUid); + iSessionId.SetSessionNum(0x0005); + } + + +void CT_LbsHybridUEAssistedMTLRPosStatus::ConstructL() + { + // Create the base class objects. + CT_LbsHybridMTLRStep::ConstructL(); + iController = CLbsPrivacyController::NewL(*this); + iProxy = CNetProtocolProxy::NewL(); + iLbsPostioningStatus = CLbsPositioningStatus::NewL(*this); + iPosStatusCount = 0; + } + + +/** + * Destructor + */ +CT_LbsHybridUEAssistedMTLRPosStatus::~CT_LbsHybridUEAssistedMTLRPosStatus() + { + delete iLbsPostioningStatus; + delete iController; + delete iProxy; + } + + +TVerdict CT_LbsHybridUEAssistedMTLRPosStatus::doTestStepL() + { + INFO_PRINTF1(_L("CT_LbsHybridUEAssistedMTLRPosStatus::doTestStepL()")); + // Stop the test if the preamble failed + TESTL(TestStepResult() == EPass); + + const TInt KTimeOut = 60*1000*1000; + const TInt KAdviceSystemStatusTimeout = 40*1000*1000; + const TInt KSmallTimeOut = 3*1000*1000; + + // >> AdviceSystemStatus(0) + TESTL(iProxy->WaitForResponse(KAdviceSystemStatusTimeout) == ENetMsgGetCurrentCapabilitiesResponse); + CLbsNetworkProtocolBase::TLbsSystemStatus status; + TInt cleanupCnt; + cleanupCnt = iProxy->GetArgsLC(ENetMsgGetCurrentCapabilitiesResponse, &status); + TESTL(status == CLbsNetworkProtocolBase::ESystemStatusNone); + CleanupStack::PopAndDestroy(cleanupCnt); + + // Initiate MTLR Start + // << ProcessStatusUpdate() + MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask = MLbsNetworkProtocolObserver::EServiceMobileTerminated; + iProxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask); + + // << ProcessPrivacyRequest() + const TBool emergency = ETrue; + TLbsNetPosRequestPrivacy privacy = ArgUtils::Privacy(); + TLbsExternalRequestInfo requestInfo = ArgUtils::RequestInfo(); + iProxy->CallL(ENetMsgProcessPrivacyRequest, &iSessionId, &emergency, &privacy, &requestInfo); + + // >> Callback from RespondNetworkLocationRequest(ERequestAccepted) + CheckForObserverEventTestsL(KTimeOut, *this); + + // Since its emergency request, Position request must be accepted and we should get UI indicator on + CheckForObserverEventTestsL(KTimeOut, *this); + TESTL(iPosStatusCount==1); + TESTL(iPositioningStatus == CLbsPositioningStatus::ELbsPositioningStatusActive); + + // >> Respond Privacy Request + TESTL(iProxy->WaitForResponse(KTimeOut) == ENetMsgRespondPrivacyRequest); + TLbsNetSessionId* getSessionId = NULL; + CLbsNetworkProtocolBase::TLbsPrivacyResponse getPrivacy; + cleanupCnt = iProxy->GetArgsLC(ENetMsgRespondPrivacyRequest, &getSessionId, &getPrivacy); + TESTL(getSessionId->SessionNum()==iSessionId.SessionNum()); + TESTL(getPrivacy==CLbsNetworkProtocolBase::EPrivacyResponseAccepted); + CleanupStack::PopAndDestroy(cleanupCnt);//getSessionId + // Initiate MTLR End + + // MTLR Reference Position Notification Start + // << ProcessLocationUpdate() + TPositionInfo positionInfo = ArgUtils::ReferencePositionInfo(); + iProxy->CallL(ENetMsgProcessLocationUpdate, &iSessionId, &positionInfo); + // MTLR Reference Position Notification Stop + + // MTLR Assistance Data Notification Start + // << ProcessAssistanceData() + TLbsAsistanceDataGroup dataRequestMask = EAssistanceDataReferenceTime; + RLbsAssistanceDataBuilderSet assistanceData; + ArgUtils::PopulateLC(assistanceData); + TInt reason = KErrNone; + iProxy->CallL(ENetMsgProcessAssistanceData, &dataRequestMask, &assistanceData, &reason); + CleanupStack::PopAndDestroy(); //assistanceData + // MTLR Assistance Data Notification Stop + + // MTLR Network Location Request Start + // << ProcessLocationRequest() + MLbsNetworkProtocolObserver::TLbsNetProtocolService service = MLbsNetworkProtocolObserver::EServiceMobileTerminated; + TLbsNetPosRequestQuality quality = ArgUtils::QualityAlpha2(); + TLbsNetPosRequestMethod method = ArgUtils::RequestHybridMethod(); + iProxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method); + // MTLR Network Location Request Stop + + //Start the timer + TTime timerStart; + timerStart.HomeTime(); + + // >> Callback from ProcessNetworkPostionUpdate(refPosition) + CheckForObserverEventTestsL(KSmallTimeOut, *this); + + // >> RequestAssistanceData(0) + TESTL(iProxy->WaitForResponse(KSmallTimeOut) == ENetMsgRequestAssistanceData); + TLbsAsistanceDataGroup dataGroup; + cleanupCnt = iProxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataGroup); + TESTL(dataGroup == EAssistanceDataNone); + CleanupStack::PopAndDestroy(cleanupCnt); + + //Find the time elapsed from timer + TTimeIntervalMicroSeconds microseconds; + TTime timerStop; + timerStop.HomeTime(); + microseconds = timerStop.MicroSecondsFrom(timerStart); + TInt64 timeElapsed = microseconds.Int64(); + + // >> RespondLocationRequest() + //Test that we do not get response before alpha2 has expired + TESTL(iProxy->WaitForResponse(KAlpha2Timeout-timeElapsed-KDelta) == ENetMsgTimeoutExpired); + TESTL(iProxy->WaitForResponse(2*KDelta) == ENetMsgRespondLocationRequest); + + getSessionId = NULL; + TInt getReason = KErrNone; + TPositionSatelliteInfo* getPositionInfo = NULL; + cleanupCnt = iProxy->GetArgsLC(ENetMsgRespondLocationRequest, &getSessionId, &getReason, &getPositionInfo); + TESTL(getSessionId->SessionNum() == iSessionId.SessionNum()); + TESTL(getReason==KErrNone); + CleanupStack::PopAndDestroy(cleanupCnt); //getSessionId,getPositionInfo + + //NHR's timer alpha2 times out -> Hybrid Positioning Start + //<< ProcessLocationRequest() + quality = ArgUtils::Quality(); //Set timeout to t + iProxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method); + + // >> RequestAssistanceData(0) + TESTL(iProxy->WaitForResponse(KSmallTimeOut) == ENetMsgRequestAssistanceData); + cleanupCnt = iProxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataGroup); + TESTL(dataGroup == EAssistanceDataNone); + CleanupStack::PopAndDestroy(cleanupCnt); + + // >> RespondLocationRequest() + TESTL(iProxy->WaitForResponse(KTTimeout) == ENetMsgRespondLocationRequest); + getSessionId = NULL; + getReason = KErrNone; + getPositionInfo = NULL; + cleanupCnt = iProxy->GetArgsLC(ENetMsgRespondLocationRequest, &getSessionId, &getReason, &getPositionInfo); + TESTL(getSessionId->SessionNum() == iSessionId.SessionNum()); + TESTL(getReason==KErrNone); + CleanupStack::PopAndDestroy(cleanupCnt);//getSessionId,getPositionInfo + + //<< ProcessNetworkPositionUpdate() | GPS Pos[Accurate Fix] + CheckForObserverEventTestsL(KTimeOut, *this); + TESTL(iState==EGpsLocReceived); + + // MTLR Session Completion Start + // << ProcessSessionComplete() + reason = KErrNone; + iProxy->CallL(ENetMsgProcessSessionComplete, &iSessionId, &reason); + + // << ProcessStatusUpdate() + MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask2 = MLbsNetworkProtocolObserver::EServiceNone; + iProxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask2); + + // >> Callback from ProcessRequestComplete() + CheckForObserverEventTestsL(KTimeOut, *this); + + CheckForObserverEventTestsL(KTimeOut, *this); + TESTL(iPosStatusCount==2); + TESTL(iPositioningStatus == CLbsPositioningStatus::ELbsPositioningStatusNotActive); + + // Verify that the last callback was to ProcessSessionComplete() + TESTL(iState==ERequestComplete); + // MTLR Session Completion Stop + + return TestStepResult(); + } + +void CT_LbsHybridUEAssistedMTLRPosStatus::ProcessNetworkLocationRequest(TUint aRequestId, const TLbsExternalRequestInfo& /*aRequestInfo*/, const TNotificationType& /*aNotificationType*/) + { + INFO_PRINTF1(_L(">>CT_LbsHybridUEAssistedMTLRPosStatus::ProcessNetworkLocationRequest()")); + TEST(iState==EInitializing); + iController->RespondNetworkLocationRequest(aRequestId, CLbsPrivacyController::ERequestAccepted); + iState = EPrivacyCheckOk; + ReturnToTestStep(); + } + +void CT_LbsHybridUEAssistedMTLRPosStatus::ProcessNetworkPositionUpdate(TUint /*aRequestId*/, const TPositionInfo& aPosInfo) + { + if(iState==EPrivacyCheckOk) + { + iState=ERefLocReceived; + INFO_PRINTF1(_L(">>CT_LbsHybridUEAssistedMTLRPosStatus::ProcessNetworkPositionUpdate(RefPosition)")); + } + else if(iState==ERefLocReceived) + { + // Test for $update,1,2,51.5015,-0.105,50,2,3* + TPosition getPos; + aPosInfo.GetPosition(getPos); + if(getPos.Latitude()==51.5015 && getPos.Longitude()==-0.105 && getPos.Altitude()==50 && getPos.HorizontalAccuracy()==2 && getPos.VerticalAccuracy()==3) + { + INFO_PRINTF1(_L(">>CT_LbsHybridUEAssistedMTLRPosStatus::ProcessNetworkPositionUpdate(GpsPosition)")); + iState=EGpsLocReceived; + } + } + ReturnToTestStep(); + } + +void CT_LbsHybridUEAssistedMTLRPosStatus::ProcessRequestComplete(TUint /*aRequestId*/, TInt /*aReason*/) + { + INFO_PRINTF1(_L(">>CT_LbsHybridUEAssistedMTLRPosStatus::ProcessRequestComplete()")); + TEST(iState==EGpsLocReceived); + iState=ERequestComplete; + ReturnToTestStep(); + } + +void CT_LbsHybridUEAssistedMTLRPosStatus::OnPositioningStatusUpdate(const CLbsPositioningStatus::TLbsPositioningStatus& aPositioningStatus) + { + iPosStatusCount++; + iPositioningStatus = aPositioningStatus; + ReturnToTestStep(); + } diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/lbsprivacyfw/lbsprivfwtestchannel/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/lbsprivacyfw/lbsprivfwtestchannel/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,35 @@ +// Copyright (c) 2005-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: +// Main projects, in build order +// +// + + +PRJ_TESTEXPORTS +./lbsprivfwtestchannel.iby /epoc32/rom/include/lbsprivfwtestchannel.iby + +../inc/tlbsprivfwtestchannel.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/tlbsprivfwtestchannel.h) +../inc/tlbsprivfwtestchannelmsgfifo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/tlbsprivfwtestchannelmsgfifo.h) +../inc/tlbsprivfwtestchannelmsgtypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/tlbsprivfwtestchannelmsgtypes.h) +../inc/tlbsprivfwtestrequestinfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/tlbsprivfwtestrequestinfo.h) +../inc/tlbstestrequestchannel.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/tlbstestrequestchannel.h) +../inc/lbsprivfwdefs.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/lbsprivfwdefs.h) + +PRJ_TESTMMPFILES +lbsprivfwtestchannel.mmp + + +//PRJ_TESTMMPFILES +//#include "../test/group/BLD.INF" + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/s60privacyfw/LcfFIPrivacyNotifier_1_0_ECom/Controller/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/s60privacyfw/LcfFIPrivacyNotifier_1_0_ECom/Controller/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,22 @@ +/* +* 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: +* +*/ +// BLD.INF +// Component description file + +PRJ_TESTMMPFILES +LcfPluginCtrl.mmp + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/s60privacyfw/LcfFIPrivacyNotifier_1_0_ECom/Notifier/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/s60privacyfw/LcfFIPrivacyNotifier_1_0_ECom/Notifier/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,21 @@ +// 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: +// + + + + +PRJ_TESTMMPFILES +LcfNotifier.mmp + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/s60privacyfw/Td_PrivFW_TEF/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/s60privacyfw/Td_PrivFW_TEF/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +/* +* 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: +* +*/ +// BLD.INF +// Component description file + +PRJ_TESTEXPORTS +../scripts/nileprivfw.script c:/testdata/scripts/nileprivfw.script +../testdata/nileprivfw.ini c:/testdata/configs/nileprivfw.ini + +PRJ_TESTMMPFILES +td_privfw.mmp diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsIntegrationSuite/LbsHybridMolrSuite/hybrid_ueassisted_molr_posstatus.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsIntegrationSuite/LbsHybridMolrSuite/hybrid_ueassisted_molr_posstatus.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ + + + + + + hybrid_ueassisted_molr_posstatus + 600 + + + + + LbsHybridMOLRTestServer + + + + lbstest\lbstestproduct\lbshybridmolr\testdata\lbs_molr.ini + c:\testdata\configs\lbs_molr.ini + + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsIntegrationSuite/LbsHybridMtlrSuite/hybrid_ueassisted_mtlr_posstatus.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsIntegrationSuite/LbsHybridMtlrSuite/hybrid_ueassisted_mtlr_posstatus.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ + + + + + + hybrid_ueassisted_mtlr_posstatus + 600 + + + + + LbsHybridMTLRTestServer + + + + lbstest\lbstestproduct\lbshybridmtlr\testdata\lbs_mtlr.ini + c:\testdata\configs\lbs_mtlr.ini + + + diff -r 2965a06983dc -r 81c9bee26a45 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 Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplconnectionmanagersuite/testexecuteservers/te_suplconnectionmanagersuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplprotocolsuite/testexecuteservers/te_suplprotocolsuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpasn1suite/testexecuteservers/te_suplrrlpasnsuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 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 Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/suplsuite/te_suplrrlpsuite/testexecuteservers/te_suplrrlpsuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_geolocmonitorsuite.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_geolocmonitorsuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,14 @@ + + + + te_geolocmonitorsuite + + + te_geolocmonitortest + + + + te_geolocmonitorsuite + + + \ No newline at end of file diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_geolocmonitorsuite/te_geolocmonitortest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_geolocmonitorsuite/te_geolocmonitortest.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ + + + + + te_geolocmonitortest + 60 + + + + + te_geolocmonitorsuite + + + + locationmgmt\locmonitor\test\te_geolocmonitorsuite\testdata\te_geolocmonitorsuite.ini + c:\testdata\configs\te_geolocmonitorsuite.ini + + + locationmgmt\locmonitor\test\te_geolocmonitorsuite\testdata\lbsgeolocmonunitconfig.txt + c:\testdata\configs\lbsgeolocmonunitconfig.txt + + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_geolocmonitorsuite/testexecuteservers/te_geolocmonitorsuite.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_geolocmonitorsuite/testexecuteservers/te_geolocmonitorsuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,21 @@ + + + + te_geolocmonitorsuite + + te_geolocmonitorsuite.mmp + locationmgmt\locmonitor\test\te_geolocmonitorsuite\group\bld.inf + + + + examplelocationconverter.dll + c:\system\libs\examplelocationconverter.dll + ExampleLocationConverter.mmp + locationmgmt\locmonitor\test\examplelocationconverter\group\bld.inf + + + \epoc32\data\Z\resource\plugins\ExampleLocationConverter.rsc + c:\resource\plugins\ExampleLocationConverter.rsc + + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsagpspsysuite/te_lbsagpspsytest.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsagpspsysuite/te_lbsagpspsytest.xml Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsagpspsysuite/te_lbsagpspsytest.xml Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsgpspsysuite/te_lbsgpspsytest.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsgpspsysuite/te_lbsgpspsytest.xml Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsgpspsysuite/te_lbsgpspsytest.xml Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbslocationinfoconvertersuite.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbslocationinfoconvertersuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,11 @@ + + + te_lbslocationinfoconvertersuite + + te_lbslocationinfoconvertertest + + + te_lbslocationinfoconvertersuite + + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbslocationinfoconvertersuite/te_lbslocationinfoconvertertest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbslocationinfoconvertersuite/te_lbslocationinfoconvertertest.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ + + + + + te_lbslocationinfoconvertertest + 240 + + + + + te_lbslocationinfoconvertersuite + + + + locationmgmt\locmonitor\test\te_lbslocationinforconvertertef\scripts\LbsLocationInfoConverter.ini + c:\testdata\configs\lbslocationinfoconverter.ini + + + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbslocationinfoconvertersuite/testexecuteservers/te_lbslocationinfoconvertersuite.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbslocationinfoconvertersuite/testexecuteservers/te_lbslocationinfoconvertersuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,57 @@ + + + te_lbslocationinfoconvertersuite + te_lbslocationinfoconverter.mmp + locationmgmt\locmonitor\test\te_lbslocationinforconvertertef\group\bld.inf + + + + examplelocationconverter.dll + c:\system\libs\examplelocationconverter.dll + ExampleLocationConverter.mmp + locationmgmt\locmonitor\test\examplelocationconverter\group\bld.inf + + + TestLocationConverter.dll + c:\system\libs\TestLocationConverter.dll + TestLocationConverter.dll + locationmgmt\locmonitor\test\TestLocationConverter\group\bld.inf + + + TestLocationConverter2.dll + c:\system\libs\TestLocationConverter2.dll + TestLocationConverter2.dll + locationmgmt\locmonitor\test\TestLocationConverter2\group\bld.inf + + + TestLocationConverter3.dll + c:\system\libs\TestLocationConverter3.dll + TestLocationConverter3.dll + locationmgmt\locmonitor\test\TestLocationConverter3\group\bld.inf + + + \epoc32\data\Z\resource\plugins\ExampleLocationConverter.rsc + c:\resource\plugins\ExampleLocationConverter.rsc + + + \epoc32\data\Z\resource\plugins\TestLocationConverter.rsc + c:\resource\plugins\TestLocationConverter.rsc + + + + \epoc32\data\Z\resource\plugins\TestLocationConverter2.rsc + c:\resource\plugins\TestLocationConverter2.rsc + + + + \epoc32\data\Z\resource\plugins\TestLocationConverter3.rsc + c:\resource\plugins\TestLocationConverter3.rsc + + + locationmgmt\locmonitor\test\te_geolocmonitorsuite\testdata\lbsgeolocmonunitconfig.txt + c:\testdata\configs\lbsgeolocmonunitconfig.txt + + + + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsnetpsysuite/te_lbsnetpsytest.xml --- a/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsnetpsysuite/te_lbsnetpsytest.xml Mon May 03 13:50:32 2010 +0300 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbsnetpsysuite/te_lbsnetpsytest.xml Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbspositioningstatussuite.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbspositioningstatussuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,11 @@ + + + te_lbspositioningstatussuite + + te_lbspositioningstatustest + + + te_lbspositioningstatussuite + + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbspositioningstatussuite/te_lbspositioningstatustest.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbspositioningstatussuite/te_lbspositioningstatustest.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ + + + + + te_lbspositioningstatustest + 300 + + + + + te_lbspositioningstatussuite + + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbspositioningstatussuite/testexecuteservers/te_lbspositioningstatussuite.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/lbstestproduct/tdxml/LbsSuite/LbsUnitSuite/te_lbspositioningstatussuite/testexecuteservers/te_lbspositioningstatussuite.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,6 @@ + + + te_lbspositioningstatussuite + te_lbspositioningstatus.mmp + locationmgmt\locationcore\lbspositioningstatus\test\te_lbspositioningstatus\group\bld.inf + diff -r 2965a06983dc -r 81c9bee26a45 lbstest/locationprotocoltest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lbstest/locationprotocoltest/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,24 @@ +// 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: +// + +// Main projects, in build order +#include "../../../networkprotocolmodules/networkprotocolmodule/LbsAssistanceDataSourceInterface/group/bld.inf" +#include "../../../networkprotocolmodules/networkprotocolmodule/LbsNetSim/group/bld.inf" +#include "../../../networkprotocolmodules/networkprotocolmodule/LbsProtocolModule/group/bld.inf" +#include "../../../networkprotocolmodules/networkprotocolmodule/suplasn1/group/bld.inf" +#include "../../../networkprotocolmodules/networkprotocolmodule/LbsSuplTestProtocol/group/bld.inf" + +PRJ_EXPORTS +./lbsnetworktest.iby /epoc32/rom/include/lbsnetworktest.iby diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/GPSClock/GpsSetClock/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/GPSClock/GpsSetClock/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,28 @@ +// 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: +// + +// Main projects, in build order +PRJ_EXPORTS +../inc/GPSSetClockBase.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/gpssetclockbase.h) + +gpssetclock.iby /epoc32/rom/include/gpssetclock.iby + + +PRJ_MMPFILES +GPSSetClock.mmp + +PRJ_TESTEXPORTS + +PRJ_TESTMMPFILES diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/GPSClock/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/GPSClock/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// 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: +// + +#include "../GpsSetClock/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsADataCache/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsADataCache/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbsadatacache.iby /epoc32/rom/include/lbsadatacache.iby + +PRJ_MMPFILES +lbsadatacache.mmp + +PRJ_TESTMMPFILES +#include "../test/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsADataCache/test/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsADataCache/test/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +#include "../te_lbsadatacachetest/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsAgpsNgMsgs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsAgpsNgMsgs/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbsagpsngmsgs.iby /epoc32/rom/include/lbsagpsngmsgs.iby + +PRJ_MMPFILES +lbsagpsngmsgs.mmp + +PRJ_TESTMMPFILES diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsAssistanceData/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsAssistanceData/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,44 @@ +// Copyright (c) 2003-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: +// + +#include "../test/group/bld.inf" + +PRJ_EXPORTS +../inc/LbsAssistanceAquisitionAssistance.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistanceaquisitionassistance.h) +../inc/LbsAssistanceBadSatList.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancebadsatlist.h) +../inc/LbsAssistanceIonosphericModel.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistanceionosphericmodel.h) +../inc/LbsAssistanceReferenceLocation.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancereferencelocation.h) +../inc/LbsAssistanceReferenceTime.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancereferencetime.h) +../inc/LbsAssistanceUtcModel.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistanceutcmodel.h) +../inc/LbsAssistanceUtranReferenceTime.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistanceutranreferencetime.h) +../inc/LbsAssistanceRrlpReferenceTime.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancerrlpreferencetime.h) +../inc/LbsAssistanceDataBase.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancedatabase.inl) +../inc/LbsAssistanceNavigationModel.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancenavigationmodel.h) +../inc/LbsAssistanceAlmanac.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancealmanac.h) +../inc/LbsAssistanceDataBase.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancedatabase.h) +../inc/LbsAssistanceStaticFuncs.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancestaticfuncs.h) +../inc/LbsAssistanceEnum.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistanceenum.h) +../inc/lbsassistancedatabuilderset.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancedatabuilderset.h) +../inc/lbsassistancedatabuilderset.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancedatabuilderset.inl) +../inc/lbsassistancedatareaderset.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancedatareaderset.h) +../inc/lbsassistancedatareaderset.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsassistancedatareaderset.inl) + +//ROM +lbsassistancedata.iby /epoc32/rom/include/lbsassistancedata.iby + + + +PRJ_MMPFILES +LbsAssistanceData.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsClient/LbsApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,46 @@ +// Copyright (c) 2003-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: +// + +#include "../test/te_lbsapi/group/bld.inf" + +PRJ_EXPORTS + +lbs.iby /epoc32/rom/include/lbs.iby + +../inc/LbsCommon.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbscommon.h) +../inc/LbsCriteria.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbscriteria.h) +../inc/lbsfieldids.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbsfieldids.h) +../inc/lbsfields.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbsfields.h) +../inc/LbsIpc.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbsipc.h) +../inc/LbsPosition.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbsposition.h) +../inc/LbsPositionInfo.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbspositioninfo.h) +../inc/LbsRequestor.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbsrequestor.h) +../inc/LbsSatellite.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbssatellite.h) +../inc/lbsgpstimingmeasurement.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsgpstimingmeasurement.h) +../inc/lbsextendedsatellite.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsextendedsatellite.h) +../inc/LbsPtrHolder.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbsptrholder.h) +../inc/LbsErrors.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbserrors.h) +../inc/lbsipc.hrh /epoc32/include/lbs/lbsipc.hrh +../inc/LbsClassTypes.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbsclasstypes.h) +../inc/Lbs.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbs.h) +../inc/lbs.inl SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbs.inl) +../inc/LbsPositionCalc.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbspositioncalc.h) +../inc/LbsGpsMeasurement.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsgpsmeasurement.h) +../inc/LbsAreaInfo.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(lbsareainfo.h) + +PRJ_MMPFILES +Lbs.mmp + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsClient/LbsApi/inc/LbsErrors.h --- a/locationmgmt/locationcore/LbsClient/LbsApi/inc/LbsErrors.h Mon May 03 13:50:32 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/inc/LbsErrors.h Tue Jul 13 12:25:28 2010 +0100 @@ -17,7 +17,6 @@ #define __LBSERRORS_H__ #include -#include /** LBS Panic string @@ -125,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. @@ -133,7 +142,7 @@ If __S60_ is defined in lbsvariant.h the constant is -30371 otherwise it is -17350 */ -const TInt KPositionErrBase = __LBS_TDEFAULT_ERROR_BASE; +const TInt KPositionErrBase = -30371; /** BufferOverflow error diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsClient/LbsApi/src/LbsAreaInfo.cpp --- a/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsAreaInfo.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsAreaInfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -17,7 +17,7 @@ #include -#include +#include #include diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositioner.cpp --- a/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositioner.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositioner.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "lbslocservermessageenums.h" #include "LbsPtrHolder.h" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsClient/LbsApi/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/traces/OstTraceDefinitions.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ + +#include +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsClient/LbsTestSvr/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsClient/LbsTestSvr/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,21 @@ +// Copyright (c) 2003-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: +// + +PRJ_MMPFILES +LbsTestSvr.mmp + +PRJ_TESTMMPFILES +../test/UnitTestTestServer.mmp +../test/AccpTestTestServer.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsClient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsClient/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,18 @@ +// Copyright (c) 2003-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: +// + +// Main projects, in build order +#include "../LbsApi/group/bld.inf" + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsCommonInternalDataTypes/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsCommonInternalDataTypes/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbscommoninternaldatatypes.iby /epoc32/rom/include/lbscommoninternaldatatypes.iby + + +PRJ_MMPFILES +lbscommoninternaldatatypes.mmp + +PRJ_TESTMMPFILES + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsInternalApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsInternalApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +// Copyright (c) 2003-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: +// + +PRJ_EXPORTS + +lbsinternalapi.iby /epoc32/rom/include/lbsinternalapi.iby + +PRJ_MMPFILES +LbsInternalApi.mmp + +PRJ_TESTMMPFILES + + +#include "../te_lbsinternalapitest/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsInternalApi/inc/lbspositioningstatusprops.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsInternalApi/inc/lbspositioningstatusprops.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,56 @@ +// Copyright (c) 2010 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: +// lbspositioningstatusprops.h +// A class for the defining of the Lbs Positioning Status Publish and Subscribe properties +// +// + +/** + @file + @internalTechnology + @released +*/ + +#ifndef POSITIONING_STATUS_PROPS_H +#define POSITIONING_STATUS_PROPS_H + + +#include +#include "lbspropertykeydefs.h" + + +/** The key for the NI Positioning Status property*/ +const TUint KLbsNiPositioningStatusKey = KLbsPositioningStatusAPIBase; +/** The key for the MO Positioning Status property*/ +const TUint KLbsMoPositioningStatusKey = KLbsNiPositioningStatusKey+1; + + +/** +The LbsPositioningStatusProps class provides the InitializeL function that allows the process-owner of +the LBS Positioning Status API RProperties to define them. + +@internalTechnology +@released + +@see CLbsPositioningStatus +*/ +NONSHARABLE_CLASS(LbsPositioningStatusProps) + { +public: + IMPORT_C static void InitializeNiPropertyL(); + IMPORT_C static void InitializeMoPropertyL(); + }; + +#endif //POSITIONING_STATUS_PROPS_H + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsInternalApi/src/lbspositioningstatusprops.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsInternalApi/src/lbspositioningstatusprops.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,95 @@ +// Copyright (c) 2010 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: +// lbspositioningstatusprops.cpp +// A class for the defining the Lbs Positioning Status Publish and Subscribe properties +// +// + +#include +#include +#include +#include "lbsdevloggermacros.h" + +#include "lbspositioningstatusprops.h" +#include "lbsrootcenrepdefs.h" + + +/** +Defines the property used by the Positioning Status API implementation for +receiving updates regarding MT-LR positioning sessions in progress + +Note that this may be created by a different process to the MO property +due to different processes being persistant in different LBS configurations. + +This key is created by LbsRoot. + +@leave If a error happens, it leaves with the correspondent error code. +*/ +EXPORT_C void LbsPositioningStatusProps::InitializeNiPropertyL() + { + LBSLOG(ELogP1, "LbsPositioningStatusProps::InitializeNiPropertyL() Begin\n"); + LBSLOG(ELogP9, "->S LbsPositioningStatusProps::InitializeNiPropertyL() InitializeNiPropertyL \n"); + const TSecurityPolicy KPositioningStatusPolicy(ECapabilityReadDeviceData, ECapabilityLocation); + + // Define the NI Positioning Status property + TInt err = RProperty::Define(KLbsNiPositioningStatusKey, RProperty::EInt, KPositioningStatusPolicy, KPositioningStatusPolicy); + if (err != KErrNone && err != KErrAlreadyExists) + { + User::Leave(err); + } + if (err != KErrAlreadyExists) + { + // store the Uid of the process that defined the property + CRepository* rep = CRepository::NewLC(KLbsCenRepUid); + User::LeaveIfError(rep->Set(KNiPositioningStatusAPIKey, TInt(RProcess().SecureId()))); + CleanupStack::PopAndDestroy(rep); + } + + LBSLOG(ELogP1, "LbsPositioningStatusProps::InitializeNiPropertyL() End\n"); + } + +/** +Defines the property used by the Positioning Status API implementation for +receiving updates regarding MO-LR positioning sessions in progress + +Note that this may be created by a different process to the MO property +due to different processes being persistant in different LBS configurations. + +This key is created by the Location Server by default. + +@leave If a error happens, it leaves with the correspondent error code. +*/ +EXPORT_C void LbsPositioningStatusProps::InitializeMoPropertyL() + { + LBSLOG(ELogP1, "LbsPositioningStatusProps::InitializeMoPropertyL() Begin\n"); + LBSLOG(ELogP9, "->S LbsPositioningStatusProps::InitializeMoPropertyL() InitializeMoPropertyL \n"); + const TSecurityPolicy KPositioningStatusPolicy(ECapabilityReadDeviceData, ECapabilityLocation); + + // Define the NI Positioning Status property + TInt err = RProperty::Define(KLbsMoPositioningStatusKey, RProperty::EInt, KPositioningStatusPolicy, KPositioningStatusPolicy); + if (err != KErrNone && err != KErrAlreadyExists) + { + User::Leave(err); + } + if (err != KErrAlreadyExists) + { + // store the Uid of the process that defined the property + CRepository* rep = CRepository::NewLC(KLbsCenRepUid); + User::LeaveIfError(rep->Set(KMoPositioningStatusAPIKey, TInt(RProcess().SecureId()))); + CleanupStack::PopAndDestroy(rep); + } + + LBSLOG(ELogP1, "LbsPositioningStatusProps::InitializeMoPropertyL() End\n"); + } + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsLocCommon/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsLocCommon/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +// Copyright (c) 2005-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: +// + +PRJ_EXPORTS + +lbsloccommon.iby /epoc32/rom/include/lbsloccommon.iby + +../inc/LbsLocCommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsloccommon.h) +../inc/LbsLocClassTypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocclasstypes.h) + +PRJ_MMPFILES +LbsLocCommon.mmp + +PRJ_TESTMMPFILES + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsLocDataSource/test/prototype/LbsGpsConTest1/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsLocDataSource/test/prototype/LbsGpsConTest1/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ +// Copyright (c) 2005-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: +// Component description file +// +// + +PRJ_MMPFILES + + +PRJ_TESTMMPFILES +LbsGpsConTest1.mmp + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsLogging/te_LbsLogging/Runtime Settings.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsLogging/te_LbsLogging/Runtime Settings.xml Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,24 @@ + + + + + + + + +]> + + + Debugger Runtime + + MWRuntimeSettings_WorkingDirectory + MWRuntimeSettings_CommandLine\testdata\scripts\te_LbsLoggingSuite.script + MWRuntimeSettings_HostApplication + PathEPOC32\RELEASE\WINSCW\UDEB\testexecute.exe + PathFormatWindows + PathRootdrive E + + MWRuntimeSettings_EnvVars + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsNetInternalApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsNetInternalApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,28 @@ +// Copyright (c) 2005-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: +// + +// Main projects, in build order +PRJ_EXPORTS +./lbsnetinternalapi.iby /epoc32/rom/include/lbsnetinternalapi.iby + +PRJ_MMPFILES +lbsnetinternalapi.mmp + +PRJ_TESTEXPORTS + +PRJ_TESTMMPFILES + +#include "../test/group/bld.inf" + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsNetInternalApi/test/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsNetInternalApi/test/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// 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: +// + +#include "../te_lbsnetinternaltest/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsNetProtocol/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsNetProtocol/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,31 @@ +// 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: +// + +// Main projects, in build order +PRJ_EXPORTS +../inc/lbsnetclasstypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsnetclasstypes.h) +../inc/lbsnetcommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsnetcommon.h) +../inc/lbsnetprotocolbase.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsnetprotocolbase.h) + +lbsnetprotocol.iby /epoc32/rom/include/lbsnetprotocol.iby + + +PRJ_MMPFILES +lbsnetprotocol.mmp + +PRJ_TESTEXPORTS + +PRJ_TESTMMPFILES + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsNetRegStatusInt/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsNetRegStatusInt/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbsnetregstatusint.iby /epoc32/rom/include/lbsnetregstatusint.iby + +PRJ_MMPFILES +lbsnetregstatusint.mmp + +PRJ_TESTMMPFILES +#include "../test/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsNetRegStatusInt/test/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsNetRegStatusInt/test/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +#include "../te_lbsnetregstatusinttest/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsNgNlmInt/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsNgNlmInt/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbsngnlmint.iby /epoc32/rom/include/lbsngnlmint.iby + +PRJ_MMPFILES +lbsngnlmint.mmp + +PRJ_TESTMMPFILES + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsNrhNgMsgs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsNrhNgMsgs/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbsnrhngmsgs.iby /epoc32/rom/include/lbsnrhngmsgs.iby + +PRJ_MMPFILES +lbsnrhngmsgs.mmp + +PRJ_TESTMMPFILES + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsPartnerCommon/src/lbsdevlogger.cpp --- a/locationmgmt/locationcore/LbsPartnerCommon/src/lbsdevlogger.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationmgmt/locationcore/LbsPartnerCommon/src/lbsdevlogger.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsPsyNgMsgs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsPsyNgMsgs/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbspsyngmsgs.iby /epoc32/rom/include/lbspsyngmsgs.iby + +PRJ_MMPFILES +lbspsyngmsgs.mmp + +PRJ_TESTMMPFILES + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsRefFnpInt/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsRefFnpInt/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +PRJ_EXPORTS + +lbsreffnpint.iby /epoc32/rom/include/lbsreffnpint.iby + +PRJ_MMPFILES +lbsreffnpint.mmp + +PRJ_TESTMMPFILES + +#include "../test/group/bld.inf" + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/LbsRefFnpInt/test/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/LbsRefFnpInt/test/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +#include "../te_lbsreffnpinttest/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/conf/locationsettings.confml Binary file locationmgmt/locationcore/conf/locationsettings.confml has changed diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/conf/locationsettings_10282266.crml Binary file locationmgmt/locationcore/conf/locationsettings_10282266.crml has changed diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/bwins/lbspositioningstatusu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/bwins/lbspositioningstatusu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,7 @@ +EXPORTS + ?CurrentPositioningStatus@CLbsPositioningStatusImpl@@QAEKXZ @ 1 NONAME ; unsigned long CLbsPositioningStatusImpl::CurrentPositioningStatus(void) + ?NewL@CLbsPositioningStatusImpl@@SAPAV1@AAVMLbsPositioningStatusObserver@@@Z @ 2 NONAME ; class CLbsPositioningStatusImpl * CLbsPositioningStatusImpl::NewL(class MLbsPositioningStatusObserver &) + ?NewL@CLbsPositioningStatus@@SAPAV1@AAVMLbsPositioningStatusObserver@@@Z @ 3 NONAME ; class CLbsPositioningStatus * CLbsPositioningStatus::NewL(class MLbsPositioningStatusObserver &) + ?CurrentPositioningStatus@CLbsPositioningStatus@@QAEKXZ @ 4 NONAME ; unsigned long CLbsPositioningStatus::CurrentPositioningStatus(void) + ?Version@MLbsPositioningStatusObserver@@UBE?AVTVersion@@XZ @ 5 NONAME ; class TVersion MLbsPositioningStatusObserver::Version(void) const + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/eabi/lbspositioningstatusu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/eabi/lbspositioningstatusu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,11 @@ +EXPORTS + _ZN21CLbsPositioningStatus24CurrentPositioningStatusEv @ 1 NONAME + _ZN21CLbsPositioningStatus4NewLER29MLbsPositioningStatusObserver @ 2 NONAME + _ZN25CLbsPositioningStatusImpl24CurrentPositioningStatusEv @ 3 NONAME + _ZN25CLbsPositioningStatusImpl4NewLER29MLbsPositioningStatusObserver @ 4 NONAME + _ZNK29MLbsPositioningStatusObserver7VersionEv @ 5 NONAME + _ZTI28CLbsInternalPosStatusWatcher @ 6 NONAME + _ZTI29MLbsPositioningStatusObserver @ 7 NONAME + _ZTV28CLbsInternalPosStatusWatcher @ 8 NONAME + _ZTV29MLbsPositioningStatusObserver @ 9 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +// Copyright (c) 2010 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: +// bld.inf file for the Lbs Positioning Status component +// +// + +PRJ_EXPORTS +../inc/lbspositioningstatus.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbspositioningstatus.h) +lbspositioningstatus.iby /epoc32/rom/include/lbspositioningstatus.iby + +PRJ_MMPFILES +lbspositioningstatus.mmp + +#include "../test/te_lbspositioningstatus/group/bld.inf" + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/group/lbspositioningstatus.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/group/lbspositioningstatus.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +// Copyright (c) 2010 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: +// + +#ifndef __LBS_POSITIONING_STATUS_IBY__ +#define __LBS_POSITIONING_STATUS_IBY__ + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) + +file=ABI_DIR\DEBUG_DIR\lbspositioningstatus.dll System\libs\lbspositioningstatus.dll + +#endif // SYMBIAN_EXCLUDE_LOCATION + +#endif // __LBS_POSITIONING_STATUS_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/group/lbspositioningstatus.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/group/lbspositioningstatus.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,40 @@ +// Copyright (c) 2010 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: +// + +TARGET lbspositioningstatus.dll +TARGETTYPE dll +UID 0x1000008d 0x1028720E +CAPABILITY ALL -Tcb +MACRO ENABLE_LBS_DEV_LOGGER + +USERINCLUDE ../inc +USERINCLUDE ../../lbsrootapi/inc +USERINCLUDE ../../LbsInternalApi/inc +USERINCLUDE ../../lbsroot/inc +USERINCLUDE ../../LbsPartnerCommon/inc + +// system include paths +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +SOURCEPATH ../src +SOURCE lbspositioningstatus.cpp +SOURCE lbspositioningstatusimpl.cpp +SOURCE lbsinternalposstatuswatcher.cpp + + +LIBRARY euser.lib centralrepository.lib lbspartnercommon.lib + + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/inc/lbsinternalposstatuswatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/inc/lbsinternalposstatuswatcher.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,90 @@ +/** +* Copyright (c) 2010 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: +* +*/ + + +/** + @file cmopositioningstatuswatcher.h + @internalTechnology +*/ +#ifndef MO_POSITIONING_STATUS_LISTENER_H_ +#define MO_POSITIONING_STATUS_LISTENER_H_ + +#include +#include + +/** A type for the internal positioning status updates */ +typedef TUint32 TLbsPositioningStatusType; + +/** The response to a privacy request. + +Note that the _TLbsPositioningStatusType enum may be extended in the future +by adding more enumerated values. To maintain compatibility any unrecognized +values must be handled as ELbsPositioningStatusUnknown. +*/ +enum _TLbsPositioningStatusType + { + /** Not used/unknown */ + ELbsPositioningStatusUnknown = 0, + /** Used to indicate Mobile Originated positioning status. */ + ELbsPositioningStatusMO = 1, + /** Used to indicate Network Initiated positioning status. */ + ELbsPositioningStatusNI = 2 + }; + + +class MLbsInternalPosStatusObserver + { +public: + + /** Send Positioning Status to the Observer. + Called whenever a change to the devices positioning status occurs. + @param aType The positioning status type being reported + @param aStatus The current positioning status + */ + virtual void OnInternalStatusUpdate(const TLbsPositioningStatusType& aType, const TInt& aStatus) = 0; + }; + + +class CLbsInternalPosStatusWatcher : public CActive + { +public: + static CLbsInternalPosStatusWatcher* NewL(const TLbsPositioningStatusType& aType, MLbsInternalPosStatusObserver& aObserver); + ~CLbsInternalPosStatusWatcher(); + +private: + // Constructors + void ConstructL(); + CLbsInternalPosStatusWatcher(const TLbsPositioningStatusType& aType, MLbsInternalPosStatusObserver& aObserver); + + // CActive + void RunL(); + void DoCancel(); + TInt RunError(TInt aError); + +private: + // Observer + MLbsInternalPosStatusObserver& iObserver; + + // the positioning status type watched. + TLbsPositioningStatusType iType; + + // handle to the P&S property being watched + RProperty iProperty; + }; + + +#endif // MO_POSITIONING_STATUS_LISTENER_H_ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/inc/lbspositioningstatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/inc/lbspositioningstatus.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,90 @@ +// Copyright (c) 2010 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: +// + +/** + @file + @publishedPartner + */ + +#ifndef POSITIONING_STATUS_H +#define POSITIONING_STATUS_H + +#include + +class CLbsPositioningStatusImpl; +class MLbsPositioningStatusObserver; + +/** +Positioning Status Library's API. + +This class provides an API by which an observer can register for notifications +regarding the current status of LBS, i.e. if one or more positioning sessions +are currently in progress or otherwise. + +@see MLbsPositioningStatusObserver +@capability Location +*/ +NONSHARABLE_CLASS(CLbsPositioningStatus) : public CBase + { +public: + /** Positioning Status define */ + typedef TUint32 TLbsPositioningStatus; + + /** Positioning Status enumeration + * Note that this enumeration may be extended by future updates */ + enum _TLbsPositioningStatus + { + ELbsPositioningStatusNotActive = 0, + ELbsPositioningStatusActive = 1 + }; + +public: + IMPORT_C static CLbsPositioningStatus* NewL(MLbsPositioningStatusObserver& aObserver); + virtual ~CLbsPositioningStatus(); + +public: + /** Returns the current positioning status */ + IMPORT_C TLbsPositioningStatus CurrentPositioningStatus(); + +private: + CLbsPositioningStatus(); + void ConstructL(MLbsPositioningStatusObserver& aObserver); + +private: + /** Handle to the internal implementation */ + CLbsPositioningStatusImpl* iImpl; + }; + + +/** Positioning Status observer definition. +This interface is implemented by observers to handle calls from +the Positioning Status manager. + +@see CLbsPositioningStatus +*/ +class MLbsPositioningStatusObserver + { +public: + IMPORT_C virtual TVersion Version() const; + + /** Send Positioning Status to the Observer. + Called whenever a change to the devices positioning status occurs. + @param aPositioningStatus The current positioning status + */ + virtual void OnPositioningStatusUpdate(const CLbsPositioningStatus::TLbsPositioningStatus& aPositioningStatus) = 0; + }; + + +#endif // POSITIONING_STATUS_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/inc/lbspositioningstatusimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/inc/lbspositioningstatusimpl.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,77 @@ +// Copyright (c) 2010 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: +// + +/** + @file + @internalTechnology +*/ + +#ifndef POSITIONING_STATUS_IMPL_H +#define POSITIONING_STATUS_IMPL_H + +#include +#include "lbspositioningstatus.h" +#include "lbsinternalposstatuswatcher.h" + +/** +The class provides an internal implementation of the functionality exposed +by the CLbsPositioningStatus interface. + +@see CLbsPositioningStatus +@see MLbsInternalPosStatusObserver + +@internalComponent +@prototype +*/ +NONSHARABLE_CLASS(CLbsPositioningStatusImpl) : public CBase, + public MLbsInternalPosStatusObserver + { +public: + IMPORT_C static CLbsPositioningStatusImpl* NewL(MLbsPositioningStatusObserver& aObserver); + virtual ~CLbsPositioningStatusImpl(); + +public: + /** Returns the current positioning status */ + IMPORT_C CLbsPositioningStatus::TLbsPositioningStatus CurrentPositioningStatus(); + +private: + CLbsPositioningStatusImpl(MLbsPositioningStatusObserver& aObserver); + void ConstructL(); + + /** from MLbsInternalPosStatusObserver */ + void OnInternalStatusUpdate(const TLbsPositioningStatusType& aType, const TInt& aCount); + + /** Returns the combined MO/NI positioning status */ + CLbsPositioningStatus::TLbsPositioningStatus CombinedStatus(); + +private: + /** Prohibit copy constructor */ + CLbsPositioningStatusImpl(const CLbsPositioningStatusImpl&); + /** Prohibit assigment operator */ + CLbsPositioningStatusImpl& operator= (const CLbsPositioningStatusImpl&); + +private: + /** Consumer for positioning status updates, SysApp */ + MLbsPositioningStatusObserver& iObserver; + + TUint iLastKnownMoStatus; + TUint iLastKnownNiStatus; + + /** P&S API Watchers */ + CLbsInternalPosStatusWatcher* iMoWatcher; + CLbsInternalPosStatusWatcher* iNiWatcher; + }; + +#endif // POSITIONING_STATUS_IMPL_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/src/lbsinternalposstatuswatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/src/lbsinternalposstatuswatcher.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,118 @@ +/** +* Copyright (c) 2010 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: +* +*/ + +#include +#include + +#include "lbsrootcenrepdefs.h" +#include "lbsinternalposstatuswatcher.h" +#include "lbspositioningstatusprops.h" + + + +CLbsInternalPosStatusWatcher* CLbsInternalPosStatusWatcher::NewL(const TLbsPositioningStatusType& aType, MLbsInternalPosStatusObserver& aObserver) + { + CLbsInternalPosStatusWatcher* me=new(ELeave) CLbsInternalPosStatusWatcher(aType, aObserver); + CleanupStack::PushL(me); + me->ConstructL(); + CleanupStack::Pop(me); + return me; + } + +CLbsInternalPosStatusWatcher::~CLbsInternalPosStatusWatcher() + { + Cancel(); + iProperty.Close(); + } + +CLbsInternalPosStatusWatcher::CLbsInternalPosStatusWatcher(const TLbsPositioningStatusType& aType, MLbsInternalPosStatusObserver& aObserver) + : CActive(EPriorityStandard), iObserver(aObserver), iType(aType) + { + } + +/** +The 2nd phase constructor. Attaches to the property, completes the async +request to cause the RunL method to be called for the first time and check +if there has already been an update to the property. + +@leave If a error happens, it leaves with one of the system error codes. +*/ +void CLbsInternalPosStatusWatcher::ConstructL() + { + // Get the CategoryUid from the cenrep file owned by LbsRoot. + TInt category; + CRepository* rep = CRepository::NewLC(KLbsCenRepUid); + + // attach to the property + if (iType == ELbsPositioningStatusMO) + { + // Mobile Originated Status P&S Property + User::LeaveIfError(rep->Get(KMoPositioningStatusAPIKey, category)); + TSecureId propOwnerSecureId(category); + User::LeaveIfError(iProperty.Attach(propOwnerSecureId, KLbsMoPositioningStatusKey, EOwnerThread)); + } + else if (iType == ELbsPositioningStatusNI) + { + // Network Initiated Status P&S Property + User::LeaveIfError(rep->Get(KNiPositioningStatusAPIKey, category)); + TSecureId propOwnerSecureId(category); + User::LeaveIfError(iProperty.Attach(propOwnerSecureId, KLbsNiPositioningStatusKey, EOwnerThread)); + } + else + { + // Any other value indicates a programming error + User::Leave(KErrArgument); + } + + CleanupStack::PopAndDestroy(rep); + + CActiveScheduler::Add(this); + // initial subscription and process current property value + RunL(); + } + +void CLbsInternalPosStatusWatcher::RunL() + { + // resubscribe before processing new value to prevent missing updates + iProperty.Subscribe(iStatus); + SetActive(); + + TInt newStatus; + // property updated, get new value + if (iProperty.Get(newStatus)==KErrNotFound) + { + // property deleted, there's no sessions of this type! + iObserver.OnInternalStatusUpdate(iType, 0); + } + else + { + // inform the positioning status observer + iObserver.OnInternalStatusUpdate(iType, newStatus); + } + } + +void CLbsInternalPosStatusWatcher::DoCancel() + { + iProperty.Cancel(); + } + +TInt CLbsInternalPosStatusWatcher::RunError(TInt aError) + { + // TODO: Handle RunL leaving... + return aError; + } + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/src/lbspositioningstatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/src/lbspositioningstatus.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,80 @@ +// Copyright (c) 2010 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: +// + +#include "lbspositioningstatus.h" +#include "lbspositioningstatusimpl.h" +#include "lbsdevloggermacros.h" + + + +//============================================================================= +// MLbsPositioningStatusObserver +//============================================================================= +/** +Provides the version of the observer interface. This can be used by the library +to determine the functionality supported by the client application. + +@return Version of the observer interface. +*/ +EXPORT_C TVersion MLbsPositioningStatusObserver::Version() const + { + LBSLOG(ELogP1, "MLbsPositioningStatusObserver::Version() Begin\n"); + LBSLOG(ELogP1, "MLbsPositioningStatusObserver::Version() End\n"); + return TVersion(1, 0, 0); + } + +EXPORT_C CLbsPositioningStatus* CLbsPositioningStatus::NewL(MLbsPositioningStatusObserver& aObserver) + { + LBSLOG(ELogP1, "CLbsPositioningStatus::NewL() Begin\n"); + LBSLOG(ELogP8, "->S CLbsPositioningStatus::NewL() CLbsPositioningStatus\n"); + CLbsPositioningStatus* me = new (ELeave) CLbsPositioningStatus(); + CleanupStack::PushL(me); + me->ConstructL(aObserver); + LBSLOG(ELogP1, "CLbsPositioningStatus::NewL() End\n"); + CleanupStack::Pop(me); + return me; + } + +CLbsPositioningStatus::~CLbsPositioningStatus() + { + LBSLOG(ELogP1, "CLbsPositioningStatus::~CLbsPositioningStatus() Begin\n"); + LBSLOG(ELogP8, "->S CLbsPositioningStatus::~CLbsPositioningStatus() CLbsPositioningStatus\n"); + delete iImpl; + iImpl = NULL; + LBSLOG(ELogP1, "CLbsPositioningStatus::~CLbsPositioningStatus() End\n"); + } + +CLbsPositioningStatus::CLbsPositioningStatus() + { + LBSLOG(ELogP1, "CLbsPositioningStatus::CLbsPositioningStatus() Begin\n"); + LBSLOG(ELogP1, "CLbsPositioningStatus::CLbsPositioningStatus() End\n"); + } + +void CLbsPositioningStatus::ConstructL(MLbsPositioningStatusObserver& aObserver) + { + LBSLOG(ELogP1, "CLbsPositioningStatus::ConstructL() Begin\n"); + iImpl = CLbsPositioningStatusImpl::NewL(aObserver); + LBSLOG(ELogP1, "CLbsPositioningStatus::ConstructL() End\n"); + } + + +EXPORT_C CLbsPositioningStatus::TLbsPositioningStatus CLbsPositioningStatus::CurrentPositioningStatus() + { + LBSLOG(ELogP1, "CLbsPositioningStatus::CurrentPositioningStatus() Begin\n"); + LBSLOG(ELogP1, "CLbsPositioningStatus::CurrentPositioningStatus() Begin\n"); + return iImpl->CurrentPositioningStatus(); + } + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/src/lbspositioningstatusimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/src/lbspositioningstatusimpl.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,108 @@ +// Copyright (c) 2010 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: +// + +#include "lbspositioningstatusimpl.h" +#include "lbsdevloggermacros.h" + +EXPORT_C CLbsPositioningStatusImpl* CLbsPositioningStatusImpl::NewL(MLbsPositioningStatusObserver& aObserver) + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::NewL() Begin\n"); + LBSLOG(ELogP8, "->S CLbsPositioningStatusImpl::NewL() CLbsPositioningStatusImpl\n"); + CLbsPositioningStatusImpl* me = new (ELeave) CLbsPositioningStatusImpl(aObserver); + CleanupStack::PushL(me); + me->ConstructL(); + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::NewL() End\n"); + CleanupStack::Pop(me); + return me; + } + +CLbsPositioningStatusImpl::~CLbsPositioningStatusImpl() + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::~CLbsPositioningStatusImpl() Begin\n"); + LBSLOG(ELogP8, "->S CLbsPositioningStatusImpl::~CLbsPositioningStatusImpl() CLbsPositioningStatus\n"); + delete iMoWatcher; + delete iNiWatcher; + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::~CLbsPositioningStatusImpl() End\n"); + } + +CLbsPositioningStatusImpl::CLbsPositioningStatusImpl(MLbsPositioningStatusObserver& aObserver) + : iObserver(aObserver) + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::CLbsPositioningStatusImpl() Begin\n"); + iLastKnownMoStatus = CLbsPositioningStatus::ELbsPositioningStatusNotActive; + iLastKnownNiStatus = CLbsPositioningStatus::ELbsPositioningStatusNotActive; + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::CLbsPositioningStatusImpl() End\n"); + } + +void CLbsPositioningStatusImpl::ConstructL() + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::ConstructL() Begin\n"); + iMoWatcher = CLbsInternalPosStatusWatcher::NewL(ELbsPositioningStatusMO, *this); + iNiWatcher = CLbsInternalPosStatusWatcher::NewL(ELbsPositioningStatusNI, *this); + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::ConstructL() End\n"); + } + + +EXPORT_C CLbsPositioningStatus::TLbsPositioningStatus CLbsPositioningStatusImpl::CurrentPositioningStatus() + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::CurrentPositioningStatus() Begin\n"); + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::CurrentPositioningStatus() End\n"); + return CombinedStatus(); + } + +/** from MLbsInternalPosStatusObserver + * + * @param aType mobile or network originated positioning status + * @param aCount count current service requests of the type being reported + * */ +void CLbsPositioningStatusImpl::OnInternalStatusUpdate(const TLbsPositioningStatusType& aType, const TInt& aCount) + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::OnInternalStatusUpdate() Begin\n"); + CLbsPositioningStatus::TLbsPositioningStatus previous = CombinedStatus(); + + // update the appropriate status + if (aType==ELbsPositioningStatusMO) + { + iLastKnownMoStatus = aCount; + } + else + { + iLastKnownNiStatus = aCount; + } + + // update the observer if the combined status has changed. + if (previous != CombinedStatus()) + { + iObserver.OnPositioningStatusUpdate(CombinedStatus()); + } + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::OnInternalStatusUpdate() End\n"); + } + + +CLbsPositioningStatus::TLbsPositioningStatus CLbsPositioningStatusImpl::CombinedStatus() + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::CombinedStatus() Begin\n"); + if (iLastKnownMoStatus + iLastKnownNiStatus != 0) + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::CombinedStatus() Active End\n"); + return CLbsPositioningStatus::ELbsPositioningStatusActive; + } + else + { + LBSLOG(ELogP1, "CLbsPositioningStatusImpl::CombinedStatus() NOT Active End\n"); + return CLbsPositioningStatus::ELbsPositioningStatusNotActive; + } + } + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,20 @@ +// Copyright (c) 2010 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: +// + +PRJ_TESTEXPORTS +../scripts/te_lbspositioningstatus.script c:/testdata/scripts/te_lbspositioningstatus.script + +PRJ_TESTMMPFILES +te_lbspositioningstatus.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/group/te_lbspositioningstatus.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/group/te_lbspositioningstatus.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,47 @@ +// 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: +// + + +TARGET te_lbspositioningstatusserver.exe +TARGETTYPE exe +UID 0x1000007A 0x102869EE +CAPABILITY ALL -TCB + +//Please add any change under here +SOURCEPATH ../src +SOURCE te_lbspositioningstatusserver.cpp +SOURCE te_lbspositioningstatusstep.cpp +SOURCE te_lbsstatustestmanager.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../lbsroot/inc +USERINCLUDE ../../../../lbsrootapi/inc +USERINCLUDE ../../../../LbsInternalApi/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY lbspositioningstatus.lib +LIBRARY bafl.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY centralrepository.lib +LIBRARY lbsinternalapi.lib + +LIBRARY testexecuteutils.lib +LIBRARY testexecutelogclient.lib + + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/inc/te_lbspositioningstatusserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/inc/te_lbspositioningstatusserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,41 @@ +/** +* Copyright (c) 2010 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: +* +*/ + + + +/** + @file te_lbspositioningstatusserver.h +*/ + +#ifndef TE_LBSPOSITIONINGSTATUSSERVER_H +#define TE_LBSPOSITIONINGSTATUSSERVER_H + +#include + + +class CTe_LbsPositioningStatusServer : public CTestServer + { +public: + static CTe_LbsPositioningStatusServer* NewL(); + // Base class pure virtual override + virtual CTestStep* CreateTestStep(const TDesC& aStepName); + +// Please Add/modify your class members +private: + }; + +#endif // TE_LBSPOSITIONINGSTATUSSERVER_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/inc/te_lbspositioningstatusstep.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/inc/te_lbspositioningstatusstep.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,46 @@ +/** +* Copyright (c) 2010 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: +* +*/ + +/** + @file te_lbspositioningstatusstepbase.h +*/ + +#ifndef TE_LBSPOSITIONINGSTATUSSTEPBASE_H +#define TE_LBSPOSITIONINGSTATUSSTEPBASE_H + +#include + +_LIT(KStatusStep,"StatusStep"); + +class CTe_LbsStatusTestManager; + +class CTe_LbsPositioningStatusStep : public CTestStep + { +public: + virtual ~CTe_LbsPositioningStatusStep(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepPostambleL(); + virtual TVerdict doTestStepL(); + + CTe_LbsPositioningStatusStep(); + +protected: + CTe_LbsStatusTestManager* iTestManager; + CActiveScheduler* iSched; + }; + +#endif // TE_LBSPOSITIONINGSTATUSSTEPBASE_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/inc/te_lbsstatustestmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/inc/te_lbsstatustestmanager.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,77 @@ +/** +* Copyright (c) 2010 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: +* +*/ + +/** + @file te_lbsstatusstep.h +*/ + +#ifndef TE_LBSSTATUSSTEP_H +#define TE_LBSSTATUSSTEP_H + +#include +#include + +class CTe_LbsPositioningStatusStep; +class CLbsPositioningStatus; + +class CTe_LbsStatusTestManager : public CActive, public MLbsPositioningStatusObserver + { +private: + enum TTestStep + { + EStepInitial, + EStepFirstRequest, + EStepSecondRequest, + EStepThirdRequest, + EStepFourthRequest, + EStepFifthRequest, + EStepStop + }; +public: + static CTe_LbsStatusTestManager* NewL(CTe_LbsPositioningStatusStep& aTest); + ~CTe_LbsStatusTestManager(); + + void StartTest(); + +private: // from MLbsPositioningStatusObserver + void OnPositioningStatusUpdate(const CLbsPositioningStatus::TLbsPositioningStatus& aPositioningStatus); + +private: + CTe_LbsStatusTestManager(CTe_LbsPositioningStatusStep& aTest); + void ConstructL(); + void RunL(); + TInt RunError(TInt aError); + void DoCancel(); + void CompleteSelf(); + +private: + CTe_LbsPositioningStatusStep& iTest; + TTestStep iStep; + + CLbsPositioningStatus* iPositioningStatus; + RTimer iTimer; + TUid iMoPosStatusCategory; + TUid iNiPosStatusCategory; + + TBool iPosStatusUpdateReceived; + CLbsPositioningStatus::TLbsPositioningStatus iReceivedPosStatus; + TBool iUpdateExpected; + TBool iTestFailed; + + }; + +#endif // TE_LBSSTATUSSTEP_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/scripts/te_lbspositioningstatus.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/scripts/te_lbspositioningstatus.script Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,41 @@ +// +// 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: +// +//! @File +//! @SYMTestSuiteName LBS-POSITIONING-STATUS +//! @SYMScriptTestEnvironment TEF + +PRINT Run all te_lbspositioningstatusserver Suite Tests +LOAD_SUITE te_lbspositioningstatusserver + + +START_TESTCASE LBS-POSITIONING-STATUS-1001 +//! @SYMTestCaseID LBS-POSITIONING-STATUS-1001 +//! @SYMTestCaseDesc Checking that the positioining status component works correctly +//! @SYMTestPriority Low +//! @SYMTestActions 1. Change the MO-LR flag to be 1 +//! 2. Change the NI flag to be 1 +//! 2. Change the MO-LR and NI flags to be 0 +//! 2. Change the NI flag to be 1 +//! 2. Change the NI flag to be 2 +//! 2. Change the NI flag to be 0 +//! @SYMTestExpectedResults The client of the API gets notified correctly when there is a change in the positioning status +//! @SYMTestType UT +//! @SYMCreationDate 24/3/2010 +//! @SYMAuthor SorinBasca +//! @SYMTestStatus 3. Released +RUN_TEST_STEP 30 te_lbspositioningstatusserver StatusStep +END_TESTCASE LBS-POSITIONING-STATUS-1001 + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/src/te_lbspositioningstatusserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/src/te_lbspositioningstatusserver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,112 @@ +// 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: +// +// + +/** + @file te_lbspositioningstatusserver.cpp + @internalComponent +*/ + +#include "te_lbspositioningstatusserver.h" +#include "te_lbspositioningstatusstep.h" + +_LIT(KServerName,"te_lbspositioningstatusserver"); + + +CTe_LbsPositioningStatusServer* CTe_LbsPositioningStatusServer::NewL() +/** + * @return - Instance of the test server + * Same code for Secure and non-secure variants + * Called inside the MainL() function to create and start the + * CTestServer derived server. + */ + { + CTe_LbsPositioningStatusServer * server = new (ELeave) CTe_LbsPositioningStatusServer(); + CleanupStack::PushL(server); + + server->ConstructL(KServerName); + CleanupStack::Pop(server); + return server; + } + + +// Secure variants much simpler +// For EKA2, just an E32Main and a MainL() +LOCAL_C void MainL() +/** + * Secure variant + * Much simpler, uses the new Rendezvous() call to sync with the client + */ + { + // Leave the hooks in for platform security +#if (defined __DATA_CAGING__) + RProcess().DataCaging(RProcess::EDataCagingOn); + RProcess().DataCaging(RProcess::ESecureApiOn); +#endif + CActiveScheduler* sched=NULL; + sched=new(ELeave) CActiveScheduler; + CActiveScheduler::Install(sched); + CTe_LbsPositioningStatusServer* server = NULL; + // Create the CTestServer derived server + TRAPD(err,server = CTe_LbsPositioningStatusServer::NewL()); + if(!err) + { + // Sync with the client and enter the active scheduler + RProcess::Rendezvous(KErrNone); + sched->Start(); + } + delete server; + delete sched; + } + + + +GLDEF_C TInt E32Main() +/** + * @return - Standard Epoc error code on process exit + * Secure variant only + * Process entry point. Called by client using RProcess API + */ + { + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + if(cleanup == NULL) + { + return KErrNoMemory; + } + TRAPD(err,MainL()); + delete cleanup; + __UHEAP_MARKEND; + return err; + } + + +CTestStep* CTe_LbsPositioningStatusServer::CreateTestStep(const TDesC& aStepName) +/** + * @return - A CTestStep derived instance + * Secure and non-secure variants + * Implementation of CTestServer pure virtual + */ + { + CTestStep* testStep = NULL; + if(aStepName == KStatusStep) + { + testStep = new CTe_LbsPositioningStatusStep(); + } + + return testStep; + } +//end of file + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/src/te_lbspositioningstatusstep.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/src/te_lbspositioningstatusstep.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,78 @@ +// Copyright (c) 2010 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: +// + +/** + @file te_lbspositioningstatusstepbase.cpp +*/ + +#include "te_lbspositioningstatusstep.h" +#include "te_lbsstatustestmanager.h" +#include "lbspositioningstatusprops.h" // from internal API + + +TVerdict CTe_LbsPositioningStatusStep::doTestStepPreambleL() + { + + INFO_PRINTF1(_L("CTe_LbsPositioningStatusStep::doTestStepPreambleL()")); + __UHEAP_MARK; + iSched=new(ELeave) CActiveScheduler; + CActiveScheduler::Install(iSched); + + LbsPositioningStatusProps::InitializeNiPropertyL(); + LbsPositioningStatusProps::InitializeMoPropertyL(); + + iTestManager = CTe_LbsStatusTestManager::NewL(*this); + SetTestStepResult(EPass); + return TestStepResult(); + } + +TVerdict CTe_LbsPositioningStatusStep::doTestStepPostambleL() + { + INFO_PRINTF1(_L("CTe_LbsPositioningStatusStep::doTestStepPostambleL()")); + iTestManager->Cancel(); + delete iTestManager; + iTestManager = NULL; + delete iSched; + iSched = NULL; + __UHEAP_MARKEND; + return TestStepResult(); + } + +TVerdict CTe_LbsPositioningStatusStep::doTestStepL() + { + INFO_PRINTF1(_L("CTe_LbsPositioningStatusStep::doTestStepL()")); + iTestManager->StartTest(); + return TestStepResult(); + } + +CTe_LbsPositioningStatusStep::CTe_LbsPositioningStatusStep() + { + SetTestStepName(KStatusStep); + } + +CTe_LbsPositioningStatusStep::~CTe_LbsPositioningStatusStep() + { + if(iTestManager) + { + iTestManager->Cancel(); + } + delete iTestManager; + delete iSched; + } + + +// end of file + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/src/te_lbsstatustestmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbspositioningstatus/test/te_lbspositioningstatus/src/te_lbsstatustestmanager.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,254 @@ +// 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: +// + +/** + @file te_lbsstatusstep.cpp + @internalComponent +*/ + +#include "te_lbsstatustestmanager.h" +#include "te_lbspositioningstatusstep.h" +#include "lbsrootcenrepdefs.h" +#include "lbspositioningstatusprops.h" +#include +#include +#include + +const TTimeIntervalMicroSeconds32 KTimerInterval = 2*1000*1000; + +CTe_LbsStatusTestManager* CTe_LbsStatusTestManager::NewL(CTe_LbsPositioningStatusStep& aTest) + { + CTe_LbsStatusTestManager* self = new(ELeave) CTe_LbsStatusTestManager(aTest); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +CTe_LbsStatusTestManager::~CTe_LbsStatusTestManager() + { + delete iPositioningStatus; + iTimer.Cancel(); + iTimer.Close(); + } + +void CTe_LbsStatusTestManager::StartTest() + { + iUpdateExpected = EFalse; + CompleteSelf(); + CActiveScheduler::Start(); + } + +CTe_LbsStatusTestManager::CTe_LbsStatusTestManager(CTe_LbsPositioningStatusStep& aTest) + : CActive(EPriorityStandard), iTest(aTest), iStep(EStepInitial) + { + CActiveScheduler::Add(this); + } + +void CTe_LbsStatusTestManager::ConstructL() + { + iPositioningStatus = CLbsPositioningStatus::NewL(*this); + CRepository* rep = CRepository::NewLC(KLbsCenRepUid); + TInt posStatusCat; + User::LeaveIfError(rep->Get(KMoPositioningStatusAPIKey, posStatusCat)); + iMoPosStatusCategory = TUid::Uid(posStatusCat); + User::LeaveIfError(rep->Get(KNiPositioningStatusAPIKey, posStatusCat)); + iNiPosStatusCategory = TUid::Uid(posStatusCat); + CleanupStack::PopAndDestroy(rep); + iTimer.CreateLocal(); + } + +void CTe_LbsStatusTestManager::RunL() + { + iTest.TESTL(!iTestFailed); + switch(iStep) + { + case EStepInitial: + { + // checks that the current status is not active + iTest.INFO_PRINTF1(_L("Checking that initial status is not active")); + iTest.TESTL(CLbsPositioningStatus::ELbsPositioningStatusNotActive == iPositioningStatus->CurrentPositioningStatus()); + // sets the MO-LR property to 1... + iTest.INFO_PRINTF1(_L("Setting the MO-LR property to 1 (expect update)")); + iTest.TESTL(KErrNone == RProperty::Set(iMoPosStatusCategory, KLbsMoPositioningStatusKey, 1)); + iStep = EStepFirstRequest; + iUpdateExpected = ETrue; + iPosStatusUpdateReceived = EFalse; + iTimer.After(iStatus, KTimerInterval); + SetActive(); + break; + } + case EStepFirstRequest: + { + // ...and expects to be notified with status active + iTest.INFO_PRINTF1(_L("Checking that status now active")); + iTest.TESTL(iPosStatusUpdateReceived); + iTest.TESTL(iReceivedPosStatus == CLbsPositioningStatus::ELbsPositioningStatusActive); + iTest.TESTL(CLbsPositioningStatus::ELbsPositioningStatusActive == iPositioningStatus->CurrentPositioningStatus()); + // sets the NI property to 1 as well (so now both are 1)... + iTest.INFO_PRINTF1(_L("Setting the NI property to be 1 (don't expect update)")); + iTest.TESTL(KErrNone == RProperty::Set(iNiPosStatusCategory, KLbsNiPositioningStatusKey, 1)); + iStep = EStepSecondRequest; + iUpdateExpected = EFalse; + iPosStatusUpdateReceived = EFalse; + iTimer.After(iStatus, KTimerInterval); + SetActive(); + break; + } + case EStepSecondRequest: + { + // ...and expects not to be notified and status should be active + iTest.INFO_PRINTF1(_L("Checking that the update wasn't received and that the status is active")); + iTest.TESTL(!iPosStatusUpdateReceived); + iTest.TESTL(CLbsPositioningStatus::ELbsPositioningStatusActive == iPositioningStatus->CurrentPositioningStatus()); + // sets both the MO-LR and the NI properties to 0... + iTest.INFO_PRINTF1(_L("Setting both MO-LR and NI properties to 0 (expect update)")); + iTest.TESTL(KErrNone == RProperty::Set(iMoPosStatusCategory, KLbsMoPositioningStatusKey, 0)); + iTest.TESTL(KErrNone == RProperty::Set(iNiPosStatusCategory, KLbsNiPositioningStatusKey, 0)); + iStep = EStepThirdRequest; + iUpdateExpected = ETrue; + iPosStatusUpdateReceived = EFalse; + iTimer.After(iStatus, KTimerInterval); + SetActive(); + break; + } + case EStepThirdRequest: + { + // ...and expects to be notified with status not active + iTest.INFO_PRINTF1(_L("Checking update was received and status is not active")); + iTest.TESTL(iPosStatusUpdateReceived); + iTest.TESTL(iReceivedPosStatus == CLbsPositioningStatus::ELbsPositioningStatusNotActive); + iTest.TESTL(CLbsPositioningStatus::ELbsPositioningStatusNotActive == iPositioningStatus->CurrentPositioningStatus()); + // sets the NI property to 1... + iTest.INFO_PRINTF1(_L("Setting NI property to 1 (expect update)")); + iTest.TESTL(KErrNone == RProperty::Set(iNiPosStatusCategory, KLbsNiPositioningStatusKey, 1)); + iStep = EStepFourthRequest; + iUpdateExpected = ETrue; + iPosStatusUpdateReceived = EFalse; + iTimer.After(iStatus, KTimerInterval); + SetActive(); + break; + } + case EStepFourthRequest: + { + // ...and expects to be notified with status active + iTest.INFO_PRINTF1(_L("Checking update was received and status is now active")); + iTest.TESTL(iPosStatusUpdateReceived); + iTest.TESTL(iReceivedPosStatus == CLbsPositioningStatus::ELbsPositioningStatusActive); + iTest.TESTL(CLbsPositioningStatus::ELbsPositioningStatusActive == iPositioningStatus->CurrentPositioningStatus()); + // sets the NI property to 2... + iTest.INFO_PRINTF1(_L("Setting NI property to 2 (don't expect update)")); + iTest.TESTL(KErrNone == RProperty::Set(iNiPosStatusCategory, KLbsNiPositioningStatusKey, 2)); + iStep = EStepFifthRequest; + iUpdateExpected = EFalse; + iPosStatusUpdateReceived = EFalse; + iTimer.After(iStatus, KTimerInterval); + SetActive(); + break; + } + case EStepFifthRequest: + { + // ...and expects no update and status to be active + iTest.INFO_PRINTF1(_L("Checking no update was received and status is still active")); + iTest.TESTL(!iPosStatusUpdateReceived); + iTest.TESTL(CLbsPositioningStatus::ELbsPositioningStatusActive == iPositioningStatus->CurrentPositioningStatus()); + // sets the NI property to 0... + iTest.INFO_PRINTF1(_L("Setting the NI property to 0 (expect update)")); + iTest.TESTL(KErrNone == RProperty::Set(iNiPosStatusCategory, KLbsNiPositioningStatusKey, 0)); + iStep = EStepStop; + iUpdateExpected = ETrue; + iPosStatusUpdateReceived = EFalse; + iTimer.After(iStatus, KTimerInterval); + SetActive(); + break; + } + case EStepStop: + { + // ...and expects to be notified with status not active + iTest.INFO_PRINTF1(_L("Checking that an update was received and the status is now not active")); + iTest.TESTL(iPosStatusUpdateReceived); + iTest.TESTL(iReceivedPosStatus == CLbsPositioningStatus::ELbsPositioningStatusNotActive); + iTest.TESTL(CLbsPositioningStatus::ELbsPositioningStatusNotActive == iPositioningStatus->CurrentPositioningStatus()); + CActiveScheduler::Stop(); + break; + } + default: + { + iTest.INFO_PRINTF1(_L("Unexpected step setting")); + iTest.TESTL(EFalse); + } + } + } + +void CTe_LbsStatusTestManager::OnPositioningStatusUpdate(const CLbsPositioningStatus::TLbsPositioningStatus& aPositioningStatus) + { + Cancel(); + iTest.INFO_PRINTF1(_L("Received a status update")); + if(!iUpdateExpected) + { + iTest.INFO_PRINTF1(_L("It was an unexpected update, test failed")); + iTestFailed = ETrue; + } + else + { + switch(iStep) + { + case EStepInitial: + case EStepFirstRequest: + case EStepThirdRequest: + case EStepFourthRequest: + case EStepStop: + { + iPosStatusUpdateReceived = ETrue; + iReceivedPosStatus = aPositioningStatus; + break; + } + case EStepSecondRequest: + case EStepFifthRequest: + default: + { + iTest.INFO_PRINTF1(_L("Update received when in the wrong test step")); + iTestFailed = ETrue; + } + } + + } + iUpdateExpected = EFalse; + CompleteSelf(); + } + +TInt CTe_LbsStatusTestManager::RunError(TInt /*aError*/) + { + iTest.INFO_PRINTF1(_L("Test failed, stopping")); + CActiveScheduler::Stop(); + return KErrNone; + } + +void CTe_LbsStatusTestManager::DoCancel() + { + iTimer.Cancel(); + } + + +void CTe_LbsStatusTestManager::CompleteSelf() + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); + } + +// end of file + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbsroot/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbsroot/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +// Copyright (c) 2003-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: +// + +PRJ_EXPORTS +./lbsprofile.ini z:/private/10282253/lbs/lbsprofile.ini + +lbsroot.iby /epoc32/rom/include/lbsroot.iby + +PRJ_MMPFILES +lbsroot.mmp +//gnumakefile createlbsrootrep.mk + +PRJ_EXPORTS +// Note: this file is exported for testing and techview only. Not used in a device +10282266.cre z:/private/10202be9/10282266.cre + +PRJ_TESTMMPFILES + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbsroot/src/lbsroot.cpp --- a/locationmgmt/locationcore/lbsroot/src/lbsroot.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationmgmt/locationcore/lbsroot/src/lbsroot.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -51,6 +51,7 @@ #include "LbsExtendModuleInfo.h" #include "lbsqualityprofile.h" #include "lbssuplpushprops.h" +#include "lbspositioningstatusprops.h" #if defined(_DEBUG) #include "LbsOomTest.h" #endif @@ -392,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 @@ -449,6 +454,12 @@ LbsSuplPushProps::InitializeL(); + + // Initialize the NI-LR Positioning Status Property. + // Note the MO-LR Positioning Status Property is initialized by the + // location server + LbsPositioningStatusProps::InitializeNiPropertyL(); + #if defined(_DEBUG) //Initialize the OOM Test property. ROomRequest::InitializeL(); diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locationcore/lbsrootapi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locationcore/lbsrootapi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +// Copyright (c) 2003-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: +// + +#include "../test/group/bld.inf" + +PRJ_EXPORTS + +lbsrootapi.iby /epoc32/rom/include/lbsrootapi.iby + + +PRJ_TESTEXPORTS + +PRJ_MMPFILES +lbsrootapi.mmp + +PRJ_TESTMMPFILES + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/bwins/lbslocmonclient.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/bwins/lbslocmonclient.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,31 @@ +EXPORTS + ?OpenL@RLbsLocMonitorAreaPositioner@@QAEXAAVRLbsLocMonitorSession@@@Z @ 1 NONAME ; void RLbsLocMonitorAreaPositioner::OpenL(class RLbsLocMonitorSession &) + ?ConstructL@RLbsLocMonitorAreaPositioner@@MAEXXZ @ 2 NONAME ; void RLbsLocMonitorAreaPositioner::ConstructL(void) + ?ConvertLocationInfoL@RLbsLocInfoConverter@@QAEXAAV?$RPointerArray@VCLbsLocationInfoBase@@@@KKVTUid@@AAVTRequestStatus@@@Z @ 3 NONAME ; void RLbsLocInfoConverter::ConvertLocationInfoL(class RPointerArray &, unsigned long, unsigned long, class TUid, class TRequestStatus &) + ?ConstructL@CLbsLocMonitorPtrHolder@@IAEXHH@Z @ 4 NONAME ; void CLbsLocMonitorPtrHolder::ConstructL(int, int) + ?PtrC@CLbsLocMonitorPtrHolder@@QAEAAVTPtrC8@@H@Z @ 5 NONAME ; class TPtrC8 & CLbsLocMonitorPtrHolder::PtrC(int) + ?CancelDatabaseWipeOut@RLbsLocMonitorSession@@QBEHXZ @ 6 NONAME ; int RLbsLocMonitorSession::CancelDatabaseWipeOut(void) const + ?Ptr@CLbsLocMonitorPtrHolder@@QAEAAVTPtr8@@H@Z @ 7 NONAME ; class TPtr8 & CLbsLocMonitorPtrHolder::Ptr(int) + ?GetLastKnownPosition@RLbsLocMonitorAreaPositioner@@QBEXAAVTPositionInfoBase@@AAVTRequestStatus@@@Z @ 8 NONAME ; void RLbsLocMonitorAreaPositioner::GetLastKnownPosition(class TPositionInfoBase &, class TRequestStatus &) const + ?Close@RLbsLocMonitorSession@@UAEXXZ @ 9 NONAME ; void RLbsLocMonitorSession::Close(void) + ?Destruct@RLbsLocMonitorAreaPositioner@@MAEXXZ @ 10 NONAME ; void RLbsLocMonitorAreaPositioner::Destruct(void) + ?OpenL@RLbsLocInfoConverter@@QAEXAAVRLbsLocMonitorSession@@@Z @ 11 NONAME ; void RLbsLocInfoConverter::OpenL(class RLbsLocMonitorSession &) + ?GetLastKnownPositionArea@RLbsLocMonitorAreaPositioner@@QBEXAAVTPositionInfoBase@@AAVTPositionAreaInfoBase@@AAVTPosAreaReqParams@@AAVTRequestStatus@@@Z @ 12 NONAME ; void RLbsLocMonitorAreaPositioner::GetLastKnownPositionArea(class TPositionInfoBase &, class TPositionAreaInfoBase &, class TPosAreaReqParams &, class TRequestStatus &) const + ?CancelGetLastKnownPositionArea@RLbsLocMonitorAreaPositioner@@QBEHXZ @ 13 NONAME ; int RLbsLocMonitorAreaPositioner::CancelGetLastKnownPositionArea(void) const + ?CancelConvertLocationInfo@RLbsLocInfoConverter@@QAEXXZ @ 14 NONAME ; void RLbsLocInfoConverter::CancelConvertLocationInfo(void) + ?Close@RLbsLocInfoConverter@@UAEXXZ @ 15 NONAME ; void RLbsLocInfoConverter::Close(void) + ?NewL@CLbsLocMonitorPtrHolder@@SAPAV1@HH@Z @ 16 NONAME ; class CLbsLocMonitorPtrHolder * CLbsLocMonitorPtrHolder::NewL(int, int) + ??0RLbsLocMonitorAreaPositioner@@QAE@XZ @ 17 NONAME ; RLbsLocMonitorAreaPositioner::RLbsLocMonitorAreaPositioner(void) + ?CancelGetLastKnownPosition@RLbsLocMonitorAreaPositioner@@QBEHXZ @ 18 NONAME ; int RLbsLocMonitorAreaPositioner::CancelGetLastKnownPosition(void) const + ??0RLbsLocMonitorSession@@QAE@XZ @ 19 NONAME ; RLbsLocMonitorSession::RLbsLocMonitorSession(void) + ?WipeOutDatabase@RLbsLocMonitorSession@@QBEXAAVTRequestStatus@@@Z @ 20 NONAME ; void RLbsLocMonitorSession::WipeOutDatabase(class TRequestStatus &) const + ?ConstructL@RLbsLocInfoConverter@@AAEXXZ @ 21 NONAME ; void RLbsLocInfoConverter::ConstructL(void) + ?ConvertLocationInfoL@RLbsLocInfoConverter@@QAEXAAVCLbsLocationInfoBase@@KABKVTUid@@AAVTRequestStatus@@@Z @ 22 NONAME ; void RLbsLocInfoConverter::ConvertLocationInfoL(class CLbsLocationInfoBase &, unsigned long, unsigned long const &, class TUid, class TRequestStatus &) + ?Close@RLbsLocMonitorAreaPositioner@@UAEXXZ @ 23 NONAME ; void RLbsLocMonitorAreaPositioner::Close(void) + ??1CLbsLocMonitorPtrHolder@@UAE@XZ @ 24 NONAME ; CLbsLocMonitorPtrHolder::~CLbsLocMonitorPtrHolder(void) + ?Version@RLbsLocMonitorSession@@UAE?AVTVersion@@XZ @ 25 NONAME ; class TVersion RLbsLocMonitorSession::Version(void) + ?Connect@RLbsLocMonitorSession@@QAEHXZ @ 26 NONAME ; int RLbsLocMonitorSession::Connect(void) + ?SetLastKnownPosition@RLbsLocMonitorAreaPositioner@@QBEHABVTPositionInfoBase@@@Z @ 27 NONAME ; int RLbsLocMonitorAreaPositioner::SetLastKnownPosition(class TPositionInfoBase const &) const + ??1RLbsLocInfoConverter@@QAE@XZ @ 28 NONAME ; RLbsLocInfoConverter::~RLbsLocInfoConverter(void) + ??0RLbsLocInfoConverter@@QAE@XZ @ 29 NONAME ; RLbsLocInfoConverter::RLbsLocInfoConverter(void) + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/eabi/lbslocmonclient.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/eabi/lbslocmonclient.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,47 @@ +EXPORTS + _ZN20RLbsLocInfoConverter10ConstructLEv @ 1 NONAME + _ZN20RLbsLocInfoConverter20ConvertLocationInfoLER13RPointerArrayI20CLbsLocationInfoBaseEmm4TUidR14TRequestStatus @ 2 NONAME + _ZN20RLbsLocInfoConverter20ConvertLocationInfoLER20CLbsLocationInfoBasemRKm4TUidR14TRequestStatus @ 3 NONAME + _ZN20RLbsLocInfoConverter25CancelConvertLocationInfoEv @ 4 NONAME + _ZN20RLbsLocInfoConverter5CloseEv @ 5 NONAME + _ZN20RLbsLocInfoConverter5OpenLER21RLbsLocMonitorSession @ 6 NONAME + _ZN20RLbsLocInfoConverterC1Ev @ 7 NONAME + _ZN20RLbsLocInfoConverterC2Ev @ 8 NONAME + _ZN20RLbsLocInfoConverterD1Ev @ 9 NONAME + _ZN20RLbsLocInfoConverterD2Ev @ 10 NONAME + _ZN21RLbsLocMonitorSession5CloseEv @ 11 NONAME + _ZN21RLbsLocMonitorSession7ConnectEv @ 12 NONAME + _ZN21RLbsLocMonitorSession7VersionEv @ 13 NONAME + _ZN21RLbsLocMonitorSessionC1Ev @ 14 NONAME + _ZN21RLbsLocMonitorSessionC2Ev @ 15 NONAME + _ZN23CLbsLocMonitorPtrHolder10ConstructLEii @ 16 NONAME + _ZN23CLbsLocMonitorPtrHolder3PtrEi @ 17 NONAME + _ZN23CLbsLocMonitorPtrHolder4NewLEii @ 18 NONAME + _ZN23CLbsLocMonitorPtrHolder4PtrCEi @ 19 NONAME + _ZN23CLbsLocMonitorPtrHolderD0Ev @ 20 NONAME + _ZN23CLbsLocMonitorPtrHolderD1Ev @ 21 NONAME + _ZN23CLbsLocMonitorPtrHolderD2Ev @ 22 NONAME + _ZN28RLbsLocMonitorAreaPositioner10ConstructLEv @ 23 NONAME + _ZN28RLbsLocMonitorAreaPositioner5CloseEv @ 24 NONAME + _ZN28RLbsLocMonitorAreaPositioner5OpenLER21RLbsLocMonitorSession @ 25 NONAME + _ZN28RLbsLocMonitorAreaPositioner8DestructEv @ 26 NONAME + _ZN28RLbsLocMonitorAreaPositionerC1Ev @ 27 NONAME + _ZN28RLbsLocMonitorAreaPositionerC2Ev @ 28 NONAME + _ZNK21RLbsLocMonitorSession15WipeOutDatabaseER14TRequestStatus @ 29 NONAME + _ZNK21RLbsLocMonitorSession21CancelDatabaseWipeOutEv @ 30 NONAME + _ZNK28RLbsLocMonitorAreaPositioner20GetLastKnownPositionER17TPositionInfoBaseR14TRequestStatus @ 31 NONAME + _ZNK28RLbsLocMonitorAreaPositioner20SetLastKnownPositionERK17TPositionInfoBase @ 32 NONAME + _ZNK28RLbsLocMonitorAreaPositioner24GetLastKnownPositionAreaER17TPositionInfoBaseR21TPositionAreaInfoBaseR17TPosAreaReqParamsR14TRequestStatus @ 33 NONAME + _ZNK28RLbsLocMonitorAreaPositioner26CancelGetLastKnownPositionEv @ 34 NONAME + _ZNK28RLbsLocMonitorAreaPositioner30CancelGetLastKnownPositionAreaEv @ 35 NONAME + _ZTI20RLbsLocInfoConverter @ 36 NONAME + _ZTI21RLbsLocMonitorSession @ 37 NONAME + _ZTI23CLbsLocMonitorPtrHolder @ 38 NONAME + _ZTI28CLbsLocInfoConversionHandler @ 39 NONAME + _ZTI28RLbsLocMonitorAreaPositioner @ 40 NONAME + _ZTV20RLbsLocInfoConverter @ 41 NONAME + _ZTV21RLbsLocMonitorSession @ 42 NONAME + _ZTV23CLbsLocMonitorPtrHolder @ 43 NONAME + _ZTV28CLbsLocInfoConversionHandler @ 44 NONAME + _ZTV28RLbsLocMonitorAreaPositioner @ 45 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ +// Copyright (c) 2002-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: +// + +PRJ_EXPORTS +lbslocmonclient.iby /epoc32/rom/include/lbslocmonclient.iby + +../../cenrep/20026814.txt c:/private/10202be9/20026814.txt + + +PRJ_MMPFILES +lbslocmonclient.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/group/lbslocmonclient.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/group/lbslocmonclient.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +/* +* 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: +* +*/ +#ifndef __LBS_LOCMONCLIENT_IBY__ +#define __LBS_LOCMONCLIENT_IBY__ + +//#if !defined(SYMBIAN_EXCLUDE_LOCATION) + +file=ABI_DIR\DEBUG_DIR\lbslocmonclient.dll sys\bin\lbslocmonclient.dll + +//#endif // SYMBIAN_EXCLUDE_LOCATION + +#endif \ No newline at end of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/group/lbslocmonclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/group/lbslocmonclient.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2005 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: +* +*/ + + +TARGET lbslocmonclient.dll +TARGETTYPE dll +UID 0x1000008d 0x102869DE + +CAPABILITY ALL -TCB + +MACRO ENABLE_LBS_DEV_LOGGER + +NOSTRICTDEF + +SOURCEPATH ../src +SOURCE rlbslocmonitorareapositioner.cpp +SOURCE rlbslocmonitorsession.cpp +SOURCE clbslocmonitorptrholder.cpp +SOURCE rlbslocinfoconverter.cpp +SOURCE clbslocinfoconversionhandler.cpp +// +// Server framework stuff +// +SOURCEPATH ../../../../locationcore/LbsLocCommon/ServerFramework/src +SOURCE tserverstartparams.cpp +SOURCE rsecuresessionbase.cpp +SOURCE cserverlaunch.cpp +SOURCE tstartparamsbase.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../../locationcore/LbsLocCommon/ServerFramework/inc +USERINCLUDE ../../../lbslocmonitorserver/inc +USERINCLUDE ../../../../locationcore/LbsInternalApi/inc +USERINCLUDE ../../../../locationcore/lbsrootapi/inc +USERINCLUDE ../../../../locationcore/LbsPartnerCommon/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY lbs.lib +LIBRARY lbsloccommon.lib +LIBRARY lbspartnercommon.lib +LIBRARY lbsrootapi.lib +LIBRARY lbslocationinfodatatypes.lib + +SMPSAFE + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/clbslocinfoconversionhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/clbslocinfoconversionhandler.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,156 @@ +/* +* 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: Declaration of CLbsLocInfoConversionHandler class. +* +*/ +#ifndef C_LBSLOCINFOCONVERSIONHANDLER_H_ +#define C_LBSLOCINFOCONVERSIONHANDLER_H_ + +#include + +// Forward declaration +class RLbsLocInfoConverter; +class CLbsLocationInfo; + +/** + * Class waits for location information completion event and + * notifies the observer on completion. + */ +class CLbsLocInfoConversionHandler : public CActive + { +public: + enum TAyncRequestType + { + EGetBuffersizeForSingleArea, + + EGetSingleConvertedArea, + + EGetBuffersizeForMultipleArea, + + EGetMultipleConvertedArea + }; +public: + /** + * Allocates and construct a new CLbsLocInfoConversionHandler object + */ + static CLbsLocInfoConversionHandler* NewL( RLbsLocInfoConverter& aLocInfoConverter ); + + /** + * Destructor. + */ + ~CLbsLocInfoConversionHandler(); + + /** + * Starts the asyncronous operation by setting the iStatus to active. + */ + void Start( TAyncRequestType aType); + + /** + * Adds the buffer into the object. + */ + void SetBuffer( CBufFlat* aBuffer ); + + /** + * Stores the client's status. + */ + void SetStatus( TRequestStatus& aStatus ); + + /** + * Adds client specified requested info. + */ + void SetClientRequestedInfo( TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Sets client's location info array. + */ + void SetClientLocationInfoArray( RLbsLocationInfoBaseArray* + aLocationInfoArray ); + + /** + * Sets client's location info object. + */ + void SetClientLocationInfo( CLbsLocationInfoBase& aLocationInfo ); + + /** + * Releases all the resources used by earlier request. + */ + void ReleaseAllResources(); + + +protected: // from CActive + void RunL(); + void DoCancel(); + +private: + CLbsLocInfoConversionHandler( RLbsLocInfoConverter& aLocInfoConverter ); + + void ConstructL(); + + void HandleSingleConversionL(); + + + void HandleMultipleConversionL(); + + void GetPositionInfoArrayL( RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo ); + + void GetGsmCellInfoArrayL( RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo); + + void GetWcdmaCellInfoArrayL( RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo ); + + void GetWlanInfoArrayL( RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo ); + + +private: // Member variables + /** + * Handle to loc info converter subsession. + */ + RLbsLocInfoConverter& iLocInfoConverter; + + /** + * Pointer to buffer + */ + CBufFlat* iBuffer; + + /** + * Pointer to client's TRequestStatus + */ + TRequestStatus* iClientStatus; + + /** + * Pointer to client's location info list + * Not Own. + */ + RLbsLocationInfoBaseArray* iClientLocationInfoList; + + /** + * Pointer to client's location info + */ + CLbsLocationInfoBase* iClientLocationInfo; + + /** + * Client specified request info + */ + TLbsConversionOutputInfoMask iRequestedInfo; + + /** + * Type of async operation requested + */ + TAyncRequestType iRequestType; + }; + +#endif /*C_LBSLOCINFOCONVERSIONHANDLER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/clbslocmonitorptrholder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/clbslocmonitorptrholder.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,56 @@ +/* +* 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: +* +*/ + + +#ifndef CLBSLOCMONITORPTRHOLDER_H +#define CLBSLOCMONITORPTRHOLDER_H + +#include + +class CLbsLocMonitorPtrHolder : public CBase +/** +Holds the TPtr8 and TPtrC8 arrays for all RPositionServer requests. +@internalComponent + */ + { +public: + + enum TParameter + { + EPosForGetLastKnownPosition = 0, + EPosForGetLastKnownPositionArea, + EAreaForGetLastKnownPositionArea, + EParamsForGetLastKnownPositionArea, + ELastParam, // Keep this the last + }; + +public: + IMPORT_C static CLbsLocMonitorPtrHolder* NewL(TInt aNumberOfPtrs, + TInt aNumberOfPtrCs); + IMPORT_C ~CLbsLocMonitorPtrHolder(); + IMPORT_C TPtr8& Ptr(TInt aIndex); + IMPORT_C TPtrC8& PtrC(TInt aIndex); +protected: + IMPORT_C void ConstructL(TInt aNumberOfPtrs, TInt aNumberOfPtrCs); +private: + /** modifiable pointer array */ + RArray iPtrArray; + /** non-modifiable pointer array */ + RArray iPtrCArray; + }; + +#endif // CLBSLOCMONITORPTRHOLDER_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/lbslocmonitorclientconsts.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/lbslocmonitorclientconsts.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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: +* +*/ + + +#ifndef LBSLOCMONITORCLIENTCONSTS_H_ +#define LBSLOCMONITORCLIENTCONSTS_H_ + +#include +#include + +/** + * Message parameters index in a message of RMessage2. The server has to use + * the parameter index defined below to write and read data into the IPC message. + */ + +// This position in the IPC is used by the client library to receive +// buffer size. +const TInt KParamBufferSize = 0; + + +// This position in the IPC is used by the client library to send location +// information. +const TInt KParamLocationInfo = 1; + +// This position in the IPC is used by the client library to send client preferences. +const TInt KParamClientPrefs = 2; + +// This position in the IPC is used by the server to send converted info +const TInt KParamConvertedInfo = 0; + +/** + * This structure holds conversion prefs,location info mask and + * the conversion module id. + */ +struct TLbsClientPrefs + { + TLbsConversionPrefs iConversionPrefs; + + TLbsConversionOutputInfoMask iRequestedInfo; + + TUid iConverterModuleId; + }; + +#endif /*LBSLOCMONITORCLIENTCONSTS_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/rlbslocinfoconverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/rlbslocinfoconverter.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,174 @@ +/* +* 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: +* +*/ + + +#ifndef R_LBSLOCINFOCONVERTER_H_ +#define R_LBSLOCINFOCONVERTER_H_ + + +#include +#include +#include "rlbslocmonitorsession.h" +#include "rsecuresessionbase.h" + + +// Forward declaration +class CLbsLocInfoConversionHandler; +class CLbsLocMonitorPtrHolder; +struct TLbsClientPrefs; + + +/** + * + * This class provides services pertaining to conversion of geographical + * area information represented as a collection of GSM/WCDMA or WLAN + * information to corresponding geographical coordinates. This class is + * used to create sub-session with the location monitor server. + * + * Before using the class, a primary connection must have already been + * established with the server with RLbsLocMonitorSession::Connect(). + * + */ +class RLbsLocInfoConverter : public RSecureSubSessionBase + { +public: + + /** + * C++ constructor + */ + IMPORT_C RLbsLocInfoConverter(); + + /** + * Destructor + */ + IMPORT_C ~RLbsLocInfoConverter(); + + /** + * Opens a subsession with Location Monitor Server. + * + * A subsession must be opened before any other service can be used. + * + * @param[in] aServer Reference to the Location Monitor Server + * session. + * + * @return KErrNone if successful. Otherwise, Symbian standard + * error code is returned, such as KErrNoMemory, KErrServerBusy, etc. + */ + IMPORT_C void OpenL( RLbsLocMonitorSession& aLocMonSession ); + + /** + * Closes the subsession with Location Monitor Server. + */ + IMPORT_C void Close(); + + /** + * Converts one area info to position info + * @param[in] aLocationInfo location information corresponding to + * a geographical location is passed and on successful completion of this + * method,position information corresponding to the location information + * is returned in the observer callback. + * @param[in] aConversionPrefs Conversion preferences suggested by client + * @param[in] aRequestedInfo Location information that is requested. + * @param[in] aConverterModuleId Module ID of the converter plugin to be + * used + * @param[out] aStatus Contains the error code when the request is completed. + * + * @leave KErrArgument If the location info pointer is NULL or one of system + * wide error codes. + */ + IMPORT_C void ConvertLocationInfoL( CLbsLocationInfoBase& aLocationInfo, + TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask& aRequestedInfo, + const TUid aConverterModuleId, + TRequestStatus& aStatus ); + + /** + * Converts the area informations of a group of geographical locations + * to its corresponding position information. + * + * @param[in] aLocationInfoArray Array of Location information to be + * converted. + * @param[in] aConversionPrefs Conversion preferences suggested by client. + * @param[in] aRequestedInfo Location information that is requested. + * @param[in] aConversionModuleId Module ID of the converter plugin to be + * used + * @param[out] aStatus Contains the error code when the request is completed. + * + * @leave KErrArgument If the location info array is empty or if array count + * exceeds KPositionMaxBatchSize or one of system wide error codes. + */ + IMPORT_C void ConvertLocationInfoL( RLbsLocationInfoBaseArray& aLocationInfoArray, + TLbsConversionPrefs aConversionPrefs, + TLbsConversionOutputInfoMask aRequestedInfo, + const TUid aConverterModuleId, + TRequestStatus& aStatus ); + + /** + * Cancel outstanding request to convert location information. + */ + IMPORT_C void CancelConvertLocationInfo(); + + /** + * Handles buffer size passed from the server to store single converted + * location info. + */ + void HandleSingleConversionBufferSizeL(); + + /** + * Handles buffer size passed from the server to store multiple converted + * location info. + */ + void HandleMultipleConversionBufferSizeL(); + + /** + * Validates location information. + */ + void ValidateLocationInfoL( CLbsLocationInfoBase* aLocationInfo ); + + +private: + /** + * Symbian 2 phase constructor + */ + void ConstructL(); + + +private: // Member variables + /** + * Pointer to location info conversion handler + */ + CLbsLocInfoConversionHandler* iConversionHandler; + + /** + * A pointer to a container that holds pointer descriptors, needed to point + * to the clients request data during asynchronous requests + */ + CLbsLocMonitorPtrHolder* iPtrHolder; + + /** + * Size of the buffer required to receive information + * from server. + */ + TInt iBufferSize; + + /** + * Client preferences + */ + TLbsClientPrefs* iClientPrefs; + }; + +#endif /*R_LBSLOCINFOCONVERTER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/rlbslocmonitorareapositioner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/rlbslocmonitorareapositioner.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,99 @@ +/* +* 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: +* +*/ + +/** +@file +@InternalTechnology +*/ + +#ifndef RLBSLOCMONITORAREAPOSITIONER_H +#define RLBSLOCMONITORAREAPOSITIONER_H + +#include +#include +#include "rlbslocmonitorsession.h" +#include "lbslocmonitorserverdata.h" +#include "clbslocmonitorptrholder.h" + +/** +This class is used by clients of the Location Monitor server to +create a sub-session with the server. + +Before using the class, a primary connection must have already been +established with the server with RLbsLocMonitorSession::Connect(). + +@see RLbsLocMonitorSession +*/ +class RLbsLocMonitorAreaPositioner : public RSecureSubSessionBase + { + +public: + + IMPORT_C RLbsLocMonitorAreaPositioner(); + IMPORT_C void OpenL(RLbsLocMonitorSession& aLocMonSession); + IMPORT_C void Close(); + + /* Called by the Location Server to report the last + Position obtained from any of its PSYs that are not otherwise + available to the Location Monitor. The position + will be stored in a database. + */ + IMPORT_C TInt SetLastKnownPosition(const TPositionInfoBase& aPosInfo) const; + + /* Retrieve the position last stored in the database */ + IMPORT_C void GetLastKnownPosition(TPositionInfoBase& aPosInfo, + TRequestStatus& aStatus) const; + + /* Cancel a previous call to GetLastKnownPosition*/ + IMPORT_C TInt CancelGetLastKnownPosition() const; + + /* Returns in aPosInfo a position which had been previously stored + in association with "context information" that is bound to a + geographical area (e.g. Global Cell Id). + + Current context information will be sensed by the server and used + to search for a position in the database. If found, the position + will be an approximation of the current position of the handset. + If no position is found in the database for the current context + information, the position last stored in the database is returned. + + The method returns in aAreaInfo a rough indication of how accurate the + returned position is based on an estimation of the size of the + geographical area covered by the sensed context information. + */ + IMPORT_C void GetLastKnownPositionArea(TPositionInfoBase& aPosInfo, + TPositionAreaInfoBase& aAreaInfo, + TPosAreaReqParams& aParameters, + TRequestStatus& aStatus) const; + + /* Cancel a call to GetLastKnownPositionArea */ + IMPORT_C TInt CancelGetLastKnownPositionArea() const; + + +protected: + + IMPORT_C virtual void ConstructL(); + IMPORT_C virtual void Destruct(); + +private: + + /** A pointer to a container that holds pointer descriptors, needed to point + to the clients request data during asynchronous requests */ + CLbsLocMonitorPtrHolder* iPtrHolder; + }; + +#endif // RLBSLOCMONITORAREAPOSITIONER_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/rlbslocmonitorsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/inc/rlbslocmonitorsession.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +/** +@InternalTechnology +@prototype +*/ + +#ifndef RLBSLOCMONITORSESSION_H +#define RLBSLOCMONITORSESSION_H + +#include "rsecuresessionbase.h" + +/** +Client-side session with the Location Monitor server. + */ +class RLbsLocMonitorSession : public RSecureSessionBase + { + +public: + + IMPORT_C RLbsLocMonitorSession(); + + IMPORT_C TInt Connect(); + + IMPORT_C void Close(); + + /* Close the database and wipe out the DB file. + */ + IMPORT_C void WipeOutDatabase(TRequestStatus& aStatus) const; + + /* Cancel previous request to delete the Database + of positions. + */ + IMPORT_C TInt CancelDatabaseWipeOut() const; + + IMPORT_C TVersion Version(); + +protected: + + // From RSecureSessionBase + TInt StartServer(TServerStartParams& aParams); + }; + +#endif // RLBSLOCMONITORSESSION_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/clbslocinfoconversionhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/clbslocinfoconversionhandler.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,378 @@ +/* +* 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: Implementation of CLbsLocInfoConversionHandler class. +* +*/ + +#include +#include +#include +#include "rlbslocinfoconverter.h" +#include "clbslocinfoconversionhandler.h" + + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocInfoConversionHandler* CLbsLocInfoConversionHandler::NewL( + RLbsLocInfoConverter& aLocInfoConverter ) + { + CLbsLocInfoConversionHandler* self = new ( ELeave ) + CLbsLocInfoConversionHandler( aLocInfoConverter ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::CLbsLocInfoConversionHandler +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocInfoConversionHandler::CLbsLocInfoConversionHandler( + RLbsLocInfoConverter& aLocInfoConverter ): + CActive( EPriorityStandard ), + iLocInfoConverter( aLocInfoConverter ) + { + CActiveScheduler::Add( this ); + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::SetBuffer +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::SetBuffer( CBufFlat* aBuffer ) + { + if( iBuffer ) + { + delete iBuffer; + iBuffer = NULL; + } + iBuffer = aBuffer; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::SetStatus +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler:: SetStatus( TRequestStatus& aStatus ) + { + iClientStatus = &aStatus; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::SetClientLocationInfoArray +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::SetClientLocationInfoArray( + RLbsLocationInfoBaseArray* + aLocationInfoArray ) + { + iClientLocationInfoList = aLocationInfoArray; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::SetClientLocationInfo +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::SetClientLocationInfo( + CLbsLocationInfoBase& aLocationInfo ) + { + iClientLocationInfo = &aLocationInfo; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::SetClientLocationInfo +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::SetClientRequestedInfo( + TLbsConversionOutputInfoMask aRequestedInfo ) + { + iRequestedInfo = aRequestedInfo; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::ReleaseAllResources +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::ReleaseAllResources() + { + if( iBuffer ) + { + delete iBuffer; + iBuffer = NULL; + } + iClientLocationInfoList = NULL; + iClientLocationInfo = NULL; + iClientStatus = NULL; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::~CLbsLocInfoConversionHandler +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocInfoConversionHandler::~CLbsLocInfoConversionHandler() + { + if( IsActive() ) + { + Cancel(); + } + delete iBuffer; + iBuffer = NULL; + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::RunL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::RunL() + { + TInt error = iStatus.Int(); + if( error == KErrNone ) + { + switch( iRequestType ) + { + case EGetBuffersizeForSingleArea: + { + iLocInfoConverter.HandleSingleConversionBufferSizeL(); + break; + } + case EGetSingleConvertedArea: + { + HandleSingleConversionL(); + break; + } + case EGetBuffersizeForMultipleArea: + { + iLocInfoConverter.HandleMultipleConversionBufferSizeL(); + break; + } + case EGetMultipleConvertedArea: + { + HandleMultipleConversionL(); + break; + } + } + } + // Incase of error, report it to the client through observer. + else + { + User::RequestComplete( iClientStatus,error ); + } + } + + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::HandleSingleConversionL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::HandleSingleConversionL() + { + RBufReadStream readStream( *iBuffer ); + CleanupClosePushL( readStream ); + + CLbsLocationInfo* clientLocInfo = static_cast + ( iClientLocationInfo ); + + // Get the client requested area info from location info object. + switch( iRequestedInfo ) + { + case ELbsConversionOutputPosition: + GetPositionInfoArrayL( readStream,*clientLocInfo ); + break; + + case ELbsConversionOutputGsm: + GetGsmCellInfoArrayL( readStream,*clientLocInfo ); + break; + + case ELbsConversionOutputWcdma: + GetWcdmaCellInfoArrayL( readStream,*clientLocInfo ); + break; + + case ELbsConversionOutputWlan: + GetWlanInfoArrayL( readStream,*clientLocInfo ); + break; + + } + + // Complete client status + CleanupStack::PopAndDestroy( &readStream ); + User::RequestComplete( iClientStatus,KErrNone ); + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::HandleMultipleConversionL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::HandleMultipleConversionL() + { + RBufReadStream readStream( *iBuffer ); + CleanupClosePushL( readStream ); + + // Extract the converted info array from the stream. + TInt locInfoArrayCount = readStream.ReadInt8L(); + + // Get the client requested area info from the each object of location + // info in the array + for( TInt i=0;i + ( (*iClientLocationInfoList)[i] ); + + switch( iRequestedInfo ) + { + case ELbsConversionOutputPosition: + GetPositionInfoArrayL( readStream,*clientLocInfo ); + break; + + case ELbsConversionOutputGsm: + GetGsmCellInfoArrayL( readStream,*clientLocInfo ); + break; + + case ELbsConversionOutputWcdma: + GetWcdmaCellInfoArrayL( readStream,*clientLocInfo ); + break; + + case ELbsConversionOutputWlan: + GetWlanInfoArrayL( readStream,*clientLocInfo ); + break; + } + } + + // Complete client status + CleanupStack::PopAndDestroy( &readStream ); + User::RequestComplete( iClientStatus,KErrNone ); + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::DoCancel +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::DoCancel() + { + User::RequestComplete(iClientStatus, iStatus.Int()); + } + +//---------------------------------------------------------------- +// CLbsLocInfoConversionHandler::ConstructL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocInfoConversionHandler::ConstructL() + { + // Nothing to be done here. + } + +// --------------------------------------------------------- +// CLbsLocInfoConversionHandler::Start +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CLbsLocInfoConversionHandler::Start( TAyncRequestType aType ) + { + iRequestType = aType; + SetActive(); + } + +// --------------------------------------------------------- +// CLbsLocInfoConversionHandler::GetPositionInfoArrayL +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CLbsLocInfoConversionHandler::GetPositionInfoArrayL( + RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo ) + { + // Read the count of converted info. + TInt convertedInfoCount = readStream.ReadInt8L(); + + for( TInt i=0;iInternaliseL( readStream ); + aDesLocationInfo.AddAreaInfoL( positionInfo ); + CleanupStack::Pop( positionInfo ); + } + } + + +// --------------------------------------------------------- +// CLbsLocInfoConversionHandler::GetGsmCellInfoArrayL +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CLbsLocInfoConversionHandler::GetGsmCellInfoArrayL( + RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo ) + { + // Read the count of converted info. + TInt convertedInfoCount = readStream.ReadInt8L(); + + for( TInt i=0;iInternaliseL( readStream ); + aDesLocationInfo.AddAreaInfoL( gsmCellInfo ); + CleanupStack::Pop( gsmCellInfo ); + } + } + +// --------------------------------------------------------- +// CLbsLocInfoConversionHandler::GetWcdmaCellInfoArrayL +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CLbsLocInfoConversionHandler::GetWcdmaCellInfoArrayL( + RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo ) + { + // Read the count of converted info. + TInt convertedInfoCount = readStream.ReadInt8L(); + + for( TInt i=0;iInternaliseL( readStream ); + aDesLocationInfo.AddAreaInfoL( wcdmaCellInfo ); + CleanupStack::Pop( wcdmaCellInfo ); + } + } + +// --------------------------------------------------------- +// CLbsLocInfoConversionHandler::GetWlanInfoArrayL +// (other items were commented in a header). +// --------------------------------------------------------- +// +void CLbsLocInfoConversionHandler::GetWlanInfoArrayL( + RBufReadStream& readStream, + CLbsLocationInfo& aDesLocationInfo ) + { + // Read the count of converted info. + TInt convertedInfoCount = readStream.ReadInt8L(); + + for( TInt i=0;iInternaliseL( readStream ); + aDesLocationInfo.AddAreaInfoL( wlanInfo ); + CleanupStack::Pop( wlanInfo ); + } + } + +// End of file. diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/clbslocmonitorptrholder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/clbslocmonitorptrholder.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,101 @@ +/* +* 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: +* +*/ + + +#include "clbslocmonitorptrholder.h" + + +//----------------------------------------------------------------------------- +// CLbsLocMonitorPtrHolder +//----------------------------------------------------------------------------- + +/** + Allocates and constructs a CLbsLocMonitorPtrHolder object. + + The function leaves if there is insufficient memory. + +@internalComponent +@param aNumberOfPtrs is the number of modifiable pointer descriptors to + create. These are used for asynchronous 'get' requests. +@param aNumberOfPtrCs is the number of read-only pointer descriptors to + create. These are used for asynchronous 'set' requests. +@return a newly created CLbsLocMonitorPtrHolder object. + */ +EXPORT_C CLbsLocMonitorPtrHolder* CLbsLocMonitorPtrHolder::NewL(TInt aNumberOfPtrs, + TInt aNumberOfPtrCs) + { + CLbsLocMonitorPtrHolder* self = new (ELeave) CLbsLocMonitorPtrHolder; + CleanupStack::PushL(self); + self->ConstructL(aNumberOfPtrs, aNumberOfPtrCs); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C void CLbsLocMonitorPtrHolder::ConstructL(TInt aNumberOfPtrs, + TInt aNumberOfPtrCs) + + { + TPtr8 ptr(NULL, 0); + TInt i; + for (i = 0; i < aNumberOfPtrs; i++) + { + User::LeaveIfError(iPtrArray.Append(ptr)); + } + + TPtrC8 ptrC(NULL, 0); + for (i = 0; i < aNumberOfPtrCs; i++) + { + User::LeaveIfError(iPtrCArray.Append(ptrC)); + } + } + +/** +Destructor for CLbsLocMonitorPtrHolder. + +@internalComponent +*/ +EXPORT_C CLbsLocMonitorPtrHolder::~CLbsLocMonitorPtrHolder() + { + iPtrCArray.Close(); + iPtrArray.Close(); + } + +/** +An accessor for the modifiable pointer descriptors. + +@internalComponent +@param aIndex specifies the descriptor to return. +@return a reference to one of our contained pointer descriptors. + */ +EXPORT_C TPtr8& CLbsLocMonitorPtrHolder::Ptr(TInt aIndex) + { + return iPtrArray[aIndex]; + } + +/** +An accessor for the read-only pointer descriptors. + +@internalComponent +@param aIndex specifies the descriptor to return. +@return a reference to one of our contained pointer descriptors. +*/ +EXPORT_C TPtrC8& CLbsLocMonitorPtrHolder::PtrC(TInt aIndex) + { + return iPtrCArray[aIndex]; + } + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/rlbslocinfoconverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/rlbslocinfoconverter.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,357 @@ +/* +* 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: Implementation of RLbsLocInfoConverter class. +* +*/ + +#include +#include +#include "rlbslocinfoconverter.h" +#include "clbslocinfoconversionhandler.h" +#include "lbslocmonitorclientconsts.h" +#include "clbslocmonitorptrholder.h" +#include "lbslocmonitorserverdata.h" +#include +#include +#include +#include +#include + +void CleanUpAreaInfoArray(TAny* aArray) + { + static_cast(aArray)->ResetAndDestroy(); + } + + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::RLbsLocInfoConverter +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C RLbsLocInfoConverter::RLbsLocInfoConverter(): + iConversionHandler( NULL ), + iPtrHolder( NULL ) + { + //iConversionHandler = NULL; + //iPtrHolder = NULL; + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::~RLbsLocInfoConverter +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C RLbsLocInfoConverter::~RLbsLocInfoConverter() + { + delete iConversionHandler; + iConversionHandler = NULL; + + delete iPtrHolder; + iPtrHolder = NULL; + + delete iClientPrefs; + iClientPrefs = NULL; + } + + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::OpenL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void RLbsLocInfoConverter::OpenL( RLbsLocMonitorSession& + aLocMonSession ) + { + __ASSERT_ALWAYS(aLocMonSession.Handle() != 0, User::Invariant()); // trying to open twice + TInt err(KErrNone); + ConstructL(); + + // Call Server Framework 'Open' + TLbsLocMonitorConversionPositionerData emptyData; + TLbsLocMonitorSubSessionType type(ELocMonitorSubSessionTypeConversionPositiner); + err = RSecureSubSessionBase::Open + (aLocMonSession, type, emptyData); + User::LeaveIfError(err); + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::Close +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void RLbsLocInfoConverter::Close() + { + // Call Server Framework 'Close' + RSecureSubSessionBase::Close(); + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::ConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void RLbsLocInfoConverter::ConvertLocationInfoL( + CLbsLocationInfoBase& aLocationInfo, + TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask& aRequestedInfo, + const TUid aConverterModuleId, + TRequestStatus& aStatus ) + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + + // If there is any outstanding request,panic the client with error code + // ELocMonitorDuplicateRequest + if( iConversionHandler->IsActive() ) + { + User::Panic( KLocationMonitorFault,ELocMonitorDuplicateRequest ); + } + + aStatus = KRequestPending; + + // Validate area information + ValidateLocationInfoL( &aLocationInfo ); + + // Release the resources used by the earlier request. + iConversionHandler->ReleaseAllResources(); + + // Store the handle to client's location info. This is required to + // update it with the converted info. + iConversionHandler->SetClientLocationInfo( aLocationInfo ); + iConversionHandler->SetClientRequestedInfo( aRequestedInfo ); + + iPtrHolder->Ptr(0).Set( reinterpret_cast(&iBufferSize), + sizeof(iBufferSize),sizeof(iBufferSize) ); + + CBufFlat* buffer = CBufFlat::NewL( 512 ); + CleanupStack::PushL( buffer ); + RBufWriteStream writeStream; + writeStream.Open( *buffer ); + CleanupClosePushL( writeStream ); + + // Write location info content to the stream. + aLocationInfo.ExternaliseL( writeStream ); + writeStream.CommitL(); + CleanupStack::PopAndDestroy( &writeStream ); + CleanupStack::Pop( buffer ); + + // Store the buffer handle in the handler object. + iConversionHandler->SetBuffer( buffer ); + + // Store handle to client's status in handler object.Handler + // object will complete client's status on conversion completion. + iConversionHandler->SetStatus( aStatus ); + + TPtr8 ptr = buffer->Ptr(0); + iPtrHolder->Ptr(1).Set( ptr ); + + // Client preferences are packed into a structure in order to send it in + // a single IPC slot. + iClientPrefs->iConversionPrefs = aConversionPrefs; + iClientPrefs->iRequestedInfo = aRequestedInfo; + iClientPrefs->iConverterModuleId = aConverterModuleId; + TPckg clientPrefsPckg( *iClientPrefs ); + + TIpcArgs ipcArgs; + ipcArgs.Set( KParamBufferSize,&iPtrHolder->Ptr(0) ); + ipcArgs.Set( KParamLocationInfo,&iPtrHolder->Ptr(1) ); + ipcArgs.Set( KParamClientPrefs,&clientPrefsPckg ); + + SendReceive( EConvertSingleLocationInfoBufferSize,ipcArgs,iConversionHandler->iStatus ); + iConversionHandler->Start( CLbsLocInfoConversionHandler::EGetBuffersizeForSingleArea ); + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::ConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void RLbsLocInfoConverter::ConvertLocationInfoL( + RLbsLocationInfoBaseArray& aLocationInfoArray, + TLbsConversionPrefs aConversionPrefs, + TLbsConversionOutputInfoMask aRequestedInfo, + const TUid aConverterModuleId, + TRequestStatus& aStatus ) + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + + // If there is any outstanding request,panic the client with error code + // ELocMonitorDuplicateRequest + if( iConversionHandler->IsActive() ) + { + User::Panic( KLocationMonitorFault,ELocMonitorDuplicateRequest ); + } + + aStatus = KRequestPending; + + TInt count = aLocationInfoArray.Count(); + // Leave with error code if array count is zero or count exceeds KPositionMaxBatchSize + if( !count || count > KPositionMaxBatchSize ) + { + User::Leave( KErrArgument ); + } + + // Validate each location info object in the array. + for( TInt i=0;iReleaseAllResources(); + + // Store the handle to client's location info array. This is required to + // update it with the converted info. + iConversionHandler->SetClientLocationInfoArray( &aLocationInfoArray ); + iConversionHandler->SetClientRequestedInfo( aRequestedInfo ); + + iPtrHolder->Ptr(0).Set( reinterpret_cast(&iBufferSize), + sizeof(iBufferSize),sizeof(iBufferSize) ); + + CBufFlat* buffer = CBufFlat::NewL( 512 ); + CleanupStack::PushL( buffer ); + RBufWriteStream writeStream; + writeStream.Open( *buffer ); + CleanupClosePushL( writeStream ); + + TInt arrayCount = aLocationInfoArray.Count(); + // Write the array count to the stream. + writeStream.WriteInt8L( arrayCount ); + + // Write location info array contents to the stream. + for( TInt i=0;iExternaliseL( writeStream ); + } + writeStream.CommitL(); + CleanupStack::PopAndDestroy( &writeStream ); + CleanupStack::Pop( buffer ); + + // Store the buffer handle in the handler object. + iConversionHandler->SetBuffer( buffer ); + + // Store handle to client's status in handler object.Handler + // object will complete client's status on conversion completion. + iConversionHandler->SetStatus( aStatus ); + + TPtr8 ptr = buffer->Ptr(0); + iPtrHolder->Ptr(1).Set( ptr ); + + // Client preferences are packed into a structure in order to send it in + // a single IPC slot. + iClientPrefs->iConversionPrefs = aConversionPrefs; + iClientPrefs->iRequestedInfo = aRequestedInfo; + iClientPrefs->iConverterModuleId = aConverterModuleId; + TPckg clientPrefsPckg( *iClientPrefs ); + + TIpcArgs ipcArgs; + ipcArgs.Set( KParamBufferSize,&iPtrHolder->Ptr(0) ); + ipcArgs.Set( KParamLocationInfo,&iPtrHolder->Ptr(1) ); + ipcArgs.Set( KParamClientPrefs,&clientPrefsPckg ); + + SendReceive( EConvertMultipleLocationInfoBufferSize,ipcArgs,iConversionHandler->iStatus ); + iConversionHandler->Start( CLbsLocInfoConversionHandler::EGetBuffersizeForMultipleArea ); + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::CancelConvertLocationInfo +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void RLbsLocInfoConverter::CancelConvertLocationInfo() + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + SendReceive( ECancelConvertLocationInfo ); + if( iConversionHandler->iStatus.Int() != KRequestPending ) + iConversionHandler->Cancel(); + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::HandleSingleConversionBufferSizeL +// (other items were commented in a header). +//---------------------------------------------------------------- +void RLbsLocInfoConverter::HandleSingleConversionBufferSizeL() + { + CBufFlat* buffer = CBufFlat::NewL(256); + CleanupStack::PushL( buffer ); + buffer->ResizeL( iBufferSize ); + CleanupStack::Pop( buffer ); + iConversionHandler->SetBuffer( buffer ); + + TPtr8 bufPtr = buffer->Ptr(0); + iPtrHolder->Ptr(0).Set( bufPtr ); + TIpcArgs ipcArgs; + ipcArgs.Set( KParamConvertedInfo,&iPtrHolder->Ptr(0) ); + + SendReceive( EGetSingleLocationInfo,ipcArgs,iConversionHandler->iStatus ); + iConversionHandler->Start( CLbsLocInfoConversionHandler::EGetSingleConvertedArea ); + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::HandleMultipleConversionBufferSizeL +// (other items were commented in a header). +//---------------------------------------------------------------- +void RLbsLocInfoConverter::HandleMultipleConversionBufferSizeL() + { + CBufFlat* buffer = CBufFlat::NewL(256); + CleanupStack::PushL( buffer ); + buffer->ResizeL( iBufferSize ); + CleanupStack::Pop( buffer ); + iConversionHandler->SetBuffer( buffer ); + + TPtr8 bufPtr = buffer->Ptr(0); + iPtrHolder->Ptr(0).Set( bufPtr ); + TIpcArgs ipcArgs; + ipcArgs.Set( KParamConvertedInfo,&iPtrHolder->Ptr(0) ); + + SendReceive( EGetMultipleLocationInfo,ipcArgs,iConversionHandler->iStatus ); + iConversionHandler->Start( CLbsLocInfoConversionHandler::EGetMultipleConvertedArea ); + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::ConstructL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void RLbsLocInfoConverter::ConstructL() + { + iConversionHandler = CLbsLocInfoConversionHandler::NewL( *this ); + iPtrHolder = CLbsLocMonitorPtrHolder::NewL(CLbsLocMonitorPtrHolder::ELastParam, 0); + iClientPrefs = new( ELeave ) TLbsClientPrefs; + } + +//---------------------------------------------------------------- +// RLbsLocInfoConverter::ValidateLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +void RLbsLocInfoConverter::ValidateLocationInfoL( CLbsLocationInfoBase* + aLocationInfo ) + { + CLbsLocationInfo* locationInfo = static_cast + ( aLocationInfo ); + + RLbsAreaInfoBaseArray areaInfoArray; + + CleanupStack::PushL(TCleanupItem(*CleanUpAreaInfoArray, &areaInfoArray )); + + locationInfo->GetAreaInfoL( areaInfoArray ); + + // Leave with error if array count is zero. + TInt count = areaInfoArray.Count(); + if( !count ) + { + User::Leave( KErrArgument ); + } + + // Validate each and every area info object. + for( TInt i=0;iValidateDataL(); + } + CleanupStack::PopAndDestroy( &areaInfoArray ); + } + +// End of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/rlbslocmonitorareapositioner.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/rlbslocmonitorareapositioner.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +#include +#include +#include +#include +#include "rlbslocmonitorareapositioner.h" + + +EXPORT_C RLbsLocMonitorAreaPositioner::RLbsLocMonitorAreaPositioner() + : RSecureSubSessionBase(), + iPtrHolder(NULL) + { + } + +EXPORT_C void RLbsLocMonitorAreaPositioner::ConstructL() + { + iPtrHolder = CLbsLocMonitorPtrHolder::NewL(CLbsLocMonitorPtrHolder::ELastParam, 0); + } + +EXPORT_C void RLbsLocMonitorAreaPositioner::Destruct() + { + delete iPtrHolder; + iPtrHolder = NULL; + } + +EXPORT_C void RLbsLocMonitorAreaPositioner::OpenL(RLbsLocMonitorSession& aLocMonSession) + { + __ASSERT_ALWAYS(aLocMonSession.Handle() != 0, User::Invariant()); // trying to open twice + TInt err(KErrNone); + ConstructL(); + + // Call Server Framework 'Open' + TLbsLocMonitorAreaPositionerData emptyData; + TLbsLocMonitorSubSessionType type(ELocMonitorSubSessionTypeAreaPositioner); + err = RSecureSubSessionBase::Open(aLocMonSession, type, emptyData); + if (err != KErrNone) + { + Destruct(); + } + User::LeaveIfError(err); + } + +EXPORT_C void RLbsLocMonitorAreaPositioner::Close() + { + // Call Server Framework 'Close' + RSecureSubSessionBase::Close(); + Destruct(); + } + +/** +Method called by the Location Server to send the Last Known Position to the Location Monitor +for storing together with Local Area information if possible. + +@param aPosInfo the position object to be sent to the server (only the TPositionInfo portion + will be sent) +@return KErrNone if position is succesfully sent to server + KErrArgument if aPosInfo is not a TPositionInfo class or derived class. + Any of the error codes returned by RSessionBase::SendReceive +*/ +EXPORT_C TInt RLbsLocMonitorAreaPositioner::SetLastKnownPosition(const TPositionInfoBase& aPosInfo) const + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + __ASSERT_ALWAYS(iPtrHolder != NULL, User::Invariant()); + // Verify aPosInfo is of a type that contains a position + const TPositionInfoBase& infoBase = static_cast(aPosInfo); + TUint32 classType = infoBase.PositionClassType(); + if (!(classType & EPositionInfoClass)) + { + return KErrArgument; + } + + // Get the TPosition in aPosInfo and send to the Location Monitor + const TPositionInfo& posInfo = static_cast(aPosInfo); + TPosition position; + posInfo.GetPosition(position); + + TPckgC posPckg(position); + return SendReceive(ESetLastKnownPosition, TIpcArgs(&posPckg)); + } + + +/* Retrieve the position last stored in the database */ +EXPORT_C void RLbsLocMonitorAreaPositioner::GetLastKnownPosition(TPositionInfoBase& aPosInfo, + TRequestStatus& aStatus) const + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + __ASSERT_ALWAYS(iPtrHolder != NULL, User::Invariant()); + + // Ensure aPosInfo output parameter is at TPositionInfo or derived class + const TPositionInfoBase& infoBase = static_cast(aPosInfo); + TUint32 classType = infoBase.PositionClassType(); + if (!(classType & EPositionInfoClass)) + { + TRequestStatus* status = &aStatus; + User::RequestComplete(status, KErrArgument); + return; + } + + iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EPosForGetLastKnownPosition).Set( + reinterpret_cast(&aPosInfo), + aPosInfo.PositionClassSize(), + aPosInfo.PositionClassSize()); + + SendReceive(EGetLastKnownPosition, + TIpcArgs(&iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EPosForGetLastKnownPosition)), + aStatus); + } + +EXPORT_C TInt RLbsLocMonitorAreaPositioner::CancelGetLastKnownPosition() const + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + + return SendReceive(ECancelGetLastKnownPosition); + } + + +/** +Returns in aPosInfo a position which had been previously stored +in association with "context information" that is bound to a +geographical area (e.g. Global Cell Id). + +Current context information will be sensed by the server and used +to search for a position in the database. If found, the position +will be an approximation of the current position of the handset. +If no position is found in the database for the current context +information, the position last stored in the database is returned. + +The method returns in aAreaInfo a rough indication of how accurate the +returned position is based on an estimation of the size of the +geographical area covered by the sensed context information. +*/ +EXPORT_C void RLbsLocMonitorAreaPositioner::GetLastKnownPositionArea(TPositionInfoBase& aPosInfo, + TPositionAreaInfoBase& aAreaInfo, + TPosAreaReqParams& aParameters, + TRequestStatus& aStatus) const + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + __ASSERT_ALWAYS(iPtrHolder != NULL, User::Invariant()); + + // Ensure aPosInfo output parameter is at TPositionInfo or derived class + const TPositionInfoBase& infoBase = static_cast(aPosInfo); + TUint32 classType = infoBase.PositionClassType(); + if (!(classType & EPositionInfoClass)) + { + TRequestStatus* status = &aStatus; + User::RequestComplete(status, KErrArgument); + return; + } + + iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EPosForGetLastKnownPositionArea).Set( + reinterpret_cast(&aPosInfo), + aPosInfo.PositionClassSize(), + aPosInfo.PositionClassSize()); + + iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EAreaForGetLastKnownPositionArea).Set( + reinterpret_cast(&aAreaInfo), + aAreaInfo.PositionClassSize(), + aAreaInfo.PositionClassSize()); + + iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EParamsForGetLastKnownPositionArea).Set( + reinterpret_cast(&aParameters), + sizeof(TPosAreaReqParams), + sizeof(TPosAreaReqParams)); + + SendReceive(EGetLastKnownPositionArea, + TIpcArgs(&iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EPosForGetLastKnownPositionArea), + &iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EAreaForGetLastKnownPositionArea), + &iPtrHolder->Ptr(CLbsLocMonitorPtrHolder::EParamsForGetLastKnownPositionArea)), + aStatus); + } + +EXPORT_C TInt RLbsLocMonitorAreaPositioner::CancelGetLastKnownPositionArea() const + { + __ASSERT_ALWAYS(SubSessionHandle(), User::Invariant()); + return SendReceive(ECancelGetLastKnownPositionArea); + } + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/rlbslocmonitorsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/CommonClientServerApi/src/rlbslocmonitorsession.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2008 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: +* +*/ + + +#include "rlbslocmonitorsession.h" +#include "lbsdevloggermacros.h" +#include "tserverstartparams.h" +#include "cserverlaunch.h" +#include "lbslocmonitorserverdata.h" +#include "lbsprocessuiddefs.h" +#include "lbsipc.h" + + +//----------------------------------------------------------------------------- +// RLbsLocMonitorSession +//----------------------------------------------------------------------------- +EXPORT_C RLbsLocMonitorSession::RLbsLocMonitorSession() + { + LBSLOG(ELogP9, "->S RLbsLocMonitorSession::RLbsLocMonitorSession() lbslocmonitor.exe\n"); + } + +/** +Creates a session with the location monitor server. +This method starts the server if not yet started. + +@return Standard Symbian OS error code. +*/ +EXPORT_C TInt RLbsLocMonitorSession::Connect() + { + LBSLOG(ELogP9, "->S RLbsLocMonitorSession::Connect()\n"); + TInt ret(KErrNone); + TServerStartParams params; + params.SetServerFileName(KLocMonitorExeName); + params.SetServerName(KLocMonitorServerName); + params.SetNumberOfServerSlots(KLbsDefaultMessageSlots); + params.SetServerUids(KNullUid, KNullUid, KLbsLocMonitorUid); + + // Base class creates the session (and the server if required) + ret = RSecureSessionBase::Connect(params); + + LBSLOG2(ELogP9, " Return = %d\n", ret); + return ret; + } + +EXPORT_C void RLbsLocMonitorSession::Close() + { + LBSLOG(ELogP9, "->S RLbsLocMonitorSession::Close() lbslocationmonitor.exe\n"); + RSecureSessionBase::Close(); + } + +/** +Attempts to Cancel a previously issued asynchronous request to delete the +database of area-locations. + +The TRequestStatus of the original request will be set to KErrCancel if +the cancellation request was successful, or any other Symbian OS error code +if CancelRequest was called too late. + +@return Standard Symbian OS error code. + */ +EXPORT_C TInt RLbsLocMonitorSession::CancelDatabaseWipeOut() const + { + LBSLOG(ELogP9, "->S RLbsLocMonitorSession::CancelDatabaseWipeOut() lbslocationmonitor.exe\n"); + __ASSERT_ALWAYS(Handle(), User::Invariant()); + return SendReceive(ECancelDbWipeOut); + } + +EXPORT_C void RLbsLocMonitorSession::WipeOutDatabase(TRequestStatus& aStatus) const + { + LBSLOG(ELogP9, "->S RLbsLocMonitorSession::WipeOutDatabase() lbslocationmonitor.exe\n"); + __ASSERT_ALWAYS(Handle(), User::Invariant()); + return SendReceive(EWipeOutDb, aStatus); + } + +EXPORT_C TVersion RLbsLocMonitorSession::Version() +/** +Obtains the current version number of the location monitor. + +@return the version of the client API. + */ + { + LBSLOG(ELogP9, "->S RLbsLocMonitorSession::Version() lbslocationmonitor.exe\n"); + LBSLOG4(ELogP9, " Return TVersion = (%d, %d, %d)\n", KLbsLocMonitorMajorVersionNumber, + KLbsLocMonitorMinorVersionNumber, + KLbsLocMonitorBuildVersionNumber); + return TVersion( + KLbsLocMonitorMajorVersionNumber, + KLbsLocMonitorMinorVersionNumber, + KLbsLocMonitorBuildVersionNumber); + } + +TInt RLbsLocMonitorSession::StartServer(TServerStartParams& aParams) + { + return RSecureSessionBase::StartServer(aParams); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/BWINS/lbslocationinfoconverteru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/BWINS/lbslocationinfoconverteru.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,17 @@ +EXPORTS + ?NewL@CLbsLocationResolver@@SAPAV1@AAVMLbsLocationResolverObserver@@@Z @ 1 NONAME ; class CLbsLocationResolver * CLbsLocationResolver::NewL(class MLbsLocationResolverObserver &) + ?NewL@CLbsLocationInfoConverter@@SAPAV1@AAVMLbsLocationInfoConverterObserver@@VTUid@@@Z @ 2 NONAME ; class CLbsLocationInfoConverter * CLbsLocationInfoConverter::NewL(class MLbsLocationInfoConverterObserver &, class TUid) + ?NewL@CLbsLocationInfoConverter@@SAPAV1@AAVMLbsLocationInfoConverterObserver@@@Z @ 3 NONAME ; class CLbsLocationInfoConverter * CLbsLocationInfoConverter::NewL(class MLbsLocationInfoConverterObserver &) + ?CancelResolveLocation@CLbsLocationResolver@@QAEXXZ @ 4 NONAME ; void CLbsLocationResolver::CancelResolveLocation(void) + ?NewL@CLbsLocationResolver@@SAPAV1@AAVMLbsLocationResolverObserver@@VTUid@@@Z @ 5 NONAME ; class CLbsLocationResolver * CLbsLocationResolver::NewL(class MLbsLocationResolverObserver &, class TUid) + ?ConvertLocationInfoL@CLbsLocationInfoConverter@@QAEXAAV?$RPointerArray@VCLbsLocationInfoBase@@@@KK@Z @ 6 NONAME ; void CLbsLocationInfoConverter::ConvertLocationInfoL(class RPointerArray &, unsigned long, unsigned long) + ??1CLbsLocationResolver@@UAE@XZ @ 7 NONAME ; CLbsLocationResolver::~CLbsLocationResolver(void) + ?ResolveLocationL@CLbsLocationResolver@@QAEXABVCLbsLocationInfo@@@Z @ 8 NONAME ; void CLbsLocationResolver::ResolveLocationL(class CLbsLocationInfo const &) + ?Version@MLbsLocationInfoConverterObserver@@UBE?AVTVersion@@XZ @ 9 NONAME ; class TVersion MLbsLocationInfoConverterObserver::Version(void) const + ??1CLbsLocationInfoConverter@@UAE@XZ @ 10 NONAME ; CLbsLocationInfoConverter::~CLbsLocationInfoConverter(void) + ?Version@MLbsLocationResolverObserver@@UBE?AVTVersion@@XZ @ 11 NONAME ; class TVersion MLbsLocationResolverObserver::Version(void) const + ?ConvertLocationInfoL@CLbsLocationInfoConverter@@QAEXAAVCLbsLocationInfoBase@@KK@Z @ 12 NONAME ; void CLbsLocationInfoConverter::ConvertLocationInfoL(class CLbsLocationInfoBase &, unsigned long, unsigned long) + ?CancelConvertLocationInfo@CLbsLocationInfoConverter@@QAEXXZ @ 13 NONAME ; void CLbsLocationInfoConverter::CancelConvertLocationInfo(void) + ?SetConversionPreferences@CLbsLocationResolver@@QAEHK@Z @ 14 NONAME ; int CLbsLocationResolver::SetConversionPreferences(unsigned long) + ?ConversionPreferences@CLbsLocationResolver@@QAEKXZ @ 15 NONAME ; unsigned long CLbsLocationResolver::ConversionPreferences(void) + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/EABI/lbslocationinfoconverteru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/EABI/lbslocationinfoconverteru.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,29 @@ +EXPORTS + _ZN20CLbsLocationResolver16ResolveLocationLERK16CLbsLocationInfo @ 1 NONAME + _ZN20CLbsLocationResolver21CancelResolveLocationEv @ 2 NONAME + _ZN20CLbsLocationResolver4NewLER28MLbsLocationResolverObserver @ 3 NONAME + _ZN20CLbsLocationResolver4NewLER28MLbsLocationResolverObserver4TUid @ 4 NONAME + _ZN20CLbsLocationResolverD0Ev @ 5 NONAME + _ZN20CLbsLocationResolverD1Ev @ 6 NONAME + _ZN20CLbsLocationResolverD2Ev @ 7 NONAME + _ZN25CLbsLocationInfoConverter20ConvertLocationInfoLER13RPointerArrayI20CLbsLocationInfoBaseEmm @ 8 NONAME + _ZN25CLbsLocationInfoConverter20ConvertLocationInfoLER20CLbsLocationInfoBasemm @ 9 NONAME + _ZN25CLbsLocationInfoConverter25CancelConvertLocationInfoEv @ 10 NONAME + _ZN25CLbsLocationInfoConverter4NewLER33MLbsLocationInfoConverterObserver @ 11 NONAME + _ZN25CLbsLocationInfoConverter4NewLER33MLbsLocationInfoConverterObserver4TUid @ 12 NONAME + _ZN25CLbsLocationInfoConverterD0Ev @ 13 NONAME + _ZN25CLbsLocationInfoConverterD1Ev @ 14 NONAME + _ZN25CLbsLocationInfoConverterD2Ev @ 15 NONAME + _ZNK28MLbsLocationResolverObserver7VersionEv @ 16 NONAME + _ZNK33MLbsLocationInfoConverterObserver7VersionEv @ 17 NONAME + _ZTI24CLbsLocationResolverImpl @ 18 NONAME + _ZTI28MLbsLocationResolverObserver @ 19 NONAME + _ZTI29CLbsLocationInfoConverterImpl @ 20 NONAME + _ZTI33MLbsLocationInfoConverterObserver @ 21 NONAME + _ZTV24CLbsLocationResolverImpl @ 22 NONAME + _ZTV28MLbsLocationResolverObserver @ 23 NONAME + _ZTV29CLbsLocationInfoConverterImpl @ 24 NONAME + _ZTV33MLbsLocationInfoConverterObserver @ 25 NONAME + _ZN20CLbsLocationResolver21ConversionPreferencesEv @ 26 NONAME + _ZN20CLbsLocationResolver24SetConversionPreferencesEm @ 27 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +// 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: +// + + +PRJ_EXPORTS +../inc/lbslocationinfoconverter.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationinfoconverter.h) +../inc/lbslocationresolver.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationresolver.h) + + +lbslocationinfoconverter.iby /epoc32/rom/include/lbslocationinfoconverter.iby + + +PRJ_MMPFILES +lbslocationinfoconverter.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/group/lbslocationinfoconverter.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/group/lbslocationinfoconverter.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +/* +* 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: +* +*/ +#ifndef __LBS_LOCATIONINFOCONVERTER_IBY__ +#define __LBS_LOCATIONINFOCONVERTER_IBY__ +//#if !defined(SYMBIAN_EXCLUDE_LOCATION) + +file=ABI_DIR\DEBUG_DIR\lbslocationinfoconverter.dll sys\bin\lbslocationinfoconverter.dll + +//#endif // SYMBIAN_EXCLUDE_LOCATION + +#endif //__LBS_LOCATIONINFOCONVERTER_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/group/lbslocationinfoconverter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/group/lbslocationinfoconverter.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,44 @@ +// 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: +// + + +TARGET lbslocationinfoconverter.dll +TARGETTYPE dll +UID 0x1000008d 0x102871F9 + +VENDORID 0x70000001 +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE lbslocationinfoconverter.cpp +SOURCE lbslocationinfoconverterimpl.cpp +SOURCE lbslocationresolver.cpp +SOURCE lbslocationresolverimpl.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../../../CommonClientServerApi/inc +USERINCLUDE ../../../../../locationcore/LbsLocCommon/ServerFramework/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY lbslocationinfodatatypes.lib +LIBRARY lbslocmonclient.lib +LIBRARY lbs.lib +LIBRARY estor.lib + +SMPSAFE + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationinfoconverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationinfoconverter.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,226 @@ +/* +* 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: Class used by client applications to convert location +* information +* +*/ + +/** +@file +@publishedPartner +@prototype +*/ + +#ifndef LBS_LOCATION_INFO_CONVERTER_H +#define LBS_LOCATION_INFO_CONVERTER_H + + +// OS wide +#include + +// LBS wide +#include +#include +#include + +class CLbsLocationInfoConverterImpl; + + +/** +* The MLbsLocationInfoConverterObserver class is used in partnership with +* CLbsLocationInfoConverter. The observer interface is used by the LBS +* subsystem to inform a client application when a Locality conversion +* process initiated through the CLbsLocationInfoConverter class has been +* finished. In OnResolveLocationComplete the results will be returned +* as an argument of the function, while OnConversionComplete indicates that the results +* have been written in to the data that was passed in using ConvertLocationInfoL. +* +* Although all the interface methods in the MLbsLocationInfoConverterObserver +* class are synchronous, the client application should ensure they return quickly +* (e.g. any extensive processing of the received data is scheduled in another +* active object). +*/ +class MLbsLocationInfoConverterObserver + { + +public: + + /** + * Gets the current version of the observer interface. + * Derived classes should not change the implementation. + * + * @return Version number (currently 1.0.0) + */ + IMPORT_C virtual TVersion Version() const; + + /** + * The callback is used by the LBS subsystem to inform a client application + * that a general purpose Locality conversion process initiated through the + * CLbsLocationInfoConverter::ConvertLocationInfoL method has been finished. + * + * Receiving the callback indicates that, unless the conversion was not successful, + * the location data structures passed through the + * CLbsLocationInfoConverter::ConvertLocationInfoL method have been updated with the + * requested information. + * + * @param aStatusCode Result of the conversion operation; + * KErrNone if at least one conversion have been successful and + * the related location data structure(s) passed through the + * CLbsLocationInfoConverter::ConvertLocationInfoL method + * have been updated with the requested information; + * KErrNotSupported if the conversion type specified by + * aRequestedInfo is not supported by converter plugin + * KErrNotFound if none of conversions have been successful; + * Or other system wide error code othervise. +In here I think we should say that when the caller uses ConvertLocationInfoL( RLbsLocationInfoBaseArray& aLocationInfoArray, ..) then on OnConversionComplete the caller should iterate around all 'n' of the entries of the aLocationInfoArray and call GetAreaInfoL to see if there is any conversion results. OH I see below that you say something near the ConvertLocationInfoL method. Maybe should say it here as well to ti e together + */ + virtual void OnConversionComplete(TInt aStatusCode) = 0; + + }; + + + + +/** +* The CLbsLocationInfoConverter interface is used in partnership with MLbsLocationInfoConverterObserver +* and provides the services to convert location information between different formats. +* +* Completion of conversions is indicated by the LBS subsystem by invoking callbacks defined +* by the MLbsLocationInfoConverterObserver class. +* +* Currently the only supported conversion is from WLAN and/or GSM and/or WCDMA info into a geographic +* Locality. +*/ +NONSHARABLE_CLASS(CLbsLocationInfoConverter) : public CBase + { + +public: + + /** + * Allocates and construct a new CLbsLocationInfoConverter + * @param[in] aObserver An observer for location conversion event. + * @param[in] aConverterModuleId UID of the conversion plugin to be used. + */ + IMPORT_C static CLbsLocationInfoConverter* NewL( + MLbsLocationInfoConverterObserver& aObserver, + const TUid aConverterModuleId); + + /** + * Allocates and construct a new CLbsLocationInfoConverter + * Note here to say that impementations for both OnResolveLocationComplete and OnConversionComplete MUST be provided even though only interested in say, ConvertLocationFingerPrintToLocalityL + * Opens the default module. + * @param[in] aObserver An observer for location conversion event. + */ + IMPORT_C static CLbsLocationInfoConverter* NewL( + MLbsLocationInfoConverterObserver& aObserver); + + /** + * Destructor. + */ + IMPORT_C ~CLbsLocationInfoConverter(); + + /** + * A general purpose function that converts a single locationinfo. + * Completion of the conversion is indicated by the LBS subsystem by invoking the + * MLbsLocationInfoConverterObserver::OnConversionComplete + * and the caller can then iterate through the results returned in aLocationInfo + * + * @capability Location + * + * @param[in] aLocationInfo location information to be converted. + * @param[in] aConversionPrefs Conversion preferences suggested by client + * @param[in] aRequestedInfo Location information that is requested. Currently + * the only supported conversion is from WLAN and/or GSM and/or WCDMA info into + * a geographic position, hence the parameter should be set to ELbsConversionOutputPosition) + * Need to say that can only do one of either ConvertLocationFingerPrintToLocalityL or ConvertLocationInfoL at a time or else user is panicked + + * @leave KErrNoMemory if there is not enough memory available to perform the conversion. + * KErrArgument If the location info pointer is NULL. + */ + IMPORT_C void ConvertLocationInfoL( CLbsLocationInfoBase& aLocationInfo, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + + /** + * A general purpose function that converts multiple locationinfos. + * The maximum allowable batch size is defined by KPositionMaxBatchSize which is 500. + * Exceeding KPositionMaxBatchSize will result in KErrNotSupported being reported. + * + * Completion of the conversion is indicated by the LBS subsystem by invoking the + * MLbsLocationInfoConverterObserver::OnConversionComplete + * and the caller can then iterate through the results returned in aLocationInfoArray + * + * @capability Location + * + * @param[in] aLocationInfo An array of location information to be converted. + * @param[in] aConversionPrefs Conversion preferences suggested by client + * @param[in] aRequestedInfo Location information that is requested. Currently + * the only supported conversion is from WLAN and/or GSM and/or WCDMA info into + * a geographic position, hence the parameter should be set to ELbsConversionOutputPosition) + * + * @leave KErrNoMemory if there is not enough memory available to perform the conversion. + * KErrArgument If the location info pointer is NULL. + * KErrNotSupported if the conversion type specified by + * aRequestedInfo is not supported or if the bitmask specified by the + * client has all options set. This error is also returned if the + * batch size exceeds KPositionMaxBatchSize. + */ + IMPORT_C void ConvertLocationInfoL( RLbsLocationInfoBaseArray& aLocationInfoArray, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Cancels an ongoing conversion operation. + * If there is no ongoing conversion the cancellation request is ignored. + * + * Neither of the The MLbsLocationInfoConverterObserver callbacks will not be invoked if cancellation is successful. + */ + IMPORT_C void CancelConvertLocationInfo(); + +private: + + /** + * Default constructor + */ + CLbsLocationInfoConverter(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(MLbsLocationInfoConverterObserver& aObserver, + const TUid aConverterModuleId); + + /** + * Copy constructor. Restricted by default. + */ + CLbsLocationInfoConverter( CLbsLocationInfoConverter& ); + + /** + * Overloaded assignment operator. Restricted by default. + */ + CLbsLocationInfoConverter& operator=( CLbsLocationInfoConverter& ); + +private: + + /** + * Pointer to implementation class + */ + CLbsLocationInfoConverterImpl* iLocationInfoConverterImpl; + + }; + + + +#endif // LBS_LOCATION_INFO_CONVERTER_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationinfoconverterimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationinfoconverterimpl.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,142 @@ +/* +* 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: Class that implements location information converter +* information +* +*/ + + +#ifndef LBSLOCATIONINFOCONVERTERIMPL_H_ +#define LBSLOCATIONINFOCONVERTERIMPL_H_ + + +#include +#include +#include "rlbslocmonitorsession.h" +#include "rlbslocinfoconverter.h" +#include + + +// forward declaration +class MLbsLocationInfoConverterObserver; + + +/** + * Class implements the services exposed by CLbsLocationInfoConverter + */ +class CLbsLocationInfoConverterImpl : public CActive + { +public: + /** + * Allocates and construct a new CLbsLocationInfoConverterImpl + * + * @param[in] aObserver Handle to the observer implementation + * @param[in] aConversionModuleId ID of the conversion plugin to be used. + * @return Pointer to the implementation class of Location Info converter. + */ + static CLbsLocationInfoConverterImpl* NewL( MLbsLocationInfoConverterObserver& aObserver, + const TUid aConversionModuleId ); + + /** + * Destructor + */ + ~CLbsLocationInfoConverterImpl(); + + /** + * Converts one area info to position info + * @param[in] aLocationInfo location information corresponding to + * a geographical location is passed and on successful completion of this + * method,position information corresponding to the location information + * is returned in the observer callback. + * @param[in] aConversionPrefs Conversion preferences suggested by client + * @param[in] aRequestedInfo Location information that is requested. + * + * @leave KErrArgument If the location info array is empty or one of system + * wide error codes. + */ + void ConvertLocationInfoL( CLbsLocationInfoBase& aLocationInfo, + TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Converts the area informations of a group of geographical locations + * to its corresponding position information. + * @param[in][out] aLocationInfoArray Array of location informations + * corresponding to geographical locations are passed and on successful + * completion of this method,position information corresponding to the + * location informations are returned in the observer callback. + * @param[in] aConversionPrefs Conversion preferences suggested by client + * + * @leave KErrArgument If the location info array is empty or one of + * system wide error codes. + */ + void ConvertLocationInfoL( RLbsLocationInfoBaseArray& aLocationInfoArray, + TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Cancels get location info operation. + */ + void CancelConvertLocationInfo(); + +protected: // From CActive + void RunL(); + + void DoCancel(); + +private: + /** + * Default constructor + */ + CLbsLocationInfoConverterImpl( MLbsLocationInfoConverterObserver& aObserver ); + + /** + * Copy constructor. Restricted by default. + */ + CLbsLocationInfoConverterImpl( CLbsLocationInfoConverterImpl& ); + + /** + * Overloaded assignment operator. Restricted by default. + */ + CLbsLocationInfoConverterImpl& operator=( CLbsLocationInfoConverterImpl& ); + + /** + * Symbian 2 phase constructor. + */ + void ConstructL( const TUid aConversionModuleId ); + +private: // data + + /** + * Reference to the observer. + */ + MLbsLocationInfoConverterObserver& iObserver; + + /** + * Handle to session + */ + RLbsLocMonitorSession iLocMoniterSession; + + /** + * Handle to subsession + */ + RLbsLocInfoConverter iLocInfoConverter; + + /** + * Client specified conversion module id. + */ + TUid iConversionModuleId; + }; + +#endif // LBSLOCATIONINFOCONVERTERIMPL_H_ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationresolver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,159 @@ +/* +* 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: Class used by client applications to convert data +* such as such as WlanInfo or CellIds into TLocality position information +* +*/ + +/** +@file +@publishedPartner +@prototype +*/ + +#ifndef LBS_LOCATIONRESOLVER_H +#define LBS_LOCATIONRESOLVER_H + + +#include +#include +#include +#include + +class CLbsLocationResolverImpl; + + +class MLbsLocationResolverObserver + { + +public: + + /** + * Gets the current version of the observer interface. + * Derived classes should not change the implementation. + * + * @return Version number (currently 1.0.0) + */ + IMPORT_C virtual TVersion Version() const; + + /** + * The callback is used by the LBS subsystem to inform a client application + * that a simple CLbsLocationResolver conversion process initiated through the + * CLbsLocationResolver::ResolveLocationL method has been finished. + * + * @param aStatus status of conversion, KErrNone for success, standard system error code + * in other cases. Note that in the event of a cancellation this method will not execute. + * @param aBasicLocationInfo the location conversion that was requested. + * If the conversion has failed the values will be uninitialised + */ + virtual void OnResolveLocationComplete(TInt aStatus, const TLocality& aLocality) = 0; + + }; + + +NONSHARABLE_CLASS(CLbsLocationResolver) : public CBase + { + +public: + + /** + * Allocates and construct a new CLbsLocationResolver + * @param[in] aObserver An observer for location conversion event. + * @param[in] aConverterModuleId UID of the conversion plugin to be used. + */ + IMPORT_C static CLbsLocationResolver* NewL(MLbsLocationResolverObserver& aObserver, + const TUid aConverterModuleId); + + /** + * Allocates and construct a new CLbsLocationResolver + * @param[in] aObserver An observer for location conversion event. + */ + IMPORT_C static CLbsLocationResolver* NewL(MLbsLocationResolverObserver& aObserver); + + /** + * Destructor. + */ + IMPORT_C ~CLbsLocationResolver(); + + /** + * A simple function that converts a single Location Info into a TLocality + * No preferences or masks may be set. + * The result is returned in the MLbsLocationResolverObserver + * callback via OnResolveLocationComplete + * + * Only one outstanding conversion can be open at a time for each client. + * Attempting to perform more than one will result in a leave with KErrInUse + * + * @param[in] aLocationInfo the information to be converted into a location. + */ + IMPORT_C void ResolveLocationL(const CLbsLocationInfo& aLocationInfo); + + /** + * Sets the option for the conversion module's connection preferences [ eg. "online without prompt"] + * @param[in] aConversionPref - Enum specifying the connection preferences + * @return KErrArgument if the value is invalid, KErrNone otherwise + */ + IMPORT_C TInt SetConversionPreferences(TLbsConversionPrefs aConversionPrefs); + + /** + * Returns the option currently set for the conversion module's + * connection preference [ eg. "local cache"] + * @return The enum corresponding to the currently set connection preferences (ELbsConversionNotDefined will be + * returned if the conversion preferences have not been set yet) + */ + IMPORT_C TLbsConversionPrefs ConversionPreferences(); + + /** + * Cancels an ongoing conversion operation. + * If there is no ongoing conversion the cancellation request is ignored. + * + * The MLbsLocationResolverObserver callback will not be invoked + * if cancellation is successful. + */ + IMPORT_C void CancelResolveLocation(); + +protected: + /** + * Default constructor + */ + CLbsLocationResolver(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(MLbsLocationResolverObserver& aObserver, const TUid aConverterModuleId); + + +private: + /** + * Copy constructor. Restricted by default. + */ + CLbsLocationResolver(CLbsLocationResolver&); + + /** + * Overloaded assignment operator. Restricted by default. + */ + CLbsLocationResolver& operator=(CLbsLocationResolver&); + +private: + + /** + * Pointer to implementation class + */ + CLbsLocationResolverImpl* iLocationResolverImpl; + + }; + + +#endif // LBS_LOCATIONRESOLVER_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationresolverimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/inc/lbslocationresolverimpl.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,149 @@ +/* +* 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: Class that implements location information converter +* information +* +*/ + + +#ifndef LBSLOCATIONINFOCONVERTERIMPL_H_ +#define LBSLOCATIONINFOCONVERTERIMPL_H_ + + +#include +#include +#include "rlbslocmonitorsession.h" +#include "rlbslocinfoconverter.h" +#include + + +// forward declaration +class MLbsLocationResolverObserver; + + +/** + * Class implements the services exposed by CLbsLocationInfoConverter + */ +class CLbsLocationResolverImpl : public CActive + { +public: + /** + * Allocates and construct a new CLbsLocationResolverImpl + * + * @param[in] aObserver Handle to the observer implementation + * @param[in] aConversionModuleId ID of the conversion plugin to be used. + * @return Pointer to the implementation class of Location Info converter. + */ + static CLbsLocationResolverImpl* NewL( MLbsLocationResolverObserver& aObserver, + const TUid aConversionModuleId ); + + /** + * Destructor + */ + ~CLbsLocationResolverImpl(); + + /** + * Converts one area info to position info + * @param[in] aLocationInfo location information corresponding to + * a geographical location is passed and on successful completion of this + * method,position information corresponding to the location information + * is returned in the observer callback. + * @param[in] aConversionPrefs Conversion preferences suggested by client + * @param[in] aRequestedInfo Location information that is requested. + * + * @leave KErrArgument If the location info array is empty or one of system + * wide error codes. + */ + void ResolveLocationL(const CLbsLocationInfoBase& aLocationInfo); + + /** + * Cancels get location info operation. + */ + void CancelResolveLocation(); + + /** + * Sets the option for the conversion module's connection preferences [ eg. "online without prompt"] + * @param[in] aConversionPrefs - Enum specifying the connection preference + * @return KErrArgument if the value is invalid, KErrNone otherwise + */ + TInt SetConversionPreferences(TLbsConversionPrefs aConversionPrefs); + + /** + * Returns the option currently set for the conversion module's + * connection preference [ eg. "local cache"] + * @return The enum corresponding to the currently set connection preferences (ELbsConversionNotDefined will be + * returned if the conversion preferences have not been set yet) + */ + TLbsConversionPrefs ConversionPreferences(); + +protected: // From CActive + void RunL(); + + void DoCancel(); + +private: + /** + * Default constructor + */ + CLbsLocationResolverImpl( MLbsLocationResolverObserver& aObserver ); + + /** + * Copy constructor. Restricted by default. + */ + CLbsLocationResolverImpl( CLbsLocationResolverImpl& ); + + /** + * Overloaded assignment operator. Restricted by default. + */ + CLbsLocationResolverImpl& operator=( CLbsLocationResolverImpl& ); + + /** + * Symbian 2 phase constructor. + */ + void ConstructL( const TUid aConversionModuleId ); + +private: // data + + /** + * Copy of locationinfo passed in by client + */ + CLbsLocationInfo* iLocationInfo; + + /** + * Reference to the observer. + */ + MLbsLocationResolverObserver& iObserver; + + /** + * Handle to session + */ + RLbsLocMonitorSession iLocMoniterSession; + + /** + * Handle to subsession + */ + RLbsLocInfoConverter iLocInfoConverter; + + /** + * Client specified conversion module id. + */ + TUid iConversionModuleId; + + /** + * Conversion module's specific connection preferences + */ + TLbsConversionPrefs iConversionPrefs; + }; + +#endif // LBSLOCATIONINFOCONVERTERIMPL_H_ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationinfoconverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationinfoconverter.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,125 @@ +/* +* 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: Class used by client applications to convert location +* information +* +*/ + +#include +#include +#include +#include "lbslocationinfoconverterimpl.h" + + +EXPORT_C TVersion MLbsLocationInfoConverterObserver::Version() const + { + return TVersion(1, 0, 0); + } + + + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C CLbsLocationInfoConverter* CLbsLocationInfoConverter::NewL( + MLbsLocationInfoConverterObserver& aObserver, + const TUid aConverterModuleId ) + { + CLbsLocationInfoConverter* self = new( ELeave ) CLbsLocationInfoConverter; + CleanupStack::PushL( self ); + self->ConstructL( aObserver,aConverterModuleId ); + CleanupStack::Pop( self ); + return self; + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C CLbsLocationInfoConverter* CLbsLocationInfoConverter::NewL( + MLbsLocationInfoConverterObserver& aObserver ) + { + CLbsLocationInfoConverter* self = new( ELeave ) CLbsLocationInfoConverter; + CleanupStack::PushL( self ); + self->ConstructL( aObserver,TUid::Uid( KNullUidValue ) ); + CleanupStack::Pop( self ); + return self; + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::~CLbsLocationInfoConverter +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C CLbsLocationInfoConverter::~CLbsLocationInfoConverter() + { + delete iLocationInfoConverterImpl; + iLocationInfoConverterImpl = NULL; + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::ConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void CLbsLocationInfoConverter::ConvertLocationInfoL( + CLbsLocationInfoBase& aLocationInfo, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ) + { + iLocationInfoConverterImpl->ConvertLocationInfoL( aLocationInfo,aConversionPrefs, + aRequestedInfo ); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::ConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void CLbsLocationInfoConverter::ConvertLocationInfoL( + RLbsLocationInfoBaseArray& aLocationInfoArray, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ) + { + iLocationInfoConverterImpl->ConvertLocationInfoL( aLocationInfoArray, + aConversionPrefs,aRequestedInfo ); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::CancelConvertLocationInfo +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void CLbsLocationInfoConverter::CancelConvertLocationInfo() + { + iLocationInfoConverterImpl->CancelConvertLocationInfo(); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::ConstructL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationInfoConverter::ConstructL( + MLbsLocationInfoConverterObserver& aObserver, + const TUid aConverterModuleId ) + { + iLocationInfoConverterImpl = CLbsLocationInfoConverterImpl::NewL( + aObserver,aConverterModuleId ); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverter::CLbsLocationInfoConverter +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationInfoConverter::CLbsLocationInfoConverter() + { + + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationinfoconverterimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationinfoconverterimpl.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,132 @@ +/* +* 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: Implementation of CLbsLocationInfoConverterImpl class. +* +*/ + +#include "lbslocationinfoconverterimpl.h" +#include + + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationInfoConverterImpl* CLbsLocationInfoConverterImpl::NewL( + MLbsLocationInfoConverterObserver& aObserver, + const TUid aConverterModuleId ) + { + CLbsLocationInfoConverterImpl* self = new( ELeave ) CLbsLocationInfoConverterImpl( + aObserver ); + CleanupStack::PushL( self ); + self->ConstructL( aConverterModuleId ); + CleanupStack::Pop( self ); + return self; + } + + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::~CLbsLocationInfoConverterImpl +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationInfoConverterImpl::~CLbsLocationInfoConverterImpl() + { + iLocInfoConverter.Close(); + iLocMoniterSession.Close(); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::CLbsLocationInfoConverterImpl +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationInfoConverterImpl::CLbsLocationInfoConverterImpl( + MLbsLocationInfoConverterObserver& aObserver ): + CActive( EPriorityStandard ), + iObserver( aObserver ) + + { + CActiveScheduler::Add( this ); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::ConstructL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationInfoConverterImpl::ConstructL( const TUid aConverterModuleId ) + { + iConversionModuleId = aConverterModuleId; + User::LeaveIfError( iLocMoniterSession.Connect() ); + iLocInfoConverter.OpenL( iLocMoniterSession ); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::ConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationInfoConverterImpl::ConvertLocationInfoL( + CLbsLocationInfoBase& aLocationInfo, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ) + { + iLocInfoConverter.ConvertLocationInfoL( aLocationInfo,aConversionPrefs,aRequestedInfo, + iConversionModuleId,iStatus ); + SetActive(); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::ConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationInfoConverterImpl::ConvertLocationInfoL( + RLbsLocationInfoBaseArray& aLocationInfoArray, + TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ) + { + iLocInfoConverter.ConvertLocationInfoL( aLocationInfoArray,aConversionPrefs,aRequestedInfo, + iConversionModuleId,iStatus ); + SetActive(); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::CancelConvertLocationInfoL +// (other items were commented in a header). +//-------;--------------------------------------------------------- +void CLbsLocationInfoConverterImpl::CancelConvertLocationInfo() + { + Cancel(); + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::RunL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationInfoConverterImpl::RunL() + { + if( iStatus.Int() != KErrCancel ) + { + iObserver.OnConversionComplete( iStatus.Int() ); + } + } + +//---------------------------------------------------------------- +// CLbsLocationInfoConverterImpl::DoCancel +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationInfoConverterImpl::DoCancel() + { + iLocInfoConverter.CancelConvertLocationInfo(); + } + +// End of file + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationresolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationresolver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,127 @@ +/* +* 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: Class used by client applications to convert location +* information +* +*/ + +#include +#include +#include +#include "lbslocationresolverimpl.h" + + +EXPORT_C TVersion MLbsLocationResolverObserver::Version() const + { + return TVersion(1, 0, 0); + } + + + +//---------------------------------------------------------------- +// CLbsLocationResolver::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C CLbsLocationResolver* CLbsLocationResolver::NewL( + MLbsLocationResolverObserver& aObserver, + const TUid aConverterModuleId ) + { + CLbsLocationResolver* self = new( ELeave ) CLbsLocationResolver; + CleanupStack::PushL( self ); + self->ConstructL( aObserver,aConverterModuleId ); + CleanupStack::Pop( self ); + return self; + } + +//---------------------------------------------------------------- +// CLbsLocationResolver::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C CLbsLocationResolver* CLbsLocationResolver::NewL( + MLbsLocationResolverObserver& aObserver ) + { + CLbsLocationResolver* self = new( ELeave ) CLbsLocationResolver; + CleanupStack::PushL( self ); + self->ConstructL( aObserver,TUid::Uid( KNullUidValue ) ); + CleanupStack::Pop( self ); + return self; + } + +//---------------------------------------------------------------- +// CLbsLocationResolver::~CLbsLocationResolver +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C CLbsLocationResolver::~CLbsLocationResolver() + { + delete iLocationResolverImpl; + iLocationResolverImpl = NULL; + } + +//---------------------------------------------------------------- +// CLbsLocationResolver::ResolveLocationL +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void CLbsLocationResolver::ResolveLocationL(const CLbsLocationInfo& aLocationInfo) + { + iLocationResolverImpl->ResolveLocationL(aLocationInfo); + } + + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::SetConversionPreferences +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C TInt CLbsLocationResolver::SetConversionPreferences(TLbsConversionPrefs aConversionPrefs) + { + return iLocationResolverImpl->SetConversionPreferences(aConversionPrefs); + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::GetConversionPref +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C TLbsConversionPrefs CLbsLocationResolver::ConversionPreferences() + { + return iLocationResolverImpl->ConversionPreferences(); + } + +//---------------------------------------------------------------- +// CLbsLocationResolver::CancelResolveLocation +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void CLbsLocationResolver::CancelResolveLocation() + { + iLocationResolverImpl->CancelResolveLocation(); + } + +//---------------------------------------------------------------- +// CLbsLocationResolver::ConstructL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationResolver::ConstructL( + MLbsLocationResolverObserver& aObserver, + const TUid aConverterModuleId ) + { + iLocationResolverImpl = CLbsLocationResolverImpl::NewL( + aObserver,aConverterModuleId ); + } + +//---------------------------------------------------------------- +// CLbsLocationResolver::CLbsLocationResolver +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationResolver::CLbsLocationResolver() + { + + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationresolverimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionClientApi/src/lbslocationresolverimpl.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,235 @@ +/* +* 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: Implementation of CLbsLocationResolverImpl class. +* +*/ + +#include +#include "lbslocationresolverimpl.h" +#include + + +void CleanUpAreaInfoArray(TAny* aArray) + { + static_cast(aArray)->ResetAndDestroy(); + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationResolverImpl* CLbsLocationResolverImpl::NewL( + MLbsLocationResolverObserver& aObserver, + const TUid aConverterModuleId ) + { + CLbsLocationResolverImpl* self = new( ELeave ) CLbsLocationResolverImpl( + aObserver ); + CleanupStack::PushL( self ); + self->ConstructL( aConverterModuleId ); + CleanupStack::Pop( self ); + return self; + } + + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::~CLbsLocationResolverImpl +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationResolverImpl::~CLbsLocationResolverImpl() + { + if(iLocationInfo) + { + delete iLocationInfo; + iLocationInfo = NULL; + } + iLocInfoConverter.Close(); + iLocMoniterSession.Close(); + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::CLbsLocationResolverImpl +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocationResolverImpl::CLbsLocationResolverImpl( + MLbsLocationResolverObserver& aObserver): + CActive(EPriorityStandard), + iObserver(aObserver) + { + CActiveScheduler::Add( this ); + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::ConstructL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationResolverImpl::ConstructL( const TUid aConverterModuleId ) + { + iConversionModuleId = aConverterModuleId; + User::LeaveIfError( iLocMoniterSession.Connect() ); + iLocInfoConverter.OpenL( iLocMoniterSession ); + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::ConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationResolverImpl::ResolveLocationL(const CLbsLocationInfoBase& aLocationInfo) + { + if(IsActive()) + { + User::Leave(KErrInUse); + } + + CBufFlat* buffer = CBufFlat::NewL(512); + CleanupStack::PushL(buffer); + RBufWriteStream writeStream; + writeStream.Open(*buffer); + CleanupClosePushL(writeStream); + + + aLocationInfo.ExternaliseL(writeStream); + writeStream.CommitL(); + + RBufReadStream readStream(*buffer); + CleanupClosePushL(readStream); + iLocationInfo = CLbsLocationInfo::NewL(); + iLocationInfo->InternaliseL(readStream); + + iLocInfoConverter.ConvertLocationInfoL(*iLocationInfo, iConversionPrefs, + ELbsConversionOutputPosition, + iConversionModuleId, iStatus); + CleanupStack::PopAndDestroy(&readStream); + CleanupStack::PopAndDestroy(&writeStream); + CleanupStack::PopAndDestroy(buffer); + + SetActive(); + } + + + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::CancelConvertLocationInfoL +// (other items were commented in a header). +//-------;--------------------------------------------------------- +void CLbsLocationResolverImpl::CancelResolveLocation() + { + Cancel(); + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::RunL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationResolverImpl::RunL() + { + TLocality result; + + if(iStatus.Int() == KErrNone) + { + if(iLocationInfo) + { + RLbsAreaInfoBaseArray areaInfoArray; + CleanupStack::PushL(TCleanupItem(*CleanUpAreaInfoArray, &areaInfoArray )); + iLocationInfo->GetAreaInfoL(areaInfoArray, CLbsLocationInfo::ELbsPosInfo); + TInt count = areaInfoArray.Count(); + if(count >0) + { + CLbsPositionInfo* posInfo = static_cast(areaInfoArray[0]); + posInfo->GetLocality(result); + } + else + { + iObserver.OnResolveLocationComplete(KErrGeneral, result); + } + CleanupStack::PopAndDestroy( &areaInfoArray ); + delete iLocationInfo; + iLocationInfo = NULL; + } + } + if(iStatus.Int() != KErrCancel) + { + iObserver.OnResolveLocationComplete(iStatus.Int(), result); + } + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::DoCancel +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocationResolverImpl::DoCancel() + { + iLocInfoConverter.CancelConvertLocationInfo(); + if(iLocationInfo) + { + delete iLocationInfo; + iLocationInfo = NULL; + } + } + + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::SetConversionPreferences +// (other items were commented in a header). +//---------------------------------------------------------------- +TInt CLbsLocationResolverImpl::SetConversionPreferences(TLbsConversionPrefs aConversionPrefs) + { + TInt retVal = KErrNone; + //The acceptable values for the TLbsConversionPrefs Enums are such that only one of the 32 bits is set + //and bit combinations are not permitted. + TLbsConversionPrefs copyConvPrefs = aConversionPrefs; + TUint bitCount = 0; + for (TUint count = 1; count <= 32; count++) + { + //Check if the LeastSignificantBit is set to 1 + if ( (copyConvPrefs) & (1) ) + { + bitCount++; + if (bitCount > 1) + { + break; + } + } + copyConvPrefs = (copyConvPrefs >> 1); + if (copyConvPrefs == 0) + { + break; + } + } + + //Check if only one of the 32 bits is set in aConversionPref + if (bitCount == 1) + { + iConversionPrefs = aConversionPrefs; + } + else + { + retVal = KErrArgument; + } + + return retVal; + } + +//---------------------------------------------------------------- +// CLbsLocationResolverImpl::ConversionPreferences +// (other items were commented in a header). +//---------------------------------------------------------------- + TLbsConversionPrefs CLbsLocationResolverImpl::ConversionPreferences() + { + return iConversionPrefs; + } + + + +// End of file + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionCommon/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionCommon/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,18 @@ +// 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: +// + + +PRJ_EXPORTS +../inc/lbslocationinfoconvertercommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationinfoconvertercommon.h) diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionCommon/inc/lbslocationinfoconvertercommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionCommon/inc/lbslocationinfoconvertercommon.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,122 @@ +/* +* 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: Common enumerations used by client applications and plugins +* for conversion of location information. +* +*/ + +/** +@file +@publishedPartner +@prototype +*/ + +#ifndef LBS_LOCATION_INFO_CONVERTER_COMMON_H +#define LBS_LOCATION_INFO_CONVERTER_COMMON_H + +#include + +/** + * Conversion preferences + */ +typedef TUint32 TLbsConversionPrefs; + + +/** + * Enumeration to define the preferences a client can specify while requesting + * location information. The conversion preferences enumeration shall not be + * used as a bitmask. + * The preferences are used by conversion module in order to decide if/how + * a connection to an external server should be established. + */ +enum _TLbsConversionPrefs + { + + /** + * Indicates that no preferences are specified. + */ + ELbsConversionNotDefined = 0x0000, + + /** + * Use only local cache to retrieve information. + */ + ELbsConversionCacheOnly = 0x0001, + + /** + * Disable prompt while making a connection to an external service for + * conversion. + * Ignored if a conversion module does not require external connection. + */ + ELbsConversionSilent = 0x0002, + + /** + * Allow prompt while making a connection to an external service for + * conversion. + * * Ignored if a conversion module does not require external connection. + */ + ELbsConversionPrompt = 0x0004, + + /** + * + * Allow Wlan Only to make a connection only using W-Lan. + * + */ + ELbsWlanOnly = 0x0008 + + }; + + +/** + * Output Location Information + */ +typedef TUint32 TLbsConversionOutputInfoMask; + + +/** + * Enumeration to define the type(s) of location information being communicated + */ +enum _TLbsConversionOutputInfoMask + { + + /** + * Used to initialise data only. Should not be used when requesting conversions. + */ + ELbsConversionOutputNotDefined = 0x0000, + + /** + * Indicates that the input data should be converted to a geographical coordinate + * @see CLbsPositionInfo + */ + ELbsConversionOutputPosition = 0x0001, + + /** + * Indicates that the input data should be converted to a GSM Cell information + * @see CLbsGsmCellInfo + */ + ELbsConversionOutputGsm = 0x0002, + + /** + * Indicates that the input data should be converted to a WCDMA Cell information + * @see CLbsWcdmaCellInfo + */ + ELbsConversionOutputWcdma = 0x0004, + + /** + * Indicates that the input data should be converted to a WLAN information + * @see CLbsWlanInfo + */ + ELbsConversionOutputWlan = 0x0008 + }; + +#endif // LBS_LOCATION_INFO_CONVERTER_COMMON_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/BWINS/lbslocationinfoconverterpluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/BWINS/lbslocationinfoconverterpluginu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,18 @@ +EXPORTS + ?ExtendedInterface@MLbsLocInfoConverterPluginObserver@@EAEPAXHPAX0@Z @ 1 NONAME ; void * MLbsLocInfoConverterPluginObserver::ExtendedInterface(int, void *, void *) + ?NewL@CLbsLocInfoConverterPluginBase@@SAPAV1@VTUid@@AAVTLbsLocInfoConverterPluginParams@@@Z @ 2 NONAME ; class CLbsLocInfoConverterPluginBase * CLbsLocInfoConverterPluginBase::NewL(class TUid, class TLbsLocInfoConverterPluginParams &) + ?ClassType@TLbsLocInfoConverterPluginClassTypeBase@@QBEKXZ @ 3 NONAME ; unsigned long TLbsLocInfoConverterPluginClassTypeBase::ClassType(void) const + ??0TLbsLocInfoConverterPluginClassTypeBase@@IAE@XZ @ 4 NONAME ; TLbsLocInfoConverterPluginClassTypeBase::TLbsLocInfoConverterPluginClassTypeBase(void) + ?Observer@TLbsLocInfoConverterPluginParams@@QBEAAVMLbsLocInfoConverterPluginObserver@@XZ @ 5 NONAME ; class MLbsLocInfoConverterPluginObserver & TLbsLocInfoConverterPluginParams::Observer(void) const + ?Version@CLbsLocInfoConverterPluginBase@@UBE?AVTVersion@@XZ @ 6 NONAME ; class TVersion CLbsLocInfoConverterPluginBase::Version(void) const + ??1CLbsLocInfoConverterPluginBase@@UAE@XZ @ 7 NONAME ; CLbsLocInfoConverterPluginBase::~CLbsLocInfoConverterPluginBase(void) + ??0TLbsLocInfoConverterPluginParams@@QAE@AAVMLbsLocInfoConverterPluginObserver@@@Z @ 8 NONAME ; TLbsLocInfoConverterPluginParams::TLbsLocInfoConverterPluginParams(class MLbsLocInfoConverterPluginObserver &) + ?ClassSize@TLbsLocInfoConverterPluginClassTypeBase@@QBEIXZ @ 9 NONAME ; unsigned int TLbsLocInfoConverterPluginClassTypeBase::ClassSize(void) const + ?ExtendedInterface@CLbsLocInfoConverterPluginBase@@UAEPAXHPAX0@Z @ 10 NONAME ; void * CLbsLocInfoConverterPluginBase::ExtendedInterface(int, void *, void *) + ?Version@MLbsLocInfoConverterPluginObserver@@UBE?AVTVersion@@XZ @ 11 NONAME ; class TVersion MLbsLocInfoConverterPluginObserver::Version(void) const + ?IsPluginPositionToBeCached@TLbsConversionPluginInfo@@QBEHXZ @ 12 NONAME ; int TLbsConversionPluginInfo::IsPluginPositionToBeCached(void) const + ??0TLbsConversionPluginInfo@@QAE@XZ @ 13 NONAME ; TLbsConversionPluginInfo::TLbsConversionPluginInfo(void) + ?SetPluginCapabilitiesMask@TLbsConversionPluginInfo@@QAEXK@Z @ 14 NONAME ; void TLbsConversionPluginInfo::SetPluginCapabilitiesMask(unsigned long) + ?SetIsPluginPositionToBeCached@TLbsConversionPluginInfo@@QAEXH@Z @ 15 NONAME ; void TLbsConversionPluginInfo::SetIsPluginPositionToBeCached(int) + ?PluginCapabilitiesMask@TLbsConversionPluginInfo@@QBEKXZ @ 16 NONAME ; unsigned long TLbsConversionPluginInfo::PluginCapabilitiesMask(void) const + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/EABI/lbslocationinfoconverterpluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/EABI/lbslocationinfoconverterpluginu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +EXPORTS + _ZN30CLbsLocInfoConverterPluginBase17ExtendedInterfaceEiPvS0_ @ 1 NONAME + _ZN30CLbsLocInfoConverterPluginBase4NewLE4TUidR32TLbsLocInfoConverterPluginParams @ 2 NONAME + _ZN30CLbsLocInfoConverterPluginBaseD0Ev @ 3 NONAME + _ZN30CLbsLocInfoConverterPluginBaseD1Ev @ 4 NONAME + _ZN30CLbsLocInfoConverterPluginBaseD2Ev @ 5 NONAME + _ZN32TLbsLocInfoConverterPluginParamsC1ER34MLbsLocInfoConverterPluginObserver @ 6 NONAME + _ZN32TLbsLocInfoConverterPluginParamsC2ER34MLbsLocInfoConverterPluginObserver @ 7 NONAME + _ZN34MLbsLocInfoConverterPluginObserver17ExtendedInterfaceEiPvS0_ @ 8 NONAME + _ZN39TLbsLocInfoConverterPluginClassTypeBaseC1Ev @ 9 NONAME + _ZN39TLbsLocInfoConverterPluginClassTypeBaseC2Ev @ 10 NONAME + _ZNK30CLbsLocInfoConverterPluginBase7VersionEv @ 11 NONAME + _ZNK32TLbsLocInfoConverterPluginParams8ObserverEv @ 12 NONAME + _ZNK34MLbsLocInfoConverterPluginObserver7VersionEv @ 13 NONAME + _ZNK39TLbsLocInfoConverterPluginClassTypeBase9ClassSizeEv @ 14 NONAME + _ZNK39TLbsLocInfoConverterPluginClassTypeBase9ClassTypeEv @ 15 NONAME + _ZTI30CLbsLocInfoConverterPluginBase @ 16 NONAME + _ZTI34MLbsLocInfoConverterPluginObserver @ 17 NONAME + _ZTV30CLbsLocInfoConverterPluginBase @ 18 NONAME + _ZTV34MLbsLocInfoConverterPluginObserver @ 19 NONAME + _ZN24TLbsConversionPluginInfo25SetPluginCapabilitiesMaskEm @ 20 NONAME + _ZN24TLbsConversionPluginInfo29SetIsPluginPositionToBeCachedEi @ 21 NONAME + _ZN24TLbsConversionPluginInfoC1Ev @ 22 NONAME + _ZN24TLbsConversionPluginInfoC2Ev @ 23 NONAME + _ZNK24TLbsConversionPluginInfo22PluginCapabilitiesMaskEv @ 24 NONAME + _ZNK24TLbsConversionPluginInfo26IsPluginPositionToBeCachedEv @ 25 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +// 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: +// + + +PRJ_EXPORTS +../inc/lbslocinfoconverterpluginbase.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocinfoconverterpluginbase.h) +../inc/lbslocinfoconverterpluginclasstypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocinfoconverterpluginclasstypes.h) +../inc/lbslocinfoconverterplugincommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocinfoconverterplugincommon.h) +../inc/lbslocinfoconverterpluginbase.hrh SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocinfoconverterpluginbase.hrh) + +lbslocationinfoconverterplugin.iby /epoc32/rom/include/lbslocationinfoconverterplugin.iby + + +PRJ_MMPFILES +lbslocationinfoconverterplugin.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/group/lbslocationinfoconverterplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/group/lbslocationinfoconverterplugin.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +/* +* 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: +* +*/ +//#ifndef __LBS_LOCATIONINFOCONVERTERPLUGIN_IBY__ +#define __LBS_LOCATIONINFOCONVERTERPLUGIN_IBY__ +//#if !defined(SYMBIAN_EXCLUDE_LOCATION) + +file=ABI_DIR\DEBUG_DIR\lbslocationinfoconverterplugin.dll sys\bin\lbslocationinfoconverterplugin.dll + + +//#endif // SYMBIAN_EXCLUDE_LOCATION + +//#endif //__LBS_LOCATIONINFOCONVERTERPLUGIN_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/group/lbslocationinfoconverterplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/group/lbslocationinfoconverterplugin.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,36 @@ +// 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: +// + + +TARGET lbslocationinfoconverterplugin.dll +TARGETTYPE dll +UID 0x1000008d 0x102871FA + +VENDORID 0x70000001 +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE lbslocinfoconverterpluginbase.cpp +SOURCE lbslocinfoconverterplugincommon.cpp + +USERINCLUDE ../inc +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY lbslocationinfodatatypes.lib + +SMPSAFE + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterpluginbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterpluginbase.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2008 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: Location information converter plug in API +* +*/ + + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef LBS_LOC_INFO_CONVERSION_PLUGIN_BASE_H +#define LBS_LOC_INFO_CONVERSION_PLUGIN_BASE_H + + +// System wide +#include + +// Common LBS data types +#include +#include + +// Component specific +#include +#include + + +class TLbsLocInfoConverterPluginParams; + + +/** +* The MLbsLocInfoConverterPluginObserver class is used in partnership with +* CLbsLocInfoConverterPluginBase. The observer interface is used by a +* conversion plugin to inform LBS when a coordinate conversion process +* initiated through the CLbsLocInfoConverterPluginBase class is completed. +* +* Although all the interface methods in the MLbsLocInfoConverterPluginObserver +* class are synchronous, the LBS subsystem ensures they return quickly. +*/ +class MLbsLocInfoConverterPluginObserver + { + +public: + + /** + * Gets the current version of the observer interface. + * Derived classes should not change the implementation. + * + * @return Version number (currently 1.0.0) + */ + IMPORT_C virtual TVersion Version() const; + + /** + * The callback is used by the conversion plugin to inform the LBS + * subsystem that a validation request initiated through the + * CLbsLocInfoConverterPluginBase::ValidateClient method is completed. + * + * @param aStatusCode Result of the validation operation. + * KErrNone if the access is granted. + * KErrPermissionDenied due to a potential security violation. + * Other system wide error codes. + */ + IMPORT_C virtual void OnValidationComplete( TInt aStatusCode ) = 0; + + /** + * The callback is used by the conversion plugin to inform the LBS + * subsystem that a coordinate conversion process initiated through the + * CLbsLocInfoConverterPluginBase::ConvertLocationInfoL method is + * completed. + * + * Receiving the callback indicates that, unless the conversion was not + * successful, the location data structures passed through the + * CLbsLocInfoConverterPluginBase::ConvertLocationInfoL method have been + * updated with the requested information. + * + * @param aStatusCode Result of the conversion operation. + * KErrNone if at least one conversion have been successful and + * the related location data structure(s) passed through the + * CLbsLocInfoConverterPluginBase::ConvertLocationInfoL method + * have been updated with the requested information; + * KErrKErrNotFound if none of conversions have been successful + * Or other system wide error code otherwise. + */ + IMPORT_C virtual void OnConversionComplete( TInt aStatusCode ) = 0; + +private: + + /** + * This methods is reserved for future expansion and should not be used or + * implemented by derived classes. + */ + IMPORT_C virtual TAny* ExtendedInterface( TInt aFunctionNumber, + TAny* aPtr1, + TAny* aPtr2 ); + + }; + + +/** +* The CLbsLocInfoConverterPluginBase is the abstract Ecom interface to a +* coordinate conversion Plugin. All coordinate conversion Plugins must derive +* from and implement this interface. +* +* The interface is used in partnership with MLbsLocInfoConverterPluginObserver +* and is used by the LBS subsystem to request conversion of location +* information between different formats. +* +* Completion of conversions must be indicated by a plugin by invoking +* callback(s) defined by the MLbsLocInfoConverterPluginObserver class. +* +* Although all the interface methods in the class are synchronous they must +* return immediately. When the LBS subsystem makes a request via +* CLbsLocInfoConverterPluginBase the Plugin must queue the request internally +* and return control to the caller immediately. Later on, when plugin provides +* a response, it uses the corresponding notification method in the +* MLbsLocInfoConverterPluginObserver class. +*/ +class CLbsLocInfoConverterPluginBase : public CBase + { + +public: + + /** + * Loads a coordinate conversion Plugin and initalises it. + * + * @param[in] aImplementationUid An implementation Uid of the module to be + * loaded. + * @param[in] aParams Arguments sent to conversion plugin. + * + * @return Pointer to the new coordinate conversion plugin. + */ + IMPORT_C static CLbsLocInfoConverterPluginBase* NewL( + TUid aImplementationUid, + TLbsLocInfoConverterPluginParams& aParams ); + + /** + * Destructor + */ + IMPORT_C virtual ~CLbsLocInfoConverterPluginBase(); + + /** + * Gets the current version of the interface implemented by a Plugin. + * Derived classes should not change the implementation. + * + * @return Version number (currently 1.0.0) + */ + IMPORT_C virtual TVersion Version() const; + + /** + * Validates a client before a request is processed. This method is called + * by the Location Monitor Server, everytime, before a conversion request is + * sent. + * The result of validation is indicated by the plugin by invoking the + * MLbsLocInfoConverterPluginObserver::OnValidationComplete callback. + * + * @param[in] aSecureId The secure ID of the client application/process + * @param[in] aVendorId The vendor ID of the client application/process + * @param{in] aRequestedInfo The requested converted information. This + * bit field would be checked by the plugin to determine if the specified + * conversion can be supported for the requesting client. + */ + IMPORT_C virtual void ValidateClient( const TSecureId& aSecureId, + const TVendorId& aVendorId, + const TLbsConversionOutputInfoMask aRequestedInfo) = 0; + + /** + * Cancels an ongoing validation operation. + * If there is no ongoing validation operation, the cancellation request + * is ignored. + * + * The MLbsLocInfoConverterPluginObserver::OnValidationComplete callback is + * not invoked. + */ + IMPORT_C virtual void CancelValidateClient() = 0; + + /** + * Converts multiple location information. + * + * Completion of the conversion is indicated by a Plugin by invoking the + * MLbsLocInfoConverterPluginObserver::OnConversionComplete callback + * + * @param[in] aLocationInfo An array of location information for which + * corresponding position information is expected. + * @param[in] aConversionPrefs Conversion preferences suggested by client + * @param[in] aRequestedInfo Location information that is requested. + + * @leave KErrNoMemory if there is not enough memory available to perform + * the conversion. + * KErrArgument If the location info pointer is NULL. + * KErrNotSupported if the conversion type specified by aRequestedInfo is + * not supported. + * Or any other system wide error code. + */ + IMPORT_C virtual void ConvertLocationInfoL( + RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ) = 0; + + /** + * Cancels an ongoing conversion operation. + * If there is no ongoing conversion the cancellation request is ignored. + * + * The MLbsLocInfoConverterPluginObserver::OnConversionComplete callback is + * not invoked. + */ + IMPORT_C virtual void CancelConvertLocationInfo() = 0; + + + /** + * This method is used to read the conversion plugin's preferences such as + * its capability to use wlan/gsm/wcdma/pos information to perform the requested conversion + * or whether position that it returns after conversion should be retained in the cache. + */ + IMPORT_C virtual void ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ) = 0; + + /** + * This method is reserved for future expansion and should not be used + * or implemented by derived classes. + */ + IMPORT_C virtual TAny* ExtendedInterface( TInt aFunctionNumber, + TAny* aPtr1, + TAny* aPtr2 ); + +private: // data + + /** + * Instance identifier key. When instance of an implementation is + * created by ECOM framework, the framework will assign UID + * for it. The UID is used in destructor to notify framework that + * this instance is being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; + + }; + + +/** +* This class encapsulates the construction parameters for a Coordinate +* Conversion plugin. +* +* These parameters are passed by the LBS subsystem to the implementation +* of the Plugin module via ECom. The ECom constructor +* should take a single TAny* parameter. That parameter should be cast to +* a variable of type TLbsLocInfoConverterPluginParams. +* +* @see CLbsLocInfoConverterPluginBase::NewL +*/ +class TLbsLocInfoConverterPluginParams : public TLbsLocInfoConverterPluginClassTypeBase + { + +public: + + /** + * This class encapsulates the construction parameters for a Coordinate + * Conversion plugin implementation. + * + * When created, the LBS subsystem must provide a reference to the + * plugin's observer. + * + * @see MLbsLocInfoConverterPluginObserver + * @see CLbsLocInfoConverterPluginBase::NewL + */ + IMPORT_C TLbsLocInfoConverterPluginParams( + MLbsLocInfoConverterPluginObserver& aObserver ); + + /** + * Returns a reference to the observer. + * + * @see MLbsLocInfoConverterPluginObserver + * @see CLbsLocInfoConverterPluginBase::NewL + */ + IMPORT_C MLbsLocInfoConverterPluginObserver& Observer() const; + +protected: + + /** + * Handle to the plugin observer + */ + MLbsLocInfoConverterPluginObserver& iObserver; + + /** + * Reserved for future use + */ + TUint8 iReserved[20]; + + }; + +#endif // LBS_LOC_INFO_CONVERSION_PLUGIN_BASE_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterpluginbase.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterpluginbase.hrh Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2008 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: Resource headers for project +* +*/ + + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef LBSLOCINFOCONVERTERPLUGINBASE_HRH +#define LBSLOCINFOCONVERTERPLUGINBASE_HRH + +// ECom interface ID for Location information converter Plugin API +#define KLbsLocInfoConverterPlugInInterfaceId (0x10287201) + + +#endif // LBSLOCINFOCONVERTERPLUGINBASE_HRH diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterpluginclasstypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterpluginclasstypes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,51 @@ +/* +* 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: Common enumerations used by client applications and plugins +* for conversion of location information. +* +*/ + +/** +@file +@publishedPartner +@prototype +*/ + + +#ifndef LBS_LOC_INFO_CONV_PLUGIN_CLASS_TYPES_H +#define LBS_LOC_INFO_CONV_PLUGIN_CLASS_TYPES_H + + +/** Type used for identifying class types */ +typedef TUint32 TLbsLocInfoConverterPluginParamsClassType; + + +/** + * Class types for TLbsLocInfoConverterPluginParams and its derived classes + */ +enum _TLbsLocInfoConverterPluginParamsClassType + { + /** Should be used for data initialisation only */ + ELbsLocInfoConverterPluginParamsUnknownClass = 0x00, + + /** Identifier for TLbsLocInfoConverterPluginParams class */ + ELbsLocInfoConverterPluginParamsClass = 0x01, + + /** Not used. */ + ELbsLocInfoConverterPluginParamsLastClass = 0xFFFFFFFF + }; + + +#endif // LBS_LOC_INFO_CONV_PLUGIN_CLASS_TYPES_H + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterplugincommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/inc/lbslocinfoconverterplugincommon.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,136 @@ +/* +* 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: Base class for all the class representing +* location informations. +* +*/ + +/** +@file +@publishedPartner +@prototype +*/ + +#ifndef LBS_LOCATION_CONVERTER_PLUGIN_COMMON_H +#define LBS_LOCATION_CONVERTER_PLUGIN_COMMON_H + +#include + + +/** +The generic base for classes that store conversion Plugin Interface +related information +*/ +class TLbsLocInfoConverterPluginClassTypeBase + { +public: + IMPORT_C TUint32 ClassType() const; + IMPORT_C TUint ClassSize() const; + +protected: + IMPORT_C TLbsLocInfoConverterPluginClassTypeBase(); + +protected: + /** The type of the derived class */ + TUint32 iClassType; + /** The size of the derived class */ + TUint iClassSize; + }; + +/** + * Conversion plugin's capabilities + */ +typedef TUint32 TLbsConversionPluginCapabilityMask; + +/** + * Enums that are used as bitmasks to define the capabilities of the conversion plugin. + */ +enum _TLbsConversionPluginCapabilityMask + { + /** + * Bitmask indicating the conversion plugin's capability has not been defined. + */ + ELbsPluginCapabilityNotDefined = 0x00, + + /** + * Bitmask indicating the conversion plugin's capability to use position information + * for the conversion. + */ + ELbsPluginCapabilityPosInfo = 0x01, + + /** + * Bitmask indicating the conversion plugin's capability to use GSM cell information + * for the conversion. + */ + ELbsPluginCapabilityGsmInfo = 0x02, + + /** + * Bitmask indicating the conversion plugin's capability to use WCDMA cell information + * for the conversion. + */ + ELbsPluginCapabilityWcdmaInfo = 0x04, + + /** + * Bitmask indicating the conversion plugin's capability to use WLAN AP information + * for the conversion. + */ + ELbsPluginCapabilityWlanInfo = 0x08, + + /** + * Bitmask indicating the conversion plugin's capability to use all area information + * for the conversion. + */ + ELbsPluginCapabilityAreaInfoAll = 0xFFFFFFFF + }; + + +/** + * Class used to read the preferences of the conversion plugin such as its capability to use + * gsm/wlan/wcdma information during conversion and whether the position that it returns is to be + * stored in the cache. + */ +class TLbsConversionPluginInfo + { +public: + IMPORT_C TLbsConversionPluginInfo(); + +public: + /** + * Read the flag indicating if the conversion result is to be cached + */ + IMPORT_C TBool IsPluginPositionToBeCached() const; + + /** + * Read the currently set capabilities + */ + IMPORT_C TLbsConversionPluginCapabilityMask PluginCapabilitiesMask() const; + + /** + * Sets the flag indicating if the conversion result returned from the plugin is + * to be cached. + */ + IMPORT_C void SetIsPluginPositionToBeCached(TBool aCachePluginPosition); + + /** + * Sets the bitmask representing the capabilities of the conversion plugin. + */ + IMPORT_C void SetPluginCapabilitiesMask(TLbsConversionPluginCapabilityMask aCapabilitiesMask); + +private: + TBool iIsPluginPositionToBeCached; + TLbsConversionPluginCapabilityMask iCapabilitiesMask; + TUint32 iReserved[8]; + }; + +#endif // LBS_LOCATION_CONVERTER_PLUGIN_COMMON_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/src/lbslocinfoconverterpluginbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/src/lbslocinfoconverterpluginbase.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,120 @@ +/* +* 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: Implentation of functions shared between all +* implementations of the LBS Network Protocol Module +* interface/ECom plugin. +* +*/ + + +#include +#include + +#include +#include + + +// --------------------------------------------------------------------------- +// MLbsLocInfoConverterPluginObserver::ExtendedInterface() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TVersion MLbsLocInfoConverterPluginObserver::Version() const + { + return TVersion( 1, 0, 0 ); + } + +// --------------------------------------------------------------------------- +// MLbsLocInfoConverterPluginObserver::ExtendedInterface() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TAny* MLbsLocInfoConverterPluginObserver::ExtendedInterface( + TInt /*aFunctionNumber*/, + TAny* /*aPtr1*/, + TAny* /*aPtr2*/ ) + { + return NULL; + } + +// --------------------------------------------------------------------------- +// CLbsLocInfoConverterPluginBase::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsLocInfoConverterPluginBase* CLbsLocInfoConverterPluginBase::NewL( + TUid aImplementationUid, + TLbsLocInfoConverterPluginParams& aParams ) + { + TAny* ptr = REComSession::CreateImplementationL( aImplementationUid, + _FOFF( CLbsLocInfoConverterPluginBase, iDtor_ID_Key ), + reinterpret_cast( &aParams ) ); + + return reinterpret_cast(ptr); + } + +// --------------------------------------------------------------------------- +// CLbsLocInfoConverterPluginBase::~CLbsLocInfoConverterPluginBase() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsLocInfoConverterPluginBase::~CLbsLocInfoConverterPluginBase() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } + +// --------------------------------------------------------------------------- +// CLbsLocInfoConverterPluginBase::Version() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TVersion CLbsLocInfoConverterPluginBase::Version() const + { + return TVersion( 1, 0, 0 ); + } + +// --------------------------------------------------------------------------- +// CLbsLocInfoConverterPluginBase::ExtendedInterface() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TAny* CLbsLocInfoConverterPluginBase::ExtendedInterface( + TInt /*aFunctionNumber*/, + TAny* /*aPtr1*/, + TAny* /*aPtr2*/ ) + { + return NULL; + } + +// --------------------------------------------------------------------------- +// TLbsLocInfoConverterPluginParams::TLbsLocInfoConverterPluginParams() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsLocInfoConverterPluginParams::TLbsLocInfoConverterPluginParams( + MLbsLocInfoConverterPluginObserver& aObserver ):iObserver(aObserver) + { + iClassType = ELbsLocInfoConverterPluginParamsClass; + iClassSize = sizeof(TLbsLocInfoConverterPluginParams); + } + +// --------------------------------------------------------------------------- +// TLbsLocInfoConverterPluginParams::Observer() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C MLbsLocInfoConverterPluginObserver& TLbsLocInfoConverterPluginParams::Observer() const + { + return iObserver; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/src/lbslocinfoconverterplugincommon.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionApi/ConversionPluginApi/src/lbslocinfoconverterplugincommon.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,103 @@ +/* +* 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: Implentation of functions shared between all +* implementations of the LBS Network Protocol Module +* interface/ECom plugin. +* +*/ + +#include +#include + + +// --------------------------------------------------------------------------- +// TLbsLocInfoConverterPluginClassTypeBase::TLbsLocInfoConverterPluginClassTypeBase() +// Default constructor for TLbsLocInfoConverterPluginClassTypeBase +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsLocInfoConverterPluginClassTypeBase::TLbsLocInfoConverterPluginClassTypeBase() +: iClassType(0), + iClassSize(0) + { + } + +// --------------------------------------------------------------------------- +// TLbsLocInfoConverterPluginClassTypeBase::ClassSize() +// Returns the size of the TLbsLocInfoConverterPluginClassTypeBase-derived class +// --------------------------------------------------------------------------- +// +EXPORT_C TUint TLbsLocInfoConverterPluginClassTypeBase::ClassSize() const + { + return iClassSize; + } + +// --------------------------------------------------------------------------- +// TLbsLocInfoConverterPluginClassTypeBase::ClassType() +// Returns the type of the TLbsLocInfoConverterPluginClassTypeBase-derived class +// --------------------------------------------------------------------------- +// +EXPORT_C TUint32 TLbsLocInfoConverterPluginClassTypeBase::ClassType() const + { + return iClassType; + } + +//---------------------------------------------------------------- +// TLbsConversionPluginInfo::TLbsConversionPluginInfo +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C TLbsConversionPluginInfo::TLbsConversionPluginInfo() : + iIsPluginPositionToBeCached(EFalse), + iCapabilitiesMask(ELbsPluginCapabilityNotDefined) + { + + } + +//---------------------------------------------------------------- +// TLbsConversionPluginInfo::TLbsConversionPluginInfo +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C TBool TLbsConversionPluginInfo::IsPluginPositionToBeCached() const + { + return iIsPluginPositionToBeCached; + } + +//---------------------------------------------------------------- +// TLbsConversionPluginInfo::PluginCapabilitiesMask +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C TLbsConversionPluginCapabilityMask TLbsConversionPluginInfo::PluginCapabilitiesMask() const + { + return iCapabilitiesMask; + } + +//---------------------------------------------------------------- +// TLbsConversionPluginInfo::SetPluginPositionToBeCached +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void TLbsConversionPluginInfo::SetIsPluginPositionToBeCached( + TBool aCachePluginPosition) + { + iIsPluginPositionToBeCached = aCachePluginPosition; + } + +//---------------------------------------------------------------- +// TLbsConversionPluginInfo::SetPluginCapabilitiesMask +// (other items were commented in a header). +//---------------------------------------------------------------- +EXPORT_C void TLbsConversionPluginInfo::SetPluginCapabilitiesMask( + TLbsConversionPluginCapabilityMask aCapabilitiesMask) + { + iCapabilitiesMask = aCapabilitiesMask; + } + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/BWINS/lbslocationinfodatatypesu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/BWINS/lbslocationinfodatatypesu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,85 @@ +EXPORTS + ??1CLbsLocationInfo@@UAE@XZ @ 1 NONAME ; CLbsLocationInfo::~CLbsLocationInfo(void) + ?SetMobileNetworkCode@CLbsWcdmaCellInfo@@QAEXH@Z @ 2 NONAME ; void CLbsWcdmaCellInfo::SetMobileNetworkCode(int) + ?SetMobileCountryCode@CLbsWcdmaCellInfo@@QAEXH@Z @ 3 NONAME ; void CLbsWcdmaCellInfo::SetMobileCountryCode(int) + ??1CLbsWlanInfo@@UAE@XZ @ 4 NONAME ; CLbsWlanInfo::~CLbsWlanInfo(void) + ??1CLbsAreaInfoBase@@UAE@XZ @ 5 NONAME ; CLbsAreaInfoBase::~CLbsAreaInfoBase(void) + ?MobileCountryCode@CLbsGsmCellInfo@@QBEHXZ @ 6 NONAME ; int CLbsGsmCellInfo::MobileCountryCode(void) const + ?ScramblingCode@CLbsWcdmaCellInfo@@QBEHXZ @ 7 NONAME ; int CLbsWcdmaCellInfo::ScramblingCode(void) const + ?Bsic@TLbsGsmNeighbourCellInfo@@QBEHXZ @ 8 NONAME ; int TLbsGsmNeighbourCellInfo::Bsic(void) const + ?AddNeighbouringCellInfoL@CLbsGsmCellInfo@@QAEXPAVTLbsGsmNeighbourCellInfo@@@Z @ 9 NONAME ; void CLbsGsmCellInfo::AddNeighbouringCellInfoL(class TLbsGsmNeighbourCellInfo *) + ?SetCellId@CLbsGsmCellInfo@@QAEXH@Z @ 10 NONAME ; void CLbsGsmCellInfo::SetCellId(int) + ?ScramblingCode@TLbsWcdmaNeighbourCellInfo@@QBEHXZ @ 11 NONAME ; int TLbsWcdmaNeighbourCellInfo::ScramblingCode(void) const + ?Pathloss@TLbsWcdmaNeighbourCellInfo@@QBEHXZ @ 12 NONAME ; int TLbsWcdmaNeighbourCellInfo::Pathloss(void) const + ?GetMacAddress@CLbsWlanInfo@@QBEXAAVTDes8@@@Z @ 13 NONAME ; void CLbsWlanInfo::GetMacAddress(class TDes8 &) const + ?NewL@CLbsWcdmaCellInfo@@SAPAV1@XZ @ 14 NONAME ; class CLbsWcdmaCellInfo * CLbsWcdmaCellInfo::NewL(void) + ?SetUniqueCellId@CLbsWcdmaCellInfo@@QAEXH@Z @ 15 NONAME ; void CLbsWcdmaCellInfo::SetUniqueCellId(int) + ?SetSignalStrength@CLbsWlanInfo@@QAEXH@Z @ 16 NONAME ; void CLbsWlanInfo::SetSignalStrength(int) + ?AddNeighbouringCellInfoL@CLbsWcdmaCellInfo@@QAEXPAVTLbsWcdmaNeighbourCellInfo@@@Z @ 17 NONAME ; void CLbsWcdmaCellInfo::AddNeighbouringCellInfoL(class TLbsWcdmaNeighbourCellInfo *) + ?NewL@CLbsLocationInfo@@SAPAV1@XZ @ 18 NONAME ; class CLbsLocationInfo * CLbsLocationInfo::NewL(void) + ?GetNeighbouringCellInfoL@CLbsWcdmaCellInfo@@QBEXAAV?$RArray@VTLbsWcdmaNeighbourCellInfo@@@@@Z @ 19 NONAME ; void CLbsWcdmaCellInfo::GetNeighbouringCellInfoL(class RArray &) const + ?GetAreaInfoL@CLbsLocationInfo@@QAEXAAV?$RPointerArray@VCLbsAreaInfoBase@@@@K@Z @ 20 NONAME ; void CLbsLocationInfo::GetAreaInfoL(class RPointerArray &, unsigned long) + ??0TLbsWcdmaNeighbourCellInfo@@QAE@HHHH@Z @ 21 NONAME ; TLbsWcdmaNeighbourCellInfo::TLbsWcdmaNeighbourCellInfo(int, int, int, int) + ?AddAreaInfoL@CLbsLocationInfo@@QAEXPAVCLbsAreaInfoBase@@@Z @ 22 NONAME ; void CLbsLocationInfo::AddAreaInfoL(class CLbsAreaInfoBase *) + ??0TLbsWcdmaNeighbourCellInfo@@QAE@XZ @ 23 NONAME ; TLbsWcdmaNeighbourCellInfo::TLbsWcdmaNeighbourCellInfo(void) + ?NewL@CLbsGsmCellInfo@@SAPAV1@HHHH@Z @ 24 NONAME ; class CLbsGsmCellInfo * CLbsGsmCellInfo::NewL(int, int, int, int) + ?Type@CLbsLocationInfoBase@@UAEKXZ @ 25 NONAME ; unsigned long CLbsLocationInfoBase::Type(void) + ?SetMacAddress@CLbsWlanInfo@@QAEXABVTDesC8@@@Z @ 26 NONAME ; void CLbsWlanInfo::SetMacAddress(class TDesC8 const &) + ?NewLC@CLbsLocationInfo@@SAPAV1@XZ @ 27 NONAME ; class CLbsLocationInfo * CLbsLocationInfo::NewLC(void) + ?SetRxLevel@TLbsGsmNeighbourCellInfo@@QAEXH@Z @ 28 NONAME ; void TLbsGsmNeighbourCellInfo::SetRxLevel(int) + ?ExternaliseL@CLbsLocationInfoBase@@QBEXAAVRWriteStream@@@Z @ 29 NONAME ; void CLbsLocationInfoBase::ExternaliseL(class RWriteStream &) const + ??1CLbsWcdmaCellInfo@@UAE@XZ @ 30 NONAME ; CLbsWcdmaCellInfo::~CLbsWcdmaCellInfo(void) + ?RxLevel@CLbsGsmCellInfo@@QBEHXZ @ 31 NONAME ; int CLbsGsmCellInfo::RxLevel(void) const + ?Arfcn@TLbsGsmNeighbourCellInfo@@QBEHXZ @ 32 NONAME ; int TLbsGsmNeighbourCellInfo::Arfcn(void) const + ?CellId@CLbsGsmCellInfo@@QBEHXZ @ 33 NONAME ; int CLbsGsmCellInfo::CellId(void) const + ?Type@CLbsLocationInfo@@MAEKXZ @ 34 NONAME ; unsigned long CLbsLocationInfo::Type(void) + ??1CLbsGsmCellInfo@@UAE@XZ @ 35 NONAME ; CLbsGsmCellInfo::~CLbsGsmCellInfo(void) + ?SetArfcn@TLbsGsmNeighbourCellInfo@@QAEXH@Z @ 36 NONAME ; void TLbsGsmNeighbourCellInfo::SetArfcn(int) + ?TimingAdvance@CLbsGsmCellInfo@@QBEHXZ @ 37 NONAME ; int CLbsGsmCellInfo::TimingAdvance(void) const + ?ResetNeighbouringCellInfo@CLbsGsmCellInfo@@QAEXXZ @ 38 NONAME ; void CLbsGsmCellInfo::ResetNeighbouringCellInfo(void) + ?NewL@CLbsWcdmaCellInfo@@SAPAV1@HHH@Z @ 39 NONAME ; class CLbsWcdmaCellInfo * CLbsWcdmaCellInfo::NewL(int, int, int) + ?InternaliseL@CLbsLocationInfoBase@@QAEXAAVRReadStream@@@Z @ 40 NONAME ; void CLbsLocationInfoBase::InternaliseL(class RReadStream &) + ??0TLbsGsmNeighbourCellInfo@@QAE@HHH@Z @ 41 NONAME ; TLbsGsmNeighbourCellInfo::TLbsGsmNeighbourCellInfo(int, int, int) + ?SignalStrength@TLbsWcdmaNeighbourCellInfo@@QBEHXZ @ 42 NONAME ; int TLbsWcdmaNeighbourCellInfo::SignalStrength(void) const + ?MobileNetworkCode@CLbsGsmCellInfo@@QBEHXZ @ 43 NONAME ; int CLbsGsmCellInfo::MobileNetworkCode(void) const + ?SetRxLevel@CLbsGsmCellInfo@@QAEXH@Z @ 44 NONAME ; void CLbsGsmCellInfo::SetRxLevel(int) + ?GetLocality@CLbsPositionInfo@@QBEXAAVTLocality@@@Z @ 45 NONAME ; void CLbsPositionInfo::GetLocality(class TLocality &) const + ?ExternaliseL@CLbsAreaInfoBase@@QAEXAAVRWriteStream@@@Z @ 46 NONAME ; void CLbsAreaInfoBase::ExternaliseL(class RWriteStream &) + ?SetScramblingCode@CLbsWcdmaCellInfo@@QAEXH@Z @ 47 NONAME ; void CLbsWcdmaCellInfo::SetScramblingCode(int) + ?MobileCountryCode@CLbsWcdmaCellInfo@@QBEHXZ @ 48 NONAME ; int CLbsWcdmaCellInfo::MobileCountryCode(void) const + ?RxLevel@TLbsGsmNeighbourCellInfo@@QBEHXZ @ 49 NONAME ; int TLbsGsmNeighbourCellInfo::RxLevel(void) const + ?SetScramblingCode@TLbsWcdmaNeighbourCellInfo@@QAEXH@Z @ 50 NONAME ; void TLbsWcdmaNeighbourCellInfo::SetScramblingCode(int) + ?SetLocationAreaCode@CLbsGsmCellInfo@@QAEXH@Z @ 51 NONAME ; void CLbsGsmCellInfo::SetLocationAreaCode(int) + ?SignalStrength@CLbsWlanInfo@@QBEHXZ @ 52 NONAME ; int CLbsWlanInfo::SignalStrength(void) const + ?SetTimingAdvance@CLbsGsmCellInfo@@QAEXH@Z @ 53 NONAME ; void CLbsGsmCellInfo::SetTimingAdvance(int) + ?GetNeighbouringCellInfoL@CLbsGsmCellInfo@@QBEXAAV?$RArray@VTLbsGsmNeighbourCellInfo@@@@@Z @ 54 NONAME ; void CLbsGsmCellInfo::GetNeighbouringCellInfoL(class RArray &) const + ?SetSignalStrength@TLbsWcdmaNeighbourCellInfo@@QAEXH@Z @ 55 NONAME ; void TLbsWcdmaNeighbourCellInfo::SetSignalStrength(int) + ?NewL@CLbsWlanInfo@@SAPAV1@XZ @ 56 NONAME ; class CLbsWlanInfo * CLbsWlanInfo::NewL(void) + ?SetPathloss@TLbsWcdmaNeighbourCellInfo@@QAEXH@Z @ 57 NONAME ; void TLbsWcdmaNeighbourCellInfo::SetPathloss(int) + ??0TLbsGsmNeighbourCellInfo@@QAE@XZ @ 58 NONAME ; TLbsGsmNeighbourCellInfo::TLbsGsmNeighbourCellInfo(void) + ?NewL@CLbsGsmCellInfo@@SAPAV1@XZ @ 59 NONAME ; class CLbsGsmCellInfo * CLbsGsmCellInfo::NewL(void) + ?ResetAreaInfo@CLbsLocationInfo@@QAEXK@Z @ 60 NONAME ; void CLbsLocationInfo::ResetAreaInfo(unsigned long) + ?SetBsic@TLbsGsmNeighbourCellInfo@@QAEXH@Z @ 61 NONAME ; void TLbsGsmNeighbourCellInfo::SetBsic(int) + ?SetMobileCountryCode@CLbsGsmCellInfo@@QAEXH@Z @ 62 NONAME ; void CLbsGsmCellInfo::SetMobileCountryCode(int) + ?UniqueCellId@CLbsWcdmaCellInfo@@QBEHXZ @ 63 NONAME ; int CLbsWcdmaCellInfo::UniqueCellId(void) const + ?SetLocality@CLbsPositionInfo@@QAEXABVTLocality@@@Z @ 64 NONAME ; void CLbsPositionInfo::SetLocality(class TLocality const &) + ?UniqueCellId@TLbsWcdmaNeighbourCellInfo@@QBEHXZ @ 65 NONAME ; int TLbsWcdmaNeighbourCellInfo::UniqueCellId(void) const + ?LocationAreaCode@CLbsGsmCellInfo@@QBEHXZ @ 66 NONAME ; int CLbsGsmCellInfo::LocationAreaCode(void) const + ?NewL@CLbsWlanInfo@@SAPAV1@ABV?$TBuf8@$0BC@@@H@Z @ 67 NONAME ; class CLbsWlanInfo * CLbsWlanInfo::NewL(class TBuf8<18> const &, int) + ?NewL@CLbsPositionInfo@@SAPAV1@XZ @ 68 NONAME ; class CLbsPositionInfo * CLbsPositionInfo::NewL(void) + ?NewL@CLbsPositionInfo@@SAPAV1@ABVTLocality@@@Z @ 69 NONAME ; class CLbsPositionInfo * CLbsPositionInfo::NewL(class TLocality const &) + ?InternaliseL@CLbsAreaInfoBase@@QAEXAAVRReadStream@@@Z @ 70 NONAME ; void CLbsAreaInfoBase::InternaliseL(class RReadStream &) + ?SetMobileNetworkCode@CLbsGsmCellInfo@@QAEXH@Z @ 71 NONAME ; void CLbsGsmCellInfo::SetMobileNetworkCode(int) + ??1CLbsPositionInfo@@UAE@XZ @ 72 NONAME ; CLbsPositionInfo::~CLbsPositionInfo(void) + ?Type@CLbsAreaInfoBase@@UAEKXZ @ 73 NONAME ; unsigned long CLbsAreaInfoBase::Type(void) + ??1CLbsLocationInfoBase@@UAE@XZ @ 74 NONAME ; CLbsLocationInfoBase::~CLbsLocationInfoBase(void) + ?SetUniqueCellId@TLbsWcdmaNeighbourCellInfo@@QAEXH@Z @ 75 NONAME ; void TLbsWcdmaNeighbourCellInfo::SetUniqueCellId(int) + ?MobileNetworkCode@CLbsWcdmaCellInfo@@QBEHXZ @ 76 NONAME ; int CLbsWcdmaCellInfo::MobileNetworkCode(void) const + ?ResetNeighbouringCellInfo@CLbsWcdmaCellInfo@@QAEXXZ @ 77 NONAME ; void CLbsWcdmaCellInfo::ResetNeighbouringCellInfo(void) + ?NewL@CLbsPositionInfo@@SAPAV1@ABV1@@Z @ 78 NONAME ; class CLbsPositionInfo * CLbsPositionInfo::NewL(class CLbsPositionInfo const &) + ?NewL@CLbsGsmCellInfo@@SAPAV1@ABV1@@Z @ 79 NONAME ; class CLbsGsmCellInfo * CLbsGsmCellInfo::NewL(class CLbsGsmCellInfo const &) + ?NewL@CLbsWcdmaCellInfo@@SAPAV1@ABV1@@Z @ 80 NONAME ; class CLbsWcdmaCellInfo * CLbsWcdmaCellInfo::NewL(class CLbsWcdmaCellInfo const &) + ?NewL@CLbsWlanInfo@@SAPAV1@ABV1@@Z @ 81 NONAME ; class CLbsWlanInfo * CLbsWlanInfo::NewL(class CLbsWlanInfo const &) + ?SetSignalStrength@CLbsWcdmaCellInfo@@QAEXH@Z @ 82 NONAME ; void CLbsWcdmaCellInfo::SetSignalStrength(int) + ?SignalStrength@CLbsWcdmaCellInfo@@QBEHXZ @ 83 NONAME ; int CLbsWcdmaCellInfo::SignalStrength(void) const + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/EABI/lbslocationinfodatatypesu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/EABI/lbslocationinfodatatypesu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,103 @@ +EXPORTS + _ZN12CLbsWlanInfo13SetMacAddressERK6TDesC8 @ 1 NONAME + _ZN12CLbsWlanInfo17SetSignalStrengthEi @ 2 NONAME + _ZN12CLbsWlanInfo4NewLERK5TBuf8ILi18EEi @ 3 NONAME + _ZN12CLbsWlanInfo4NewLEv @ 4 NONAME + _ZN12CLbsWlanInfoD0Ev @ 5 NONAME + _ZN12CLbsWlanInfoD1Ev @ 6 NONAME + _ZN12CLbsWlanInfoD2Ev @ 7 NONAME + _ZN15CLbsGsmCellInfo10SetRxLevelEi @ 8 NONAME + _ZN15CLbsGsmCellInfo16SetTimingAdvanceEi @ 9 NONAME + _ZN15CLbsGsmCellInfo19SetLocationAreaCodeEi @ 10 NONAME + _ZN15CLbsGsmCellInfo20SetMobileCountryCodeEi @ 11 NONAME + _ZN15CLbsGsmCellInfo20SetMobileNetworkCodeEi @ 12 NONAME + _ZN15CLbsGsmCellInfo24AddNeighbouringCellInfoLEP24TLbsGsmNeighbourCellInfo @ 13 NONAME + _ZN15CLbsGsmCellInfo25ResetNeighbouringCellInfoEv @ 14 NONAME + _ZN15CLbsGsmCellInfo4NewLEiiii @ 15 NONAME + _ZN15CLbsGsmCellInfo4NewLEv @ 16 NONAME + _ZN15CLbsGsmCellInfo9SetCellIdEi @ 17 NONAME + _ZN15CLbsGsmCellInfoD0Ev @ 18 NONAME + _ZN15CLbsGsmCellInfoD1Ev @ 19 NONAME + _ZN15CLbsGsmCellInfoD2Ev @ 20 NONAME + _ZN16CLbsAreaInfoBase12ExternaliseLER12RWriteStream @ 21 NONAME + _ZN16CLbsAreaInfoBase12InternaliseLER11RReadStream @ 22 NONAME + _ZN16CLbsAreaInfoBase4TypeEv @ 23 NONAME + _ZN16CLbsAreaInfoBaseD0Ev @ 24 NONAME + _ZN16CLbsAreaInfoBaseD1Ev @ 25 NONAME + _ZN16CLbsAreaInfoBaseD2Ev @ 26 NONAME + _ZN16CLbsLocationInfo12AddAreaInfoLEP16CLbsAreaInfoBase @ 27 NONAME + _ZN16CLbsLocationInfo12GetAreaInfoLER13RPointerArrayI16CLbsAreaInfoBaseEm @ 28 NONAME + _ZN16CLbsLocationInfo13ResetAreaInfoEm @ 29 NONAME + _ZN16CLbsLocationInfo4NewLEv @ 30 NONAME + _ZN16CLbsLocationInfo4TypeEv @ 31 NONAME + _ZN16CLbsLocationInfo5NewLCEv @ 32 NONAME + _ZN16CLbsLocationInfoD0Ev @ 33 NONAME + _ZN16CLbsLocationInfoD1Ev @ 34 NONAME + _ZN16CLbsLocationInfoD2Ev @ 35 NONAME + _ZN16CLbsPositionInfo11SetLocalityERK9TLocality @ 36 NONAME + _ZN16CLbsPositionInfo4NewLERK9TLocality @ 37 NONAME + _ZN16CLbsPositionInfo4NewLEv @ 38 NONAME + _ZN16CLbsPositionInfoD0Ev @ 39 NONAME + _ZN16CLbsPositionInfoD1Ev @ 40 NONAME + _ZN16CLbsPositionInfoD2Ev @ 41 NONAME + _ZN17CLbsWcdmaCellInfo15SetUniqueCellIdEi @ 42 NONAME + _ZN17CLbsWcdmaCellInfo17SetScramblingCodeEi @ 43 NONAME + _ZN17CLbsWcdmaCellInfo20SetMobileCountryCodeEi @ 44 NONAME + _ZN17CLbsWcdmaCellInfo20SetMobileNetworkCodeEi @ 45 NONAME + _ZN17CLbsWcdmaCellInfo24AddNeighbouringCellInfoLEP26TLbsWcdmaNeighbourCellInfo @ 46 NONAME + _ZN17CLbsWcdmaCellInfo25ResetNeighbouringCellInfoEv @ 47 NONAME + _ZN17CLbsWcdmaCellInfo4NewLEiii @ 48 NONAME + _ZN17CLbsWcdmaCellInfo4NewLEv @ 49 NONAME + _ZN17CLbsWcdmaCellInfoD0Ev @ 50 NONAME + _ZN17CLbsWcdmaCellInfoD1Ev @ 51 NONAME + _ZN17CLbsWcdmaCellInfoD2Ev @ 52 NONAME + _ZN20CLbsLocationInfoBase12InternaliseLER11RReadStream @ 53 NONAME + _ZN20CLbsLocationInfoBase4TypeEv @ 54 NONAME + _ZN20CLbsLocationInfoBaseD0Ev @ 55 NONAME + _ZN20CLbsLocationInfoBaseD1Ev @ 56 NONAME + _ZN20CLbsLocationInfoBaseD2Ev @ 57 NONAME + _ZN24TLbsGsmNeighbourCellInfo10SetRxLevelEi @ 58 NONAME + _ZN24TLbsGsmNeighbourCellInfo7SetBsicEi @ 59 NONAME + _ZN24TLbsGsmNeighbourCellInfo8SetArfcnEi @ 60 NONAME + _ZN24TLbsGsmNeighbourCellInfoC1Eiii @ 61 NONAME + _ZN24TLbsGsmNeighbourCellInfoC1Ev @ 62 NONAME + _ZN24TLbsGsmNeighbourCellInfoC2Eiii @ 63 NONAME + _ZN24TLbsGsmNeighbourCellInfoC2Ev @ 64 NONAME + _ZN26TLbsWcdmaNeighbourCellInfo11SetPathlossEi @ 65 NONAME + _ZN26TLbsWcdmaNeighbourCellInfo15SetUniqueCellIdEi @ 66 NONAME + _ZN26TLbsWcdmaNeighbourCellInfo17SetScramblingCodeEi @ 67 NONAME + _ZN26TLbsWcdmaNeighbourCellInfo17SetSignalStrengthEi @ 68 NONAME + _ZN26TLbsWcdmaNeighbourCellInfoC1Eiiii @ 69 NONAME + _ZN26TLbsWcdmaNeighbourCellInfoC1Ev @ 70 NONAME + _ZN26TLbsWcdmaNeighbourCellInfoC2Eiiii @ 71 NONAME + _ZN26TLbsWcdmaNeighbourCellInfoC2Ev @ 72 NONAME + _ZNK12CLbsWlanInfo13GetMacAddressER5TDes8 @ 73 NONAME + _ZNK12CLbsWlanInfo14SignalStrengthEv @ 74 NONAME + _ZNK15CLbsGsmCellInfo13TimingAdvanceEv @ 75 NONAME + _ZNK15CLbsGsmCellInfo16LocationAreaCodeEv @ 76 NONAME + _ZNK15CLbsGsmCellInfo17MobileCountryCodeEv @ 77 NONAME + _ZNK15CLbsGsmCellInfo17MobileNetworkCodeEv @ 78 NONAME + _ZNK15CLbsGsmCellInfo24GetNeighbouringCellInfoLER6RArrayI24TLbsGsmNeighbourCellInfoE @ 79 NONAME + _ZNK15CLbsGsmCellInfo6CellIdEv @ 80 NONAME + _ZNK15CLbsGsmCellInfo7RxLevelEv @ 81 NONAME + _ZNK16CLbsPositionInfo11GetLocalityER9TLocality @ 82 NONAME + _ZNK17CLbsWcdmaCellInfo12UniqueCellIdEv @ 83 NONAME + _ZNK17CLbsWcdmaCellInfo14ScramblingCodeEv @ 84 NONAME + _ZNK17CLbsWcdmaCellInfo17MobileCountryCodeEv @ 85 NONAME + _ZNK17CLbsWcdmaCellInfo17MobileNetworkCodeEv @ 86 NONAME + _ZNK17CLbsWcdmaCellInfo24GetNeighbouringCellInfoLER6RArrayI26TLbsWcdmaNeighbourCellInfoE @ 87 NONAME + _ZNK20CLbsLocationInfoBase12ExternaliseLER12RWriteStream @ 88 NONAME + _ZNK24TLbsGsmNeighbourCellInfo4BsicEv @ 89 NONAME + _ZNK24TLbsGsmNeighbourCellInfo5ArfcnEv @ 90 NONAME + _ZNK24TLbsGsmNeighbourCellInfo7RxLevelEv @ 91 NONAME + _ZNK26TLbsWcdmaNeighbourCellInfo12UniqueCellIdEv @ 92 NONAME + _ZNK26TLbsWcdmaNeighbourCellInfo14ScramblingCodeEv @ 93 NONAME + _ZNK26TLbsWcdmaNeighbourCellInfo14SignalStrengthEv @ 94 NONAME + _ZNK26TLbsWcdmaNeighbourCellInfo8PathlossEv @ 95 NONAME + _ZN12CLbsWlanInfo4NewLERKS_ @ 96 NONAME + _ZN15CLbsGsmCellInfo4NewLERKS_ @ 97 NONAME + _ZN16CLbsPositionInfo4NewLERKS_ @ 98 NONAME + _ZN17CLbsWcdmaCellInfo4NewLERKS_ @ 99 NONAME + _ZN17CLbsWcdmaCellInfo17SetSignalStrengthEi @ 100 NONAME + _ZNK17CLbsWcdmaCellInfo14SignalStrengthEv @ 101 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,32 @@ +// 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: +// + + +PRJ_EXPORTS +../inc/lbslocationclasstypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationclasstypes.h) +../inc/lbslocationcommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationcommon.h) +../inc/lbslocationposinfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationposinfo.h) +../inc/lbslocationgsminfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationgsminfo.h) +../inc/lbslocationgsmneighbourinfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationgsmneighbourinfo.h) +../inc/lbslocationinfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationinfo.h) +../inc/lbslocationwcdmainfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationwcdmainfo.h) +../inc/lbslocationwcdmaneighbourinfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationwcdmaneighbourinfo.h) +../inc/lbslocationwlaninfo.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbslocationwlaninfo.h) + +lbslocationinfodatatypes.iby /epoc32/rom/include/lbslocationinfodatatypes.iby + +PRJ_MMPFILES +lbslocationinfodatatypes.mmp + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/group/lbslocationinfodatatypes.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/group/lbslocationinfodatatypes.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +/* +* 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: +* +*/ +#ifndef __LBS_LOCATIONINFODATATYPES_IBY__ +#define __LBS_LOCATIONINFODATATYPES_IBY__ + +//#if !defined(SYMBIAN_EXCLUDE_LOCATION) + +file=ABI_DIR\DEBUG_DIR\lbslocationinfodatatypes.dll sys\bin\lbslocationinfodatatypes.dll + +//#endif // SYMBIAN_EXCLUDE_LOCATION +#endif //__LBS_LOCATIONINFODATATYPES_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/group/lbslocationinfodatatypes.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/group/lbslocationinfodatatypes.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,42 @@ +// 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: +// + + +TARGET lbslocationinfodatatypes.dll +TARGETTYPE dll +UID 0x1000008d 0x102871FB + +VENDORID 0x70000001 +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE lbslocationcommon.cpp +SOURCE lbslocationinfo.cpp +SOURCE lbslocationposinfo.cpp +SOURCE lbslocationgsminfo.cpp +SOURCE lbslocationwcdmainfo.cpp +SOURCE lbslocationwlaninfo.cpp +SOURCE lbslocationwcdmaneighbourinfo.cpp +SOURCE lbslocationgsmneighbourinfo.cpp + +USERINCLUDE ../inc +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY lbs.lib + +SMPSAFE + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationclasstypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationclasstypes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,111 @@ +/* +* 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: +* +*/ + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef LBS_LOCATION_CLASS_TYPES_H +#define LBS_LOCATION_CLASS_TYPES_H + + +/** + * Type used for identifying location info class types + */ +typedef TUint32 TLbsAreaInfoClassType; + +/** + * Enumeration to indicate the type of area information. + * This information is included when a client application creates + * a class derived from CLbsAreaInfoBase + */ +enum _TLbsAreaInfoClassType + { + /** + * Should be used for data initialisation only + */ + ELbsAreaInfoUnknownClass = 0x00, + + /** + * Identifier for CLbsPositionInfo class + */ + ELbsAreaPositionInfoClass = 0x01, + + /** + * Identifier for CLbsGsmCellInfo class + */ + ELbsAreaGsmCellInfoClass = 0x02, + + /** + * Identifier for CLbsGsmNeighbourCellInfo class + */ + ELbsAreaGsmNeighbourCellInfoClass = 0x04, + + /** + * Identifier for CLbsWcdmaCellInfo class + */ + ELbsAreaWcmdaCellInfoClass = 0x08, + + /** + * Identifier for CLbsWcdmaNeighbourCellInfo class + */ + ELbsAreaWcmdaNeighbourCellInfoClass = 0x10, + + /** + * Identifier for CLbsWlanInfo class + */ + ELbsAreaWlanInfoClass = 0x20, + + /** + * Not used + */ + ELbsAreaInfoLastClass = 0xFFFFFFFF + }; + + +/** + * Type used for identifying location info class types + */ +typedef TUint32 TLbsLocationInfoClassType; + +/** + * Enumeration to indicate the type of area information. + * This information is included when a client application creates + * a class derived from CLbsLocationInfoBase + */ +enum _TLbsLocationInfoClassType + { + /** + * Should be used for data initialisation only + */ + ELbsLocationInfoUnknownClass = 0x00, + + /** + * Identifier for CLbsLocationInfo class + */ + ELbsLocationInfoClass = 0x01, + + /** + * Not used + */ + ELbsLocationInfoLastClass = 0xFFFFFFFF + }; + +#endif //LBS_LOCATION_CLASS_TYPES_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationcommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationcommon.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,211 @@ +/* +* 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: Base class for all the class representing +* location informations. +* +*/ + + +/** +@file +@publishedPartner +@prototype +*/ + + +#ifndef LBS_LOCATION_COMMON_H +#define LBS_LOCATION_COMMON_H + + +#include +#include +#include + + +// Constants + +/** + * Defines the maximum allowable batch size supported by the system + */ +const TUint KPositionMaxBatchSize = 500; + + +/** + * Abstract base class for data class representing location area + * information. + */ +NONSHARABLE_CLASS(CLbsLocationInfoBase) : public CBase + { + +public: + + /** + * This method is implemented by each of the derived classes that + * extend this class. + */ + IMPORT_C virtual TLbsLocationInfoClassType Type(); + + /** + * Destructor + */ + IMPORT_C virtual ~CLbsLocationInfoBase(); + + /** + * Internalizes the geographical area information from a stream. + * + * @param[in] aStream Stream from which the object is internalized. + */ + IMPORT_C void InternaliseL( RReadStream& aStream ); + + /** + * Externalizes the geographical area information to a stream. + * + * @param[in] aStream Stream to which the object is to be + * externalized. + */ + IMPORT_C void ExternaliseL( RWriteStream& aStream ) const; + +protected: + + /** + * C++ default constructor + */ + CLbsLocationInfoBase(); + + /** + * Internalize method that subclass must implement. + * + * @param[in] aStream Stream from which the object is internalized. + */ + virtual void DoInternaliseL( RReadStream& aStream ) = 0; + + /** + * Externalize method that subclass must implement. + * + * @param[in] aStream Stream to which the object is to be + * externalized. + */ + virtual void DoExternaliseL( RWriteStream& aStream ) const = 0; + +private: + + /** + * Copy constructor. Prohibited by default. + */ + CLbsLocationInfoBase( CLbsLocationInfoBase& ); + + /** + * Overloaded assignment operator. Prohibited by default. + */ + CLbsLocationInfoBase& operator=( CLbsLocationInfoBase& ); + +private: + + /* + * Reserved for future use. + */ + TAny* iReserved; + + }; + +typedef RPointerArray RLbsLocationInfoBaseArray; + +/** + * Abstract base class for data types representing geogrphical area + * information. + * + * Geographical information may be a collection of GSM or WCDMA cells + * or WLAN information. + */ +NONSHARABLE_CLASS(CLbsAreaInfoBase) : public CBase + { + +public: + + /** + * This method is implemented by each of the geographical area type classes + * that extend this class. The method returns the type of geographical area + * being represented. + */ + IMPORT_C virtual TLbsAreaInfoClassType Type(); + + /** + * Destructor + */ + IMPORT_C virtual ~CLbsAreaInfoBase(); + + /** + * Internalizes the geographical area information from a stream. + * + * @param[in] aStream Stream from which the object is internalized. + */ + IMPORT_C void InternaliseL( RReadStream& aStream ); + + /** + * Externalizes the geographical area information to a stream. + * + * @param[in] aStream Stream to which the object is to be + * externalized. + */ + IMPORT_C void ExternaliseL( RWriteStream& aStream ); + + /** + * Validates area information. + */ + virtual void ValidateDataL() const = 0; + +protected: + + /** + * C++ default constructor + */ + CLbsAreaInfoBase(); + + /** + * Internalize method that subclass must implement. + * + * @param[in] aStream Stream from which the object is internalized. + */ + virtual void DoInternaliseL( RReadStream& aStream ) = 0; + + /** + * Externalize method that subclass must implement. + * + * @param[in] aStream Stream to which the object is to be + * externalized. + */ + virtual void DoExternaliseL( RWriteStream& aStream ) const = 0; + +private: + + /** + * Copy constructor. Prohibited by default. + */ + CLbsAreaInfoBase( CLbsAreaInfoBase& ); + + /** + * Overloaded assignment operator. Prohibited by default. + */ + CLbsAreaInfoBase& operator=( CLbsAreaInfoBase& ); + +private: + + /** + * Reserved for future use. + */ + TAny* iReserved; + + }; + +#endif // LBS_LOCATION_COMMON_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationgsminfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationgsminfo.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,326 @@ +/* +* 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: Data class representing a geographical area in terms of +* cell information in a GSM PLMN. This class may also optionally contain +* neighbouring cell information +* +*/ + + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef LBS_GSM_CELL_INFO_H +#define LBS_GSM_CELL_INFO_H + + +#include +#include +#include + + +/** + * This class contains information related to a cell in GSM PLMN. An instance + * of this class may also contain information of one or more neighbouring + * GSM cells + */ +NONSHARABLE_CLASS(CLbsGsmCellInfo) : public CLbsAreaInfoBase + { + +public: + + /** + * Allocates and constructs a new GSM cell info object. In the returned + * instance, the country code, network code, location area code and cell ID + * are marked as undefined. + * + * @return Pointer to the new GSM cell info object. + * @leave Standard symbian error codes, such as KErrNoMemory + */ + IMPORT_C static CLbsGsmCellInfo* NewL(); + + /** + * Allocates and constructs a new GSM cell info object. + * + * @param[in] aCountryCode Network country code. + * @param[in] aNetworkCode Network code. + * @param[in] aLocationAreaCode Location area code. + * @param[in] aCellId Cell ID of a cell in GSM PLMN. + * @return Pointer to the new GSM cell info object. + * @leave standard symbian error codes, such as KErrNoMemory. + */ + IMPORT_C static CLbsGsmCellInfo* NewL( const TInt aCountryCode, + const TInt aNetworkCode, + const TInt aLocationAreaCode, + const TInt aCellId ); + + + /** + * Allocates and constructs new GSM cell info objec, a copy of another one. + * + * @param[in] aLocality Instance of CLbsGsmCellInfo. + */ + IMPORT_C static CLbsGsmCellInfo* NewL( const CLbsGsmCellInfo& aPositionInfo ); + + + /** + * Destructor + */ + IMPORT_C ~CLbsGsmCellInfo(); + + /** + * Sets the Mobile Country Code information. + * + * @param[in] aCountryCode Mobile Country Code, range 0..999. + */ + IMPORT_C void SetMobileCountryCode(const TInt aCountryCode); + + /** + * Retrieves the Mobile Country Code information. + * + * @return Mobile Country Code, range 0..999; + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt MobileCountryCode() const; + + /** + * Sets the Mobile Network Code information. + * + * @param[in] aNetworkCode Mobilre Network Code, range 0..999. + */ + IMPORT_C void SetMobileNetworkCode( const TInt aNetworkCode ); + + /** + * Retrieves the Mobile Network Code information. + * + * @return Mobile Network Code, range 0..999. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt MobileNetworkCode() const; + + /** + * Sets the Location Area Code information. + * + * @param[in] aLocationAreaCode Location Area Code, range 0..65535. + */ + IMPORT_C void SetLocationAreaCode( const TInt aLocationAreaCode ); + + /** + * Retrieves the Location Area Code information. + * + * @return Location Area Code, range 0..65535. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt LocationAreaCode() const; + + /** + * Sets the Cell Identity information. + * + * @param[in] aCellId Cell Identity, range 0..65535. + */ + IMPORT_C void SetCellId( const TInt aCellId ); + + /** + * Retrieves the Cell Identity information. + * + * @return Cell Identity, range 0..65535. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt CellId() const; + + /** + * Initializes the signal strength parameter. + * + * @param[in] aRxLev Rx Level, range 0..63. + */ + IMPORT_C void SetRxLevel( const TInt aRxLev ); + + /** + * Retrieves the Rx level. + * + * @return Rx Level, range 0..63. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt RxLevel() const; + + /** + * Sets the Timing Advance information. + * + * @param[in] aTimingAdvance Timing Advance, range 0..255. + */ + IMPORT_C void SetTimingAdvance( const TInt aTimingAdvance ); + + /** + * Retrieves the Timing Advance information. + * + * @return Timing Advance, range 0..255. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt TimingAdvance() const; + + /** + * Adds a neighbouring cell information. + * + * @param[in] An instance of TLbsGsmNeighbourCellInfo class + * (memory ovnership is being transferred) + * @leave KErrArgument if the argument is NULL or one of standard symbian + * error codes + */ + IMPORT_C void AddNeighbouringCellInfoL( + TLbsGsmNeighbourCellInfo* aNeighbourCellInfo ); + + /** + * Retrieves a copy of neighbouring cell information information as an + * array. + * + * @param[in] aNeighbourCellInfo GSM neighbouring cell information + * (memory ownership is not being transferred to this function therefore + * it is the responsibility of the caller to ensure Close() is called to + * free resources) + */ + IMPORT_C void GetNeighbouringCellInfoL( + RLbsGsmNeighbourCellInfoArray& aNeighbourCellInfo ) const; + + /** + * Removes all neighbouring cell information. + */ + IMPORT_C void ResetNeighbouringCellInfo(); + +public: // from CLbsAreaInfoBase + + /** + * Returns the type of area information instance. + * + * @return Area type information + */ + virtual TLbsAreaInfoClassType Type(); + + /** + * Validates GSM cell information. + * This method checks for boundary conditions as well as the mandatory + * attributes. The attributes of this class become mandatory in a + * hierarchical manner. For instance, if location area code is + * specified then the mobile network code attribute is mandatory. If cell + * id is specified then, both LAC and MNC become mandatory attributes and + * so on. However, the mobile country code attribute is always mandatory + * which means client applications must at least specify the MCC attribute + * when specifying GSM cell information. + * This method is used internally to determine the correctness of + * information provided. Optionally, this method, may also be used by + * client applications to validate their input. + * + * @leave KErrArgument If the specified attributes dont meet the boundary + * conditions or the mandatory arguments are not specified. + */ + virtual void ValidateDataL() const; + +protected: // from CLbsAreaInfoBase + + /** + * Internalize method to write GSM cell information to a stream. + */ + virtual void DoInternaliseL( RReadStream& aStream ); + + /** + * Externalize method to read GSM cell information from a stream. + */ + virtual void DoExternaliseL( RWriteStream& aStream ) const; + +private: + + /** + * C++ default constructor + */ + CLbsGsmCellInfo(); + + /** + * Copy constructor. Prohibited by default. + */ + CLbsGsmCellInfo( CLbsGsmCellInfo& ); + + /** + * Overloaded assignment operator. Prohibited by default. + */ + CLbsGsmCellInfo& operator=( CLbsGsmCellInfo& ); + + /** + * Symbian 2 phase constructor + */ + void ConstructL(); + + /** + * Symbian 2 phase constructor + */ + void ConstructL( const TInt aCountryCode, const TInt aNetworkCode, + const TInt aLocationAreaCode, const TInt aCellId ); + +private: // attributes + + enum _TGsmDataValidationMask + { + EGsmDataNull = 0x00, + EGsmMCC = 0x01, + EGsmMNC = 0x02, + EGsmLAC = 0x04, + EGsmCI = 0x08, + EGsmRx = 0x10, + EGsmTA = 0x20 + }; + + /** + * Mobile country code + */ + TInt16 iMCC; + + /** + * Mobile network code + */ + TInt16 iMNC; + + /** + * Location area code + */ + TInt32 iLAC; + + /** + * Cell id + */ + TInt32 iCid; + + /** + * Signal strength + */ + TInt32 iRxLev; + + /** + * Timing advance + */ + TInt16 iTA; + + /** + * Data mask to determine initialized data. Used internally. + */ + TInt8 iDataValidationMask; + + /** + * Neighbouring cell info + */ + RLbsGsmNeighbourCellInfoArray iNeighbourCellInfo; + }; + +#endif //LBS_GSM_CELL_INFO_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationgsmneighbourinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationgsmneighbourinfo.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,136 @@ +/* +* 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: Data class representing a geographical area in terms of +* cell information in a GSM PLMN. This class may also optionally contain +* neighbouring cell information +* +*/ + +/** +@file +@publishedPartner +@prototype +*/ + + +#ifndef LBS_GSM_NEIGHB_CELL_INFO_H +#define LBS_GSM_NEIGHB_CELL_INFO_H + +#include +#include + + +/** + * This class contains information related to a GSM neighbouring cell + * information. + */ +NONSHARABLE_CLASS(TLbsGsmNeighbourCellInfo) + { + +public: + + /** + * Allocates and constructs a new neighbour GSM cell info object. In the + * returned instance all data is marked as undefined + * + * @return Pointer to the new neighbour GSM cell info object. + */ + IMPORT_C TLbsGsmNeighbourCellInfo(); + + /** + * Allocates and constructs a new neighbour GSM cell info object. + + * @param[in] aARFCN Absolute Radio Frequency Channel Number + * @param[in] aBSIC Base station identity (colour) code. + * @param[in] aRxLev Rx level. + * + * @return Pointer to the new neighbour GSM cell info object. + */ + IMPORT_C TLbsGsmNeighbourCellInfo( const TInt aARFCN, + const TInt aBSIC, + const TInt aRxLev ); + + /** + *Sets the Absolute Radio Frequency Channel Number. + * + * @param[in] aARFCN Absolute Radio Frequency Channel Number, range 0..1023. + */ + IMPORT_C void SetArfcn(const TInt aARFCN); + + /** + * Retrieves the Absolute Radio Frequency Channel Number. + * + * @return Absolute Radio Frequency Channel Number, range 0..1023. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt Arfcn() const; + + /** + * Sets the Base station identity (colour) code. + * + * @param[in] iBSIC Base station identity code, range 0..63. + */ + IMPORT_C void SetBsic( const TInt aBSIC ); + + /** + * Retrieves the Base station identity code. + * + * @return Base station identity code, range 0..63. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt Bsic() const; + + /** + * Sets the Rx level. + * + * @param[in] aRxLev Rx Level, range 0..63. + */ + IMPORT_C void SetRxLevel( const TInt aRxLev ); + + /** + * Retrieves the Rx level. + * + * @return Rx Level, range 0..63. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt RxLevel() const; + +protected: // attributes + + /** + * Absolute Radio Frequency Channel Number + */ + TInt16 iARFCN; + + /** + * Base station identity code + */ + TInt8 iBSIC; + + /** + * Rx level + */ + TInt8 iRxLev; + + /** + * Reserved + */ + TUint8 iReserved[4]; + + }; + +typedef RArray RLbsGsmNeighbourCellInfoArray; + + +#endif //LBS_GSM_NEIGHB_CELL_INFO_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationinfo.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,204 @@ +/* +* 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: Container class representing geographical area information as a +* collection of GSM/WCDMA cell information and WLAN MAC IDs. +* +*/ + + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef C_LBSLOCATIONINFO_H +#define C_LBSLOCATIONINFO_H + + +#include +#include +#include +#include +#include +#include + + +/** + * Type definitions + */ + +/** + * Structure used to carry location information to be converted + */ +typedef RPointerArray RLbsAreaInfoBaseArray; + +/** + * This class contains information related to a collection of geographical area + * information. Client applications create an instance of this class to + * represent a geographical area for which a conversion is required. The + * corresponding coordinate values determined by the conversion plugins would + * be updated in the same instance of CLbsLocationInfo. Client applications + * may retrieve the position estimate(s) using GetPositionInfo method. + * + */ +NONSHARABLE_CLASS(CLbsLocationInfo) : public CLbsLocationInfoBase + { + +public: + + typedef TUint32 TAreaInfoMask; + + enum _TAreaInfoMask + { + /** + * Bit mask used to retrieve position information. + */ + ELbsPosInfo = 0x01, + + /** + * Bit mask used to retrieve GSM cell information. + */ + ELbsGsmInfo = 0x02, + + /** + * Bit mask used to retrieve WCDMA cell information. + */ + ELbsWcdmaInfo = 0x04, + + /** + * Bit mask used to retrieve WLAN AP information. + */ + ELbsWlanInfo = 0x08, + + /** + * Bit mask used to retrieve all area information. + */ + ELbsAreaInfoAll = 0xFFFFFFFF + }; + + /** + * Allocates and constructs a new location info object. + * + * @return Pointer to the new area info object. + * @leave Standard symbian error codes, such as KErrNoMemory + */ + IMPORT_C static CLbsLocationInfo* NewL(); + + /** + * Allocates and constructs a new location info object. This method will + * push the resultant object onto the cleanup stack. + * + * @return Pointer to the new area info object. + * @leave Standard symbian error codes, such as KErrNoMemory + */ + IMPORT_C static CLbsLocationInfo* NewLC(); + + /** + * Destructor + */ + IMPORT_C ~CLbsLocationInfo(); + + /** + * Appends the specified area info entry to the data structure. This + * method takes a pointer to CLbsAreaInfoBase type instances. + * + * @param[in] aAreaInfo Pointer to a CLbsAreaInfoBase type instance. + * @leave KErrArgument if the pointer to CLbsAreaInfoBase type is NULL + */ + IMPORT_C void AddAreaInfoL( CLbsAreaInfoBase* aAreaInfo ); + + /** + * Retrieves the area information that is stored in the internal + * data structure. Client applications can specify the type of information + * to be retrieved using the TAreaInfoMask. The result is updated in + * the instance of RLbsAreaInfoBaseArray. If there is no information stored + * for the requested type the instance of RLbsAreaInfoBaseArray will not be + * updated. Client applications would need to check the contents of the + * array to determine the information retrieved. + * + * @param[out] aAreaInfoArray Array that is filled with pointers to the + * area information retrieved. Note it is the callers responsibility to call + * Close() to free the pointers. However ownership of the objects pointed to + * is not transferred to the caller. + * @param[in] aLocInfoMask Specifies the type of information to be + * retrieved. + */ + IMPORT_C void GetAreaInfoL( RLbsAreaInfoBaseArray& aAreaInfoArray, + TAreaInfoMask aAreaInfoMask = ELbsAreaInfoAll ); + + /** + * Removes all entries of the specified type from the data structure. If + * the mask is not specified all entries would be removed. If there are no + * entries found for a specific type, no changes will be done. + * + * @param[in] aLocInfoMask Specifies the type of information to be + * removed. + */ + IMPORT_C void ResetAreaInfo( TAreaInfoMask aAreaInfoMask + = ELbsAreaInfoAll ); + +protected: // from CLbsLocationInfoBase + + /** + * Type of location info class + */ + virtual TLbsLocationInfoClassType Type(); + + /** + * Internalize method to write location information to a stream. + */ + virtual void DoInternaliseL( RReadStream& aStream ); + + /** + * Externalize method to read location information from a stream. + */ + virtual void DoExternaliseL( RWriteStream& aStream ) const; + +private: + + /** + * C++ default constructor + */ + CLbsLocationInfo(); + + /** + * Copy constructor. Prohibited by default. + */ + CLbsLocationInfo( CLbsLocationInfo& ); + + /** + * Overloaded assignment operator. Prohibited by default. + */ + CLbsLocationInfo& operator = ( CLbsLocationInfo& ); + + /** + * Symbian 2 phase constructor + */ + void ConstructL(); + +private: + + /** + * A collection of geographical area information. + */ + RPointerArray iAreaInfoArray; + + }; + +typedef RPointerArray RLbsLocationInfoArray; + + +#endif //C_LBSLOCATIONINFO_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationposinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationposinfo.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,172 @@ +/* +* 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: Data class representing a geographical area in terms of +* latitude,longitude,altitude,horizontal accuracy and vertical accuracy. +* +*/ + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef LBS_COORDINATE_INFO_H +#define LBS_COORDINATE_INFO_H + + +#include +#include +#include + + +/** + * This class contains the basic coordinates of a location (latitude, longitude + * and altitude) along with vertical and horizontal accuracies. This class + * is different from TPositionInfo class defined in LBS and cannot be used + * interchangeably. @see TPositionInfo class for more details. + */ +NONSHARABLE_CLASS(CLbsPositionInfo) : public CLbsAreaInfoBase + { + +public: + + /** + * Allocates and constructs a new position info object. In the returned + * instance, the longitude, latitude, altitude, horizontal accuracy and + * vertical accuracy are set to NaN. + * + * @return Pointer to the new coordinate info object. + * @leave Standard symbian error codes, such as KErrNoMemory + */ + IMPORT_C static CLbsPositionInfo* NewL(); + + /** + * Allocates and constructs a new position info object, a copy of another one. + * + * @param[in] aLocality Instance of CLbsPositionInfo. + */ + IMPORT_C static CLbsPositionInfo* NewL( const CLbsPositionInfo& aPositionInfo ); + + /** + * Allocates and constructs a new position info object + * + * @param[in] aLocality Instance of TLocality class that contains + * coordinates along with the error estimates for the horizontal and + * vertical accuracy of the point. + */ + IMPORT_C static CLbsPositionInfo* NewL( const TLocality& aLocality ); + + /** + * Destructor + */ + IMPORT_C virtual ~CLbsPositionInfo(); + + /** + * Initializes the locality information. This includes + * latitude - should be between and including -90 and 90 degrees. + * longitude - should be between and including -180 and 180 degrees. + * altitude - Altitude information in meters. + * datum - datum information. Defaults to the constant for the + * coordinate system for a specific positioning system. + * horizontal accuracy - horizontal accuracy in meters. + * vertical accuracy - vertical accuracy in meters. + * + * @param[in] aLatitude Latitude information. + */ + IMPORT_C void SetLocality( const TLocality& aLocality ); + + /** + * Retrieves the Locality information. + * + * @return NaN if nothing specified or latitude information. + * network. + */ + IMPORT_C void GetLocality( TLocality& aLocality ) const; + +public: // from CLbsAreaInfoBase + + /** + * Returns the type of area information instance. + * + * @return Area type information + */ + virtual TLbsAreaInfoClassType Type(); + + /** + * Validates position information. + * This method checks for boundary conditions as well as the mandatory + * attributes. The latitude, longitude and horizontal accuracy attributes + * are mandatory and must be specified in the TLocality instance being + * passed as an argument to instantiate/initialize an instance of this + * class. + * This method is used internally to determine the correctness of + * information provided. Optionally, this method, may also be used by + * client applications to validate their input. + * + * @leave KErrArgument If the specified attributes dont meet the boundary + * conditions or the mandatory arguments are not specified. + */ + virtual void ValidateDataL() const; + +protected: // from CLbsAreaInfoBase + + /** + * Internalize method to write GSM cell information to a stream. + */ + virtual void DoInternaliseL( RReadStream& aStream ); + + /** + * Externalize method to read GSM cell information from a stream. + */ + virtual void DoExternaliseL( RWriteStream& aStream ) const; + +private: + + /** + * C++ default constructor + */ + CLbsPositionInfo(); + + /** + * Copy constructor. Prohibited by default. + */ + CLbsPositionInfo( CLbsPositionInfo& ); + + /** + * Overloaded assignment operator. Prohibited by default. + */ + CLbsPositionInfo& operator=( CLbsPositionInfo& ); + + /** + * Symbian 2 phase constructor + */ + void ConstructL(); + + /** + * Symbian 2 phase constuctor + */ + void ConstructL( const TLocality& aLocality ); + +private: // attributes + + /** + * Locality information + */ + TLocality iLocality; + + }; + +#endif //LBS_COORDINATE_INFO_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationwcdmainfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationwcdmainfo.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,300 @@ +/* +* 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: Data class representing a geographical area in terms of +* cell information in a WCDMA PLMN. This class may also optionally contain +* neighbouring cell information +* +*/ + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef C_LBSWCDMACELLINFO_H +#define C_LBSWCDMACELLINFO_H + + +#include +#include +#include + + +/** + * This class contains information related to a cell in WCDMA PLMN. An instance + * of this class may also contain information of one or more neighbouring + * WCDMA cells + */ +NONSHARABLE_CLASS(CLbsWcdmaCellInfo) : public CLbsAreaInfoBase + { + +public: + + /** + * Allocates and constructs a new WCDMA cell info object. In the returned + * instance, the country code, network code and cell ID are set to zero. + * + * @return Pointer to the new WCDMA cell info object. + * @leave Standard symbian error codes, such as KErrNoMemory + */ + IMPORT_C static CLbsWcdmaCellInfo* NewL(); + + /** + * Allocates and constructs a new WCDMA cell info object. + * + * @param[in] aCountryCode Network country code. + * @param[in] aNetworkCode Network code. + * @param[in] aUniqueCellId Cell ID of a cell in WCDMA PLMN. + * @return Pointer to the new WCDMA cell info object. + * @leave KErrArgument in case of invalid input or other standard symbian + * error codes, such as KErrNoMemory. + */ + IMPORT_C static CLbsWcdmaCellInfo* NewL( const TInt aCountryCode, + const TInt aNetworkCode, + const TInt aUniqueCellId ); + /** + * Allocates and constructs a WCDMA cell info object, a copy of another one. + * + * @param[in] aLocality Instance of CLbsWcdmaCellInfo. + */ + IMPORT_C static CLbsWcdmaCellInfo* NewL( const CLbsWcdmaCellInfo& aPositionInfo); + + /** + * Destructor + */ + IMPORT_C ~CLbsWcdmaCellInfo(); + + /** + * Initializes the country code attribute. + * + * @param[in] aCountryCode Network country code, range 0..999 + */ + IMPORT_C void SetMobileCountryCode( const TInt aCountryCode); + + /** + * Retrieves the country code information. + + * @return Network country code, range 0..999 + KErrNotFound if the value is undefined. + */ + IMPORT_C TInt MobileCountryCode() const; + + /** + * Initializes the network code attribute. + * + * @param[in] aNetworkCode Network code, range 0..999 + */ + IMPORT_C void SetMobileNetworkCode( const TInt aNetworkCode ); + + /** + * Retrieves the network code information. + * + * @return Network code, range 0..999 + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt MobileNetworkCode() const; + + /** + * Sets the Cell Identity. + * + * @param[in] aUniqueCellId Cell Identity, range 0..268435455. + */ + IMPORT_C void SetUniqueCellId( const TInt aUniqueCellId ); + + /** + * Retrieves the Cell Identity. + * + * @return Cell Identity, range 0..268435455. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt UniqueCellId() const; + + /** + * Sets the scrambling code + * + * @param[in] aScramblingCode scrambling code , range 0..511. + */ + IMPORT_C void SetScramblingCode( const TInt aScramblingCode ); + + /** + * Retrieves the scrambling code . + * + * @return Base scrambling code, range 0..511. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt ScramblingCode() const; + + /** + * Sets the RSSI parameter + * + * @param[in] aRssi Received Signal Strength Indicator, range 0..127. + */ + IMPORT_C void SetSignalStrength( const TInt aRssi ); + + /** + * Retrieves the RSSI information. + * + * @return RSSI, range 0..127. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt SignalStrength() const; + + /** + * Adds a neighbouring cell information. + * + * @param[in] An instance of TLbsWcdmaNeighbourCellInfo class + * (memory ovnership is being transferred) + * @leave KErrArgument if the argument is NULL or one of standard symbian + * error codes + */ + IMPORT_C void AddNeighbouringCellInfoL( + TLbsWcdmaNeighbourCellInfo* aNeighbourCellInfo ); + + /** + * Retrieves a copy of neighbouring cell information information as an + * array. + * + * @param[in] aNeighbourCellInfo WCDMA neighbouring cell information + * (memory ownership is not being transferred to this function therefore + * it is the responsibility of the caller to ensure Close() is called to + * free resources) + */ + IMPORT_C void GetNeighbouringCellInfoL( + RLbsWcdmaNeighbourCellInfoArray& aNeighbourCellInfo ) const; + + /** + * Removes all neighbouring cell information. + */ + IMPORT_C void ResetNeighbouringCellInfo(); + +public: // from CLbsAreaInfoBase + + /** + * Returns the type of area information instance. + * + * @return Area type information + */ + virtual TLbsAreaInfoClassType Type(); + + /** + * Validates WCDMA information. + * This method checks for boundary conditions as well as the mandatory + * attributes. The attributes of this class become mandatory in a + * hierarchical manner. For instance, if scrambling code is specified then, + * all other attributes except the neighbouring cell information become + * mandatory. However, the mobile country code attribute is always + * mandatory which means client applications must at least specify the MCC + * attribute when specifying WCDMA cell information. + * This method is used internally to determine the correctness of + * information provided. Optionally, this method, may also be used by + * client applications to validate their input. + * + * @leave KErrArgument If the specified attributes dont meet the boundary + * conditions or the mandatory arguments are not specified. + */ + virtual void ValidateDataL() const; + +protected: // from CLbsAreaInfoBase + + /** + * Internalize method to write WCDMA cell information to a stream. + */ + virtual void DoInternaliseL( RReadStream& aStream ); + + /** + * Externalize method to read WCDMA cell information from a stream. + */ + virtual void DoExternaliseL( RWriteStream& aStream ) const; + +private: + + /** + * C++ default constructor + */ + CLbsWcdmaCellInfo(); + + /** + * Copy constructor. Prohibited by default. + */ + CLbsWcdmaCellInfo( CLbsWcdmaCellInfo& ); + + /** + * Overloaded assignment operator. Prohibited by default. + */ + CLbsWcdmaCellInfo& operator=( CLbsWcdmaCellInfo& ); + + /** + * Symbian 2 phase constructor + */ + void ConstructL(); + + /** + * Symbian 2 phase constructor + */ + void ConstructL( const TInt aCountryCode, + const TInt aNetworkCode, + const TInt aUniqueCellId ); + +private: // data + + enum _TWcdmaDataValidationMask + { + EWcdmaDataNull = 0x00, + EWcdmaMCC = 0x01, + EWcdmaMNC = 0x02, + EWcdmaUCid = 0x04, + EWcdmaSC = 0x08, + EWcdmaRSSI = 0x10, + }; + + /** + * Mobile country code + */ + TInt16 iMCC; + + /** + * Mobile network code + */ + TInt16 iMNC; + + /** + * Unique cell identifier + */ + TInt32 iUCid; + + /** + * Scrambling code + */ + TInt16 iSCode; + + /** + * RSSI + */ + TInt16 iRssi; + + /** + * Data mask to determine initialized data. Used internally. + */ + TInt8 iDataValidationMask; + + /** + * Neighbouring cell info + */ + RLbsWcdmaNeighbourCellInfoArray iNeighbourCellInfo; + + }; + +#endif // C_POSWCDMACELLINFO_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationwcdmaneighbourinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationwcdmaneighbourinfo.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,158 @@ +/* +* 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: Data class representing a geographical area in terms of +* cell information in a Wcdma PLMN. This class may also optionally contain +* neighbouring cell information +* +*/ + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef LBS_WCDMA_NEIGHB_CELL_INFO_H +#define LBS_WCDMA_NEIGHB_CELL_INFO_H + + +#include +#include + + +/** + * This class contains information related to a Wcdma neighbouring cell information + */ +NONSHARABLE_CLASS(TLbsWcdmaNeighbourCellInfo) + { + +public: + + /** + * Allocates and constructs a new neighbour Wcdma cell info object. In the returned + * instance all data is marked as undefined + * + * @return Pointer to the new neighbour Wcdma cell info object. + */ + IMPORT_C TLbsWcdmaNeighbourCellInfo(); + + /** + * Allocates and constructs a new neighbour Wcdma cell info object. + * + * @param[in] aUCid Cell Identity + * @param[in] aSCode Scrambling Code + * @param[in] aPathloss Pathloss + * @param[in] Received Signal Strength Indicator + * + * @return Pointer to the new neighbour Wcdma cell info object. + */ + IMPORT_C TLbsWcdmaNeighbourCellInfo(const TInt aUCid, + const TInt aSCode, + const TInt aPathloss, + const TInt aRssi ); + + /** + * Sets the Cell Identity. + * + * @param[in] aUniqueCellId Cell Identity, range 0..268435455. + */ + IMPORT_C void SetUniqueCellId( const TInt aUniqueCellId ); + + /** + * Retrieves the Cell Identity. + * + * @return Cell Identity, range 0..268435455. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt UniqueCellId() const; + + /** + * Sets the scrambling code + * + * @param[in] aScramblingCode scrambling code , range 0..511. + */ + IMPORT_C void SetScramblingCode( const TInt aScramblingCode ); + + /** + * Retrieves the scrambling code . + * + * @return Base scrambling code, range 0..511. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt ScramblingCode() const; + + /** + * Sets the Pathloss parameter + * + * @param[in] aPathloss Pathloss, range 46..173. + */ + IMPORT_C void SetPathloss( const TInt aPathloss ); + + /** + * Retrieves the pathloss information. + * + * @return pathloss, range 46..173. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt Pathloss() const; + + /** + * Sets the RSSI parameter + * + * @param[in] aRssi Received Signal Strength Indicator, range 0..127. + */ + IMPORT_C void SetSignalStrength( const TInt aRssi ); + + /** + * Retrieves the RSSI information. + * + * @return RSSI, range 0..127. + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt SignalStrength() const; + +protected: // attributes + + /** + * Cell Identity + */ + TInt32 iUniqueCellId; + + /** + * Scrambling Code + */ + TInt16 iScramblingCode; + + /** + * Path loss + */ + TInt16 iPathloss; + + /** + * RSSI + */ + TInt16 iRssi; + + /** + * Reserved + */ + TUint8 iReserved[8]; + + }; + +typedef RArray RLbsWcdmaNeighbourCellInfoArray; + + +#endif //LBS_WCDMA_NEIGHB_CELL_INFO_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationwlaninfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/inc/lbslocationwlaninfo.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,203 @@ +/* +* 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: Data class representing a geographical area in terms of +* WLAN MAC ID. +* +*/ + +/** +* @file +* @publishedPartner +* @prototype +*/ + + +#ifndef LBSWLANINFO_H +#define LBSWLANINFO_H + + +#include +#include + + +/** + * Length of a WLAN MAC address. + */ +const TInt KLbsWlanMacAddressLength = 18; + + +/** + * WLAN MAC address consists of six hex numbers and is typically represented as + * a string with 6, colon separated hexadecimal numbers. (e.g. 11:22:33:44:55:66) + * + * In order so save memory the LBS subsystem does not use a string. A 6 byte long + * buffer is used instead. + * + * The leftmost number of the MAC address ("11" in the example) is stored in the first + * byte of the buffer. The rightmost number of the MAC address ("66" in the example) + * is stored in the last byte of the buffer. + */ +typedef TBuf8 TLbsWlanMacAddress; + + +/** + * This class contains information related to a WLAN radio map object. + */ +NONSHARABLE_CLASS(CLbsWlanInfo) : public CLbsAreaInfoBase + { + +public: + + /** + * Allocates and constructs a new WLAN info object. In the returned + * instance, the MAC ID and signal strength values are set to zero. + * + * @return Pointer to the new WLAN info object. + * @leave Standard symbian error codes, such as KErrNoMemory + */ + IMPORT_C static CLbsWlanInfo* NewL(); + + /** + * Allocates and constructs a new WLAN info object. + * + * The validation for the arguments is hierarchical. For instance, if + * signal strength is given, then specifying MAC ID is mandatory. + * + * @param[in] aMacAddress MAC address of the WLAN AP. + * @param[in] aRxStrength AP signal strength received at the SET. + + * @return Pointer to the new WLAN info object. + * @leave KErrArgument in case of invalid input or other standard symbian + * error codes, such as KErrNoMemory. + */ + IMPORT_C static CLbsWlanInfo* NewL( const TLbsWlanMacAddress& MacAddress, + const TInt aRxStrength ); + + /** + * Allocates and constructs a Wlan info object, a copy of another one. + * + * @param[in] aLocality Instance of CLbsWlanInfo. + */ + + IMPORT_C static CLbsWlanInfo* NewL( const CLbsWlanInfo& aPositionInfo); + + /** + * Destructor + */ + IMPORT_C ~CLbsWlanInfo(); + + /** + * Initializes the MAC ID attribute. + * + * @param[in] aMacAddress MAC address of the WLAN AP + */ + IMPORT_C void SetMacAddress( const TDesC8& aMacAddress ); + + /** + * Retrieves the MAC ID information. + */ + IMPORT_C void GetMacAddress(TDes8& aMacAddress ) const; + + /** + * Initializes the AP signal strength received at the SET. + * + * @param[in] aRxStrength AP signal strength received at the SET, range 0..255 + */ + IMPORT_C void SetSignalStrength( const TInt aRxStrength ); + + /** + * Retrieves the AP signal strength received at the SET. + * + * @return AP signal strength received at the SET, range 0..255 + * KErrNotFound if the value is undefined. + */ + IMPORT_C TInt SignalStrength() const; + +public: // from CLbsAreaInfoBase + + /** + * Returns the type of area information instance. + * + * @return Area type information + */ + virtual TLbsAreaInfoClassType Type(); + + /** + * Validates WLAN information. + * This method checks for boundary conditions as well as the mandatory + * attributes. All attributes of this class are mandatory. + * This method is used internally to determine the correctness of + * information provided. Optionally, this method, may also be used by + * client applications to validate their input. + * + * @leave KErrArgument If the specified attributes dont meet the boundary + * conditions or the mandatory arguments are not specified. + */ + virtual void ValidateDataL() const; + +protected: // from CLbsAreaInfoBase + + /** + * Internalize method to write WLAN information to a stream. + */ + virtual void DoInternaliseL( RReadStream& aStream ); + + /** + * Externalize method to read WLAN information from a stream. + */ + virtual void DoExternaliseL( RWriteStream& aStream ) const; + +private: + + /** + * C++ default constructor + */ + CLbsWlanInfo(); + + /** + * Copy constructor. Prohibited by default. + */ + CLbsWlanInfo( CLbsWlanInfo& ); + + /** + * Overloaded assignment operator. Prohibited by default. + */ + CLbsWlanInfo& operator=( CLbsWlanInfo& ); + + /** + * Symbian 2 phase constructor + */ + void ConstructL(); + + /** + * Symbian 2 phase constructor + */ + void ConstructL( const TLbsWlanMacAddress& MacAddress, + const TInt aPowRx ); + +private: // data + + /** + * MAC code + */ + TLbsWlanMacAddress iMacAddress; + + /** + * Received signal strength + */ + TInt16 iPowRx; + + }; + +#endif // LBSWLANINFO_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationcommon.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationcommon.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,119 @@ +/* +* 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: Base class for all the class representing +* location informations. +* +*/ + + +#include +#include +#include + + +// --------------------------------------------------------------------------- +// CLbsLocationInfoBase::Type() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsLocationInfoClassType CLbsLocationInfoBase::Type() + { + return ELbsAreaInfoUnknownClass; + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfoBase::~CLbsLocationInfoBase() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsLocationInfoBase::~CLbsLocationInfoBase() + { + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfoBase::InternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsLocationInfoBase::InternaliseL( RReadStream& aStream ) + { + DoInternaliseL( aStream ); + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfoBase::ExternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsLocationInfoBase::ExternaliseL( RWriteStream& aStream ) const + { + DoExternaliseL( aStream ); + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfoBase::CLbsLocationInfoBase() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +CLbsLocationInfoBase::CLbsLocationInfoBase() + { + } + +// --------------------------------------------------------------------------- +// CLbsAreaInfoBase::Type() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsAreaInfoClassType CLbsAreaInfoBase::Type() + { + return ELbsAreaInfoUnknownClass; + } + +// --------------------------------------------------------------------------- +// CLbsAreaInfoBase::~CLbsAreaInfoBase() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsAreaInfoBase::~CLbsAreaInfoBase() + { + } + +// --------------------------------------------------------------------------- +// CLbsAreaInfoBase::~CLbsAreaInfoBase() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +CLbsAreaInfoBase::CLbsAreaInfoBase() + { + } + +// --------------------------------------------------------------------------- +// CLbsAreaInfoBase::InternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsAreaInfoBase::InternaliseL( RReadStream& aStream ) + { + DoInternaliseL( aStream ); + } + +// --------------------------------------------------------------------------- +// CLbsAreaInfoBase::ExternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsAreaInfoBase::ExternaliseL( RWriteStream& aStream ) + { + DoExternaliseL( aStream ); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationgsminfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationgsminfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,412 @@ +/* +* 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: Data class representing a geographical area in terms of +* cell information in a GSM PLMN. This class may also optionally contain +* neighbouring cell information +* +*/ + + +#include +#include + + +// --------------------------------------------------------------------------- +// CPosGsmCellInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsGsmCellInfo* CLbsGsmCellInfo::NewL() + { + CLbsGsmCellInfo* self = new( ELeave ) CLbsGsmCellInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsGsmCellInfo* CLbsGsmCellInfo::NewL( const TInt aCountryCode, + const TInt aNetworkCode, + const TInt aLocationAreaCode, + const TInt aCellId ) + { + CLbsGsmCellInfo* self = new( ELeave ) CLbsGsmCellInfo; + CleanupStack::PushL( self ); + self->ConstructL( aCountryCode, aNetworkCode, aLocationAreaCode, aCellId ); + CleanupStack::Pop(); + return self; + } + +EXPORT_C CLbsGsmCellInfo* CLbsGsmCellInfo::NewL( const CLbsGsmCellInfo& aPositionInfo ) + { + CLbsGsmCellInfo* self = CLbsGsmCellInfo::NewL(aPositionInfo.iMCC,aPositionInfo.iMNC,aPositionInfo.iLAC,aPositionInfo.iCid); + + self->iRxLev = aPositionInfo.iRxLev; + self->iTA = aPositionInfo.iTA; + self->iDataValidationMask = aPositionInfo.iDataValidationMask; + + RLbsGsmNeighbourCellInfoArray neighbourCellInfoArray; + aPositionInfo.GetNeighbouringCellInfoL(neighbourCellInfoArray); + + for (TInt i=0; i < neighbourCellInfoArray.Count(); i++) + { + TLbsGsmNeighbourCellInfo neighbourCellInfo = neighbourCellInfoArray[i]; + self->AddNeighbouringCellInfoL(&neighbourCellInfo); + } + neighbourCellInfoArray.Close(); + + return self; + + } + + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::~CLbsGsmCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsGsmCellInfo::~CLbsGsmCellInfo() + { + ResetNeighbouringCellInfo(); + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::SetMobileCountryCodeL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::SetMobileCountryCode( const TInt aCountryCode ) + { + iMCC = aCountryCode; + iDataValidationMask |= EGsmMCC; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::MobileCountryCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsGsmCellInfo::MobileCountryCode() const + { + return iMCC; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::SetMobileNetworkCodeL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::SetMobileNetworkCode( const TInt aNetworkCode ) + { + iMNC = aNetworkCode; + iDataValidationMask |= EGsmMNC; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::MobileNetworkCodeL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsGsmCellInfo::MobileNetworkCode() const + { + return iMNC; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::SetLocationAreaCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::SetLocationAreaCode( const TInt aLocationAreaCode ) + { + iLAC = aLocationAreaCode; + iDataValidationMask |= EGsmLAC; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::LocationAreaCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsGsmCellInfo::LocationAreaCode() const + { + return iLAC; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::SetCellId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::SetCellId( const TInt aCellId ) + { + iCid = aCellId; + iDataValidationMask |= EGsmCI; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::CellId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsGsmCellInfo::CellId() const + { + return iCid; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::SetSetRxLevel() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::SetRxLevel( const TInt aRxLev ) + { + iRxLev = aRxLev; + iDataValidationMask |= EGsmRx; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::RxLevel() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsGsmCellInfo::RxLevel() const + { + return iRxLev; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::SetTimingAdvance() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::SetTimingAdvance( const TInt aTimingAdvance ) + { + iTA = aTimingAdvance; + iDataValidationMask |= EGsmTA; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::TimingAdvance() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsGsmCellInfo::TimingAdvance() const + { + return iTA; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::SetNeighbouringCellInfoList() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::AddNeighbouringCellInfoL( + TLbsGsmNeighbourCellInfo* + aNeighbourCellInfo ) + { + if( !aNeighbourCellInfo ) + { + User::Leave( KErrArgument ); + } + + TLbsGsmNeighbourCellInfo neighbourCellInfo; + neighbourCellInfo.SetArfcn( aNeighbourCellInfo->Arfcn() ); + neighbourCellInfo.SetBsic( aNeighbourCellInfo->Bsic() ); + neighbourCellInfo.SetRxLevel( aNeighbourCellInfo->RxLevel() ); + + iNeighbourCellInfo.Append( neighbourCellInfo ); + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::GetNeighbouringCellInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::GetNeighbouringCellInfoL( + RLbsGsmNeighbourCellInfoArray& + aNeighbourCellInfo ) const + { + for( TInt i = 0; i < iNeighbourCellInfo.Count(); i++ ) + { + aNeighbourCellInfo.AppendL( iNeighbourCellInfo[i] ); + } + } + + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::ResetNeighbouringCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsGsmCellInfo::ResetNeighbouringCellInfo() + { + iNeighbourCellInfo.Reset(); + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::Type() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +TLbsAreaInfoClassType CLbsGsmCellInfo::Type() + { + return ELbsAreaGsmCellInfoClass; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::DoInternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsGsmCellInfo::DoInternaliseL( RReadStream& aStream ) + { + iMCC = aStream.ReadInt16L(); + iMNC = aStream.ReadInt16L(); + iLAC = aStream.ReadInt32L(); + iCid = aStream.ReadInt32L(); + iRxLev = aStream.ReadInt8L(); + iTA = aStream.ReadInt16L(); + TInt count = aStream.ReadInt8L(); + for( TInt i = 0;i < count;i++ ) + { + TLbsGsmNeighbourCellInfo cellInfo; + cellInfo.SetArfcn( aStream.ReadInt16L() ); + cellInfo.SetBsic( aStream.ReadInt8L() ); + cellInfo.SetRxLevel( aStream.ReadInt8L() ); + iNeighbourCellInfo.AppendL( cellInfo ); + } + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::DoExternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsGsmCellInfo::DoExternaliseL( RWriteStream& aStream ) const + { + aStream.WriteInt16L( iMCC ); + aStream.WriteInt16L( iMNC ); + aStream.WriteInt32L( iLAC ); + aStream.WriteInt32L( iCid ); + aStream.WriteInt8L( iRxLev ); + aStream.WriteInt16L( iTA ); + TInt count = iNeighbourCellInfo.Count(); + aStream.WriteInt8L( count ); + for( TInt i = 0;i < count;i++ ) + { + aStream.WriteInt16L( iNeighbourCellInfo[i].Arfcn() ); + aStream.WriteInt8L( iNeighbourCellInfo[i].Bsic() ); + aStream.WriteInt8L( iNeighbourCellInfo[i].RxLevel() ); + } + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::ValidateAreaInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsGsmCellInfo::ValidateDataL() const + { + // The following condition is to check the hierarchy of data values specified + if( ( iMCC < 0 || iMCC > 999 ) || ( iMNC < 0 && iLAC > -1 ) || + ( iLAC < 0 && iCid > -1 ) || ( iCid < 0 && iTA > -1 ) || + ( iCid < 0 && iRxLev > -1 ) || + ( iCid < 0 && iNeighbourCellInfo.Count() ) ) + User::Leave( KErrArgument ); + + // Check for range values if they are set specifically by clients + if( iDataValidationMask & EGsmMNC ) + { + if( iMNC < 0 || iMNC > 999 ) + User::Leave( KErrArgument ); + } + if( iDataValidationMask & EGsmLAC ) + { + if( iLAC < 0 || iLAC > 65535 ) + User::Leave( KErrArgument ); + } + if( iDataValidationMask & EGsmCI ) + { + if( iCid < 0 || iCid > 65535 ) + User::Leave( KErrArgument ); + } + if( iDataValidationMask & EGsmRx ) + { + if( iRxLev < 0 || iRxLev > 63 ) + User::Leave( KErrArgument ); + } + if( iDataValidationMask & EGsmTA ) + { + if( iTA < 0 || iTA > 255 ) + User::Leave( KErrArgument ); + } + + // Check neighbouring cell information + for( TInt i = 0; i < iNeighbourCellInfo.Count(); i++ ) + { + if( iNeighbourCellInfo[i].Arfcn() < 0 || iNeighbourCellInfo[i].Arfcn() > 1023 || + iNeighbourCellInfo[i].Bsic() < 0 || iNeighbourCellInfo[i].Bsic() > 63 || + iNeighbourCellInfo[i].RxLevel() < 0 || iNeighbourCellInfo[i].RxLevel() > 63 ) + { + User::Leave( KErrArgument ); + } + } + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::CLbsGsmCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +CLbsGsmCellInfo::CLbsGsmCellInfo() + { + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::CLbsGsmCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsGsmCellInfo::ConstructL() + { + iMCC = -1; + iMNC = -1; + iLAC = -1; + iCid = -1; + iRxLev = -1; + iTA = -1; + iDataValidationMask = EGsmDataNull; + } + +// --------------------------------------------------------------------------- +// CLbsGsmCellInfo::CLbsGsmCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsGsmCellInfo::ConstructL( const TInt aCountryCode, const TInt aNetworkCode, + const TInt aLocationAreaCode, const TInt aCellId ) + { + SetMobileCountryCode( aCountryCode ); + SetMobileNetworkCode( aNetworkCode ); + SetLocationAreaCode( aLocationAreaCode ); + SetCellId( aCellId ); + iRxLev = -1; + iTA = -1; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationgsmneighbourinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationgsmneighbourinfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,107 @@ +/* +* 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: Data class representing a neighbouring cell +* information in a GSM PLMN. +* +*/ + + +#include + + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::TLbsGsmNeighbourCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsGsmNeighbourCellInfo::TLbsGsmNeighbourCellInfo() + { + iARFCN = -1; + iBSIC = -1; + iRxLev = -1; + } + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::TLbsGsmNeighbourCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsGsmNeighbourCellInfo::TLbsGsmNeighbourCellInfo( const TInt aARFCN, + const TInt aBSIC, + const TInt aRxLev ) + { + iARFCN = aARFCN; + iBSIC = aBSIC; + iRxLev = aRxLev; + } + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::SetArfcn() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void TLbsGsmNeighbourCellInfo::SetArfcn( const TInt aARFCN ) + { + iARFCN = aARFCN; + } + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::TLbsGsmNeighbourCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TLbsGsmNeighbourCellInfo::Arfcn() const + { + return iARFCN; + } + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::SetBsic() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void TLbsGsmNeighbourCellInfo::SetBsic( const TInt aBSIC ) + { + iBSIC = aBSIC; + } + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::Bsic() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TLbsGsmNeighbourCellInfo::Bsic() const + { + return iBSIC; + } + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::SetRxLevel() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void TLbsGsmNeighbourCellInfo::SetRxLevel( const TInt aRxLev ) + { + iRxLev = aRxLev; + } + +// --------------------------------------------------------------------------- +// TLbsGsmNeighbourCellInfo::RxLevel() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TLbsGsmNeighbourCellInfo::RxLevel() const + { + return iRxLev; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationinfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,290 @@ +/* +* 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: Container class representing geographical area information as a +* collection of GSM/WCDMA cell information and WLAN MAC IDs. +* +*/ + + +#include +#include +#include + + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsLocationInfo* CLbsLocationInfo::NewL() + { + CLbsLocationInfo* self = new( ELeave ) CLbsLocationInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::NewLC() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsLocationInfo* CLbsLocationInfo::NewLC() + { + CLbsLocationInfo* self = new( ELeave ) CLbsLocationInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::~CLbsLocationInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsLocationInfo::~CLbsLocationInfo() + { + iAreaInfoArray.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::AddAreaInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsLocationInfo::AddAreaInfoL( CLbsAreaInfoBase* + aAreaInfo ) + { + if( !aAreaInfo ) + { + User::Leave( KErrArgument ); + } + iAreaInfoArray.AppendL( aAreaInfo ); + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::GetAreaInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsLocationInfo::GetAreaInfoL( RLbsAreaInfoBaseArray& aAreaInfoArray, + TAreaInfoMask aAreaInfoMask ) + { + + for( TInt i = 0; i < iAreaInfoArray.Count(); i++ ) + { + switch( iAreaInfoArray[i]->Type() ) + { + case ELbsAreaPositionInfoClass: + if( aAreaInfoMask & ELbsPosInfo ) + { + // an object that is a copy of the CLbsPositionInfo + // object that is owned by the CLbsAreaInfoBase object + // is created. Note, ownership of this is passed to + // the caller of GetAreaInfo so the caller needs to do + // a ResetAndDestroy on the array to clean up. + + CLbsPositionInfo* posInfo = static_cast( iAreaInfoArray[i] ); + + CLbsPositionInfo* copyOfPosInfo = CLbsPositionInfo::NewL(*posInfo); + CleanupStack::PushL(copyOfPosInfo ); + aAreaInfoArray.AppendL(copyOfPosInfo); + CleanupStack::Pop(copyOfPosInfo); // ownership transferred to instance of CLbsLocationInfo + + } + break; + + case ELbsAreaGsmCellInfoClass: + if( aAreaInfoMask & ELbsGsmInfo ) + { + CLbsGsmCellInfo* cellInfo = static_cast( iAreaInfoArray[i]); + CLbsGsmCellInfo* copyOfGsmCellInfo = CLbsGsmCellInfo::NewL(*cellInfo); + CleanupStack::PushL(copyOfGsmCellInfo ); + aAreaInfoArray.AppendL( copyOfGsmCellInfo ); + CleanupStack::Pop(copyOfGsmCellInfo); // ownership transferred to instance of CLbsLocationInfo + + } + break; + + case ELbsAreaWcmdaCellInfoClass: + if( aAreaInfoMask & ELbsWcdmaInfo ) + { + CLbsWcdmaCellInfo* wcdaCellInfo = static_cast( iAreaInfoArray[i]); + CLbsWcdmaCellInfo* copyOfWcdaCellInfo = CLbsWcdmaCellInfo::NewL(*wcdaCellInfo); + CleanupStack::PushL(copyOfWcdaCellInfo ); + aAreaInfoArray.AppendL(copyOfWcdaCellInfo); + CleanupStack::Pop(copyOfWcdaCellInfo ); // ownership transferred to instance of CLbsLocationInfo + } + break; + + case ELbsAreaWlanInfoClass: + if( aAreaInfoMask & ELbsWlanInfo ) + { + CLbsWlanInfo* wlanInfo = static_cast( iAreaInfoArray[i]); + CLbsWlanInfo* copyOfWlanInfo = CLbsWlanInfo::NewL(*wlanInfo); + CleanupStack::PushL(copyOfWlanInfo ); + aAreaInfoArray.AppendL(copyOfWlanInfo); + CleanupStack::Pop(copyOfWlanInfo ); // ownership transferred to instance of CLbsLocationInfo + } + break; + + default: + break; + } + } + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::ResetAreaInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsLocationInfo::ResetAreaInfo( TAreaInfoMask aAreaInfoMask ) + { + // If the mask reflects reset all,then reset and destroy is called on + // areaInfoArray directly + if( aAreaInfoMask == ELbsAreaInfoAll ) + { + iAreaInfoArray.ResetAndDestroy(); + return; + } + + for( TInt i = 0; i < iAreaInfoArray.Count(); i++ ) + { + switch( iAreaInfoArray[i]->Type() ) + { + case ELbsAreaPositionInfoClass: + if( aAreaInfoMask & ELbsPosInfo ) + { + CLbsAreaInfoBase* areaInfo = iAreaInfoArray[i]; + iAreaInfoArray.Remove( i ); + delete areaInfo; + } + break; + + case ELbsAreaGsmCellInfoClass: + if( aAreaInfoMask & ELbsGsmInfo ) + { + CLbsAreaInfoBase* areaInfo = iAreaInfoArray[i]; + iAreaInfoArray.Remove( i ); + delete areaInfo; + } + break; + + case ELbsAreaWcmdaCellInfoClass: + if( aAreaInfoMask & ELbsWcdmaInfo ) + { + CLbsAreaInfoBase* areaInfo = iAreaInfoArray[i]; + iAreaInfoArray.Remove( i ); + delete areaInfo; + } + break; + + case ELbsAreaWlanInfoClass: + if( aAreaInfoMask & ELbsWlanInfo ) + { + CLbsAreaInfoBase* areaInfo = iAreaInfoArray[i]; + iAreaInfoArray.Remove( i ); + delete areaInfo; + } + break; + + default: + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::Type() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsLocationInfoClassType CLbsLocationInfo::Type() + { + return ELbsLocationInfoClass; + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::DoInternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsLocationInfo::DoInternaliseL( RReadStream& aStream ) + { + TInt count = aStream.ReadInt8L(); + for( TInt i = 0; i < count; i++ ) + { + TLbsAreaInfoClassType type = aStream.ReadUint16L(); + CLbsAreaInfoBase* area = NULL; + if( ELbsAreaPositionInfoClass == type ) + { + area = CLbsPositionInfo::NewL(); + } + if( ELbsAreaGsmCellInfoClass == type ) + { + area = CLbsGsmCellInfo::NewL(); + } + if( ELbsAreaWcmdaCellInfoClass == type ) + { + area = CLbsWcdmaCellInfo::NewL(); + } + if( ELbsAreaWlanInfoClass == type ) + { + area = CLbsWlanInfo::NewL(); + } + if( area ) + { + area->InternaliseL( aStream ); + iAreaInfoArray.AppendL( area ); + } + } + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::DoExternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsLocationInfo::DoExternaliseL( RWriteStream& aStream ) const + { + TInt count = iAreaInfoArray.Count(); + aStream.WriteInt8L( count ); + for( TInt i = 0; i < count; i++ ) + { + TLbsAreaInfoClassType type = iAreaInfoArray[i]->Type(); + aStream.WriteUint16L( type ); + iAreaInfoArray[i]->ExternaliseL( aStream ); + } + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::CLbsLocationInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +CLbsLocationInfo::CLbsLocationInfo() + { + } + +// --------------------------------------------------------------------------- +// CLbsLocationInfo::ConstructL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsLocationInfo::ConstructL() + { + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationposinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationposinfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,177 @@ +/* +* 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: Data class representing a geographical area in terms of +* latitude,longitude,altitude,horizontal accuracy and vertical accuracy. +* +*/ + + +#include +#include +#include + + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsPositionInfo* CLbsPositionInfo::NewL() + { + CLbsPositionInfo* self = new( ELeave ) CLbsPositionInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +EXPORT_C CLbsPositionInfo* CLbsPositionInfo::NewL( const CLbsPositionInfo& aPositionInfo ) + { + TLocality locality; + + aPositionInfo.GetLocality(locality); + CLbsPositionInfo* self = CLbsPositionInfo::NewL( locality ); + return self; + + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsPositionInfo* CLbsPositionInfo::NewL( const TLocality& aLocality ) + { + CLbsPositionInfo* self = new( ELeave ) CLbsPositionInfo; + CleanupStack::PushL( self ); + self->ConstructL( aLocality ); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::~CLbsPositionInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsPositionInfo::~CLbsPositionInfo() + { + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::SetLocality() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsPositionInfo::SetLocality( + const TLocality& aLocality ) + { + iLocality = aLocality; + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::Locality() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsPositionInfo::GetLocality( TLocality& aLocality ) const + { + aLocality = iLocality; + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::Type() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +TLbsAreaInfoClassType CLbsPositionInfo::Type() + { + return ELbsAreaPositionInfoClass; + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::ValidateAreaInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsPositionInfo::ValidateDataL() const + { + if( Math::IsNaN( iLocality.Latitude() ) || + Math::IsNaN( iLocality.Longitude() ) || + iLocality.HorizontalAccuracy() < 0.0 ) + { + User::Leave( KErrArgument ); + } + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::DoInternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsPositionInfo::DoInternaliseL( RReadStream& aStream ) + { + TReal64 latitude = aStream.ReadReal64L(); + TReal64 longitude = aStream.ReadReal64L(); + TReal32 altitude = aStream.ReadReal32L(); + iLocality.SetCoordinate( latitude, longitude, altitude ); + TInt datum = aStream.ReadInt32L(); + iLocality.SetDatum( TUid::Uid( datum ) ); + TReal32 hAccuracy = aStream.ReadReal32L(); + TReal32 vAccuracy = aStream.ReadReal32L(); + iLocality.SetAccuracy( hAccuracy, vAccuracy ); + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::DoExternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsPositionInfo::DoExternaliseL( RWriteStream& aStream ) const + { + aStream.WriteReal64L( iLocality.Latitude() ); + aStream.WriteReal64L( iLocality.Longitude() ); + aStream.WriteReal32L( iLocality.Altitude() ); + aStream.WriteInt32L( iLocality.Datum().iUid ); + aStream.WriteReal32L( iLocality.HorizontalAccuracy() ); + aStream.WriteReal32L( iLocality.VerticalAccuracy() ); + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::CLbsPositionInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +CLbsPositionInfo::CLbsPositionInfo() + { + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::ConstructL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsPositionInfo::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CLbsPositionInfo::ConstructL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsPositionInfo::ConstructL( const TLocality& aLocality ) + { + SetLocality( aLocality ); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationwcdmainfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationwcdmainfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,386 @@ +/* +* 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: Data class representing a geographical area in terms of +* cell information in a WCDMA PLMN. This class may also optionally contain +* neighbouring cell information +* +*/ + + +#include +#include + + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsWcdmaCellInfo* CLbsWcdmaCellInfo::NewL() + { + CLbsWcdmaCellInfo* self = new( ELeave ) CLbsWcdmaCellInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsWcdmaCellInfo* CLbsWcdmaCellInfo::NewL( const TInt aCountryCode, + const TInt aNetworkCode, + const TInt aUniqueCellId ) + { + CLbsWcdmaCellInfo* self = new( ELeave ) CLbsWcdmaCellInfo; + CleanupStack::PushL( self ); + self->ConstructL( aCountryCode, aNetworkCode, aUniqueCellId ); + CleanupStack::Pop(); + return self; + } + +EXPORT_C CLbsWcdmaCellInfo* CLbsWcdmaCellInfo::NewL( const CLbsWcdmaCellInfo& aPositionInfo ) + { + + CLbsWcdmaCellInfo* self = CLbsWcdmaCellInfo::NewL( aPositionInfo.iMCC,aPositionInfo.iMNC,aPositionInfo.iUCid); + self->iSCode = aPositionInfo.iSCode; + + RLbsWcdmaNeighbourCellInfoArray neighbourCellInfoArray; + aPositionInfo.GetNeighbouringCellInfoL(neighbourCellInfoArray); + + for (TInt i=0; i < neighbourCellInfoArray.Count(); i++) + { + TLbsWcdmaNeighbourCellInfo neighbourCellInfo = neighbourCellInfoArray[i]; + self->AddNeighbouringCellInfoL(&neighbourCellInfo); + } + + self->iDataValidationMask = aPositionInfo.iDataValidationMask; + + neighbourCellInfoArray.Close(); + + return self; + } +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::~CLbsWcdmaCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsWcdmaCellInfo::~CLbsWcdmaCellInfo() + { + ResetNeighbouringCellInfo(); + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::SetMobileCountryCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::SetMobileCountryCode( const TInt aCountryCode ) + { + iMCC = aCountryCode; + iDataValidationMask |= EWcdmaMCC; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::MobileCountryCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsWcdmaCellInfo::MobileCountryCode() const + { + return iMCC; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::SetMobileNetworkCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::SetMobileNetworkCode( const TInt aNetworkCode ) + { + iMNC = aNetworkCode; + iDataValidationMask |= EWcdmaMNC; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::MobileNetworkCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsWcdmaCellInfo::MobileNetworkCode() const + { + return iMNC; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::SetUniqueCellId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::SetUniqueCellId( const TInt aUniqueCellId ) + { + iUCid = aUniqueCellId; + iDataValidationMask |= EWcdmaUCid; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::UniqueCellId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsWcdmaCellInfo::UniqueCellId() const + { + return iUCid; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::SetScramblingCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::SetScramblingCode( const TInt aScramblingCode ) + { + iSCode = aScramblingCode; + iDataValidationMask |= EWcdmaSC; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::ScramblingCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsWcdmaCellInfo::ScramblingCode() const + { + return iSCode; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::SetSignalStrength() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::SetSignalStrength( const TInt aRssi ) + { + iRssi = aRssi; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::SignalStrength() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsWcdmaCellInfo::SignalStrength() const + { + return iRssi; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::AddNeighbouringCellInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::AddNeighbouringCellInfoL( + TLbsWcdmaNeighbourCellInfo* + aNeighbourCellInfo ) + { + if( !aNeighbourCellInfo ) + { + User::Leave( KErrArgument ); + } + TLbsWcdmaNeighbourCellInfo wcdmaNeighbourCellInfo; + wcdmaNeighbourCellInfo.SetUniqueCellId( aNeighbourCellInfo->UniqueCellId()); + wcdmaNeighbourCellInfo.SetScramblingCode( aNeighbourCellInfo->ScramblingCode() ); + wcdmaNeighbourCellInfo.SetSignalStrength( aNeighbourCellInfo->SignalStrength() ); + wcdmaNeighbourCellInfo.SetPathloss( aNeighbourCellInfo->Pathloss() ); + iNeighbourCellInfo.AppendL( wcdmaNeighbourCellInfo ); + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::SetNeighbouringCellInfoList() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::GetNeighbouringCellInfoL( + RLbsWcdmaNeighbourCellInfoArray& + aNeighbourCellInfoList ) const + { + for( TInt i = 0; i < iNeighbourCellInfo.Count(); i++ ) + { + aNeighbourCellInfoList.AppendL( iNeighbourCellInfo[i] ); + } + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::ResetNeighbouringCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWcdmaCellInfo::ResetNeighbouringCellInfo() + { + iNeighbourCellInfo.Reset(); + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::Type() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +TLbsAreaInfoClassType CLbsWcdmaCellInfo::Type() + { + return ELbsAreaWcmdaCellInfoClass; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::DoInternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWcdmaCellInfo::DoInternaliseL( RReadStream& aStream ) + { + iMCC = aStream.ReadInt16L(); + iMNC = aStream.ReadInt16L(); + iUCid = aStream.ReadInt32L(); + iSCode = aStream.ReadInt16L(); + iRssi = aStream.ReadInt16L(); + + TInt count = aStream.ReadInt16L(); + for( TInt i = 0; i < count; i++ ) + { + TLbsWcdmaNeighbourCellInfo cellInfo; + cellInfo.SetUniqueCellId( aStream.ReadInt32L() ); + cellInfo.SetScramblingCode( aStream.ReadInt16L() ); + cellInfo.SetPathloss( aStream.ReadInt16L() ); + cellInfo.SetSignalStrength( aStream.ReadInt16L() ); + iNeighbourCellInfo.Append( cellInfo ); + } + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::DoExternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWcdmaCellInfo::DoExternaliseL( RWriteStream& aStream )const + { + aStream.WriteInt16L( iMCC ); + aStream.WriteInt16L( iMNC ); + aStream.WriteInt32L( iUCid ); + aStream.WriteInt16L( iSCode ); + aStream.WriteInt16L( iRssi ); + + TInt count = iNeighbourCellInfo.Count(); + aStream.WriteInt16L( count ); + for( TInt i = 0; i < count; i++ ) + { + aStream.WriteInt32L( iNeighbourCellInfo[i].UniqueCellId() ); + aStream.WriteInt16L( iNeighbourCellInfo[i].ScramblingCode() ); + aStream.WriteInt16L( iNeighbourCellInfo[i].Pathloss() ); + aStream.WriteInt16L( iNeighbourCellInfo[i].SignalStrength() ); + } + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::ValidateAreaInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWcdmaCellInfo::ValidateDataL() const + { + // The following condition is to check the hierarchy of data values specified + if( ( iMCC < 0 || iMCC > 999 ) || + ( iMNC < 0 && iUCid > -1 ) || + ( iUCid < 0 && iSCode > -1 ) || + ( iUCid < 0 && iRssi > -1 ) || + ( iUCid < 0 && iNeighbourCellInfo.Count() ) ) + User::Leave( KErrArgument ); + + // Check for range values if they are set specifically by clients + if( iDataValidationMask & EWcdmaMNC ) + { + if( iMNC < 0 || iMNC > 999 ) + User::Leave( KErrArgument ); + } + if( iDataValidationMask & EWcdmaUCid ) + { + if( iUCid < 0 || iUCid > 268435455 ) + User::Leave( KErrArgument ); + } + if( iDataValidationMask & EWcdmaSC ) + { + if( iSCode < 0 || iSCode > 511 ) + User::Leave( KErrArgument ); + } + if ( iDataValidationMask & EWcdmaRSSI ) + { + if( iRssi < 0 || iRssi > 127 ) + User::Leave( KErrArgument ); + } + + for( TInt i = 0; i < iNeighbourCellInfo.Count(); i++ ) + { + if( iNeighbourCellInfo[i].UniqueCellId() < 0 || + iNeighbourCellInfo[i].UniqueCellId() > 268435455 || + iNeighbourCellInfo[i].ScramblingCode() < 0 || + iNeighbourCellInfo[i].ScramblingCode() > 511 || + iNeighbourCellInfo[i].Pathloss() < 46 || + iNeighbourCellInfo[i].Pathloss() > 173 || + iNeighbourCellInfo[i].SignalStrength() < 0 || + iNeighbourCellInfo[i].SignalStrength() > 127 ) + { + User::Leave( KErrArgument ); + } + } + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::CLbsWcdmaCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +CLbsWcdmaCellInfo::CLbsWcdmaCellInfo() + { + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::ConstructL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWcdmaCellInfo::ConstructL() + { + iMCC = -1; + iMNC = -1; + iUCid = -1; + iSCode = -1; + iRssi = -1; + iDataValidationMask = EWcdmaDataNull; + } + +// --------------------------------------------------------------------------- +// CLbsWcdmaCellInfo::ConstructL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWcdmaCellInfo::ConstructL( const TInt aCountryCode, + const TInt aNetworkCode, + const TInt aUniqueCellId ) + { + SetMobileCountryCode( aCountryCode ); + SetMobileNetworkCode( aNetworkCode ); + SetUniqueCellId( aUniqueCellId ); + iSCode = -1; + iRssi = -1; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationwcdmaneighbourinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationwcdmaneighbourinfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,131 @@ +/* +* 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: Data class representing a neighbouring cell +* information in a WCDMA PLMN. +* +*/ + + +#include + + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::TLbsWcdmaNeighbourCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsWcdmaNeighbourCellInfo::TLbsWcdmaNeighbourCellInfo() + { + iUniqueCellId = -1; + iScramblingCode = -1; + iPathloss = -1; + iRssi = -1; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::TLbsWcdmaNeighbourCellInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TLbsWcdmaNeighbourCellInfo::TLbsWcdmaNeighbourCellInfo( const TInt aUCid, + const TInt aSCode, + const TInt aPathloss, + const TInt aRssi ) + { + iUniqueCellId = aUCid; + iScramblingCode = aSCode; + iPathloss = aPathloss; + iRssi = aRssi; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::SetUniqueCellId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void TLbsWcdmaNeighbourCellInfo::SetUniqueCellId( const TInt aUniqueCellId ) + { + iUniqueCellId = aUniqueCellId; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::UniqueCellId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TLbsWcdmaNeighbourCellInfo::UniqueCellId() const + { + return iUniqueCellId; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::SetScramblingCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void TLbsWcdmaNeighbourCellInfo::SetScramblingCode( + const TInt aScramblingCode ) + { + iScramblingCode = aScramblingCode; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::ScramblingCode() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TLbsWcdmaNeighbourCellInfo::ScramblingCode() const + { + return iScramblingCode; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::SetPathloss() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void TLbsWcdmaNeighbourCellInfo::SetPathloss( const TInt aPathloss ) + { + iPathloss = aPathloss; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::Pathloss() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TLbsWcdmaNeighbourCellInfo::Pathloss() const + { + return iPathloss; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::SetSignalStrength() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void TLbsWcdmaNeighbourCellInfo::SetSignalStrength( const TInt aRssi ) + { + iRssi = aRssi; + } + +// --------------------------------------------------------------------------- +// TLbsWcdmaNeighbourCellInfo::SignalStrength() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt TLbsWcdmaNeighbourCellInfo::SignalStrength() const + { + return iRssi; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationwlaninfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/ConversionDataTypes/src/lbslocationwlaninfo.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,198 @@ +/* +* 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: Data class representing a geographical area in terms of +* WLAN MAC ID. +* +*/ + + +#include +#include + + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsWlanInfo* CLbsWlanInfo::NewL() + { + CLbsWlanInfo* self = new( ELeave ) CLbsWlanInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::~CLbsWlanInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsWlanInfo* CLbsWlanInfo::NewL( const CLbsWlanInfo& aPositionInfo) + { + + TLbsWlanMacAddress macAddress; + aPositionInfo.GetMacAddress(macAddress); + TInt16 powRx = aPositionInfo.SignalStrength(); + + CLbsWlanInfo* self = CLbsWlanInfo::NewL( macAddress, powRx); + + return self; + } +// --------------------------------------------------------------------------- +// CLbsWlanInfo::NewL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsWlanInfo* CLbsWlanInfo::NewL( const TLbsWlanMacAddress& MacAddress, + const TInt aPowRx ) + { + CLbsWlanInfo* self = new( ELeave ) CLbsWlanInfo; + CleanupStack::PushL( self ); + self->ConstructL( MacAddress, aPowRx ); + CleanupStack::Pop(); + return self; + } + + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::~CLbsWlanInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C CLbsWlanInfo::~CLbsWlanInfo() + { + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::SetMacId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWlanInfo::SetMacAddress( const TDesC8& aMacAddress ) + { + iMacAddress = aMacAddress; + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::MacId() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWlanInfo::GetMacAddress(TDes8& aMacAddress ) const + { + aMacAddress = iMacAddress; + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::SetSignalStrength() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C void CLbsWlanInfo::SetSignalStrength( const TInt aPowRx ) + { + iPowRx = aPowRx; + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::SignalStrength() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CLbsWlanInfo::SignalStrength() const + { + return iPowRx; + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::Type() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +TLbsAreaInfoClassType CLbsWlanInfo::Type() + { + return ELbsAreaWlanInfoClass; + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::DoInternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWlanInfo::DoInternaliseL( RReadStream& aStream ) + { + TInt len = aStream.ReadInt32L(); + aStream.ReadL( iMacAddress, len ); + iPowRx = aStream.ReadInt16L(); + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::DoExternaliseL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWlanInfo::DoExternaliseL( RWriteStream& aStream )const + { + TInt len = iMacAddress.Length(); + aStream.WriteInt32L( len ); + aStream.WriteL( iMacAddress,len ); + aStream.WriteInt16L( iPowRx ); + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::ValidateAreaInfoL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWlanInfo::ValidateDataL() const + { + if( !iMacAddress.Length() ) + User::Leave( KErrArgument ); + + if( iPowRx < 0 || iPowRx > 255 ) + User::Leave( KErrArgument ); + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::CLbsWlanInfo() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +CLbsWlanInfo::CLbsWlanInfo() + { + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::ConstructL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWlanInfo::ConstructL() + { + iMacAddress.FillZ(); + iPowRx = -1; + } + +// --------------------------------------------------------------------------- +// CLbsWlanInfo::ConstructL() +// other items were commented in the header +// --------------------------------------------------------------------------- +// +void CLbsWlanInfo::ConstructL( const TLbsWlanMacAddress& MacAddress, + const TInt aPowRx ) + { + SetMacAddress( MacAddress ); + SetSignalStrength( aPowRx ); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/cenrep/20026814.txt Binary file locationmgmt/locmonitor/lbslocmonitorapis/cenrep/20026814.txt has changed diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/conf/locationinfoconverter.confml Binary file locationmgmt/locmonitor/lbslocmonitorapis/conf/locationinfoconverter.confml has changed diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/conf/locationinfoconverter_20026814.crml Binary file locationmgmt/locmonitor/lbslocmonitorapis/conf/locationinfoconverter_20026814.crml has changed diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorapis/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorapis/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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: This file provides the information required for building the +* location monitor API component. +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +#ifdef OS_LAYER_CONFML +../conf/locationinfoconverter.confml OS_LAYER_CONFML(locationinfoconverter.confml) +#endif + +#ifdef OS_LAYER_CRML +../conf/locationinfoconverter_20026814.crml OS_LAYER_CRML(locationinfoconverter_20026814.crml) +#endif + +#include "../ConversionApi/ConversionCommon/group/bld.inf" +#include "../ConversionDataTypes/group/bld.inf" +#include "../CommonClientServerApi/group/bld.inf" +#include "../ConversionApi/ConversionClientApi/group/bld.inf" +#include "../ConversionApi/ConversionPluginApi/group/bld.inf" + +// End of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/inc/clbsconversionpositionersubsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/inc/clbsconversionpositionersubsession.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,76 @@ +/* +* 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: +* +*/ + + +#ifndef CLBSCONVERSIONPOSITIONERSUBSESSION_H_ +#define CLBSCONVERSIONPOSITIONERSUBSESSION_H_ + + +#include +#include "tserverstartparams.h" +#include "csecureasbase.h" +#include "csecureserverbase.h" +#include "csecuresessionbase.h" +#include "csecuresessionsubsessionbase.h" +#include "csubsessionbase.h" +#include "messageutils.h" +#include "clbslocmonitorutils.h" + +class CLbsLocMonitorServer; + +/* + Server side subsession of the Location Monitor server. + This subsession handles client's requests for the + location info conversion. +*/ +class CLbsConversionPositionerSubsession : public CBase, + public MSubSessionImpl + { +public: + static CLbsConversionPositionerSubsession* NewL(); + + ~CLbsConversionPositionerSubsession(); + + // From MSubSessionImpl + virtual void DispatchL(const RMessage2& aMessage); + virtual void DispatchError(const RMessage2& aMessage, TInt aError); + virtual void CreateSubSessionL(const RMessage2& aMessage, const CSecureServerBase* aServer); + virtual void CloseSubSession(); + + // via MSubSessionImpl::MRelease + void VirtualRelease(); + +protected: + CLbsConversionPositionerSubsession(); + void ConstructL(); + + // + // action methods. + // + void GetPositionL(const RMessage2& aMessage); + void CancelGetPositionL(const RMessage2& aMessage); + void SetLastKnownPositionL(const RMessage2& aMessage); + +private: + + CLbsLocMonitorServer* iLocMonitorServer; + + // Unique ID of this subsession + CLbsLocMonitorUtils::sessionAndSubSessionId iSubsessionId; + }; + +#endif /*CLBSCONVERSIONPOSITIONERSUBSESSION_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/inc/clbslocmonitorconversionhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/inc/clbslocmonitorconversionhandler.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,256 @@ +/* +* 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: Declaration of CLbsLocMonitorConversionHandler class. +* +*/ + +#ifndef CLBSLOCMONITORCONVERSIONHANDLER_H_ +#define CLBSLOCMONITORCONVERSIONHANDLER_H_ + +#include +#include +#include +#include "mlbsconversioncompleteobserver.h" +#include "rlbslocmonitordb.h" + +/** + * This class is responsible for requesting location conversion from + * the plug in and later to handle the converted information. + */ +class CLbsLocMonitorConversionHandler : public CActive, + public MLbsLocInfoConverterPluginObserver + { +public: + /** + * Validation info assosciated with each client + */ + struct TValidationInfo + { + TSecureId iClientSecureId; + }; /** + * This represent different state of conversion handler. + */ + enum TState + { + EStateIdle, + EStateValidation, + EStateConversion, + EStateCacheSave, + EStateCacheSaveComplete + }; + +public: + /** + * Creates new instance of CLbsLocMonitorConversionHandler object. + */ + static CLbsLocMonitorConversionHandler* NewL( + MLbsConversionCompleteObserver& + aConversionCompleteObserver, + TUid aConversionPluginUid ); + + /** + * Destructor + */ + ~CLbsLocMonitorConversionHandler(); + + /** + * Returns the size of converted location information to the client. + */ + void GetConvertLocationInfoSizeL(const RMessage2& aMessage); + + /** + * Returns the converted location information to the client. + */ + void GetConvertedLocationInfoL(const RMessage2& aMessage); + + /** + * Cancel location info conversion. + */ + void CancelLocationInfoConversionL(const RMessage2& aMessage); + + /** + * Returns Uid of conversion plugin that is loaded. + */ + TUid ConversionPluginUid(); + + /** + * Returns ETrue is any message corresponding to subsession id + * is present in the handler. + */ + TBool IsMessagePresent(const RMessage2& aMessage); + + /** + * Returns ETrue if secure id and subsession id matches else EFalse. + */ + TBool CompareMessage(const RMessage2& aSrc,const RMessage2& aDes); + + /** + * Returns accuracy level from a cache match, or nan if undefined. + */ + TReal32 AccuracyFromMatchLevel(TPositionAreaExtendedInfo::TArea aMatchlevel); + + + +public: // from MLbsLocInfoConverterPluginObserver + virtual void OnConversionComplete(TInt aStatusCode); + + virtual void OnValidationComplete(TInt aStatusCode); + +protected: // from CActive + void RunL(); + void DoCancel(); + +private: + /** + * Constructor. + */ + CLbsLocMonitorConversionHandler(MLbsConversionCompleteObserver& + aConversionCompleteObserver); + + /** + * Symbian 2 phase constructor. + */ + void ConstructL(TUid aConversionPluginUid); + + /** + * Processes the request which is recently validated. + */ + TInt ProcessRequestL(); + + /** + * Loads the conversion module specified by client. + */ + void LoadConversionPluginL(TUid aConversionModuleId); + + /** + * Writes converted position information to the stream. + */ + void WriteAreaInfoL(RBufWriteStream& aWriteStream, + CLbsLocationInfo::TAreaInfoMask aAreaInfoMask); + + /** + * Completes client's message. + */ + void CompleteRequest(const RMessage2& aMessage,TInt aReason); + + /** + * This is called after each conversion request complete + */ + void RequestCompleteL(); + + + void WriteResultToBufferL(); + + + /** + * Fills in partial results from cache where they are better than those returned from the plugin + */ + void FillInPartialL(); + + /** + * Sends requests from iRequestedInfo to the cacne and uses the result to + * fill in iCacheLookupResults, the RunL will decide which responses to + * write back into iRequestedInfo and send back to the client + */ + TBool CacheLookupL(); + + /* + * Writes any cellid + location pairs received as part of a query back into + * the cache + */ + TBool CacheSaveL(); + +private: // Member variables + /** + * Handle to conversion complete observer + */ + MLbsConversionCompleteObserver& iConversionCompleteObserver; + + /** + * Conversion request. + */ + RMessage2 iConversionRequest; + + /** + * Validation request array. + */ + RArray iValidationRequestQueue; + + /** + * Pointer to conversion plugin + */ + CLbsLocInfoConverterPluginBase* iLocInfoConverterPlugIn; + + /** + * Handle to buffer that contains converted information. + */ + CBufFlat* iBuffer; + + /** + * Client specified request info + */ + TLbsConversionOutputInfoMask iRequestedInfo; + + /** + * Location information array passed from client. + */ + RLbsLocationInfoArray iLocationInfoArray; + + + /** + * A subset of location information array passed from client. + * requests that have been solved by the cache are ommitted + * this array DOES NOT OWN its contents and should not destroy them. + * as the ownership remains with iLocationInfoArray + */ + RLbsLocationInfoArray iSubsetLocationInfoArray; + + /** + * Uid of currently loaded conversion plug in + */ + TUid iConversionPluginId; + + /** + * State of conversion handler. + */ + TState iState; + + /** + * Secure id of client that has outstanding request + */ + TSecureId iCurrentRequestSecureId; + + /** + * Subsession id of client that has outstanding request + */ + TInt iCurrentRequestSubsessionId; + + + /* + * Cache lookup results + */ + RArray iCachePartialResults; + + + /** + * Cache for lookups + */ + RLbsLocMonitorDb iCache; + + + TInt iSavedToCacheCount; + + }; + +#endif /*CLBSLOCMONITORCONVERSIONHANDLER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/inc/clbslocmonitorpluginresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/inc/clbslocmonitorpluginresolver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,86 @@ +/* +* 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: Declaration of CLbsLocMonitorPluginResolver class +* +*/ + +#ifndef CLBSLOCMONITORPLUGINRESOLVER_H_ +#define CLBSLOCMONITORPLUGINRESOLVER_H_ + +#include +#include + +/** + * This class is responsible for choosing the default converter plugin based + * on vendorid and plugin priority. + * + */ +class CLbsLocMonitorPluginResolver : public CActive + { +public: + /** + * Constructs new object of CLbsLocMonitorPluginResolver. + */ + static CLbsLocMonitorPluginResolver* NewL(); + + /** + * Destructor. + */ + ~CLbsLocMonitorPluginResolver(); + + /** + * Returns uid of default converter. + * @param[out] aConverterPluginUid Default converter plugin id. + * @return KErrNotFound If none of converter plugin available. + */ + TInt DefaultConverterUid( TUid& aConverterPluginUid ); + +protected: // From CActive + void RunL(); + void DoCancel(); + + +private: + /** + * Default constructor. + */ + CLbsLocMonitorPluginResolver(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Finds default converter plugin + */ + void FindDefaultConverterPluginL(); + + /** + * + */ + TInt PriorityInfo( const TDesC8& aOpaqueData ); +private: // Member variables + + /** + * Pointer to ecom session + */ + REComSession* iEcomSession; + + /** + * Default converter plugin uid. + */ + TUid iDefaultConverterPluginId; + }; +#endif /* CLBSLOCMONITORPLUGINRESOLVER_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/inc/locmonitorsettingskeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/inc/locmonitorsettingskeys.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2006 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: Defines the cenrep keys of location monitor +* +*/ + + +#ifndef LOCMONITORSETTINGSKEYS_H +#define LOCMONITORSETTINGSKEYS_H + +// CONSTANTS + +// ENUMERATION FOR CENTRAL REPOSITORY KEYS +enum TCenRepKeys + { + EPhoneVendorId = 0x00000001, + }; + +// CENTRAL REPOSITORY UID +const TUid KCRUidLocMonitorSettings = {0x20026814}; + + +#endif // LOCMONITORSETTINGSKEYS_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/inc/mlbsconversioncompleteobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/inc/mlbsconversioncompleteobserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: +* +*/ + +#ifndef MLBSCONVERSIONCOMPLETEOBSERVER_H_ +#define MLBSCONVERSIONCOMPLETEOBSERVER_H_ + +// Forward declarations +class CLbsLocMonitorConversionHandler; + +/** + * Class that needs to implement this interface to listen + * to conversion complete event from the handler. + * + */ +class MLbsConversionCompleteObserver + { +public: + virtual void HandleConversionComplete(CLbsLocMonitorConversionHandler* + aConversionHandler) = 0; + }; + + +#endif /*MLBSCONVERSIONCOMPLETEOBSERVER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/src/clbsconversionpositionersubsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/src/clbsconversionpositionersubsession.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,201 @@ +/* +* 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: +* +*/ + +#include "clbsconversionpositionersubsession.h" +#include "lbslocmonitorserverdata.h" +#include "clbslocmonitorutils.h" +#include "clbslocmonitorserver.h" +#include "lbsdevloggermacros.h" +#include "clbslocmonitorconversionhandler.h" +#include "lbslocmonitorclientconsts.h" + +//---------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::NewL +// +//----------------------------------------------------------------------------- +CLbsConversionPositionerSubsession* CLbsConversionPositionerSubsession::NewL() + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::NewL()"); + CLbsConversionPositionerSubsession* self = new (ELeave) CLbsConversionPositionerSubsession; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// ----------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::~CLbsConversionPositionerSubsession +//------------------------------------------------------------------------------ +CLbsConversionPositionerSubsession::CLbsConversionPositionerSubsession() + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::CLbsConversionPositionerSubsession()"); + } + +// ----------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::ConstructL +//------------------------------------------------------------------------------ +void CLbsConversionPositionerSubsession::ConstructL() + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::ConstructL()"); + // Nothing to do + } +//---------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::~CLbsConversionPositionerSubsession +// +//----------------------------------------------------------------------------- +CLbsConversionPositionerSubsession::~CLbsConversionPositionerSubsession() + { + LBSLOG(ELogP1,"->CLbsConversionPositionerSubsession::~CLbsConversionPositionerSubsession"); + + // Tell the DB reader that this subsession is being deleted + // so that if there are any outanding requests from this session + // they are terminated with KErrServerTerminated. + iLocMonitorServer->ReadRequestHandler().ClientTerminated(iSubsessionId); + + LBSLOG(ELogP1,"<-CLbsConversionPositionerSubsession::~CLbsConversionPositionerSubsession"); + } + +//---------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::DispatchL +// +//----------------------------------------------------------------------------- +void CLbsConversionPositionerSubsession::DispatchL(const RMessage2& aMessage) + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::DispatchL()"); + switch(aMessage.Function()) + { + case EConvertSingleLocationInfoBufferSize: + case EConvertMultipleLocationInfoBufferSize: + { + // Extract client preferences + TLbsClientPrefs clientPrefs; + TPckg clientPrefsPckg(clientPrefs); + aMessage.ReadL(KParamClientPrefs,clientPrefsPckg); + + // If client has not specified any conversion plugin id, read the default + // plugin from cenrep and load it. + TUid conversionPluginId; + if(clientPrefs.iConverterModuleId.iUid == KNullUidValue) + { + TInt error = iLocMonitorServer->PluginResolver()->DefaultConverterUid( + conversionPluginId); + if(error != KErrNone) + { + aMessage.Complete(error); + return; + } + } + else + { + conversionPluginId = clientPrefs.iConverterModuleId; + } + + CLbsLocMonitorConversionHandler* conversionHandler = + iLocMonitorServer->ConversionHandlerL(conversionPluginId); + conversionHandler->GetConvertLocationInfoSizeL(aMessage); + break; + } + + case EGetSingleLocationInfo: + case EGetMultipleLocationInfo: + { + CLbsLocMonitorConversionHandler* conversionHandler = + iLocMonitorServer->ConversionHandler(aMessage); + + conversionHandler->GetConvertedLocationInfoL(aMessage); + break; + } + + + + case ECancelConvertLocationInfo: + { + CLbsLocMonitorConversionHandler* conversionHandler = + iLocMonitorServer->ConversionHandler(aMessage); + + // If there is no outstanding request from the subsession which requested cancel operation, + // complete the request. + if(conversionHandler) + { + conversionHandler->CancelLocationInfoConversionL(aMessage); + } + else + { + aMessage.Complete(KErrNone); + } + break; + } + default: + __ASSERT_DEBUG(EFalse, User::Invariant()); + break; + } + } + + +//---------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::DispatchError +// +//----------------------------------------------------------------------------- +void CLbsConversionPositionerSubsession::DispatchError(const RMessage2& aMessage, + TInt aError) + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::DispatchError()"); + // errors from DispatchL end up in here + aMessage.Complete(aError); + } + + +//---------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::DispatchError +// +//----------------------------------------------------------------------------- +void CLbsConversionPositionerSubsession::CreateSubSessionL(const RMessage2& aMessage, + const CSecureServerBase* aServer) + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::CreateSubSessionL()"); + CSecureServerBase* server = const_cast (aServer); + iLocMonitorServer = reinterpret_cast(server); + iSubsessionId.iSessionPtr = static_cast(aMessage.Session()); + + TInt subsessionId; + TPckg subsessionIdBuf(subsessionId); + User::LeaveIfError(aMessage.Read(3, subsessionIdBuf)); + + iSubsessionId.iSubsessionId = subsessionId; + } + +//---------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::CloseSubSession +// +//----------------------------------------------------------------------------- +void CLbsConversionPositionerSubsession::CloseSubSession() + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::CloseSubSession()"); + // Release anything allocated in CreateSubSessionL. + // In this case there is nothing to do. + } + +//---------------------------------------------------------------------------- +// CLbsConversionPositionerSubsession::VirtualRelease +// +//----------------------------------------------------------------------------- +void CLbsConversionPositionerSubsession::VirtualRelease() + { + LBSLOG(ELogP1,"CLbsConversionPositionerSubsession::VirtualRelease()"); + delete this; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/src/clbslocmonitorconversionhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/src/clbslocmonitorconversionhandler.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,910 @@ +/* +* 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: Implementation of CLbsLocMonitorConversionHandler class. +* +*/ + +#include +#include +#include +#include +#include "clbslocmonitorconversionhandler.h" +#include "lbslocmonitorclientconsts.h" +#include "lbslocmonitorserverdata.h" +#include "lbsdevloggermacros.h" + + + +// constants +const TInt KCurrentRequestIndex = 0; +const TInt KMaxBufferSize = 512; + +//TODO need to agree which core lbs header to put them in and names +const TReal32 KWlanAccuracy = 100.0; +const TReal32 KCellFullAccuracy = 3000.0; +const TReal32 KCellLocationAccuracy = 30000.0; +const TReal32 KCellCountryAccuracy = 1000000.0; + + + +void CleanUpResetAndDestroy(TAny* aArray) + { + static_cast(aArray)->ResetAndDestroy(); + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::NewL +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocMonitorConversionHandler* CLbsLocMonitorConversionHandler::NewL( + MLbsConversionCompleteObserver& + aConversionCompleteObserver, + TUid aConversionPluginUid) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::NewL()"); + CLbsLocMonitorConversionHandler* self = new(ELeave) + CLbsLocMonitorConversionHandler( + aConversionCompleteObserver); + CleanupStack::PushL(self); + self->ConstructL(aConversionPluginUid); + CleanupStack::Pop(self); + return self; + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::CLbsLocMonitorConversionHandler +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocMonitorConversionHandler::CLbsLocMonitorConversionHandler( + MLbsConversionCompleteObserver& + aConversionCompleteObserver): + CActive(EPriorityStandard), + iConversionCompleteObserver( + aConversionCompleteObserver) + + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::CLbsLocMonitorConversionHandler()"); + CActiveScheduler::Add(this); + iBuffer = NULL; + iLocInfoConverterPlugIn = NULL; + iConversionPluginId = TUid::Uid(KNullUidValue); + iState = EStateIdle; + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::~CLbsLocMonitorConversionHandler +// (other items were commented in a header). +//---------------------------------------------------------------- +CLbsLocMonitorConversionHandler::~CLbsLocMonitorConversionHandler() + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::~CLbsLocMonitorConversionHandler()"); + + iCachePartialResults.Reset(); + iSubsetLocationInfoArray.Reset(); // NOT OWNED! + iLocationInfoArray.ResetAndDestroy(); + + iValidationRequestQueue.Close(); + + delete iLocInfoConverterPlugIn; + delete iBuffer; + iCache.Close(); + // NewL of plugin internally uses REComSession to find implementations. + // Hence it needs to be closed to avoid memory leak. + REComSession::FinalClose(); + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::ConstructL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::ConstructL(TUid aConversionPluginUid) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::ConstructL()"); + LoadConversionPluginL(aConversionPluginUid); + iCache.OpenL(); + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::GetConvertLocationInfoSizeL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::GetConvertLocationInfoSizeL( + const RMessage2& aMessage) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::GetConvertLocationInfoSizeL()"); + iValidationRequestQueue.AppendL(aMessage); + + // If the message which is appended is the only message in the queue, + // send the necessary information of the message to the plug in for + // validation. + if(iValidationRequestQueue.Count() == 1) + { + iState = EStateValidation; + // Extract client preferences to get the requested info. + TLbsClientPrefs clientPrefs; + TPckg clientPrefsPckg(clientPrefs); + aMessage.ReadL(KParamClientPrefs,clientPrefsPckg); + + iLocInfoConverterPlugIn->ValidateClient(aMessage.SecureId(), + aMessage.VendorId(), + clientPrefs.iRequestedInfo); + } + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::ProcessRequestL +// (other items were commented in a header). +//---------------------------------------------------------------- +TInt CLbsLocMonitorConversionHandler::ProcessRequestL() + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::ProcessRequestL()"); + // Reset the member variables. + iLocationInfoArray.ResetAndDestroy(); + delete iBuffer; + iBuffer = NULL; + iState = EStateIdle; + + // Store secure id and subsession id of the request. This is required + // to identify the next IPC that requests for actual data. + iCurrentRequestSecureId = iConversionRequest.SecureId(); + iCurrentRequestSubsessionId = iConversionRequest.Int3(); + + // Extract client preferences + TLbsClientPrefs clientPrefs; + TPckg clientPrefsPckg(clientPrefs); + iConversionRequest.ReadL(KParamClientPrefs,clientPrefsPckg); + + // Store the client requested info.This is required to extract the + // required information on conversion complete. + iRequestedInfo = clientPrefs.iRequestedInfo; + + // Extract the client specified location information + TInt dataSize = iConversionRequest.GetDesLength(KParamLocationInfo); + if (dataSize < 0) + { + CompleteRequest(iConversionRequest,KErrBadDescriptor); + return KErrBadDescriptor; + } + HBufC8* buffer = HBufC8::NewLC(dataSize); + TPtr8 ptrToBuf = buffer->Des(); + iConversionRequest.ReadL(KParamLocationInfo, ptrToBuf); + + RDesReadStream stream(*buffer); + CleanupClosePushL(stream); + + TInt count; + // Read the number of location info object only incase of multiple conversion + if(iConversionRequest.Function() == EConvertMultipleLocationInfoBufferSize) + { + count = stream.ReadInt8L(); + } + else + { + // Incase of single location info conversion, count value is always one. + count = 1; + } + + for(TInt i = 0; iInternaliseL(stream); + CleanupStack::Pop(locationInfo); + iLocationInfoArray.AppendL(locationInfo); + } + + CleanupStack::PopAndDestroy(2); // stream,buffer + + iState = EStateConversion; + // Ask Cache, + // take different action depending on whether it has results for all our requests + if(CacheLookupL()) + { + // Cache has supplied all positions. We can self complete now to pass result back to client + iState = EStateCacheSaveComplete; + } + else + { + // Cache did not have all the positions we wanted, must go to plugin + iLocInfoConverterPlugIn->ConvertLocationInfoL(iSubsetLocationInfoArray, + clientPrefs.iConversionPrefs, + clientPrefs.iRequestedInfo); + } + return KErrNone; + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::LoadConversionPluginL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::LoadConversionPluginL( + TUid aConversionModuleId) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::LoadConversionPluginL()"); + TLbsLocInfoConverterPluginParams conversionPluginParam(*this); + + iLocInfoConverterPlugIn = CLbsLocInfoConverterPluginBase::NewL( + aConversionModuleId,conversionPluginParam); + iConversionPluginId = aConversionModuleId; + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::GetConvertLocationInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::GetConvertedLocationInfoL( + const RMessage2& aMessage) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::GetConvertedLocationInfoL()"); + TPtr8 ptr = iBuffer->Ptr(0); + aMessage.WriteL(KParamConvertedInfo,ptr); + aMessage.Complete(KErrNone); + + // This is the last step of a any location conversion. Hence request + // complete call needs to be called to process next request if any. + RequestCompleteL(); + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::IsMessagePresent +// (other items were commented in a header). +//---------------------------------------------------------------- +TBool CLbsLocMonitorConversionHandler::IsMessagePresent( + const RMessage2& aMessage) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::IsMessagePresent()"); + // Iterate through the validation request array to find the message. + // First element in the validation queue will the current request + // under conversion. + for(TInt i=0;iCancelValidateClient(); + break; + + case EStateConversion: + iLocInfoConverterPlugIn->CancelConvertLocationInfo(); + break; + + default: + break; + } + CompleteRequest(iValidationRequestQueue[i],KErrCancel); + Cancel(); + RequestCompleteL(); + } + else + { + RMessage2 message = iValidationRequestQueue[i]; + iValidationRequestQueue.Remove(i); + message.Complete(KErrCancel); + } + aMessage.Complete(KErrNone); + return; + } + } + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::ConversionPluginUid +// (other items were commented in a header). +//---------------------------------------------------------------- +TUid CLbsLocMonitorConversionHandler::ConversionPluginUid() + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::ConversionPluginUid()"); + return iConversionPluginId; + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::OnConversionComplete +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::OnConversionComplete(TInt aStatusCode) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::OnConversionComplete()"); + // This is done to release the Plug-in's method from which this method + // has been called. + TRequestStatus* statusPtr = &iStatus; + iStatus = KRequestPending; + SetActive(); + User::RequestComplete(statusPtr,aStatusCode); + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::OnValidationComplete +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::OnValidationComplete(TInt aStatusCode) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::OnValidationComplete()"); + // This is done to release the Plug-in's method from which this method + // has been called. + TRequestStatus* statusPtr = &iStatus; + iStatus = KRequestPending; + SetActive(); + User::RequestComplete(statusPtr,aStatusCode); + } + + +void CLbsLocMonitorConversionHandler::WriteResultToBufferL() + { + iBuffer = CBufFlat::NewL(KMaxBufferSize); + RBufWriteStream writeStream; + writeStream.Open(*iBuffer); + CleanupClosePushL(writeStream); + + // Write the count only if multiple conversion was requested by client. + if(iConversionRequest.Function() == EConvertMultipleLocationInfoBufferSize) + { + writeStream.WriteInt8L(iLocationInfoArray.Count()); + } + + switch(iRequestedInfo) + { + case ELbsConversionOutputPosition: + WriteAreaInfoL(writeStream,CLbsLocationInfo::ELbsPosInfo); + break; + + case ELbsConversionOutputGsm: + WriteAreaInfoL(writeStream,CLbsLocationInfo::ELbsGsmInfo); + break; + + case ELbsConversionOutputWcdma: + WriteAreaInfoL(writeStream,CLbsLocationInfo::ELbsWcdmaInfo); + break; + + case ELbsConversionOutputWlan: + WriteAreaInfoL(writeStream,CLbsLocationInfo::ELbsWlanInfo); + break; + + default: + break; + } + + writeStream.CommitL(); + CleanupStack::PopAndDestroy(&writeStream); + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::RunL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::RunL() + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::RunL()"); + TBool cacheSaveComplete = EFalse; + switch(iState) + { + case EStateValidation: + { + // This validation result corresponds to the first request in the validation + // queue. + iConversionRequest = iValidationRequestQueue[KCurrentRequestIndex]; + if(iStatus.Int() == KErrNone) + { + // On successful validation, process the request + ProcessRequestL(); + } + else + { + iConversionRequest.Complete(iStatus.Int()); + RequestCompleteL(); + } + break; + } + case EStateConversion: + { + if(iStatus.Int() == KErrNone) + { + //First we loop through comparing accuracies to any partial results we may have had + FillInPartialL(); + + TLbsConversionPluginInfo pluginPreferences; + iLocInfoConverterPlugIn->ConversionPluginPreferences(pluginPreferences); + + // Then save all things we are allowed to, to the cache + if(pluginPreferences.IsPluginPositionToBeCached()) + { + iSavedToCacheCount = 0; + cacheSaveComplete = CacheSaveL(); + if(cacheSaveComplete) + { + iState = EStateCacheSaveComplete; + } + } + else + { + WriteResultToBufferL(); + + // Send the required buffer size to the client. + TInt size = iBuffer->Size(); + TPckg sizePckg(size); + iConversionRequest.WriteL(KParamBufferSize,sizePckg); + CompleteRequest(iConversionRequest,KErrNone); + } + } + else + { + // Since there is error in conversion, server dont receive + // any call to retrieve converted info.Hence we need to + // remove the current request. + CompleteRequest(iConversionRequest,iStatus.Int()); + RequestCompleteL(); + } + break; + } + case EStateCacheSave: + { + cacheSaveComplete = CacheSaveL(); + if(cacheSaveComplete) + { + iState = EStateCacheSaveComplete; + } + break; + } + case EStateCacheSaveComplete: + { + // fall through + break; + } + default: + { + User::Invariant(); + } + } + if(iState == EStateCacheSaveComplete) + { + WriteResultToBufferL(); + + // Send the required buffer size to the client. + TInt size = iBuffer->Size(); + TPckg sizePckg(size); + iConversionRequest.WriteL(KParamBufferSize,sizePckg); + CompleteRequest(iConversionRequest,KErrNone); + } + } + + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::RequestCompleteL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::RequestCompleteL() + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::RequestCompleteL()"); + // Remove the completed conversion request. + iValidationRequestQueue.Remove(KCurrentRequestIndex); + + // Process the next the request in the queue incase any. + if(iValidationRequestQueue.Count()) + { + iState = EStateValidation; + // Extract client preferences to get the requested info. + TLbsClientPrefs clientPrefs; + TPckg clientPrefsPckg(clientPrefs); + iValidationRequestQueue[KCurrentRequestIndex].ReadL(KParamClientPrefs,clientPrefsPckg); + + iLocInfoConverterPlugIn->ValidateClient( + iValidationRequestQueue[KCurrentRequestIndex].SecureId(), + iValidationRequestQueue[KCurrentRequestIndex].VendorId(), + clientPrefs.iRequestedInfo); + } + else + { + iConversionCompleteObserver.HandleConversionComplete(this); + } + } + + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::DoCancel +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::DoCancel() + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::DoCancel()"); + // Nothing to do here. + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::WriteAreaInfoL +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::WriteAreaInfoL(RBufWriteStream& + aWriteStream, + CLbsLocationInfo::TAreaInfoMask aAreaInfoMask) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::WriteAreaInfoL()"); + for(TInt i=0;iGetAreaInfoL(areaInfoArray,aAreaInfoMask); + + // Write the count of converted information for each location info object. + TInt count = areaInfoArray.Count(); + aWriteStream.WriteInt8L(count); + + for(TInt j=0;jExternaliseL(aWriteStream); + } + CleanupStack::PopAndDestroy(&areaInfoArray); + } + } + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::CompleteRequest +// (other items were commented in a header). +//---------------------------------------------------------------- +void CLbsLocMonitorConversionHandler::CompleteRequest(const RMessage2& aMessage, + TInt aReason) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::CompleteRequest()"); + TInt pos = iValidationRequestQueue.Find(aMessage); + if(!aMessage.IsNull()) + { + aMessage.Complete(aReason); + iValidationRequestQueue[pos] = aMessage; + } + } + + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::CompareMessage +// (other items were commented in a header). +//---------------------------------------------------------------- +TBool CLbsLocMonitorConversionHandler::CompareMessage(const RMessage2& aSrc, + const RMessage2& aDes) + { + LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::CompareMessage()"); + // If the src message is NULL,this is the message corresponding to the + // first request for which it is completed with size of converted info. + // Hence it needs to checked aganist current request's secure id and the + // subsession id. + if(aSrc.IsNull()) + { + if(aDes.SecureId() == iCurrentRequestSecureId && + aDes.Int3() == iCurrentRequestSubsessionId) + { + return ETrue; + } + return EFalse; + } + + // Subsession id is stored in the 4th IPC slot. + if(aSrc.SecureId() == aDes.SecureId() && + aSrc.Int3() == aDes.Int3()) + { + return ETrue; + } + return EFalse; + } + + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::AccuracyFromMatchLevel +// (other items were commented in a header). +//---------------------------------------------------------------- +TReal32 CLbsLocMonitorConversionHandler::AccuracyFromMatchLevel(TPositionAreaExtendedInfo::TArea aMatchlevel) + { + TRealX outputAccuracy; + outputAccuracy.SetNaN(); + switch(aMatchlevel) + { + case TPositionAreaExtendedInfo::EAreaUnknown: + { + break; + } + case TPositionAreaExtendedInfo::EAreaCountry: + { + outputAccuracy.Set(KCellCountryAccuracy); + break; + } + case TPositionAreaExtendedInfo::EAreaRegion: + { + outputAccuracy.Set(KCellLocationAccuracy); + break; + } + case TPositionAreaExtendedInfo::EAreaCity: + { + outputAccuracy.Set(KCellFullAccuracy); + break; + } + case TPositionAreaExtendedInfo::EAreaDistrict: + { + outputAccuracy.Set(KWlanAccuracy); + break; + } + case TPositionAreaExtendedInfo::EAreaStreet: + { + outputAccuracy.Set(KWlanAccuracy); + break; + } + default: + { + break; + } + } + return outputAccuracy; + } + + + +void CLbsLocMonitorConversionHandler::FillInPartialL() + { + TInt infoCount = iSubsetLocationInfoArray.Count(); + TInt partialCount = iCachePartialResults.Count(); + if((infoCount != partialCount) || infoCount == 0) + return; + + for(TInt i = 0; i < infoCount; i++) + { + CLbsLocationInfo* locationInfo = static_cast(iSubsetLocationInfoArray[i]); + + RLbsAreaInfoBaseArray locationArray; + CleanupStack::PushL(TCleanupItem(*CleanUpResetAndDestroy, &locationArray)); + locationInfo->GetAreaInfoL(locationArray, CLbsLocationInfo::ELbsPosInfo); + + if(locationArray.Count() > 0) + { + CLbsPositionInfo* location = static_cast(locationArray[0]); + TLocality pluginLocality; + location->GetLocality(pluginLocality); + if(!Math::IsNaN(iCachePartialResults[i].HorizontalAccuracy()) && + (iCachePartialResults[i].HorizontalAccuracy() < pluginLocality.HorizontalAccuracy())) + { + locationInfo->ResetAreaInfo(CLbsLocationInfo::ELbsPosInfo); + CLbsPositionInfo* newLocation = CLbsPositionInfo::NewL(iCachePartialResults[i]); + locationInfo->AddAreaInfoL(newLocation); + } + } + CleanupStack::PopAndDestroy(&locationArray); + } + } + + + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::CacheLookupL +// (other items were commented in a header). +//---------------------------------------------------------------- +TBool CLbsLocMonitorConversionHandler::CacheLookupL() + { + iCachePartialResults.Reset(); + // Does NOT own contents + iSubsetLocationInfoArray.Reset(); + TInt infoCount = iLocationInfoArray.Count(); + // We only do lookups if the client wants a position + if(iRequestedInfo != ELbsConversionOutputPosition) + { + // copy all into subset array, the cache has solved nothing + for(TInt i = 0; i < infoCount; i++) + { + iSubsetLocationInfoArray.AppendL(iLocationInfoArray[i]); + } + return EFalse; + } + + TInt cacheLoads = 0; + TBool resolved = EFalse; + + + for(TInt i=0; i < infoCount; i++) + { + CLbsLocationInfo* locationInfo = static_cast(iLocationInfoArray[i]); + RLbsAreaInfoBaseArray areaArray; + CleanupStack::PushL(TCleanupItem(*CleanUpResetAndDestroy, &areaArray)); + // NOTE! When locmonitor is expanded to cache 3g / wlan this call must be changed! + locationInfo->GetAreaInfoL(areaArray, ELbsAreaGsmCellInfoClass); + + TInt areaCount = areaArray.Count(); + TBool saved = EFalse; + + TRealX nan; + nan.SetNaN(); + TLocality partialLocality; + partialLocality.SetCoordinate(nan, nan, nan); + partialLocality.SetAccuracy(nan, nan); + + for (TInt j = 0; j < areaCount; j++) + { + resolved = EFalse; + TLbsAreaInfoClassType type = areaArray[j]->Type(); + TLbsLocMonitorAreaInfoGci areaInfoGci; + switch(type) + { + case ELbsAreaGsmCellInfoClass: + { + CLbsGsmCellInfo* area = static_cast(areaArray[j]); + areaInfoGci.iMcc = area->MobileCountryCode(); + areaInfoGci.iMnc = area->MobileNetworkCode(); + areaInfoGci.iLac = area->LocationAreaCode(); + areaInfoGci.iCid = area->CellId(); + resolved = ETrue; + break; + } + default: + { + resolved = EFalse; + break; + } + } + + if(resolved && !saved) + { + TPosition position; + RPointerArray outArray; + outArray.Append(&areaInfoGci); + TPositionAreaExtendedInfo matchLevel; + matchLevel.SetArea(TPositionAreaInfo::EAreaUnknown); + TRequestStatus status; + // Cache gets are fast and not really asynch, so no harm in blocking here + TInt ret = iCache.GetPosition(position,outArray,matchLevel,status); + if((ret == KErrNone) || (ret == KErrNotFound)) + { + User::WaitForRequest(status); + } + outArray.Reset(); + + if((ret == KErrNone) && (matchLevel.Area() >= TPositionAreaExtendedInfo::EAreaCity)) + { + TLocality locality; + locality.SetCoordinate(position.Latitude(), position.Longitude(), + position.Altitude()); + TRealX nan; + nan.SetNaN(); + locality.SetAccuracy(AccuracyFromMatchLevel(matchLevel.Area()), nan); + + CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL(locality); + CleanupStack::PushL(positionInfo); + iLocationInfoArray[i]->AddAreaInfoL(positionInfo); + CleanupStack::Pop(positionInfo); + saved = ETrue; + cacheLoads++; + } + else if ((ret == KErrNone) && (matchLevel.Area() > TPositionAreaExtendedInfo::EAreaUnknown)) + { + // we also store partial matches in case they are better than the plugin response + partialLocality.SetCoordinate(position.Latitude(), position.Longitude(), + position.Altitude()); + TRealX nan; + nan.SetNaN(); + partialLocality.SetAccuracy(AccuracyFromMatchLevel(matchLevel.Area()), nan); + } + + } + } + if(!saved) + { + //copy into subset array, we couldn't solve this from cache + iSubsetLocationInfoArray.AppendL(iLocationInfoArray[i]); + + iCachePartialResults.AppendL(partialLocality); + } + CleanupStack::PopAndDestroy(&areaArray); + } + // If we've loaded as many results from the cache as there are requests + // then we have fully satisfied the query + return cacheLoads == infoCount; + } + + +//---------------------------------------------------------------- +// CLbsLocMonitorConversionHandler::CacheSaveL +// (other items were commented in a header). +//---------------------------------------------------------------- +TBool CLbsLocMonitorConversionHandler::CacheSaveL() + { + iState = EStateCacheSave; + TBool saveRequested = EFalse; + TInt infoCount = iSubsetLocationInfoArray.Count(); + while((iSavedToCacheCount < infoCount) && !saveRequested) + { + CLbsLocationInfo* locationInfo = static_cast(iSubsetLocationInfoArray[iSavedToCacheCount]); + + RLbsAreaInfoBaseArray cellArray; + CleanupStack::PushL(TCleanupItem(*CleanUpResetAndDestroy, &cellArray)); + locationInfo->GetAreaInfoL(cellArray, CLbsLocationInfo::ELbsGsmInfo); + + RLbsAreaInfoBaseArray locationArray; + CleanupStack::PushL(TCleanupItem(*CleanUpResetAndDestroy, &locationArray)); + locationInfo->GetAreaInfoL(locationArray, CLbsLocationInfo::ELbsPosInfo); + + + // We should get only 1 pos back but may have passed in multiple cells + // We want to save that pos against all cells + if((locationArray.Count() > 0) && (cellArray.Count() > 0)) + { + CLbsPositionInfo* location = static_cast(locationArray[0]); + TLocality locality; + location->GetLocality(locality); + // Only locations that have an accuracy that is better than a cell + // location code will be saved in the cache + if(locality.HorizontalAccuracy() < KCellLocationAccuracy) + { + for(TInt i = 0; i < cellArray.Count(); i++) + { + CLbsGsmCellInfo* cell = static_cast(cellArray[i]); + TLbsLocMonitorAreaInfoGci areaInfoGci; + areaInfoGci.iMcc = cell->MobileCountryCode(); + areaInfoGci.iMnc = cell->MobileNetworkCode(); + areaInfoGci.iLac = cell->LocationAreaCode(); + areaInfoGci.iCid = cell->CellId(); + RPointerArray areaArray; + areaArray.Append(&areaInfoGci); + TTime now; + now.HomeTime(); + TPosition pos(locality, now); + TInt ret = iCache.SavePosition(pos, areaArray, EFalse, iStatus); + if(ret != KErrNone) + { + saveRequested = EFalse; + } + else + { + saveRequested = ETrue; + SetActive(); + } + areaArray.Reset(); + } + } + } + CleanupStack::PopAndDestroy(&locationArray); + CleanupStack::PopAndDestroy(&cellArray); + iSavedToCacheCount++; + } + if((iSavedToCacheCount >= infoCount) && !saveRequested) + { + return ETrue; + } + return EFalse; + } + + +// End of file. diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/lbslocmonitorserver/src/clbslocmonitorpluginresolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/lbslocmonitorserver/src/clbslocmonitorpluginresolver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,302 @@ +/* +* 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: Implementation of CLbsLocMonitorPluginResolver class +* +*/ + +#include +#include +#include "clbslocmonitorpluginresolver.h" +#include "locmonitorsettingskeys.h" +#include "lbsdevloggermacros.h" + +// Constants +static const TInt KLeastPluginPriority = 0; + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::NewL +// +//----------------------------------------------------------------------------- +CLbsLocMonitorPluginResolver* CLbsLocMonitorPluginResolver::NewL() + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::NewL()"); + CLbsLocMonitorPluginResolver* self = new (ELeave) CLbsLocMonitorPluginResolver; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::CLbsLocMonitorPluginResolver +// +//----------------------------------------------------------------------------- +CLbsLocMonitorPluginResolver::CLbsLocMonitorPluginResolver(): +CActive(EPriorityStandard), iDefaultConverterPluginId(KNullUid) + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::CLbsLocMonitorPluginResolver()"); + CActiveScheduler::Add(this); + } + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::ConstructL +// +//----------------------------------------------------------------------------- +void CLbsLocMonitorPluginResolver::ConstructL() + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::ConstructL()"); + iEcomSession = &(REComSession::OpenL()); + // Find the default plugin. + FindDefaultConverterPluginL(); + // Register for ecom data change. + iEcomSession->NotifyOnChange(iStatus); + SetActive(); + } + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::~CLbsLocMonitorPluginResolver +// +//----------------------------------------------------------------------------- +CLbsLocMonitorPluginResolver::~CLbsLocMonitorPluginResolver() + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::~CLbsLocMonitorPluginResolver()"); + // Cancel outstanding notify request. + Cancel(); + iEcomSession->Close(); + REComSession::FinalClose(); + } + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::DefaultConverterUid +// +//----------------------------------------------------------------------------- +TInt CLbsLocMonitorPluginResolver::DefaultConverterUid(TUid& aConverterPluginUid) + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::DefaultConverterUid()"); + if(iDefaultConverterPluginId == KNullUid) + { + return KErrNotFound; + } + aConverterPluginUid = iDefaultConverterPluginId; + return KErrNone; + } + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::FindDefaultConverterPluginL +// +//----------------------------------------------------------------------------- +void CLbsLocMonitorPluginResolver::FindDefaultConverterPluginL() + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::FindDefaultConverterPluginL()"); + RImplInfoPtrArray implementationArray; + CleanupClosePushL(implementationArray); + + iEcomSession->ListImplementationsL(TUid::Uid(KLbsLocInfoConverterPlugInInterfaceId), + implementationArray); + + TInt count = implementationArray.Count(); + // Leave if there are no plugin available. + if(!count) + { + CleanupStack::Pop(&implementationArray); + implementationArray.ResetAndDestroy(); + // Reset the default id. + iDefaultConverterPluginId = KNullUid; + return; + } + + // Initialise both phoneVendorImpl and otherVendorImpl to NULL. + CImplementationInformation* phoneVendorImpl = NULL; + CImplementationInformation* otherVendorImpl = NULL; + + // Get the phone's vendor id from the cenrep. + CRepository* repository = NULL; + TVendorId phoneVendorId(0); + + TRAPD(error,repository = CRepository::NewL(KCRUidLocMonitorSettings)); + if(error == KErrNone) + { + TInt vendorId; + error = repository->Get(EPhoneVendorId,vendorId); + if(error == KErrNone) + { + phoneVendorId.iId = vendorId; + } + delete repository; + } + + if(error == KErrNone) + { + // The default plugin to be used is the highest priority plugin provided by the + // phone vendor if any else the highest priority plugin from other vendor. + for(TInt i=0;iVendorId()) + { + if(!phoneVendorImpl) + { + phoneVendorImpl = implementationArray[i]; + } + else + { + TInt currentHighestPriority,currentImplPriority; + currentHighestPriority = PriorityInfo(phoneVendorImpl->OpaqueData()); + currentImplPriority = PriorityInfo(implementationArray[i]->OpaqueData()); + + // Store the handle to current implementation if its priority + // is higher than currently stored implementation. + if(currentImplPriority > currentHighestPriority) + { + phoneVendorImpl = implementationArray[i]; + } + } + } + else + { + // Other vendor implementation is required only if current vendor implementation + // is not available. Hence the search for the high priority other vendor implementation + // should continue till the phone vendor plug in is found. + if(!phoneVendorImpl) + { + if(!otherVendorImpl) + { + otherVendorImpl = implementationArray[i]; + } + else + { + TInt currentHighestPriority,currentImplPriority; + currentHighestPriority = PriorityInfo(otherVendorImpl->OpaqueData()); + currentImplPriority = PriorityInfo(implementationArray[i]->OpaqueData()); + + // Store the handle to current implementation if its priority + // is higher than currently stored implementation. + if(currentImplPriority > currentHighestPriority) + { + otherVendorImpl = implementationArray[i]; + } + } + } + } + } + } + else + { + for(TInt i=0;iOpaqueData()); + currentImplPriority = PriorityInfo(implementationArray[i]->OpaqueData()); + + // Store the handle to current implementation if its priority + // is higher than currently stored implementation. + if(currentImplPriority > currentHighestPriority) + { + otherVendorImpl = implementationArray[i]; + } + } + + } + } + + if(phoneVendorImpl) + { + iDefaultConverterPluginId = phoneVendorImpl->ImplementationUid(); + } + else if(otherVendorImpl) + { + iDefaultConverterPluginId = otherVendorImpl->ImplementationUid(); + } + + CleanupStack::Pop(&implementationArray); + implementationArray.ResetAndDestroy(); + } + + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::RunL +// +//----------------------------------------------------------------------------- +void CLbsLocMonitorPluginResolver::RunL() + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::RunL()"); + if(KErrNone == iStatus.Int()) + { + FindDefaultConverterPluginL(); + } + // Register for ecom data change. + iEcomSession->NotifyOnChange(iStatus); + SetActive(); + } + + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::DoCancel +// +//----------------------------------------------------------------------------- +void CLbsLocMonitorPluginResolver::DoCancel() + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::DoCancel()"); + iEcomSession->CancelNotifyOnChange(iStatus); + } + +//---------------------------------------------------------------------------- +// CLbsLocMonitorPluginResolver::PriorityInfo +// +//----------------------------------------------------------------------------- +TInt CLbsLocMonitorPluginResolver::PriorityInfo(const TDesC8& aOpaqueData) + { + LBSLOG(ELogP1,"CLbsLocMonitorPluginResolver::PriorityInfo()"); + TInt opaqueDataLength = aOpaqueData.Length(); + if(!opaqueDataLength) + { + return KLeastPluginPriority; + } + + TLex8 lex(aOpaqueData); + + TInt iterator = 0; + // Iterate through the descriptor till we get colon. + while(lex.Get() != ':') + { + iterator++; + if(iterator == opaqueDataLength) + { + return KLeastPluginPriority; + } + } + // Neglect space if any + while(lex.Peek() == ' ') + { + lex.Inc(); + if(iterator == opaqueDataLength) + { + return KLeastPluginPriority; + } + } + + TInt priority; + lex.Val(priority); + return priority; + } + +//End of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/.cproject Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,671 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/.project Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,19 @@ + + + ExampleLocationConverter + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/data/10287201.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/data/10287201.rss Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: Resource file for movement detector plugin +* +*/ +// mydetector.rss +// +#include + +#include "ExampleLocationConverter.hrh" +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = KExampleLocationConverterUid; +interfaces = + { + INTERFACE_INFO + { + interface_uid = KLbsLocInfoConverterPlugInInterfaceId; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KExampleLocationConverterImplementationUid; + version_no = 1; + display_name = "Example location info converter"; + default_data = "text/ascii"; + opaque_data = "priority:5"; + } + }; + } + }; +} diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/data/ExampleLocationConverter.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/data/ExampleLocationConverter.hrh Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 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: Resource headers for project +* +*/ + + +#ifndef EXAMPLELOCATIONCONVERTER_HRH +#define EXAMPLELOCATIONCONVERTER_HRH + +#define KExampleLocationConverterUid 0x2002140C +#define KExampleLocationConverterImplementationUid 0x2002140D + + +#endif // EXAMPLELOCATIONCONVERTER_HRH diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/group/ExampleLocationConverter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/group/ExampleLocationConverter.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2006-2007 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: Project definition file for project Cell Id movement detector +* +*/ + + +#include "../data/ExampleLocationConverter.hrh" + +TARGET ExampleLocationConverter.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KExampleLocationConverterUid +VENDORID 0x2002140e + +CAPABILITY ALL -TCB + +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../data + +SOURCEPATH ../src +SOURCE ExampleLocationConverter.cpp + +START RESOURCE ../data/10287201.rss +TARGET ExampleLocationConverter.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY flogger.lib +LIBRARY lbslocationinfoconverterplugin.lib +LIBRARY lbslocationinfodatatypes.lib +LIBRARY lbs.lib + +PAGED + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2006 - 2007 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: Build information file for project ?myapp +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTMMPFILES +ExampleLocationConverter.mmp + +// END OF FILE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/inc/ExampleLocationConverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/inc/ExampleLocationConverter.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2008 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: Definition of Movement Detection API +* +*/ + + +#ifndef C_EXAMPLELOCATIONCONVERTER_H +#define C_EXAMPLELOCATIONCONVERTER_H + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * CExampleLocationConverter is an ECom plugin that implements CLbsLocInfoConversionPluginBase. + * + * This class is responsible for monitering movement of mobile based on + * GSM information available to mobile at any instant. + * + * @lib movementdetector.lib + * @since S60 v4.0 + */ +class CExampleLocationConverter : public CLbsLocInfoConverterPluginBase + + { + +public: + + /** + * Loads a location info conveter and initalises it. + * + * @param[in] aObserver An observer for location conversion event. + * @param[in] aPluginArgs Agruements sent to conversion plugin. + * return Pointer to the new loation info converter.If module id is not specified + * default plug in will be loaded. + */ + static CExampleLocationConverter* NewL( TLbsLocInfoConverterPluginParams& aPluginParams ); + + /** + * Unloads this movement detector. + * + * @since S60 TACO + */ + virtual ~CExampleLocationConverter(); + + // From CLbsLocInfoConversionPluginBase + + /** + * Converts the area informations of a group of geographical locations + * to its corresponding position information. + * + * @param[in] aLocationInfoArray Array of location informations corresponding + * to geographical locations are passed and on successful completion of this + * method,position information corresponding to the loation informations are + * updated in each area info object. + * @param[in] aConversionPrefs Conversion preferences suggested by client. + * + * @leave KErrArgument If the location info array is empty. + */ + virtual void ConvertLocationInfoL( + RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Cancels get location info operation. + */ + virtual void CancelConvertLocationInfo(); + + virtual void ValidateClient( const TSecureId& aSecureId, + const TVendorId& aVendorId, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + virtual void CancelValidateClient(); + + virtual void ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ); + +private: + + + void ConstructL(TLbsLocInfoConverterPluginParams& aPluginParams); + + /** + * Default C++ Constructor + */ + CExampleLocationConverter(TLbsLocInfoConverterPluginParams& aParams); + +private: // data + + MLbsLocInfoConverterPluginObserver &iObserver; + TBool iRetainLocalityInCache; + }; + + +#endif // C_LBTCELLIDMVMTDET_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/ExampleLocationConverter/src/ExampleLocationConverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/ExampleLocationConverter/src/ExampleLocationConverter.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,331 @@ +/* +* Copyright (c) 2008 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: Definition of CdummyMvmtDet class. +* +*/ + + + +#include +#include +#include +#include "ExampleLocationConverter.h" + +// the test code sets the timing advance in the GSM vell info to this value +// which instructs the test converter to constuct TLocalitys with +// latitude ser to country code, longitude set to +// network code and altitiude set to local area code +const TInt KTimingAdvanceSpecialValue= 254; + +const TInt KTimingAdvanceSaveToCacheTrue= 253; + +const TInt KTimingAdvanceSaveToCacheFalse= 252; + +// ECOM implementation specifics +static const TImplementationProxy implTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x2002140D, CExampleLocationConverter::NewL) + }; + + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(implTable) / sizeof(TImplementationProxy); + + return implTable; + } + + +// Class methods + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::NewL +// Symbian Two - phase constructor +//------------------------------------------------------------ +// +CExampleLocationConverter* CExampleLocationConverter::NewL( TLbsLocInfoConverterPluginParams& aParams) + { + CExampleLocationConverter* self = new (ELeave) CExampleLocationConverter(aParams); + CleanupStack::PushL(self); + self->ConstructL(aParams); + CleanupStack::Pop(); + return self; + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConstructL +//------------------------------------------------------------ +// +void CExampleLocationConverter::ConstructL( TLbsLocInfoConverterPluginParams& /*aParams*/ ) + { + CLbsLocInfoConverterPluginBase::Version(); + TInt aFunctionNumber = 1982; + TAny* aPtr1 = &aFunctionNumber; + TAny* aPtr2 = &aFunctionNumber; + CLbsLocInfoConverterPluginBase::ExtendedInterface(aFunctionNumber, aPtr1, aPtr2); + + iObserver.Version(); + } + + +//----------------------------------------------------------------- +// CLbsLocInfoConversionPluginBase::CLbsLocInfoConversionPluginBase +// C++ Default constructor +//------------------------------------------------------------------ +// +CExampleLocationConverter::CExampleLocationConverter(TLbsLocInfoConverterPluginParams& aParams):iObserver(aParams.Observer()), + iRetainLocalityInCache(ETrue) + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::~CLbsLocInfoConversionPluginBase +// Destructor +//------------------------------------------------------------ +// +CExampleLocationConverter::~CExampleLocationConverter() + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CExampleLocationConverter::ConvertLocationInfoL( RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs /*aConversionPrefs*/, + const TLbsConversionOutputInfoMask aRequestedInfo) + { + if(aRequestedInfo == ELbsConversionOutputNotDefined) + { + iObserver.OnConversionComplete(KErrArgument); + return; + } + TInt count = aLocationInfoArray.Count(); + for(TInt i=0 ; iGetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + + + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + TLocality locality; + if (areaInfoArray[0]->Type() == ELbsAreaGsmCellInfoClass) + { + CLbsGsmCellInfo* posInfo = + static_cast (areaInfoArray[0]); + + TInt timingAdvance = posInfo->TimingAdvance(); + + if (timingAdvance == KTimingAdvanceSaveToCacheFalse) + { + iRetainLocalityInCache = EFalse; + } + else + { + // for all others values ensiure that we put + // localities in cache + iRetainLocalityInCache = ETrue; + } + + if ((timingAdvance == KTimingAdvanceSpecialValue) + || (timingAdvance + == KTimingAdvanceSaveToCacheTrue) + || (timingAdvance + == KTimingAdvanceSaveToCacheFalse)) + { + // For all the special tests + TReal64 lat = posInfo->MobileCountryCode(); + TReal64 lng = posInfo->MobileNetworkCode(); + TReal32 alt = posInfo->LocationAreaCode(); + + TReal32 horAcc = posInfo->CellId(); + + locality.SetCoordinate(lat, lng, alt); + locality.SetAccuracy(horAcc, 11.0); + } + else + { + // and for the original tests + locality.SetCoordinate(62.5285, 23.9385, 1.22f); + locality.SetAccuracy(10.0f, 0.0); + + } + } + else + { + // and for the original tests + locality.SetCoordinate(62.5285, 23.9385, 1.22f); + locality.SetAccuracy(10.0f, 0.0); + } + areaInfoArray.ResetAndDestroy(); + + CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); + CleanupStack::PushL( positionInfo ); + aLocationInfoArray[i]->AddAreaInfoL( positionInfo ); + CleanupStack::Pop( positionInfo ); + break; + } + case ELbsConversionOutputGsm: + { + // Extract the area info provided by the client. + // If client has specified only gsm info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsWcdmaInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 100,101,102,103); + CleanupStack::PushL( gsmCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( gsmCellInfo ); + CleanupStack::Pop( gsmCellInfo ); + break; + } + case ELbsConversionOutputWcdma: + { + // Extract the area info provided by the client. + // If client has specified only wcdma info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 100,101,102 ); + CleanupStack::PushL( wcdmaCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( wcdmaCellInfo ); + CleanupStack::Pop( wcdmaCellInfo ); + break; + } + case ELbsConversionOutputWlan: + { + // Extract the area info provided by the client. + // If client has specified only wlan info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWcdmaInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + TLbsWlanMacAddress macAddress(_L8("10.0.1")); + CLbsWlanInfo* WlanInfo = CLbsWlanInfo::NewL( macAddress,10.1); + CleanupStack::PushL( WlanInfo ); + aLocationInfoArray[i]->AddAreaInfoL( WlanInfo ); + CleanupStack::Pop( WlanInfo ); + } + default: + break; + } + + } + iObserver.OnConversionComplete(KErrNone); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CExampleLocationConverter::CancelConvertLocationInfo( ) + { + + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CExampleLocationConverter::ValidateClient( const TSecureId& /*aSecureId*/, + const TVendorId& /*aVendorId*/, + const TLbsConversionOutputInfoMask /*aRequestedInfo*/ ) + { + iObserver.OnValidationComplete( KErrNone ); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CExampleLocationConverter::CancelValidateClient() + { + + } + +//------------------------------------------------------------ +// CExampleLocationConverter::ConversionPluginPreferences +//------------------------------------------------------------ +// +void CExampleLocationConverter::ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ) + { + aPluginInfo.SetIsPluginPositionToBeCached(iRetainLocalityInCache); + + //Note: The capability mask is currently not used anywhere in the location + //monitor. + TLbsConversionPluginCapabilityMask capabilityMask; + capabilityMask = aPluginInfo.PluginCapabilitiesMask(); + capabilityMask = ( ELbsPluginCapabilityGsmInfo|ELbsPluginCapabilityPosInfo|ELbsPluginCapabilityWlanInfo); + aPluginInfo.SetPluginCapabilitiesMask(capabilityMask); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/Bmarm/LocInfoConversionUnitTestU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/Bmarm/LocInfoConversionUnitTestU.DEF Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/Bwins/LocInfoConversionUnitTestU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/Bwins/LocInfoConversionUnitTestU.DEF Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/EABI/LocInfoConversionUnitTestU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/EABI/LocInfoConversionUnitTestU.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/conf/LocInfoConversionUnitTest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/conf/LocInfoConversionUnitTest.cfg Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,113 @@ +[Test] +title UnitTest1 +create LocInfoConversionUnitTest foobar +foobar UnitTest1 +delete foobar +[Endtest] + +[Test] +title UnitTest2 +create LocInfoConversionUnitTest foobar +foobar UnitTest2 +delete foobar +[Endtest] + +[Test] +title UnitTest3 +create LocInfoConversionUnitTest foobar +foobar UnitTest3 +delete foobar +[Endtest] + +[Test] +title UnitTest4 +create LocInfoConversionUnitTest foobar +foobar UnitTest4 +delete foobar +[Endtest] + +[Test] +title UnitTest5 +create LocInfoConversionUnitTest foobar +foobar UnitTest5 +delete foobar +[Endtest] + +[Test] +title UnitTest6 +create LocInfoConversionUnitTest foobar +foobar UnitTest6 +delete foobar +[Endtest] + +[Test] +title UnitTest7 +create LocInfoConversionUnitTest foobar +foobar UnitTest7 +delete foobar +[Endtest] + + +[Test] +title UnitTest8 +create LocInfoConversionUnitTest foobar +foobar UnitTest8 +delete foobar +[Endtest] + +[Test] +title UnitTest9 +create LocInfoConversionUnitTest foobar +foobar UnitTest9 +delete foobar +[Endtest] + +[Test] +title UnitTest10 +create LocInfoConversionUnitTest foobar +foobar UnitTest10 +delete foobar +[Endtest] + +[Test] +title UnitTest11 +create LocInfoConversionUnitTest foobar +foobar UnitTest11 +delete foobar +[Endtest] + +[Test] +title UnitTest12 +create LocInfoConversionUnitTest foobar +foobar UnitTest12 +delete foobar +[Endtest] + +[Test] +title UnitTest13 +create LocInfoConversionUnitTest foobar +foobar UnitTest13 +delete foobar +[Endtest] + +[Test] +title UnitTest14 +create LocInfoConversionUnitTest foobar +foobar UnitTest14 +delete foobar +[Endtest] + +[Test] +title UnitTest15 +create LocInfoConversionUnitTest foobar +foobar UnitTest15 +delete foobar +[Endtest] + +[Test] +title UnitTest16 +create LocInfoConversionUnitTest foobar +foobar UnitTest16 +delete foobar +[Endtest] + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/group/LocInfoConversionUnitTest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/group/LocInfoConversionUnitTest.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,90 @@ +/*TYPE TESTCLASS*/ +/* +* 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: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include + +TARGET LocInfoConversionUnitTest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +// VENDORID 0x00000000 +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 + +//TARGETPATH ?target_path +DEFFILE LocInfoConversionUnitTest.def + +USERINCLUDE ../inc +USERINCLUDE ../../../lbslocmonitorapis/CommonClientServerApi/inc +USERINCLUDE ../../../lbslocmonitorserver/inc +USERINCLUDE ../../../../locationcore/lbsrootapi/inc +USERINCLUDE ../../../../locationcore/LbsInternalApi/inc +USERINCLUDE ../../../../locationcore/LbsNetInternalApi/inc +USERINCLUDE ../../../../locationcore/LbsLocDataSource/inc +USERINCLUDE ../../../../locationcore/LbsPartnerCommon/inc +USERINCLUDE ../../../../locationcore/LbsLocCommon/ServerFramework/inc +USERINCLUDE ../../../../locationcore/LbsDebug/inc +USERINCLUDE ../../../../locationcore/LbsLogging/inc + + +OS_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE LocInfoConversionUnitTest.cpp +SOURCE LocInfoConversionUnitTestBlocks.cpp +SOURCE LocInfoConversionHandler.cpp + +//RESOURCE resource_file +//RESOURCE resource_file2 + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY lbslocationinfodatatypes.lib +LIBRARY lbslocmonclient.lib +LIBRARY lbs.lib +LANG SC + +/* +START WINS +?wins_specific_information +END + +START MARM +?marm_specific_information +END +*/ +// Other possible keywords: + +// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCE ?color_depth ?source_bitmap +END +*/ +// DEFFILE ?filename +// AIF ?filename + +SMPSAFE + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/group/LocInfoConversionUnitTest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/group/LocInfoConversionUnitTest.pkg Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,60 @@ +; +; 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: +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x00000000),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +"\epoc32\release\armv5\udeb\LocInfoConversionUnitTest.dll" - "!:\Sys\Bin\LocInfoConversionUnitTest.dll" + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,60 @@ +/* +* 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: +* +*/ + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these + + DEFAULT + +PRJ_TESTEXPORTS +// NOTE: If using ARS requirements all export operations should be done under this. +// 'abld test export' + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in \epoc32\include +// Example: +/* +\agnmodel\inc\AGMCOMON.H +*/ + +//PRJ_TESTMMPFILES + +// LocInfoConversionUnitTest.mmp + +PRJ_MMPFILES +LocInfoConversionUnitTest.mmp +// LocInfoConversionUnitTest_nrm.mmp + +// Specify the .mmp files required for building the important component +// releasables. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +\agnmodel\group\agnmodel.mmp +#if defined(MARM) +\agnmodel\group\agsvexe.mmp +#endif +*/ + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/LocInfoConversionHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/LocInfoConversionHandler.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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: STIF testclass declaration +* +*/ + +#ifndef LOCINFOCONVERSIONHANDLER_H_ +#define LOCINFOCONVERSIONHANDLER_H_ + +#include + +class CLocInfoConversionHanlder : public CActive + { +public: + static CLocInfoConversionHanlder* NewL(); + + ~CLocInfoConversionHanlder(); + + void Start(); +protected: // from CActive + void RunL(); + void DoCancel(); + +private: + CLocInfoConversionHanlder(); + + void ConstructL(); + }; + +#endif /*LOCINFOCONVERSIONHANDLER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/LocInfoConversionUnitTest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/LocInfoConversionUnitTest.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,234 @@ +/* +* 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: STIF testclass declaration +* +*/ + +#ifndef LOCINFOCONVERSIONUNITTEST_H +#define LOCINFOCONVERSIONUNITTEST_H + +// INCLUDES +#include +#include +#include +#include +#include +#include "LocInfoConversionHandler.h" +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KLocInfoConversionUnitTestLogPath, "\\logs\\testframework\\LocInfoConversionUnitTest\\" ); +// Log file +_LIT( KLocInfoConversionUnitTestLogFile, "LocInfoConversionUnitTest.txt" ); +_LIT( KLocInfoConversionUnitTestLogFileWithTitle, "LocInfoConversionUnitTest_[%S].txt" ); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class CLocInfoConversionUnitTest; +class CLbsPositionInfo; +class CLbsGsmCellInfo; +class CLbsWcdmaCellInfo; +class CLbsWlanInfo; +class CLbsLocationInfo; + +enum TTestType + { + EPositive, + + ENegative + }; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CLocInfoConversionUnitTest test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CLocInfoConversionUnitTest) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CLocInfoConversionUnitTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CLocInfoConversionUnitTest(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CLocInfoConversionUnitTest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + /** + * Example test method. + * @since ?Series60_version + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + TInt RLbsLocInfoConverter_Connect1L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_Connect2L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo1L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo2L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo3L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo4L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo5L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo6L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo7L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo8L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo9L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_ConvertLocationInfo10L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_Cancel1L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_Cancel2L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_Cancel3L(CStifItemParser& aItem ); + TInt RLbsLocInfoConverter_Cancel4L(CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + /** + * Helper methods. + */ + CLbsPositionInfo* CreatePositionInfoObjectLC(); + + CLbsGsmCellInfo* CreateGsmCellInfoObjectLC(); + + CLbsWcdmaCellInfo* CreateWcdmaCellInfoObjectLC(); + + CLbsWlanInfo* CreateWlanInfoObjectLC(); + + CLbsLocationInfo* CreateLocationInfoObjectLC( TLbsAreaInfoClassType aAreaType ); + + void AppendAreaInfoObjectToLocationInfoL( CLbsLocationInfo* aLocationInfo, + TLbsAreaInfoClassType aAreaType ); + + void CheckPositionConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + + void CheckGsmCellConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + + void CheckWcdmaCellConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + + void CheckWlanConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + CLocInfoConversionHanlder* iConversionHandler; + + CLocInfoConversionHanlder* iConversionHandler1; + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // LOCINFOCONVERSIONUNITTEST_H + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/lbtlogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/lbtlogger.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,374 @@ +/* +* Copyright (c) 2007 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: Defines the macros for logging mechanism in LBT +* +*/ + + +#ifndef LBT_LOGGER_H +#define LBT_LOGGER_H + +/** + * To use this logger mechanism you also need to add flogger.lib to the mmp + * using, + * DEBUGLIBRARY flogger.lib + */ + + +/** + * The trace level is defined as follows, + * 0x[moduleid - 4digits][logginglevel-4digits], + * The currently define logginglevels are + * 0x0001 - Verbose + * things like entered method, leaving method etc, + * logs of the parameters to methods, files + * that are being used, creating a key, creating a file, + * opening a resource, + * + * 0x0002 - Warning + * things like events, error cases that were not processed + * but ignored. + * + * 0x0003 - Operations + * things like what operation started (create, delete), + * manipulations to the data structures, important events like + * MMC card , app uninstall events which we process, + * current location, triggers being monitored, psy conked off, + * any other such important event. + * + * 0x0004 - Errors + * log all _ASSERT_DEBUG kind of cases, basically things which + * you don't expect to happen but happened - Sounds like paradox ;-) + * Also log all error cases with this trace level. + * + * 0x0005 - Fatal + * Use this if the server cannot recover from this error and you + * have to crash !! ;-) + * + * So for a create trigger operation in server the log should be like + * LBT_TRACE(KLbtLogOperation|KLbtLogServerLogic,"Creating Trigger"); + */ +#define KLbtLogLevelMask 0x0000FFFF + +#define KLbtLogVerbose 0x00000001 +#define KLbtLogWarning 0x00000002 +#define KLbtLogOperation 0x00000003 +#define KLbtLogError 0x00000004 +#define KLbtLogFatal 0x00000005 + +/** + * + * Then for the module id lets use + * 0x0001 - Lbt Client Library + * 0x0002 - Lbt Server Core + * 0x0003 - Lbt Server Logic Base + * 0x0004 - Lbt Server Logic ( ecom plugin ) + * 0x0005 - Lbt Container + * 0x0006 - Lbt Strategy Plugin api + * 0x0007 - Lbt Strategy Implementation ( Ecom plugin ) + * 0x0008 - Lbt Movement detector plugin api + * 0x0009 - Lbt Cell id Movement Detector + * Did I miss any component ? + */ +#define KLbtLogComponentMask 0xFFFF0000 + +#define KLbtLogClientLib 0x00010000 +#define KLbtLogServerCore 0x00020000 +#define KLbtLogServerLogicBase 0x00030000 +#define KLbtLogServerLogic 0x00040000 +#define KLbtLogContainer 0x00050000 +#define KLbtLogStrategyPluginApi 0x00060000 +#define KLbtLogStrategyEngine 0x00070000 +#define KLbtLogMovementDetectorApi 0x00080000 +#define KLbtLogCellIdMovementDetector 0x00090000 + +#ifdef _DEBUG +#define _LBT_DEBUG +#endif // #ifdef _DEBUG + +// define _LBT_DEBUG to enable LBT logging +#define _LBT_DEBUG + +#ifdef _LBT_DEBUG + +#include +#include +#include "lbtloggerimpl.h" + +_LIT8( KEndOfLineChars, "\r\n"); + +// CLASS DECLARATION +class TLogFunc + { + public: + TLogFunc(const char aFunctionName[]) + { + const unsigned char* string = (unsigned char*)(aFunctionName); + iBuffer.Zero(); + iBuffer.Copy(string); + TBuf8<150> buf; + buf.Zero(); + buf.Append(_L("=>")); + buf.Append(iBuffer); + CLbtLoggerImpl* loggerImpl = CLbtLoggerImpl::CreateLogger(); + if( loggerImpl ) + { + RFileLogger& logger = loggerImpl->GetFileLogger(); + logger.Write( buf ); + } + } + + ~TLogFunc() + { + RThread thread; + TInt exitReason = thread.ExitReason(); + if(exitReason != KErrNone) + { + TExitCategoryName name = thread.ExitCategory(); + TBuf8<400> buf; + buf.Zero(); + buf.Append(_L("LBT PANICKED : ")); + buf.Append(name); + + CLbtLoggerImpl* loggerImpl = CLbtLoggerImpl::CreateLogger(); + if(loggerImpl) + { + RFileLogger& logger = loggerImpl->GetFileLogger(); + logger.Write( buf); + } + // The thread has panicked and hence dont print the exit placeholder + thread.Close(); + return; + } + iBuffer.Append(_L("=>")); + CLbtLoggerImpl* loggerImpl = CLbtLoggerImpl::CreateLogger(); + if(loggerImpl) + { + RFileLogger& logger = loggerImpl->GetFileLogger(); + logger.Write( iBuffer); + } + thread.Close(); + } + + static void FileName( TDes& aFileNameBuffer ) + { + TTime currTime; + currTime.HomeTime(); + TDateTime dt = currTime.DateTime(); + + _LIT16( filefmt, "%S_%d%d%d_%d%d%d.log" ); + + TBuf<150> logFileName; + logFileName.Append( _L("C:\\Logs\\Epos\\lbt_func") ); + aFileNameBuffer.AppendFormat( filefmt(), &logFileName, dt.Day(), + dt.Month(), dt.Year(), dt.Hour(), dt.Minute(), dt.Second() ); + } + + static void FormatTextToBuffer( TDes8& aTrg, const TDesC8& aText ) + { + TTime currTime; + currTime.HomeTime(); + TDateTime dt = currTime.DateTime(); + _LIT8( dtFmt, "%d/%d/%d %d:%d:%d "); + aTrg.AppendFormat( dtFmt(), dt.Day(), dt.Month(), dt.Year(), dt.Hour(), dt.Minute(), dt.Second() ); + aTrg.Append( aText ); + aTrg.Append( KEndOfLineChars ); + } + + static void RenameFileIfRequired() + { + RFs fs; + RFile file; + fs.Connect(); + + TInt err = file.Open( fs, _L("C:\\Logs\\Epos\\lbt_func.log"), EFileWrite|EFileShareAny ); + if( KErrNone == err ) + { + // Check Size of file + TInt size; + file.Size( size ); + + if( size > 1024 ) + { + file.Close(); + TBuf<200> fileName; + FileName( fileName ); + //BaflUtils::RenameFile( fs, _L("C:\\Logs\\Epos\\lbt.log"), fileName ); + fs.Rename(_L("C:\\Logs\\Epos\\lbt_func.log"), fileName ); + } + } + file.Close(); + fs.Close(); + } + + private: + TBuf8<150> iBuffer; + }; + +#define FUNC_ENTER(x) //TLogFunc lbtlog(x); + +#define STOPLOGGING CLbtLoggerImpl::Destroy(); + +#define ERROR(x,y) { TBuf8<150> buffer; \ + const unsigned char* string = (unsigned char*)(x); \ + buffer.Zero(); \ + buffer.Copy(string); \ + buffer.Append(_L(": LBT ERROR")); \ + CLbtLoggerImpl* loggerImpl = CLbtLoggerImpl::CreateLogger(); \ + if( loggerImpl ) \ + { \ + RFileLogger& logger = loggerImpl->GetFileLogger(); \ + logger.WriteFormat( buffer, y); \ + } \ + } + +#define LOG(x) { TBuf8<150> buffer; \ + const unsigned char* string = (unsigned char*)(x); \ + buffer.Zero(); \ + buffer.Copy(string); \ + CLbtLoggerImpl* loggerImpl = CLbtLoggerImpl::CreateLogger(); \ + if( loggerImpl ) \ + { \ + RFileLogger& logger = loggerImpl->GetFileLogger(); \ + logger.Write( buffer); \ + } \ + } + +#define LOG1(x,y) { TBuf8<150> buffer; \ + const unsigned char* string = (unsigned char*)(x); \ + buffer.Zero(); \ + buffer.Copy(string); \ + CLbtLoggerImpl* loggerImpl = CLbtLoggerImpl::CreateLogger(); \ + if( loggerImpl ) \ + { \ + RFileLogger& logger = loggerImpl->GetFileLogger(); \ + logger.WriteFormat( buffer, y); \ + } \ + } + +#define LOGSTRING(x, y) { \ + _LIT(KTmpStr, x); \ + CLbtLoggerImpl* loggerImpl = CLbtLoggerImpl::CreateLogger(); \ + if( loggerImpl ) \ + { \ + RFileLogger& logger = loggerImpl->GetFileLogger(); \ + logger.WriteFormat( TRefByValue(KTmpStr()), y); \ + } \ + } \ + + +#define LBT_FILE_LOGGER 1 // Always log to file + +const char* const LbtLogLevelStr[] = + { + "", + "Verbose", + "Warning", + "Operation", + "Error", + "Fatal" + }; + +const char* const LbtLogComponentStr[] = + { + "", + "client lib", + "server core", + "server logic api", + "server logic", + "container", + "strategy api", + "strategy engine", + "movement detector api", + "cell id movement detector" + }; + + +#define LENGTH(str,len) for(len = 0; str[len]; len++) {} + + +NONSHARABLE_CLASS( TLbtDesOverflow ) : public TDes8Overflow + { + void Overflow(TDes8 &/*aDes*/) + { + // Dummy Implementation to prevent User panic 23 + } + }; + +#define LBT_TRACE(level, file, lineno, desc...) + +/* +LOCAL_C void LBT_TRACE(TInt level, const char* file, TInt lineno, const char* desc,...) + { + _LIT8(fmt, "!%s %s %s:%d "); + TInt desclength, filelength, fmtlength; + fmtlength = fmt().Length(); + LENGTH(desc,desclength); + LENGTH(file,filelength); + + HBufC8* str = NULL; + TRAPD(error, str = HBufC8::NewL(desclength+fmtlength+filelength+10+25+200)); + if ( error != KErrNone ) + { + return; + } + + TPtr8 ptr(str->Des()); + ptr.Zero(); + + TLbtDesOverflow ovrflowHandler; + ptr.AppendFormat(fmt(), + &ovrflowHandler, + LbtLogLevelStr[(level&KLbtLogLevelMask)], + LbtLogComponentStr[(level&KLbtLogComponentMask) >> 16], + file, + lineno); + + HBufC8* descbuf = HBufC8::NewL(desclength); + if ( error == KErrNone ) + { + descbuf->Des().Append(reinterpret_cast(desc), desclength); + VA_LIST list; + VA_START(list, desc); + ptr.AppendFormat(*descbuf, + &ovrflowHandler, + list ); + delete descbuf; + } + +#ifdef LBT_FILE_LOGGER + _LIT(KLbtTraceDir,"epos"); + _LIT(KLbtTraceFile,"lbt.log"); + RFileLogger::Write(KLbtTraceDir(), KLbtTraceFile(), EFileLoggingModeAppend, *str); +#else + RDebug::RawPrint(*str); +#endif + delete str; + } +*/ + +#else // if _DEBUG flag is not defined + +#define LBT_TRACE(level, file, lineno, desc...) +#define FUNC_ENTER(x) +#define STOPLOGGING +#define LOG(x) +#define LOG1(x,y) +#define ERROR(x,y) +#define LOGSTRING(x, y) + +#endif // end of #ifdef _DEBUG + + +#endif // LBT_LOGGER_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/lbtloggerimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/inc/lbtloggerimpl.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2006 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 header file describes the triggering logger implementation +* +*/ + + +// INCLUDES +#include + +// FORWARD DECLARATION +class RFileLogger; + +NONSHARABLE_CLASS( CLbtLoggerImpl ) : public CBase + { + public: + IMPORT_C static CLbtLoggerImpl* CreateLogger(); + + IMPORT_C static void Destroy(); + + IMPORT_C RFileLogger& GetFileLogger(); + + private: + CLbtLoggerImpl(); + + ~CLbtLoggerImpl(); + + RFileLogger iLogger; + + static CLbtLoggerImpl* iSelf; + }; \ No newline at end of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/src/LocInfoConversionHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/src/LocInfoConversionHandler.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,63 @@ +/* +* 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: STIF testclass declaration +* +*/ + +#include "LocInfoConversionHandler.h" + +CLocInfoConversionHanlder* CLocInfoConversionHanlder::NewL() + { + CLocInfoConversionHanlder* self = new ( ELeave ) CLocInfoConversionHanlder; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +CLocInfoConversionHanlder::CLocInfoConversionHanlder():CActive( EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +CLocInfoConversionHanlder::~CLocInfoConversionHanlder() + { + if( IsActive() ) + { + Cancel(); + } + } + +void CLocInfoConversionHanlder::Start() + { + iStatus = KRequestPending; + SetActive(); + } + +void CLocInfoConversionHanlder::RunL() + { + CActiveScheduler::Stop(); + } + + +void CLocInfoConversionHanlder::ConstructL() + { + // Nothign to do here + } + + +void CLocInfoConversionHanlder::DoCancel() + { + // Nothign to do here + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/src/LocInfoConversionUnitTest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/src/LocInfoConversionUnitTest.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,202 @@ +/* +* 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: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include +#include "LocInfoConversionUnitTest.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CLocInfoConversionUnitTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CLocInfoConversionUnitTest::CLocInfoConversionUnitTest( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KLocInfoConversionUnitTestLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KLocInfoConversionUnitTestLogFile); + } + + iLog = CStifLogger::NewL( KLocInfoConversionUnitTestLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + iConversionHandler = CLocInfoConversionHanlder::NewL(); + iConversionHandler1 = CLocInfoConversionHanlder::NewL(); + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CLocInfoConversionUnitTest* CLocInfoConversionUnitTest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CLocInfoConversionUnitTest* self = new (ELeave) CLocInfoConversionUnitTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CLocInfoConversionUnitTest::~CLocInfoConversionUnitTest() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + delete iConversionHandler; + delete iConversionHandler1; + } + +//----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("LocInfoConversionUnitTest.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CLocInfoConversionUnitTest::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/LocInfoConversionUnitTest/src/LocInfoConversionUnitTestBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/LocInfoConversionUnitTest/src/LocInfoConversionUnitTestBlocks.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,2017 @@ +/* +* 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: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include + +#include "LocInfoConversionUnitTest.h" +#include "rlbslocmonitorsession.h" +#include "rlbslocinfoconverter.h" +#include "rlbslocmonitorareapositioner.h" +#include +#include +#include "lbsposition.h" + + +// Plug in +const TInt KDummyPluginId = 537007117; +const TInt KSuplPluginId = 537028467; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::Delete() + { + + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + ENTRY( "UnitTest1", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect1L ), + ENTRY( "UnitTest2", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect2L ), + ENTRY( "UnitTest3", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo1L ), + ENTRY( "UnitTest4", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo2L ), + ENTRY( "UnitTest5", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo3L ), + ENTRY( "UnitTest6", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo4L ), + ENTRY( "UnitTest7", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo5L ), + ENTRY( "UnitTest8", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo6L ), + ENTRY( "UnitTest9", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo7L ), + ENTRY( "UnitTest10", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo8L ), + ENTRY( "UnitTest11", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo9L ), + ENTRY( "UnitTest12", CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo10L ), + ENTRY( "UnitTest13", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel1L ), + ENTRY( "UnitTest14", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel2L ), + ENTRY( "UnitTest15", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel3L ), + ENTRY( "UnitTest16", CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel4L ), + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect1 +// simple session and subsession. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect1L(CStifItemParser& /*aItem*/ ) + { + TInt error; + RLbsLocMonitorSession locMonitorSession; + error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + locInfoConverter.Close(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect2 +// Opening multiple subsession from single session +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect2L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + RLbsLocInfoConverter locInfoConverter1; + CleanupClosePushL( locInfoConverter1 ); + + locInfoConverter.OpenL( locMonitorSession ); + locInfoConverter1.OpenL( locMonitorSession ); + locInfoConverter.Close(); + locInfoConverter1.Close(); + + CleanupStack::PopAndDestroy( 3 ); //locInfoConverter1,locInfoConverter and + //locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo1L +// This test case tests the simple and corner case related +// to RLbsLocInfoConverter::ConvertLocationInfoL +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo1L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * Case 1: where NULL pointer is passed instead of location info + */ + error = KErrNone; + CLbsLocationInfo* locationInfo = CLbsLocationInfo::NewL(); + CleanupStack::PushL( locationInfo ); + TRAP( error,locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition, + conversionModuleId,iConversionHandler->iStatus )); + if( error!= KErrArgument ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: where we pass location info.This is + * just test where this method completes without leaving. + */ + + // Here we append gsmcell info object to the existing location info object. + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + CleanupStack::PopAndDestroy( locationInfo ); + + /** + * Case 3. Empty location info array is passed. + */ + error = KErrNone; + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + TRAP( error,locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus )); + + if( error != KErrArgument ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 4: where we pass location info array.This is + * just test where this method completes without leaving. + */ + + // Here we create locationInfo object with gsm cell info object contained in it. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + CleanupStack::Pop( 2 ); //locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo2L +// This test case tests ConvertLocationInfo when expected information is +// of type ECoordinate +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo2L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * case 1: Any information regarding the area is passed and + * coordinate corresponding to that area info is expected. + */ + + // Here GSM cell info is passed as input area. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // If the conversion status is KErrNone, check for the corresponding + // converted info. + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + + /** + * case 2: Pass any information related to multiple area and we expect coordinate information + * corresponding to each area information. + */ + + // Create one more location info object which holds wlan info for which corresponding coordinate + // is expected. + CLbsLocationInfo* locationInfo2 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for coordinate info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfoArray.Append( locationInfo ); + + locationInfoArray.Append( locationInfo2 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Iterate through the array and check for converted info. + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo3L +// This test case tests ConvertLocationInfo when expected information is +// of type EGsm +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo3L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId );; + + /** + * case 1: Pass any area info and we expect GSM cell info + */ + + // Here WLAN info is passed as input area. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionCacheOnly,ELbsConversionOutputGsm, + conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // If the conversion status is success, check for the corresponding + // converted info. + if( error == KErrNone ) + { + CheckGsmCellConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + + /** + * case 2: Pass any information related to multiple area and we expect GSM cell info + * corresponding to each area information. + */ + + // Create one more location info object which holds coordinate info for which corresponding GSM + // cell info is expected. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for GSM cell info, hence we need to clear it before + // we use it for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsGsmInfo ); + locationInfoArray.Append( locationInfo ); + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionCacheOnly,ELbsConversionOutputGsm, + conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Iterate through the array and check for converted info. + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckGsmCellConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo4L +//This test case tests ConvertLocationInfo when expected information is +// of type EWcdma +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo4L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * case 1: Pass any area info pointer and we expect EWcdma type + */ + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionSilent,ELbsConversionOutputWcdma, + conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // If the conversion status is success, check for the corresponding + // converted info. + if( error == KErrNone ) + { + CheckWcdmaCellConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + + /** + * case 2: Pass any information related to multiple area and we expect wcdma information + * corresponding to each area information. + */ + + // Create one more location info object which holds wlan info for which corresponding WCDMA + // cell info is expected. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for WCDMA info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWcdmaInfo ); + locationInfoArray.Append( locationInfo ); + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionSilent,ELbsConversionOutputWcdma, + conversionModuleId,iConversionHandler->iStatus ); + + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Iterate through the array and check for converted info. + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckWcdmaCellConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo5L +// This test case tests ConvertLocationInfo when expected information is +// of type EWlan +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo5L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * case 1: Pass any area info pointer and we expect EWlan type + */ + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionCacheOnly,ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // If the conversion status is success, check for the corresponding + // converted info. + if( iConversionHandler->iStatus == KErrNone ) + { + CheckWlanConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( iConversionHandler->iStatus == KErrNotSupported || iConversionHandler->iStatus == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: Pass any information related to multiple area and we expect Wlan info + * corresponding to each area information. + */ + + // Create one more location info object which holds coordinate info for which corresponding + // Wlan info is expected. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for wlan info, hence we need to clear it before + // we use it for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWlanInfo ); + locationInfoArray.Append( locationInfo ); + locationInfoArray.Append( locationInfo1 ); + + TRequestStatus status; + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionCacheOnly,ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Iterate through the array and check for converted info. + if( iConversionHandler->iStatus == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckWlanConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( iConversionHandler->iStatus == KErrNotSupported || iConversionHandler->iStatus == KErrNotFound ) ) + { + User::Leave( KErrArgument ); + } + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo6L +// This test case tests the scenario when user tries to request new single +// conversion without waiting for completion of previous one. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo6L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + // Here in this case input area doesnt matter + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + error = KErrNone; + TRequestStatus status; + TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0); + locInfoConverter.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,status ); + + CleanupStack::PopAndDestroy( 2 ); // locationInfo1,locationInfo + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo7L +// This test case tests the scenario when user tries to request new batch +// conversion without waiting for completion of previous one. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo7L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KNullUidValue );; + + // Here in this case input area doesnt matter + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locationInfoArray.Append( locationInfo ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId ,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locationInfoArray1.Append( locationInfo1 ); + + TRequestStatus status; + TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0); + locInfoConverter.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,status ); + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo8L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying same plugin. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo8L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need to open two subsessions. + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying same conversion uid. + */ + + // Here type of area input doesnt matter. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + User::Leave( KErrArgument ); + } + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo9L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying different plugin. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo9L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need two subsessions + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId1 = TUid::Uid( KDummyPluginId ); + TUid conversionModuleId2 = TUid::Uid( KSuplPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying different conversion uid. + */ + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo10L +// This test case tests following unsuccessful conversion scenarios: +// 1. Conversion preference not supported by plugin. +// 2. Conversion request by specifying input area type same as requested type. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_ConvertLocationInfo10L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need two subsessions + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + /** + * Case 1: Users tries to request conversion by specifying conversion + * preference not supported by plugin. Example plugin doesnt + * support conversion using cache. + */ + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionCacheOnly, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request for coordinate info by specifying + * only coordinate info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaPositionInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 3: Users tries to request for gsm cell info by specifying + * only gsm cell info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaGsmCellInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputGsm,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 4: Users tries to request for wcdma cell info by specifying + * only wcdma cell info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaWcmdaCellInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputWcdma,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 5: Users tries to request for wlan info by specifying + * only wlan info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaWlanInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + User::Leave( KErrArgument ); + } + + CleanupStack::PopAndDestroy( 3 ); // locationInfo,locInfoConverter,locMonitorSession + return KErrNone; + } + + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel1L +// This test case tests the scenario when user tries to cancel the request before +// and after the conversion request complete for both single and batch conversion. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel1L(CStifItemParser& /*aItem*/ ) + { + + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + // This can can be done for any area type here EGsm to ECoordinate conversion has + // been used. + + /** + * Case 1: Here single location information conversion is requested + * and cancel is called before the conversion completes. + */ + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + error = iConversionHandler->iStatus.Int(); + // Request should be completed with the error code KErrCancel and + // location info should not have converted information. + if( error == KErrCancel ) + { + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + else + { + User::Leave( KErrArgument ); + } + + /** + * case 2: Here single location information conversion is requested + * and cancel is called after the conversion completes. + */ + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + CActiveScheduler::Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + error = iConversionHandler->iStatus.Int(); + // Request should be completed with the error code KErrNone and + // location info should have converted information. + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else + { + User::Leave( KErrArgument ); + } + + // case 3: Here mutiple location information conversion is + // requested and cancel is called before the conversion completes. + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + // We had requested for coordinate info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfoArray.Append( locationInfo ); + + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + // Request should be completed with the error code KErrCancel and + // location info should not have converted information. + error = iConversionHandler->iStatus.Int(); + + if( error == KErrCancel ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + } + else + { + User::Leave( KErrArgument ); + } + + + /** + * case 4: Here mutiple location information conversion is + * requested and cancel is called after the conversion completes. + */ + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + CActiveScheduler::Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + // Request should be completed with the error code KErrNone and + // location info should have converted information. + error = iConversionHandler->iStatus.Int(); + + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + User::Leave( KErrArgument ); + } + + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel2L +// This test case tests the scenario when user tries to cancel the conversion request +// from the different subsession for both single and multiple conversion. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel2L(CStifItemParser& /*aItem*/ ) + { + + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need to subsessions. + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + // This can can be done for any area type here EGsm to ECoordinate conversion has + // been used. + + /** + * Case 1: Here single location information conversion is + * requested and cancel is called the different subsession. + */ + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter1.CancelConvertLocationInfo(); + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Request should be completed with the error code KErrNone and + // location info should have converted information. + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: Here mutiple location information conversion is requested + * and cancel is called from the different subsession. + */ + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + // We had requested for coordinate info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfoArray.Append( locationInfo ); + + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter1.CancelConvertLocationInfo(); + CActiveScheduler::Start(); + + // Request should be completed with the error code KErrNone and + // location info should have converted information. + error = iConversionHandler->iStatus.Int(); + + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + User::Leave( KErrArgument ); + } + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel3L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying same plugin and we cancel one request +// of two requests. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel3L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need to open two subsessions. + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying same conversion uid and + * anyone conversion request is cancelled. + */ + + // Here type of area input doesnt matter. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here first request is called. + locInfoConverter.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrCancel ) + { + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + else + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid and + * any one conversion request is cancelled. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here second request is called. + locInfoConverter1.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrCancel ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + } + else + { + User::Leave( KErrArgument ); + } + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel4L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying different plugin. +// ----------------------------------------------------------------------------- +// +TInt CLocInfoConversionUnitTest::RLbsLocInfoConverter_Cancel4L(CStifItemParser& /*aItem*/ ) + { + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need two subsessions + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId1 = TUid::Uid( KDummyPluginId ); + TUid conversionModuleId2 = TUid::Uid( KSuplPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying different conversion uid + * any one request is cancelled. + */ + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here first request is cancelled. + locInfoConverter.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrCancel ) + { + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid and + * one conversion request is cancelled. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here we cancel 2nd request + locInfoConverter1.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrCancel ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + User::Leave( KErrArgument ); + } + + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + + +// Helper methods + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CreatePositionObjectLC +// ----------------------------------------------------------------------------- +// +CLbsPositionInfo* CLocInfoConversionUnitTest::CreatePositionInfoObjectLC() + { + TLocality locality; + locality.SetCoordinate( 62.5285,23.9385 ); + locality.SetAccuracy( 100,0.0 ); + CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); + CleanupStack::PushL( positionInfo ); + return positionInfo; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CreateGsmCellInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsGsmCellInfo* CLocInfoConversionUnitTest::CreateGsmCellInfoObjectLC() + { + CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 100,101,102,103); + CleanupStack::PushL( gsmCellInfo ); + return gsmCellInfo; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CreateWcdmaCellInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsWcdmaCellInfo* CLocInfoConversionUnitTest::CreateWcdmaCellInfoObjectLC() + { + CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 100,101,102 ); + CleanupStack::PushL( wcdmaCellInfo ); + return wcdmaCellInfo; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CreateWlanInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsWlanInfo* CLocInfoConversionUnitTest::CreateWlanInfoObjectLC() + { + TLbsWlanMacAddress macAddress(_L8("10.0.1")); + CLbsWlanInfo* wlanInfo = CLbsWlanInfo::NewL( macAddress,10.1 ); + CleanupStack::PushL( wlanInfo ); + return wlanInfo; + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CreateLocationInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsLocationInfo* CLocInfoConversionUnitTest::CreateLocationInfoObjectLC( + TLbsAreaInfoClassType aAreaType ) + { + CLbsLocationInfo* locationInfo = CLbsLocationInfo::NewL(); + CleanupStack::PushL( locationInfo ); + AppendAreaInfoObjectToLocationInfoL( locationInfo,aAreaType ); + return locationInfo; + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::AppendAreaInfoObjectToLocationInfoL +// ----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::AppendAreaInfoObjectToLocationInfoL( + CLbsLocationInfo* aLocationInfo, + TLbsAreaInfoClassType aAreaType ) + { + switch( aAreaType ) + { + case ELbsAreaPositionInfoClass: + CLbsPositionInfo* positionInfo = NULL; + positionInfo = CreatePositionInfoObjectLC(); + aLocationInfo->AddAreaInfoL( positionInfo ); + CleanupStack::Pop( positionInfo ); + break; + + case ELbsAreaGsmCellInfoClass: + CLbsGsmCellInfo* gsmCellInfo = NULL; + gsmCellInfo = CreateGsmCellInfoObjectLC(); + aLocationInfo->AddAreaInfoL( gsmCellInfo ); + CleanupStack::Pop( gsmCellInfo ); + break; + + case ELbsAreaWcmdaCellInfoClass: + CLbsWcdmaCellInfo* wcdmaCellInfo = NULL; + wcdmaCellInfo = CreateWcdmaCellInfoObjectLC(); + aLocationInfo->AddAreaInfoL( wcdmaCellInfo ); + CleanupStack::Pop( wcdmaCellInfo ); + break; + + case ELbsAreaWlanInfoClass: + CLbsWlanInfo* wlanInfo = NULL; + wlanInfo = CreateWlanInfoObjectLC(); + aLocationInfo->AddAreaInfoL( wlanInfo ); + CleanupStack::Pop( wlanInfo ); + break; + + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CheckPositionConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::CheckPositionConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsPosInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.Reset(); + if( aTestType == EPositive ) + { + if( !count ) + { + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + User::Leave( KErrArgument ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CheckGsmCellConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::CheckGsmCellConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsGsmInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.Reset(); + if( aTestType == EPositive ) + { + if( !count ) + { + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + User::Leave( KErrArgument ); + } + } + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CheckWcdmaCellConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::CheckWcdmaCellConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsWcdmaInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.Reset(); + if( aTestType == EPositive ) + { + if( !count ) + { + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + User::Leave( KErrArgument ); + } + } + } + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::CheckWlanConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CLocInfoConversionUnitTest::CheckWlanConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfo( areaInfoArray,CLbsLocationInfo::ELbsWlanInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + if( aTestType == EPositive ) + { + if( !count ) + { + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + User::Leave( KErrArgument ); + } + } + } +// [End of File] diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/bmarm/Te_locationinfoconverterU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/bmarm/Te_locationinfoconverterU.DEF Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/bwins/Te_locationinfoconverterU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/bwins/Te_locationinfoconverterU.DEF Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/conf/Te_locationinfoconverter.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/conf/Te_locationinfoconverter.cfg Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,2037 @@ +[Define] +PrefsUnspecified 0 +LocalCacheOnly 1 +ConnectionSilent 2 +ConnectionPrompt 4 +ConvertionNotDefined 0 +Coordinate 1 +Gsm 2 +Wcdma 4 +Wlan 8 +GsmAndWcdma 3 +GsmAndWlan 5 +WcdmaAndWlan 6 +KErrArgument -6 +KErrCancel -3 +[Enddefine] +[Test] +title GetAllLocationInfo +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetCoordinateInfo 1 LATITUDE= 100 LONGITUDE= 200 ALTITUDE= 300 HA= 20 VA= 30 +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 2 ARFCN= 3 CCODE= 10 NRXLEV=1 ARFCN= 3 CCODE= 10 NRXLEV=1 +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 15 NEIGHBOURCELLS= 2 NCELLID= 44 NSCODE= 15 NCELLID= 20 NSCODE= 44 +foobar SetWLanInfo 1 MACID= 100 SIGNAL= 200 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 404 NETWORKCODE= 49 LOCATIONCODE= 16 CELLID= 7141 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionPrompt Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 0 NETWORKCODE= 0 LOCATIONCODE= 0 CELLID= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 999 NETWORKCODE= 999 LOCATIONCODE= 65535 CELLID= 65535 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.5 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= -1 NETWORKCODE= 0 LOCATIONCODE= 0 CELLID= 0 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.6 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= -1 LOCATIONCODE= 0 CELLID= 0 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.7 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= -1 CELLID= 0 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.8 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.9 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 1000 NETWORKCODE= 0 LOCATIONCODE= 0 CELLID= 0 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.10 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 1000 LOCATIONCODE= 0 CELLID= 0 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.11 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 65536 CELLID= 0 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.12 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 65536 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.1.13 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 999 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.5 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 1000 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.6 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.7 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.8 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 999 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.9 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.10 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 1000 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.11 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.12 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.13 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 65535 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.14 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.15 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 65536 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.16 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.17 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 65535 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.18 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.19 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 65536 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.20 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.21 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 255 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.22 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.23 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.24 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 256 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.25 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo LocalCacheOnly Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.26 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionSilent Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.27 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionPrompt Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 0 NETWORKCODE= 0 CELLID= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 999 NETWORKCODE= 999 CELLID= 65535 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.5 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= -1 NETWORKCODE= 200 CELLID= 300 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.6 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= -1 CELLID= 300 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.7 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.8 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 1000 NETWORKCODE= 200 CELLID= 300 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.9 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 1000 CELLID= 300 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.1.10 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 268435456 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.28.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.29 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.30 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 999 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.31 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.32 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 1000 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.33 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.34 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.35 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 999 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.36 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.37 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 1000 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.38 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.39 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 65535 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.40 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.41 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 268435456 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.42 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.43 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.44 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.45 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 512 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.46 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.47.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 NETWORKCODE= 200 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.47.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.47.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 300 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.49.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.49.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 200 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.51 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo LocalCacheOnly Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.52 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionSilent Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.1.53 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 2 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionPrompt Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 0 NRXLEV=1 ARFCN= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV=1 ARFCN= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 2 ARFCN= 3 CCODE= 10 NRXLEV=1 ARFCN= 3 CCODE= 10 NRXLEV=1 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= -1 NRXLEV=1 ARFCN= 3 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.5 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 64 NRXLEV=1 ARFCN= 3 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.6 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV=1 ARFCN= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.7 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV=1 ARFCN= 1023 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.8 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV=1 ARFCN= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.9 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV=1 ARFCN= 1024 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.10 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 0 ARFCN= 1023 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.11 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.12 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= -1 ARFCN= 1023 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.13 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 64 ARFCN= 1023 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.14 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 0 NSCODE= 15 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.15 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 15 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.16 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 15 NEIGHBOURCELLS= 2 NCELLID= 44 NSCODE= 15 NCELLID= 20 NSCODE= 44 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.17 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= -1 NSCODE= 15 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.18 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435456 NSCODE= 15 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.19 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 0 NSCODE= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.20 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.21 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 0 NSCODE= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.2.22 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 512 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.1.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.2.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.2.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo LocalCacheOnly Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.5 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionSilent Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.6 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionPrompt Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.7 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 0 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.8 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 255 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.9 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= -1 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.3.10 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 256 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.4.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +allownextresult KErrCancel +foobar Misc 1 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.4.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 255 +allownextresult KErrCancel +foobar Misc 1 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.4.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar Misc 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.4.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar Misc 3 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.5.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar Misc 4 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.4.5.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo 10 +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo 10 +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo 10 +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo 10 +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo 10 +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo 10 +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo 10 +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo 10 +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo 10 +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo 10 +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.5 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.6 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.7 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.8 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.9 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 1000 NETWORKCODE= -1 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.10 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 64 NRXLEV= 64 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.11 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= -1 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.12 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.13 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 1000 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.14 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435456 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.15 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 512 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.16 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.17 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.18 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo LocalCacheOnly Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.19 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionSilent Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.20 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionPrompt Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.21 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo LocalCacheOnly Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.22 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionSilent Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.23 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 SCODE= 511 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo ConnectionPrompt Coordinate 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.24 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified ConvertionNotDefined 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.25 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Gsm 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.26 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Wcdma 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.1.27 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 NEIGHBOURCELLS= 1 NCELLID= 268435455 NSCODE= 511 +foobar AddLocationInfo +foobar SetWCDMACellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 TIMINGADVANCE= 40 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Wlan 2 +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.2.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.2.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo 10 +foobar SetWLanInfo 1 MACID= 200000 SIGNAL= 30 +foobar AddLocationInfo 10 +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo 10 +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo 10 +foobar SetWLanInfo 1 MACID= 200000 SIGNAL= 30 +foobar AddLocationInfo 10 +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.2.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.2.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.2.5 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 256 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +allownextresult KErrArgument +foobar ConvertLocationInfo PrefsUnspecified Coordinate 2 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.2.6 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetWLanInfo 1 MACID= 100000 SIGNAL= 3 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 NEIGHBOURCELLS= 1 CCODE= 63 NRXLEV= 63 ARFCN= 1023 +foobar AddLocationInfo +foobar ConvertLocationInfo PrefsUnspecified Coordinate +foobar ValidateLocationInfo +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.3.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +allownextresult KErrCancel +foobar Misc 5 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.3.2 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetWLanInfo 2 MACID= 100000 SIGNAL= 255 +foobar AddLocationInfo +allownextresult KErrCancel +foobar Misc 5 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.3.3 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar Misc 6 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.3.4 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar Misc 7 +foobar Cleanup +delete foobar +[Endtest] + +[Test] +title 2698.5.4.1 +create Te_locationinfoconverter foobar +foobar CreateLocationInfoConverter +foobar SetGSMCellInfo 1 COUNTRYCODE= 100 NETWORKCODE= 200 LOCATIONCODE= 300 CELLID= 30 +foobar AddLocationInfo +foobar Misc 8 +foobar Cleanup +delete foobar +[Endtest] + + + + + + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/conf/te_LbsLocationInfoConverterSuite.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/conf/te_LbsLocationInfoConverterSuite.script Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,755 @@ +START_TESTCASE LBS-LocationInfoConverter-GetAllLocationInfo +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini GetAllLocationInfo +END_TESTCASE LBS-LocationInfoConverter-GetAllLocationInfo + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_3 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_4 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_5 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_5 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_5 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_6 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_6 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_6 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_7 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_7 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_7 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_8 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_8 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_8 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_9 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_9 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_9 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_10 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_10 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_10 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_11 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_11 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_11 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_12 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_12 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_12 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_13 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_1_13 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_1_13 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_3 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_4 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_5 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_5 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_5 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_6 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_6 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_6 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_7 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_7 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_7 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_8 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_8 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_8 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_9 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_9 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_9 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_10 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_10 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_10 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_11 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_11 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_11 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_12 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_12 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_12 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_13 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_13 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_13 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_14 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_14 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_14 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_15 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_15 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_15 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_16 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_16 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_16 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_17 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_17 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_17 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_18 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_18 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_18 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_19 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_19 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_19 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_20 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_20 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_20 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_21 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_21 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_21 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_22 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_22 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_22 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_23 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_23 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_23 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_24 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_24 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_24 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_25 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_25 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_25 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_26 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_26 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_26 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_27 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_27 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_27 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_3 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_4 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_5 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_5 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_5 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_6 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_6 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_6 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_7 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_7 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_7 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_8 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_8 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_8 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_9 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_9 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_9 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_10 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_1_10 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_1_10 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_28_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_28_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_29 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_29 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_29 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_30 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_30 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_30 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_31 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_31 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_31 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_32 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_32 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_32 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_33 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_33 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_33 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_34 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_34 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_34 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_35 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_35 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_35 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_36 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_36 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_36 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_37 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_37 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_37 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_38 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_38 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_38 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_39 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_39 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_39 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_40 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_40 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_40 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_41 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_41 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_41 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_42 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_42 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_42 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_43 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_43 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_43 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_44 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_44 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_44 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_45 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_45 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_45 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_46 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_46 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_46 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_47_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_47_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_47_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_47_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_47_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_47_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_47_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_47_3 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_47_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_49_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_49_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_49_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_49_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_49_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_49_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_51 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_51 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_51 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_52 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_52 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_52 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_1_53 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_1_53 +END_TESTCASE LBS-LocationInfoConverter-2698_4_1_53 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_3 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_4 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_5 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_5 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_5 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_6 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_6 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_6 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_7 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_7 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_7 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_8 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_8 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_8 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_9 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_9 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_9 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_10 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_10 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_10 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_11 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_11 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_11 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_12 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_12 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_12 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_13 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_13 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_13 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_14 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_14 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_14 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_15 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_15 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_15 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_16 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_16 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_16 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_17 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_17 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_17 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_18 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_18 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_18 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_19 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_19 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_19 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_20 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_20 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_20 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_21 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_21 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_21 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_2_22 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_2_22 +END_TESTCASE LBS-LocationInfoConverter-2698_4_2_22 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_1_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_1_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_1_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_2_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_2_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_2_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_2_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_2_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_2_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_4 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_5 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_5 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_5 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_6 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_6 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_6 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_7 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_7 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_7 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_8 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_8 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_8 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_9 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_9 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_9 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_3_10 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_3_10 +END_TESTCASE LBS-LocationInfoConverter-2698_4_3_10 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_4_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_4_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_4_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_4_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_4_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_4_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_4_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_4_3 +END_TESTCASE LBS-LocationInfoConverter-2698_4_4_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_4_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_4_4 +END_TESTCASE LBS-LocationInfoConverter-2698_4_4_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_5_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_5_1 +END_TESTCASE LBS-LocationInfoConverter-2698_4_5_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_4_5_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_4_5_2 +END_TESTCASE LBS-LocationInfoConverter-2698_4_5_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_1 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_2 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_3 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_4 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_5 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_5 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_5 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_6 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_6 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_6 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_7 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_7 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_7 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_8 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_8 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_8 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_9 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_9 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_9 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_10 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_10 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_10 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_11 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_11 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_11 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_12 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_12 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_12 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_13 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_13 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_13 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_14 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_14 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_14 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_15 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_15 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_15 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_16 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_16 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_16 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_17 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_17 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_17 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_18 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_18 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_18 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_19 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_19 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_19 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_20 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_20 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_20 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_21 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_21 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_21 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_22 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_22 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_22 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_23 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_23 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_23 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_24 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_24 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_24 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_25 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_25 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_25 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_26 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_26 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_26 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_1_27 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_1_27 +END_TESTCASE LBS-LocationInfoConverter-2698_5_1_27 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_2_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_2_1 +END_TESTCASE LBS-LocationInfoConverter-2698_5_2_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_2_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_2_2 +END_TESTCASE LBS-LocationInfoConverter-2698_5_2_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_2_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_2_3 +END_TESTCASE LBS-LocationInfoConverter-2698_5_2_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_2_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_2_4 +END_TESTCASE LBS-LocationInfoConverter-2698_5_2_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_2_5 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_2_5 +END_TESTCASE LBS-LocationInfoConverter-2698_5_2_5 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_2_6 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_2_6 +END_TESTCASE LBS-LocationInfoConverter-2698_5_2_6 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_3_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_3_1 +END_TESTCASE LBS-LocationInfoConverter-2698_5_3_1 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_3_2 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_3_2 +END_TESTCASE LBS-LocationInfoConverter-2698_5_3_2 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_3_3 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_3_3 +END_TESTCASE LBS-LocationInfoConverter-2698_5_3_3 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_3_4 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_3_4 +END_TESTCASE LBS-LocationInfoConverter-2698_5_3_4 + + +START_TESTCASE LBS-LocationInfoConverter-2698_5_4_1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step LbsLocationInfoConverter.ini 2698_5_4_1 +END_TESTCASE LBS-LocationInfoConverter-2698_5_4_1 + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/eabi/Te_locationinfoconverterU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/eabi/Te_locationinfoconverterU.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI33CTelocationinfoconversionobserver @ 2 NONAME + _ZTV33CTelocationinfoconversionobserver @ 3 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,51 @@ +/*TYPE TESTCLASS*/ +/* +* 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: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include + +TARGET Te_locationinfoconverter.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB + +//TARGETPATH ?target_path +DEFFILE Te_locationinfoconverter.def + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE Te_locationinfoconverter.cpp +SOURCE Te_locationinfoconverterBlocks.cpp Te_locationinfoconversionobserver.cpp + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib bafl.lib +LIBRARY lbslocationinfodatatypes.lib lbslocationinfoconverter.lib /*lbsselflocate.lib*/ +LIBRARY lbs.lib + +LANG SC + + +SMPSAFE + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter.pkg Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,62 @@ +; +; 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: +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x00000000),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +"\epoc32\release\armv5\urel\Te_locationinfoconverter.dll" - "!:\Sys\Bin\Te_locationinfoconverter.dll" +"..\conf\Te_locationinfoconverter.cfg"-"C:\TestFramework\Te_locationinfoconverter.cfg" + ;"Te_locationinfoconverter.bat" - "C:\Sys\Bin\Te_locationinfoconverter.bat" + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_DoxyFile.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_DoxyFile.txt Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,239 @@ +# +# 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: +# +# + +# Doxyfile 1.4.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = Te_locationinfoconverter +PROJECT_NUMBER = +OUTPUT_DIRECTORY = \Te_locationinfoconverter\ +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = YES +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = \Te_locationinfoconverter\ +FILE_PATTERNS = *.h \ + *.rh \ + *.hrh +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = NO +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = YES +TOC_EXPAND = YES +DISABLE_INDEX = YES +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = YES +RTF_OUTPUT = Doc +COMPACT_RTF = YES +RTF_HYPERLINKS = YES +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = NONSHARABLE_CLASS +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_c.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_c.bat Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: batch file +rem + +rem copy C:\TestFramework\TestFramework_locblid.ini C:\TestFramework\TestFramework.ini +rem md e:\BCTest +rem md e:\BCTest\Results + +ATSINTERFACE.EXE -testmodule testcombiner -config C:\TestFramework\Te_locationinfoconverter.cfg +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\Te_locationinfoconverter.txt + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_nrm.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_nrm.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,78 @@ +/*TYPE TESTCLASS*/ +/* +* 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: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include + +TARGET Te_locationinfoconverter.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +// VENDORID 0x00000000 +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 + +//TARGETPATH ?target_path +DEFFILE Te_locationinfoconverter.def + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE Te_locationinfoconverter.cpp +SOURCE Te_locationinfoconverterBlocks.cpp + +//RESOURCE resource_file +//RESOURCE resource_file2 + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib + +LANG SC + +/* +START WINS +?wins_specific_information +END + +START MARM +?marm_specific_information +END +*/ +// Other possible keywords: + +// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCE ?color_depth ?source_bitmap +END +*/ +// DEFFILE ?filename +// AIF ?filename + + +SMPSAFE + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_z.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/group/Te_locationinfoconverter_z.bat Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: batch file +rem + +copy z:\TestFramework\TestFramework_locblid.ini C:\TestFramework\TestFramework.ini +md e:\BCTest +md e:\BCTest\Results + +ATSINTERFACE.EXE -testmodule testcombiner -config C:\TestFramework\tcLmkBlid.cfg +copy c:\Logs\TestFramework\TestReport.txt e:\BCTest\results\Location_LmkBlid.txt + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,21 @@ +/* +* 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: +* +*/ + +PRJ_TESTMMPFILES +Te_locationinfoconverter.mmp + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/inc/Te_locationinfoconversionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/inc/Te_locationinfoconversionobserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002 - 2007 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: Test module to implement Advanced trigger supervision cases +* +*/ + + + +#ifndef TE_LOCATIONINFOCONVERSIONOBSERVER_H +#define TE_LOCATIONINFOCONVERSIONOBSERVER_H +#include + + + class CTelocationinfoconversionobserver: public CTimer, public MLbsLocationInfoConverterObserver + + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CTelocationinfoconversionobserver* NewL( ); + + /** + * Destructor. + */ + ~CTelocationinfoconversionobserver(); + + + void OnConversionComplete( TInt aStatusCode ); + + void RunL( ); + + void DoCancel( ); + + TInt ConversionResult(); + + // RTimer iTimer; + TRequestStatus iWaitStatus; + + private: + + /** + * C++ default constructor. + */ + CTelocationinfoconversionobserver( ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + + TInt iStatusCode; + + }; + +#endif // TE_LOCATIONINFOCONVERSIONOBSERVER_H + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/inc/Te_locationinfoconverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/inc/Te_locationinfoconverter.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,190 @@ +/* +* 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: STIF testclass declaration +* +*/ + +#ifndef TE_LOCATIONINFOCONVERTER_H +#define TE_LOCATIONINFOCONVERTER_H + +// INCLUDES + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "Te_locationinfoconversionobserver.h" + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KTe_locationinfoconverterLogPath, "c:\\logs\\testframework\\" ); +// Log file +_LIT( KTe_locationinfoconverterLogFile, "Te_locationinfoconverter.txt" ); +_LIT( KTe_locationinfoconverterLogFileWithTitle, "Te_locationinfoconverter_[%S].txt" ); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class CTe_locationinfoconverter; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CTe_locationinfoconverter test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CTe_locationinfoconverter) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CTe_locationinfoconverter* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CTe_locationinfoconverter(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CTe_locationinfoconverter( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + /** + * Example test method. + * @since ?Series60_version + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + virtual TInt ConvertLocationInfoL( CStifItemParser& aItem ); + virtual TInt CreateLocationInfoConverterL( CStifItemParser& aItem ); + virtual TInt SetCoordinateInfoL( CStifItemParser& aItem ); + virtual TInt SetGSMCellInfoL( CStifItemParser& aItem ); + virtual TInt SetWCDMACellInfoL( CStifItemParser& aItem ); + virtual TInt SetWLanInfoL( CStifItemParser& aItem ); + virtual TInt AddLocationInfoL( CStifItemParser& aItem ); + virtual TInt ValidateLocationInfoL( CStifItemParser& aItem ); + virtual TInt MiscL( CStifItemParser& aItem ); + virtual TInt Cleanup( CStifItemParser& aItem ); + + + + + private: // Data + + // ?one_line_short_description_of_data + //?data_declaration; + CLbsLocationInfoConverter* ilbslocationinfoconverter; + CLbsLocationInfo* ilbslocationinfo; + CTelocationinfoconversionobserver* iObserver; + RLbsLocationInfoBaseArray ilbslocationinfoarray; + RLbsLocationInfoBaseArray ilbslocationinfoarrayTemp; + + + + }; + +#endif // TE_LOCATIONINFOCONVERTER_H + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/init/TestFramework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/init/TestFramework.ini Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,218 @@ +# +# This is STIF initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# + XML, Test report will be xml type, for example 'TestReport.xml'. +# Note, that xml format is available only when output is set to FILE. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + # 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT, HTML or XML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +Timeout= 0 # Default timeout value for each test case. In milliseconds +#UITestingSupport= YES # Possible values: YES or NO +#SeparateProcesses= YES # Possible values: YES or NO (default: NO) +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +[New_Module] +ModuleName= testscripter +TestCaseFile= c:\testframework\Te_locationinfoconverter.cfg +[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIF logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +#FileUnicode= YES # Possible values: YES or NO +#AddTestCaseTitle= YES # Possible values: YES or NO +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set filters to be used by ConsoleUI. +# If you want to use filter with ConsoleUI, simply remove comments +# from section below and provide valid filter entries. +# Each filter line has to start with "filter= " keyword. +# Filter can contain special wildcard characters: +# * which stands for none or any literal; +# ? which stands for single character. +# Filters are not case-sensitive. + +#[Filters] +#filter= *math* +#filter= *radio* +#[End_Filters] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/src/Te_locationinfoconversionobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/src/Te_locationinfoconversionobserver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002 - 2007 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: Test module to implement Advanced trigger supervision cases +* +*/ + + + +// INCLUDE FILES +#include +#include "Te_locationinfoconversionobserver.h" + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::CTriggerFireObserver +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTelocationinfoconversionobserver::CTelocationinfoconversionobserver( ):CTimer( CTimer::EPriorityStandard ) + { + + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTelocationinfoconversionobserver::ConstructL() + { + iStatusCode=KErrNone; + CTimer::ConstructL(); + + } + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTelocationinfoconversionobserver* CTelocationinfoconversionobserver::NewL( ) + { + + CTelocationinfoconversionobserver* self = new (ELeave) CTelocationinfoconversionobserver( ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop(); + return self; + + } + +// Destructor +CTelocationinfoconversionobserver::~CTelocationinfoconversionobserver() + { + Cancel(); + } + +void CTelocationinfoconversionobserver::OnConversionComplete( TInt aStatusCode ) + { + iStatusCode = aStatusCode; + CActiveScheduler::Stop(); + } + +TInt CTelocationinfoconversionobserver::ConversionResult() + { + return iStatusCode; + } + + + +void CTelocationinfoconversionobserver::RunL( ) + { + iStatusCode = KErrCancel; + CActiveScheduler::Stop(); + + } + +void CTelocationinfoconversionobserver::DoCancel( ) + { + + + } + +//End of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/src/Te_locationinfoconverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/src/Te_locationinfoconverter.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,199 @@ +/* +* 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: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include +#include "Te_locationinfoconverter.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::CTe_locationinfoconverter +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTe_locationinfoconverter::CTe_locationinfoconverter( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTe_locationinfoconverter::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KTe_locationinfoconverterLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KTe_locationinfoconverterLogFile); + } + + iLog = CStifLogger::NewL( KTe_locationinfoconverterLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTe_locationinfoconverter* CTe_locationinfoconverter::NewL( + CTestModuleIf& aTestModuleIf ) + { + CTe_locationinfoconverter* self = new (ELeave) CTe_locationinfoconverter( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CTe_locationinfoconverter::~CTe_locationinfoconverter() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +//----------------------------------------------------------------------------- +// CTe_locationinfoconverter::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CTe_locationinfoconverter::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("Te_locationinfoconverter.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CTe_locationinfoconverter::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/Te_locationinfoconverter/src/Te_locationinfoconverterBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/Te_locationinfoconverter/src/Te_locationinfoconverterBlocks.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,712 @@ +/* +* 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: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include "Te_locationinfoconverter.h" +#include +#include +#include +#include +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +#define KTestLatitude 10 +#define KTestLongitude 20 +#define KTestAltitude 30 +#define KTestHorizontalaccuracy 30 +#define KTestVerticalaccuracy 40 + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def +//Tags used in cfg file +_LIT(KLatitude, "LATITUDE= "); +_LIT(KLongitude, "LONGITUDE= "); +_LIT(KAltitude, "ALTITUDE= "); +_LIT(KHorizontalAccuracy, "HA= "); +_LIT(KVerticalAccuracy, "VA= "); +_LIT(KCountrycode, "COUNTRYCODE= "); +_LIT(KNetworkcode, "NETWORKCODE= "); +_LIT(KLocationcode, "LOCATIONCODE= "); +_LIT(KCellid, "CELLID= "); +_LIT(KRxlev, "RXLEV= "); +_LIT(KTimingAdvance, "TIMINGADVANCE= "); +_LIT(KNeighbouringcells, "NEIGHBOURCELLS= "); +_LIT(KArfcn, "ARFCN= "); +_LIT(KColourcode, "CCODE= "); +_LIT(KNeighbourRxlev, "NRXLEV= "); +_LIT(KScramblingcode, "SCODE= "); +_LIT(KNeighbourCellid, "NCELLID= "); +_LIT(KNeighbourScramblingcode, "NSCODE= "); +_LIT(KMacId, "MACID= "); +_LIT(KSignalstrength, "SIGNAL= "); +_LIT(KNeighbourPathloss, "NPATHLOSS= "); +_LIT(KNeighbourSignalstrength, "NSIGNAL= "); + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CTe_locationinfoconverter::Delete() + { + + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "ConvertLocationInfo", CTe_locationinfoconverter::ConvertLocationInfoL ), + ENTRY( "Misc", CTe_locationinfoconverter::MiscL ), + ENTRY( "CreateLocationInfoConverter", CTe_locationinfoconverter::CreateLocationInfoConverterL ), + ENTRY( "SetCoordinateInfo", CTe_locationinfoconverter::SetCoordinateInfoL ), + ENTRY( "SetGSMCellInfo", CTe_locationinfoconverter::SetGSMCellInfoL ), + ENTRY( "SetWCDMACellInfo", CTe_locationinfoconverter::SetWCDMACellInfoL ), + ENTRY( "SetWLanInfo", CTe_locationinfoconverter::SetWLanInfoL ), + ENTRY( "AddLocationInfo", CTe_locationinfoconverter::AddLocationInfoL ), + ENTRY( "ValidateLocationInfo", CTe_locationinfoconverter::ValidateLocationInfoL ), + ENTRY( "Cleanup", CTe_locationinfoconverter::Cleanup ), + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::CreateLocationInfoConverterL +// Creates and initializes Location info converter object +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::CreateLocationInfoConverterL( CStifItemParser& aItem ) + { + iLog->Log(_L("CovertLocationInfoL Function")); +// TUint Uidinteger = 537028467; // SUPL + TUint Uidinteger = 537007117; // Example + TUid uid = TUid::Uid( Uidinteger ); + + aItem.GetNextInt(Uidinteger); + + iObserver = CTelocationinfoconversionobserver::NewL(); + ilbslocationinfo = CLbsLocationInfo::NewL(); + if(Uidinteger!=0) + { + ilbslocationinfoconverter = CLbsLocationInfoConverter::NewL(*iObserver,uid); + } + else + { + iLog->Log(_L("CovertLocationInfoL Function : Creating")); + ilbslocationinfoconverter = CLbsLocationInfoConverter::NewL(*iObserver); + } + iLog->Log(_L("CovertLocationInfoL Function end")); + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::SetCoordinateInfoL +// Converts one location info to its corresponding position info. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::SetCoordinateInfoL( CStifItemParser& aItem ) + { + TInt fntype; + aItem.GetNextInt(fntype); + TPtrC Llatidude,Llongitude,Laltidude,Lhoracc,LVerAcc; + aItem.GetNextString( KLatitude, Llatidude); + aItem.GetNextString( KLongitude, Llongitude); + aItem.GetNextString( KAltitude, Laltidude); + aItem.GetNextString( KHorizontalAccuracy, Lhoracc); + aItem.GetNextString( KVerticalAccuracy, LVerAcc); + + TReal64 latitude =0 ; + TLex16 lat(Llatidude); + lat.Val(latitude); + + TReal64 longitude =0; + TLex16 longi(Llongitude); + longi.Val(longitude); + + TReal32 Altitude =0; + TLex16 Alt(Laltidude); + Alt.Val(Altitude); + + TReal32 HorizontalAccuracy =0; + TLex16 HA(Lhoracc); + HA.Val(HorizontalAccuracy); + + TReal32 VerticalAccuracy =0; + TLex16 VA(LVerAcc); + VA.Val(VerticalAccuracy); + TLocality Locality; + if(latitude!=0 && longitude!=0 && Altitude==0) + { + Locality.SetCoordinate(latitude,longitude); + } + else if (latitude!=0 && longitude!=0 && Altitude!=0) + { + Locality.SetCoordinate(latitude,longitude,Altitude); + } + + + if(HorizontalAccuracy!=0 ) + { + Locality.SetHorizontalAccuracy(HorizontalAccuracy); + } + if(VerticalAccuracy!=0 ) + { + Locality.SetVerticalAccuracy(VerticalAccuracy); + } + + CLbsPositionInfo* Posinfo; + if(fntype==1) + { + Posinfo=CLbsPositionInfo::NewL( Locality); + } + else if(fntype==2) + { + Posinfo=CLbsPositionInfo::NewL(); + Posinfo->SetLocality(Locality); + } + + ilbslocationinfo->AddAreaInfoL(Posinfo); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::SetGSMCellInfoL +// . +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::SetGSMCellInfoL( CStifItemParser& aItem ) + { + TInt fntype; + aItem.GetNextInt(fntype); + TInt countrycode=-2,networkcode=-2,locationcode=-2,cellid=-2,timingadvance=-2,Rxlev=-2,nNeignbourcells=0,arfcn=-2,bsic=-2,NRxlev=-2; + aItem.GetNextInt( KCountrycode, countrycode); + aItem.GetNextInt( KNetworkcode, networkcode); + aItem.GetNextInt( KLocationcode, locationcode); + aItem.GetNextInt( KCellid, cellid); + aItem.GetNextInt( KTimingAdvance, timingadvance); + aItem.GetNextInt( KRxlev, Rxlev); + aItem.GetNextInt( KNeighbouringcells, nNeignbourcells); + + CLbsGsmCellInfo* gsmcellinfo; + if(fntype==1) + { + gsmcellinfo=CLbsGsmCellInfo::NewL( countrycode,networkcode,locationcode,cellid); + if(timingadvance!=-2) + { + gsmcellinfo->SetTimingAdvance(timingadvance); + } + if(Rxlev!=-2) + { + gsmcellinfo->SetRxLevel(Rxlev); + } + if(nNeignbourcells!=0) + { + TLbsGsmNeighbourCellInfo neighbourcell; + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + + } + } + } + else if(fntype==2) + { + gsmcellinfo=CLbsGsmCellInfo::NewL(); + if(countrycode!=-2) + { + gsmcellinfo->SetMobileCountryCode(countrycode); + } + if(networkcode!=-2) + { + gsmcellinfo->SetMobileNetworkCode(networkcode); + } + if(locationcode!=-2) + { + gsmcellinfo->SetLocationAreaCode(locationcode); + } + if(cellid!=-2) + { + gsmcellinfo->SetCellId(cellid); + } + if(timingadvance!=-2) + { + gsmcellinfo->SetTimingAdvance(timingadvance); + } + if(Rxlev!=-2) + { + gsmcellinfo->SetRxLevel(Rxlev); + } + if(nNeignbourcells!=0) + { + + + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + + } + } + } + + ilbslocationinfo->AddAreaInfoL(gsmcellinfo); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::SetWCDMACellInfoL +// . +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::SetWCDMACellInfoL( CStifItemParser& aItem ) + { + TInt fntype; + aItem.GetNextInt(fntype); + TInt countrycode=-2,networkcode=-2,cellid=-2,nNeignbourcells=0,scramblingcode=-2,neighbourucid=-2,neighbourscode=-2,neighbourpathloss=-2,neighboursignalstrength=-2; + aItem.GetNextInt( KCountrycode, countrycode); + aItem.GetNextInt( KNetworkcode, networkcode); + + aItem.GetNextInt( KCellid, cellid); + aItem.GetNextInt( KScramblingcode, scramblingcode); + + aItem.GetNextInt( KNeighbouringcells, nNeignbourcells); + + CLbsWcdmaCellInfo* wcdmacellinfo; + if(fntype==1) + { + wcdmacellinfo=CLbsWcdmaCellInfo::NewL( countrycode,networkcode,cellid); + if(scramblingcode!=-2) + { + wcdmacellinfo->SetScramblingCode(scramblingcode); + } + if(nNeignbourcells!=0) + { + TLbsWcdmaNeighbourCellInfo neighbourcell; + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + } + } + } + else if(fntype==2) + { + wcdmacellinfo=CLbsWcdmaCellInfo::NewL(); + if(countrycode!=-2) + { + wcdmacellinfo->SetMobileCountryCode(countrycode); + } + if(networkcode!=-2) + { + wcdmacellinfo->SetMobileNetworkCode(networkcode); + } + if(cellid!=-2) + { + wcdmacellinfo->SetUniqueCellId(cellid); + } + if(scramblingcode!=-2) + { + wcdmacellinfo->SetScramblingCode(scramblingcode); + } + if(nNeignbourcells!=0) + { + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + } + } + } + + ilbslocationinfo->AddAreaInfoL(wcdmacellinfo); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::SetWLanInfoL +// . +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::SetWLanInfoL( CStifItemParser& aItem ) + { + TInt fntype; + aItem.GetNextInt(fntype); + TPtrC macid; + TInt signalstrength=-2; + aItem.GetNextString( KMacId, macid); + aItem.GetNextInt( KSignalstrength, signalstrength); + TBuf8<6> macidbuf; + macidbuf.Copy(macid); + CLbsWlanInfo* wlaninfo; + if(fntype==1) + { + wlaninfo=CLbsWlanInfo::NewL( macidbuf,signalstrength); + } + else if(fntype==2) + { + wlaninfo=CLbsWlanInfo::NewL(); + if (macidbuf.Length()!=0) + { + wlaninfo->SetMacAddress(macidbuf); + } + if(signalstrength!=-2) + { + wlaninfo->SetSignalStrength(signalstrength); + } + } + ilbslocationinfo->AddAreaInfoL(wlaninfo); + return KErrNone; + } +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::AddLocationInfoL +// Converts one location info to its corresponding position info. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::AddLocationInfoL( CStifItemParser& aItem ) + { + TInt nTimes =1; + aItem.GetNextInt(nTimes); + ilbslocationinfoarrayTemp.Append(ilbslocationinfo); + for (TInt i=0 ; iConvertLocationInfoL(*ilbslocationinfoarray[0],conversionprefs,requestedinfo); + } + else if (fntype==2) + { + ilbslocationinfoconverter->ConvertLocationInfoL(ilbslocationinfoarray,conversionprefs,requestedinfo); + } + ) + + if(err) + return err; + + CActiveScheduler::Start(); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::CancelConvertLocationInfo +// Converts one location info to its corresponding position info. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CTe_locationinfoconverter::MiscL( CStifItemParser& aItem) + { + TInt testcase ; + aItem.GetNextInt(testcase); + switch(testcase) + { + case 1: + ilbslocationinfoconverter->ConvertLocationInfoL(*ilbslocationinfo,0,1); + ilbslocationinfoconverter->CancelConvertLocationInfo(); + iObserver->After(1500000); + CActiveScheduler::Start(); + break; + case 2: + ilbslocationinfoconverter->ConvertLocationInfoL(*ilbslocationinfo,0,1); + CActiveScheduler::Start(); + ilbslocationinfoconverter->CancelConvertLocationInfo(); + + break; + case 3: + + ilbslocationinfoconverter->CancelConvertLocationInfo(); + + break; + case 4: + TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0); + ilbslocationinfoconverter->ConvertLocationInfoL(*ilbslocationinfo,0,1); + ilbslocationinfoconverter->ConvertLocationInfoL(*ilbslocationinfo,0,1); + + break; + case 5: + ilbslocationinfoconverter->ConvertLocationInfoL(ilbslocationinfoarray,0,1); + ilbslocationinfoconverter->CancelConvertLocationInfo(); + iObserver->After(1500000); + CActiveScheduler::Start(); + break; + case 6: + ilbslocationinfoconverter->ConvertLocationInfoL(ilbslocationinfoarray,0,1); + CActiveScheduler::Start(); + ilbslocationinfoconverter->CancelConvertLocationInfo(); + + break; + case 7: + + ilbslocationinfoconverter->CancelConvertLocationInfo(); + + break; + case 8: + TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0); + ilbslocationinfoconverter->ConvertLocationInfoL(ilbslocationinfoarray,0,1); + ilbslocationinfoconverter->ConvertLocationInfoL(ilbslocationinfoarray,0,1); + + break; + + } + + + return iObserver->ConversionResult();; + } + + + +TInt CTe_locationinfoconverter::ValidateLocationInfoL( CStifItemParser& aItem) + { + + if( iObserver->ConversionResult() == KErrNotSupported || + iObserver->ConversionResult() == KErrNotFound ) + return KErrNone; + + if( iObserver->ConversionResult() == KErrNone ) + { + TInt requestedinfo =1; + aItem.GetNextInt(requestedinfo); + if(requestedinfo ==1) + { + TInt count = ilbslocationinfoarray.Count(); + for(TInt i=0; i PosInfoList; + static_cast(ilbslocationinfoarray[i])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo); + TInt count2 = PosInfoList.Count(); + PosInfoList.Reset(); + PosInfoList.Close(); + if(count2>=1) + { + return KErrNone; + } + } + return KErrGeneral; + } + } + + return iObserver->ConversionResult(); + } + +TInt CTe_locationinfoconverter::Cleanup( CStifItemParser& aItem ) + { + if(iObserver) + { + delete iObserver; + } + if(ilbslocationinfo) + { + delete ilbslocationinfo; + } + if(ilbslocationinfoconverter) + { + delete ilbslocationinfoconverter; + } + ilbslocationinfoarrayTemp.ResetAndDestroy(); + ilbslocationinfoarray.Reset(); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_locationinfoconverter::?member_function +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +/* +TInt CTe_locationinfoconverter::?member_function( + CItemParser& aItem ) + { + + ?code + + } +*/ + +// ========================== OTHER EXPORTED FUNCTIONS ========================= +// None + +// [End of File] - Do not remove diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter/data/10287201.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter/data/10287201.rss Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: Resource file for movement detector plugin +* +*/ +// mydetector.rss +// +#include + +#include "TestLocationConverter.hrh" +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = KTestLocationConverterUid; +interfaces = + { + INTERFACE_INFO + { + interface_uid = KLbsLocInfoConverterPlugInInterfaceId; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KTestLocationConverterImplementationUid; + version_no = 1; + display_name = "Test location info converter"; + default_data = "text/ascii"; + opaque_data = "priority:2"; + } + }; + } + }; +} diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter/data/TestLocationConverter.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter/data/TestLocationConverter.hrh Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 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: Resource headers for project +* +*/ + + +#ifndef TESTLOCATIONCONVERTER_HRH +#define TESTLOCATIONCONVERTER_HRH + +#define KTestLocationConverterUid 0x2002150C +#define KTestLocationConverterImplementationUid 0x2002150D + + +#endif // TESTLOCATIONCONVERTER_HRH diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter/group/TestLocationConverter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter/group/TestLocationConverter.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2007 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: Project definition file for project Cell Id movement detector +* +*/ + + +#include "../data/TestLocationConverter.hrh" + +TARGET TestLocationConverter.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KTestLocationConverterUid +VENDORID 0x2002140e + +CAPABILITY ALL -TCB + +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../data + +SOURCEPATH ../src +SOURCE TestLocationConverter.cpp + +START RESOURCE ../data/10287201.rss +TARGET TestLocationConverter.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY commdb.lib +LIBRARY flogger.lib +LIBRARY lbslocationinfoconverterplugin.lib +LIBRARY lbslocationinfodatatypes.lib +LIBRARY lbs.lib + +PAGED + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2006 - 2007 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: Build information file for project ?myapp +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTMMPFILES +TestLocationConverter.mmp + +// END OF FILE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter/inc/TestLocationConverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter/inc/TestLocationConverter.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2008 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: Definition of Movement Detection API +* +*/ + + +#ifndef C_TESTLOCATIONCONVERTER_H +#define C_TESTLOCATIONCONVERTER_H + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * CTestLocationConverter is an ECom plugin that implements CLbsLocInfoConversionPluginBase. + * + * This class is responsible for monitering movement of mobile based on + * GSM information available to mobile at any instant. + * + * @lib movementdetector.lib + * @since S60 v4.0 + */ +class CTestLocationConverter : public CLbsLocInfoConverterPluginBase + + { + +public: + + /** + * Loads a location info conveter and initalises it. + * + * @param[in] aObserver An observer for location conversion event. + * @param[in] aPluginArgs Agruements sent to conversion plugin. + * return Pointer to the new loation info converter.If module id is not specified + * default plug in will be loaded. + */ + static CTestLocationConverter* NewL( TLbsLocInfoConverterPluginParams& aPluginParams ); + + /** + * Unloads this movement detector. + * + * @since S60 TACO + */ + virtual ~CTestLocationConverter(); + + // From CLbsLocInfoConversionPluginBase + + /** + * Converts the area informations of a group of geographical locations + * to its corresponding position information. + * + * @param[in] aLocationInfoArray Array of location informations corresponding + * to geographical locations are passed and on successful completion of this + * method,position information corresponding to the loation informations are + * updated in each area info object. + * @param[in] aConversionPrefs Conversion preferences suggested by client. + * + * @leave KErrArgument If the location info array is empty. + */ + virtual void ConvertLocationInfoL( + RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Cancels get location info operation. + */ + virtual void CancelConvertLocationInfo(); + + virtual void ValidateClient( const TSecureId& aSecureId, + const TVendorId& aVendorId, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + virtual void CancelValidateClient(); + + virtual void ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ); + +private: + + + void ConstructL(TLbsLocInfoConverterPluginParams& aPluginParams); + + /** + * Default C++ Constructor + */ + CTestLocationConverter(TLbsLocInfoConverterPluginParams& aParams); + +private: // data + + MLbsLocInfoConverterPluginObserver &iObserver; + TBool iRetainLocalityInCache; + }; + + +#endif // C_TESTLOCATIONCONVERTER_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter/src/TestLocationConverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter/src/TestLocationConverter.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2008 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: Definition of CdummyMvmtDet class. +* +*/ + + + +#include +#include +#include +#include "TestLocationConverter.h" + +// the test code sets the timing advance in the GSM vell info to this value +// which instructs the test converter to constuct TLocalitys with +// latitude ser to country code, longitude set to +// network code and altitiude set to local area code +const TInt KTimingAdvanceSpecialValue= 254; + +const TInt KTimingAdvanceSaveToCacheTrue= 253; + +const TInt KTimingAdvanceSaveToCacheFalse= 252; + +// ECOM implementation specifics +static const TImplementationProxy implTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x2002150D, CTestLocationConverter::NewL) + }; + + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(implTable) / sizeof(TImplementationProxy); + + return implTable; + } + + +// Class methods + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::NewL +// Symbian Two - phase constructor +//------------------------------------------------------------ +// +CTestLocationConverter* CTestLocationConverter::NewL( TLbsLocInfoConverterPluginParams& aParams) + { + CTestLocationConverter* self = new (ELeave) CTestLocationConverter(aParams); + CleanupStack::PushL(self); + self->ConstructL(aParams); + CleanupStack::Pop(); + return self; + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConstructL +//------------------------------------------------------------ +// +void CTestLocationConverter::ConstructL( TLbsLocInfoConverterPluginParams& /*aParams*/ ) + { + + + } + + +//----------------------------------------------------------------- +// CLbsLocInfoConversionPluginBase::CLbsLocInfoConversionPluginBase +// C++ Default constructor +//------------------------------------------------------------------ +// +CTestLocationConverter::CTestLocationConverter(TLbsLocInfoConverterPluginParams& aParams):iObserver(aParams.Observer()), + iRetainLocalityInCache(ETrue) + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::~CLbsLocInfoConversionPluginBase +// Destructor +//------------------------------------------------------------ +// +CTestLocationConverter::~CTestLocationConverter() + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CTestLocationConverter::ConvertLocationInfoL( RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs /*aConversionPrefs*/, + const TLbsConversionOutputInfoMask aRequestedInfo) + { + if(aRequestedInfo == ELbsConversionOutputNotDefined) + { + iObserver.OnConversionComplete(KErrArgument); + return; + } + TInt count = aLocationInfoArray.Count(); + for(TInt i=0 ; iGetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + + + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + // + CLbsGsmCellInfo* posInfo = static_cast( areaInfoArray[0] ); + + TInt timingAdvance = posInfo->TimingAdvance(); + + TLocality locality; + if (timingAdvance == KTimingAdvanceSpecialValue) + { + TReal64 lat = posInfo->MobileCountryCode() ; + TReal64 lng = posInfo->MobileNetworkCode(); + TReal32 alt = posInfo->LocationAreaCode(); + locality.SetCoordinate( lat,lng, alt); + } + else + { + locality.SetCoordinate( 82.5285,35.9385, 2.22f); + } + +// if (timingAdvance == KTimingAdvanceSaveToCacheTrue) +// { +// TReal64 lat = posInfo->MobileCountryCode() ; +// TReal64 lng = posInfo->MobileNetworkCode(); +// TReal32 alt = posInfo->LocationAreaCode(); +// locality.SetCoordinate( lat,lng, alt); +// iRetainLocalityInCache = ETrue; +// } +// else if (timingAdvance == KTimingAdvanceSaveToCacheFalse) +// { +// TReal64 lat = posInfo->MobileCountryCode() ; +// TReal64 lng = posInfo->MobileNetworkCode(); +// TReal32 alt = posInfo->LocationAreaCode(); +// locality.SetCoordinate( lat,lng, alt); +// iRetainLocalityInCache = EFalse; +// } + + if (timingAdvance == KTimingAdvanceSaveToCacheFalse) + { + TReal64 lat = posInfo->MobileCountryCode(); + TReal64 lng = posInfo->MobileNetworkCode(); + TReal32 alt = posInfo->LocationAreaCode(); + locality.SetCoordinate(lat, lng, alt); + iRetainLocalityInCache = EFalse; + } + else + { + iRetainLocalityInCache = ETrue; + } + + + areaInfoArray.ResetAndDestroy(); + + locality.SetAccuracy( 100,0.0 ); + CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); + CleanupStack::PushL( positionInfo ); + aLocationInfoArray[i]->AddAreaInfoL( positionInfo ); + CleanupStack::Pop( positionInfo ); + break; + } + case ELbsConversionOutputGsm: + { + // Extract the area info provided by the client. + // If client has specified only gsm info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsWcdmaInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 200,201,202,203); + CleanupStack::PushL( gsmCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( gsmCellInfo ); + CleanupStack::Pop( gsmCellInfo ); + break; + } + case ELbsConversionOutputWcdma: + { + // Extract the area info provided by the client. + // If client has specified only wcdma info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 200,201,202 ); + CleanupStack::PushL( wcdmaCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( wcdmaCellInfo ); + CleanupStack::Pop( wcdmaCellInfo ); + break; + } + case ELbsConversionOutputWlan: + { + // Extract the area info provided by the client. + // If client has specified only wlan info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWcdmaInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + TLbsWlanMacAddress macAddress(_L8("10.0.1")); + CLbsWlanInfo* WlanInfo = CLbsWlanInfo::NewL( macAddress,10.1); + CleanupStack::PushL( WlanInfo ); + aLocationInfoArray[i]->AddAreaInfoL( WlanInfo ); + CleanupStack::Pop( WlanInfo ); + } + default: + break; + } + + } + iObserver.OnConversionComplete(KErrNone); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CTestLocationConverter::CancelConvertLocationInfo( ) + { + + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CTestLocationConverter::ValidateClient( const TSecureId& /*aSecureId*/, + const TVendorId& /*aVendorId*/, + const TLbsConversionOutputInfoMask /*aRequestedInfo*/ ) + { + iObserver.OnValidationComplete( KErrNone ); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CTestLocationConverter::CancelValidateClient() + { + + } + +//------------------------------------------------------------ +// CExampleLocationConverter::ConversionPluginPreferences +//------------------------------------------------------------ +// +void CTestLocationConverter::ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ) + { + aPluginInfo.SetIsPluginPositionToBeCached(iRetainLocalityInCache); + //aPluginInfo.SetIsPluginPositionToBeCached(ETrue); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter2/data/10287201.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter2/data/10287201.rss Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: Resource file for movement detector plugin +* +*/ +// mydetector.rss +// +#include + +#include "TestLocationConverter2.hrh" +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = KTestLocationConverter2Uid; +interfaces = + { + INTERFACE_INFO + { + interface_uid = KLbsLocInfoConverterPlugInInterfaceId; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KTestLocationConverter2ImplementationUid; + version_no = 1; + display_name = "Test location info converter 2"; + default_data = "text/ascii"; + opaque_data = "priority:3"; + } + }; + } + }; +} diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter2/data/TestLocationConverter2.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter2/data/TestLocationConverter2.hrh Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 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: Resource headers for project +* +*/ + + +#ifndef TESTLOCATIONCONVERTER2_HRH +#define TESTLOCATIONCONVERTER2_HRH + +#define KTestLocationConverter2Uid 0x2002160C +#define KTestLocationConverter2ImplementationUid 0x2002160D + + +#endif // TESTLOCATIONCONVERTER2_HRH diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter2/group/TestLocationConverter2.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter2/group/TestLocationConverter2.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2007 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: Project definition file for project Cell Id movement detector +* +*/ + + +#include "../data/TestLocationConverter2.hrh" + +TARGET TestLocationConverter2.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KTestLocationConverter2Uid +VENDORID 0x70000001 + +CAPABILITY ALL -TCB + +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../data + +SOURCEPATH ../src +SOURCE TestLocationConverter2.cpp + +START RESOURCE ../data/10287201.rss +TARGET TestLocationConverter2.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY commdb.lib +LIBRARY flogger.lib +LIBRARY lbslocationinfoconverterplugin.lib +LIBRARY lbslocationinfodatatypes.lib +LIBRARY lbs.lib + +PAGED + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter2/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter2/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2006 - 2007 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: Build information file for project ?myapp +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTMMPFILES +TestLocationConverter2.mmp + +// END OF FILE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter2/inc/TestLocationConverter2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter2/inc/TestLocationConverter2.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2008 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: Definition of Movement Detection API +* +*/ + + +#ifndef C_TESTLOCATIONCONVERTER2_H +#define C_TESTLOCATIONCONVERTER2_H + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * CTestLocationConverter is an ECom plugin that implements CLbsLocInfoConversionPluginBase. + * + * This class is responsible for monitering movement of mobile based on + * GSM information available to mobile at any instant. + * + * @lib movementdetector.lib + * @since S60 v4.0 + */ +class CTestLocationConverter2 : public CLbsLocInfoConverterPluginBase + + { + +public: + + /** + * Loads a location info conveter and initalises it. + * + * @param[in] aObserver An observer for location conversion event. + * @param[in] aPluginArgs Agruements sent to conversion plugin. + * return Pointer to the new loation info converter.If module id is not specified + * default plug in will be loaded. + */ + static CTestLocationConverter2* NewL( TLbsLocInfoConverterPluginParams& aPluginParams ); + + /** + * Unloads this movement detector. + * + * @since S60 TACO + */ + virtual ~CTestLocationConverter2(); + + // From CLbsLocInfoConversionPluginBase + + /** + * Converts the area informations of a group of geographical locations + * to its corresponding position information. + * + * @param[in] aLocationInfoArray Array of location informations corresponding + * to geographical locations are passed and on successful completion of this + * method,position information corresponding to the loation informations are + * updated in each area info object. + * @param[in] aConversionPrefs Conversion preferences suggested by client. + * + * @leave KErrArgument If the location info array is empty. + */ + virtual void ConvertLocationInfoL( + RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Cancels get location info operation. + */ + virtual void CancelConvertLocationInfo(); + + virtual void ValidateClient( const TSecureId& aSecureId, + const TVendorId& aVendorId, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + virtual void CancelValidateClient(); + + virtual void ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ); + +private: + + + void ConstructL(TLbsLocInfoConverterPluginParams& aPluginParams); + + /** + * Default C++ Constructor + */ + CTestLocationConverter2(TLbsLocInfoConverterPluginParams& aParams); + +private: // data + + MLbsLocInfoConverterPluginObserver &iObserver; + TBool iRetainLocalityInCache; + }; + + +#endif // C_TESTLOCATIONCONVERTER2_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter2/src/TestLocationConverter2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter2/src/TestLocationConverter2.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2008 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: Definition of CdummyMvmtDet class. +* +*/ + + + +#include +#include +#include +#include "TestLocationConverter2.h" + +// the test code sets the timing advance in the GSM vell info to this value +// which instructs the test converter to constuct TLocalitys with +// latitude ser to country code, longitude set to +// network code and altitiude set to local area code +const TInt KTimingAdvanceSpecialValue= 254; + +const TInt KTimingAdvanceSaveToCacheTrue= 253; + +const TInt KTimingAdvanceSaveToCacheFalse= 252; + +// ECOM implementation specifics +static const TImplementationProxy implTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x2002160D, CTestLocationConverter2::NewL) + }; + + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(implTable) / sizeof(TImplementationProxy); + + return implTable; + } + + +// Class methods + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::NewL +// Symbian Two - phase constructor +//------------------------------------------------------------ +// +CTestLocationConverter2* CTestLocationConverter2::NewL( TLbsLocInfoConverterPluginParams& aParams) + { + CTestLocationConverter2* self = new (ELeave) CTestLocationConverter2(aParams); + CleanupStack::PushL(self); + self->ConstructL(aParams); + CleanupStack::Pop(); + return self; + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConstructL +//------------------------------------------------------------ +// +void CTestLocationConverter2::ConstructL( TLbsLocInfoConverterPluginParams& /*aParams*/ ) + { + + + } + + +//----------------------------------------------------------------- +// CLbsLocInfoConversionPluginBase::CLbsLocInfoConversionPluginBase +// C++ Default constructor +//------------------------------------------------------------------ +// +CTestLocationConverter2::CTestLocationConverter2(TLbsLocInfoConverterPluginParams& aParams):iObserver(aParams.Observer()), + iRetainLocalityInCache(ETrue) + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::~CLbsLocInfoConversionPluginBase +// Destructor +//------------------------------------------------------------ +// +CTestLocationConverter2::~CTestLocationConverter2() + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CTestLocationConverter2::ConvertLocationInfoL( RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs /*aConversionPrefs*/, + const TLbsConversionOutputInfoMask aRequestedInfo) + { + if(aRequestedInfo == ELbsConversionOutputNotDefined) + { + iObserver.OnConversionComplete(KErrArgument); + return; + } + TInt count = aLocationInfoArray.Count(); + for(TInt i=0 ; iGetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + + + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + // + CLbsGsmCellInfo* posInfo = static_cast( areaInfoArray[0] ); + + TInt timingAdvance = posInfo->TimingAdvance(); + + TLocality locality; + if (timingAdvance == KTimingAdvanceSpecialValue) + { + TReal64 lat = posInfo->MobileCountryCode() ; + TReal64 lng = posInfo->MobileNetworkCode(); + TReal32 alt = posInfo->LocationAreaCode(); + locality.SetCoordinate( lat,lng, alt); + } + else + { + locality.SetCoordinate( 62.5285,23.9385, 1.22f); + } + +// if (timingAdvance == KTimingAdvanceSaveToCacheTrue) +// { +// TReal64 lat = posInfo->MobileCountryCode() ; +// TReal64 lng = posInfo->MobileNetworkCode(); +// TReal32 alt = posInfo->LocationAreaCode(); +// locality.SetCoordinate( lat,lng, alt); +// iRetainLocalityInCache = ETrue; +// } +// else if (timingAdvance == KTimingAdvanceSaveToCacheFalse) +// { +// TReal64 lat = posInfo->MobileCountryCode() ; +// TReal64 lng = posInfo->MobileNetworkCode(); +// TReal32 alt = posInfo->LocationAreaCode(); +// locality.SetCoordinate( lat,lng, alt); +// iRetainLocalityInCache = EFalse; +// } + + if (timingAdvance == KTimingAdvanceSaveToCacheFalse) + { + TReal64 lat = posInfo->MobileCountryCode(); + TReal64 lng = posInfo->MobileNetworkCode(); + TReal32 alt = posInfo->LocationAreaCode(); + locality.SetCoordinate(lat, lng, alt); + iRetainLocalityInCache = EFalse; + } + else + { + iRetainLocalityInCache = ETrue; + } + + + areaInfoArray.ResetAndDestroy(); + + locality.SetAccuracy( 100,0.0 ); + CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); + CleanupStack::PushL( positionInfo ); + aLocationInfoArray[i]->AddAreaInfoL( positionInfo ); + CleanupStack::Pop( positionInfo ); + break; + } + case ELbsConversionOutputGsm: + { + // Extract the area info provided by the client. + // If client has specified only gsm info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsWcdmaInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 100,101,102,103); + CleanupStack::PushL( gsmCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( gsmCellInfo ); + CleanupStack::Pop( gsmCellInfo ); + break; + } + case ELbsConversionOutputWcdma: + { + // Extract the area info provided by the client. + // If client has specified only wcdma info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 100,101,102 ); + CleanupStack::PushL( wcdmaCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( wcdmaCellInfo ); + CleanupStack::Pop( wcdmaCellInfo ); + break; + } + case ELbsConversionOutputWlan: + { + // Extract the area info provided by the client. + // If client has specified only wlan info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWcdmaInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + TLbsWlanMacAddress macAddress(_L8("10.0.1")); + CLbsWlanInfo* WlanInfo = CLbsWlanInfo::NewL( macAddress,10.1); + CleanupStack::PushL( WlanInfo ); + aLocationInfoArray[i]->AddAreaInfoL( WlanInfo ); + CleanupStack::Pop( WlanInfo ); + } + default: + break; + } + + } + iObserver.OnConversionComplete(KErrNone); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CTestLocationConverter2::CancelConvertLocationInfo( ) + { + + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CTestLocationConverter2::ValidateClient( const TSecureId& /*aSecureId*/, + const TVendorId& /*aVendorId*/, + const TLbsConversionOutputInfoMask /*aRequestedInfo*/ ) + { + iObserver.OnValidationComplete( KErrNone ); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CTestLocationConverter2::CancelValidateClient() + { + + } + +//------------------------------------------------------------ +// CExampleLocationConverter::ConversionPluginPreferences +//------------------------------------------------------------ +// +void CTestLocationConverter2::ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ) + { + aPluginInfo.SetIsPluginPositionToBeCached(iRetainLocalityInCache); + //aPluginInfo.SetIsPluginPositionToBeCached(ETrue); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter3/data/10287201.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter3/data/10287201.rss Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: Resource file for movement detector plugin +* +*/ +// mydetector.rss +// +#include + +#include "TestLocationConverter3.hrh" +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = KTestLocationConverter3Uid; +interfaces = + { + INTERFACE_INFO + { + interface_uid = KLbsLocInfoConverterPlugInInterfaceId; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KTestLocationConverter3ImplementationUid; + version_no = 1; + display_name = "Test location info converter 3"; + default_data = "text/ascii"; + opaque_data = "priority:1"; + } + }; + } + }; +} diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter3/data/TestLocationConverter3.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter3/data/TestLocationConverter3.hrh Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 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: Resource headers for project +* +*/ + + +#ifndef TESTLOCATIONCONVERTER3_HRH +#define TESTLOCATIONCONVERTER3_HRH + +#define KTestLocationConverter3Uid 0x2002170C +#define KTestLocationConverter3ImplementationUid 0x2002170D + + +#endif // TESTLOCATIONCONVERTER3_HRH diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter3/group/TestLocationConverter3.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter3/group/TestLocationConverter3.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-2007 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: Project definition file for project Cell Id movement detector +* +*/ + + +#include "../data/TestLocationConverter3.hrh" + +TARGET TestLocationConverter3.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KTestLocationConverter3Uid +VENDORID 0x70000001 + +CAPABILITY ALL -TCB + +OS_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../data + +SOURCEPATH ../src +SOURCE TestLocationConverter3.cpp + +START RESOURCE ../data/10287201.rss +TARGET TestLocationConverter3.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY commdb.lib +LIBRARY flogger.lib +LIBRARY lbslocationinfoconverterplugin.lib +LIBRARY lbslocationinfodatatypes.lib +LIBRARY lbs.lib + +PAGED + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter3/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter3/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2006 - 2007 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: Build information file for project ?myapp +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTMMPFILES +TestLocationConverter3.mmp + +// END OF FILE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter3/inc/TestLocationConverter3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter3/inc/TestLocationConverter3.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2008 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: Definition of Movement Detection API +* +*/ + + +#ifndef C_TESTLOCATIONCONVERTER3_H +#define C_TESTLOCATIONCONVERTER3_H + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * CTestLocationConverter is an ECom plugin that implements CLbsLocInfoConversionPluginBase. + * + * This class is responsible for monitering movement of mobile based on + * GSM information available to mobile at any instant. + * + * @lib movementdetector.lib + * @since S60 v4.0 + */ +class CTestLocationConverter3 : public CLbsLocInfoConverterPluginBase + + { + +public: + + /** + * Loads a location info conveter and initalises it. + * + * @param[in] aObserver An observer for location conversion event. + * @param[in] aPluginArgs Agruements sent to conversion plugin. + * return Pointer to the new loation info converter.If module id is not specified + * default plug in will be loaded. + */ + static CTestLocationConverter3* NewL( TLbsLocInfoConverterPluginParams& aPluginParams ); + + /** + * Unloads this movement detector. + * + * @since S60 TACO + */ + virtual ~CTestLocationConverter3(); + + // From CLbsLocInfoConversionPluginBase + + /** + * Converts the area informations of a group of geographical locations + * to its corresponding position information. + * + * @param[in] aLocationInfoArray Array of location informations corresponding + * to geographical locations are passed and on successful completion of this + * method,position information corresponding to the loation informations are + * updated in each area info object. + * @param[in] aConversionPrefs Conversion preferences suggested by client. + * + * @leave KErrArgument If the location info array is empty. + */ + virtual void ConvertLocationInfoL( + RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs aConversionPrefs, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + /** + * Cancels get location info operation. + */ + virtual void CancelConvertLocationInfo(); + + virtual void ValidateClient( const TSecureId& aSecureId, + const TVendorId& aVendorId, + const TLbsConversionOutputInfoMask aRequestedInfo ); + + virtual void CancelValidateClient(); + + virtual void ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ); + +private: + + + void ConstructL(TLbsLocInfoConverterPluginParams& aPluginParams); + + /** + * Default C++ Constructor + */ + CTestLocationConverter3(TLbsLocInfoConverterPluginParams& aParams); + +private: // data + + MLbsLocInfoConverterPluginObserver &iObserver; + TBool iRetainLocalityInCache; + }; + + +#endif // C_TESTLOCATIONCONVERTER3_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/TestLocationConverter3/src/TestLocationConverter3.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/TestLocationConverter3/src/TestLocationConverter3.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2008 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: Definition of CdummyMvmtDet class. +* +*/ + + + +#include +#include +#include +#include "TestLocationConverter3.h" + +// the test code sets the timing advance in the GSM vell info to this value +// which instructs the test converter to constuct TLocalitys with +// latitude ser to country code, longitude set to +// network code and altitiude set to local area code +const TInt KTimingAdvanceSpecialValue= 254; + +const TInt KTimingAdvanceSaveToCacheTrue= 253; + +const TInt KTimingAdvanceSaveToCacheFalse= 252; + +// ECOM implementation specifics +static const TImplementationProxy implTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x2002170D, CTestLocationConverter3::NewL) + }; + + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(implTable) / sizeof(TImplementationProxy); + + return implTable; + } + + +// Class methods + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::NewL +// Symbian Two - phase constructor +//------------------------------------------------------------ +// +CTestLocationConverter3* CTestLocationConverter3::NewL( TLbsLocInfoConverterPluginParams& aParams) + { + CTestLocationConverter3* self = new (ELeave) CTestLocationConverter3(aParams); + CleanupStack::PushL(self); + self->ConstructL(aParams); + CleanupStack::Pop(); + return self; + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConstructL +//------------------------------------------------------------ +// +void CTestLocationConverter3::ConstructL( TLbsLocInfoConverterPluginParams& /*aParams*/ ) + { + + + } + + +//----------------------------------------------------------------- +// CLbsLocInfoConversionPluginBase::CLbsLocInfoConversionPluginBase +// C++ Default constructor +//------------------------------------------------------------------ +// +CTestLocationConverter3::CTestLocationConverter3(TLbsLocInfoConverterPluginParams& aParams):iObserver(aParams.Observer()), + iRetainLocalityInCache(ETrue) + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::~CLbsLocInfoConversionPluginBase +// Destructor +//------------------------------------------------------------ +// +CTestLocationConverter3::~CTestLocationConverter3() + { + + } + + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CTestLocationConverter3::ConvertLocationInfoL( RLbsLocationInfoArray& aLocationInfoArray, + const TLbsConversionPrefs /*aConversionPrefs*/, + const TLbsConversionOutputInfoMask aRequestedInfo) + { + if(aRequestedInfo == ELbsConversionOutputNotDefined) + { + iObserver.OnConversionComplete(KErrArgument); + return; + } + TInt count = aLocationInfoArray.Count(); + for(TInt i=0 ; iGetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + + + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + // + CLbsGsmCellInfo* posInfo = static_cast( areaInfoArray[0] ); + + TInt timingAdvance = posInfo->TimingAdvance(); + + TLocality locality; + if (timingAdvance == KTimingAdvanceSpecialValue) + { + TReal64 lat = posInfo->MobileCountryCode() ; + TReal64 lng = posInfo->MobileNetworkCode(); + TReal32 alt = posInfo->LocationAreaCode(); + locality.SetCoordinate( lat,lng, alt); + } + else + { + locality.SetCoordinate( 62.5285,23.9385, 1.22f); + } + +// if (timingAdvance == KTimingAdvanceSaveToCacheTrue) +// { +// TReal64 lat = posInfo->MobileCountryCode() ; +// TReal64 lng = posInfo->MobileNetworkCode(); +// TReal32 alt = posInfo->LocationAreaCode(); +// locality.SetCoordinate( lat,lng, alt); +// iRetainLocalityInCache = ETrue; +// } +// else if (timingAdvance == KTimingAdvanceSaveToCacheFalse) +// { +// TReal64 lat = posInfo->MobileCountryCode() ; +// TReal64 lng = posInfo->MobileNetworkCode(); +// TReal32 alt = posInfo->LocationAreaCode(); +// locality.SetCoordinate( lat,lng, alt); +// iRetainLocalityInCache = EFalse; +// } + + if (timingAdvance == KTimingAdvanceSaveToCacheFalse) + { + TReal64 lat = posInfo->MobileCountryCode(); + TReal64 lng = posInfo->MobileNetworkCode(); + TReal32 alt = posInfo->LocationAreaCode(); + locality.SetCoordinate(lat, lng, alt); + iRetainLocalityInCache = EFalse; + } + else + { + iRetainLocalityInCache = ETrue; + } + + + areaInfoArray.ResetAndDestroy(); + + locality.SetAccuracy( 100,0.0 ); + CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); + CleanupStack::PushL( positionInfo ); + aLocationInfoArray[i]->AddAreaInfoL( positionInfo ); + CleanupStack::Pop( positionInfo ); + break; + } + case ELbsConversionOutputGsm: + { + // Extract the area info provided by the client. + // If client has specified only gsm info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsWcdmaInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 100,101,102,103); + CleanupStack::PushL( gsmCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( gsmCellInfo ); + CleanupStack::Pop( gsmCellInfo ); + break; + } + case ELbsConversionOutputWcdma: + { + // Extract the area info provided by the client. + // If client has specified only wcdma info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWlanInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 100,101,102 ); + CleanupStack::PushL( wcdmaCellInfo ); + aLocationInfoArray[i]->AddAreaInfoL( wcdmaCellInfo ); + CleanupStack::Pop( wcdmaCellInfo ); + break; + } + case ELbsConversionOutputWlan: + { + // Extract the area info provided by the client. + // If client has specified only wlan info, + // return KErrNotSupported. + RLbsAreaInfoBaseArray areaInfoArray; + CLbsLocationInfo::TAreaInfoMask areaInfoMask = 0; + areaInfoMask |= CLbsLocationInfo::ELbsPosInfo | + CLbsLocationInfo::ELbsGsmInfo | + CLbsLocationInfo::ELbsWcdmaInfo; + aLocationInfoArray[i]->GetAreaInfoL( areaInfoArray,areaInfoMask ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( count == 0 ) + { + iObserver.OnConversionComplete(KErrNotSupported); + return; + } + + TLbsWlanMacAddress macAddress(_L8("10.0.1")); + CLbsWlanInfo* WlanInfo = CLbsWlanInfo::NewL( macAddress,10.1); + CleanupStack::PushL( WlanInfo ); + aLocationInfoArray[i]->AddAreaInfoL( WlanInfo ); + CleanupStack::Pop( WlanInfo ); + } + default: + break; + } + + } + iObserver.OnConversionComplete(KErrNone); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ConvertLocationInfoL +//------------------------------------------------------------ +// +void CTestLocationConverter3::CancelConvertLocationInfo( ) + { + + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CTestLocationConverter3::ValidateClient( const TSecureId& /*aSecureId*/, + const TVendorId& /*aVendorId*/, + const TLbsConversionOutputInfoMask /*aRequestedInfo*/ ) + { + iObserver.OnValidationComplete( KErrNone ); + } + +//------------------------------------------------------------ +// CLbsLocInfoConversionPluginBase::ValidateClient +//------------------------------------------------------------ +// +void CTestLocationConverter3::CancelValidateClient() + { + + } + +//------------------------------------------------------------ +// CExampleLocationConverter::ConversionPluginPreferences +//------------------------------------------------------------ +// +void CTestLocationConverter3::ConversionPluginPreferences( + TLbsConversionPluginInfo& aPluginInfo ) + { + aPluginInfo.SetIsPluginPositionToBeCached(iRetainLocalityInCache); + //aPluginInfo.SetIsPluginPositionToBeCached(ETrue); + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,32 @@ +// Copyright (c) 2002-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: +// + +PRJ_EXPORTS + +PRJ_TESTEXPORTS +../scripts/te_geolocmonitorsuite.script c:/testdata/scripts/te_geolocmonitorsuite.script +../testdata/te_geolocmonitorsuite.ini c:/testdata/configs/te_geolocmonitorsuite.ini + +../testdata/lbsgeolocmonunitconfig.txt c:/testdata/configs/lbsgeolocmonunitconfig.txt +../testdata/lbsgeolocmonunitconfigbad.txt c:/testdata/configs/lbsgeolocmonunitconfigbad.txt + +./te_geolocmonitorsuite.iby /epoc32/rom/include/te_geolocmonitorsuite.iby + + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +//#include "../../testlocationmonitor/group/bld.inf" +te_geolocmonitorsuite.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/group/te_geolocmonitorsuite.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/group/te_geolocmonitorsuite.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: +* +*/ + +#ifndef __TE_SUPLPROTOCOL_SUITE_IBY__ +#define __TE_SUPLPROTOCOL_SUITE_IBY__ + +#include + +file=ABI_DIR\DEBUG_DIR\te_geolocmonitorsuite.exe sys\bin\te_geolocmonitorsuite.exe +data=EPOCROOT##Epoc32\data\c\TestData\scripts\te_geolocmonitorsuite.script TestData\scripts\te_geolocmonitorsuite.script +data=EPOCROOT##Epoc32\data\c\TestData\configs\lbsgeolocmonunitconfig.txt TestData\configs\lbslocmonunitconfig.txt + + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/group/te_geolocmonitorsuite.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/group/te_geolocmonitorsuite.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,77 @@ +/* +* 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: +* +*/ + + +TARGET te_geolocmonitorsuite.exe +TARGETTYPE exe +UID 0x1000007A 0x102869E3 + +CAPABILITY ALL -TCB +MACRO ENABLE_LBS_DEV_LOGGER +SOURCEPATH ../src + +//test steps +SOURCE te_geolocmonitorsuiteserver.cpp +SOURCE te_geolocmonitorstepbase.cpp +SOURCE te_geolocmonitorstep1.cpp +SOURCE te_geolocmonitorstep2.cpp +SOURCE te_geolocmonitorstep3.cpp +SOURCE te_geolocmonitorstep4.cpp +SOURCE te_geolocmonitorstep5.cpp +SOURCE te_geolocmonitorstep6.cpp +SOURCE te_geolocmonitorstep7.cpp +SOURCE LocInfoConversionHandler.cpp + + +// test step headers +USERINCLUDE ../inc + +// Test step headers +USERINCLUDE ../src + +// Required to start up the fake/test Location Monitor server + +// Various LBS subsystem headers +USERINCLUDE ../../../lbslocmonitorapis/CommonClientServerApi/inc +USERINCLUDE ../../../lbslocmonitorserver/inc +USERINCLUDE ../../../../locationcore/LbsInternalApi/inc +USERINCLUDE ../../../../locationcore/LbsNetInternalApi/inc +USERINCLUDE ../../../../locationcore/LbsLocDataSource +USERINCLUDE ../../../../locationcore/LbsLocCommon/ServerFramework/inc +USERINCLUDE ../../../../locationcore/LbsPartnerCommon/inc +USERINCLUDE ../../../../locationcore/LbsPartnerCommon/inc +USERINCLUDE ../../../../locationcore/LbsCommonInternalDataTypes/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY estor.lib +LIBRARY euser.lib +LIBRARY testexecuteutils.lib +LIBRARY testexecutelogclient.lib +LIBRARY efsrv.lib + +LIBRARY lbsinternalapi.lib +LIBRARY lbsnetinternalapi.lib +LIBRARY lbsnetprotocol.lib + +LIBRARY lbslocmonclient.lib +LIBRARY lbs.lib +LIBRARY lbspartnercommon.lib +LIBRARY lbslocationinfodatatypes.lib + + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/LocInfoConversionHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/LocInfoConversionHandler.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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: STIF testclass declaration +* +*/ + +#ifndef LOCINFOCONVERSIONHANDLER_H_ +#define LOCINFOCONVERSIONHANDLER_H_ + +#include + +class CLocInfoConversionHandler : public CActive + { +public: + static CLocInfoConversionHandler* NewL(); + + ~CLocInfoConversionHandler(); + + void Start(); +protected: // from CActive + void RunL(); + void DoCancel(); + +private: + CLocInfoConversionHandler(); + + void ConstructL(); + }; + +#endif /*LOCINFOCONVERSIONHANDLER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep1.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,50 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep1.h +*/ +#ifndef TE_LOCMONITORSTEP1_H +#define TE_LOCMONITORSTEP1_H + +#include +#include "te_geolocmonitorstepbase.h" + +class CTe_LocMonitorStep1 : public CTe_LocMonitorStepBase + { +public: + CTe_LocMonitorStep1(); + ~CTe_LocMonitorStep1(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + TInt TestValidateGSMInfoL(TInt iMCC, TInt iMNC, TInt iLAC, TInt iCI, TInt iTA); + void CTe_LocMonitorStep1::ReadIniFileValues(); + + TInt iMCC; + TInt iMNC; + TInt iLAC; + TInt iCID; + TInt iTA; + TInt iExpectedError; +private: + }; + +_LIT(KLocMonitorStep1,"te_locmonitorstep1"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep2.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,55 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep2.h +*/ +#ifndef TE_LOCMONITORSTEP2_H +#define TE_LOCMONITORSTEP2_H + +#include +#include "te_geolocmonitorstepbase.h" + +class CTe_LocMonitorStep2 : public CTe_LocMonitorStepBase + { +public: + CTe_LocMonitorStep2(); + ~CTe_LocMonitorStep2(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + TInt TestValidateWCDMAInfoL(TInt iMCC, TInt iMNC, TInt iUCID, TInt iSC); + void ReadIniFileValues(); + + TInt iMCC; + TInt iMNC; + TInt iLAC; + TInt iUCID; + TInt iSC; + TInt iExpectedError; + +private: + + TPositionSatelliteInfo* iPosition; + TPositionAreaExtendedInfo* iAreaInfo; + TPosAreaReqParams* iAreaReqParams; + }; + +_LIT(KLocMonitorStep2,"te_locmonitorstep2"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep3.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,49 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep3.h +*/ +#ifndef TE_LOCMONITORSTEP3_H +#define TE_LOCMONITORSTEP3_H + +#include +#include "te_geolocmonitorstepbase.h" + +class CTe_LocMonitorStep3 : public CTe_LocMonitorStepBase + { + +public: + + CTe_LocMonitorStep3(); + ~CTe_LocMonitorStep3(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + TInt CTe_LocMonitorStep3::TestLocInfoAddCoordL(); +private: + + TPositionInfo* iPosition; + TPositionAreaInfo* iAreaInfo; + TPosAreaReqParams* iAreaReqParams; + + }; + +_LIT(KLocMonitorStep3,"te_locmonitorstep3"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep4.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,71 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep4.h +*/ +#ifndef TE_LOCMONITORSTEP4_H +#define TE_LOCMONITORSTEP4_H + +#include +#include "te_geolocmonitorstepbase.h" + +class CTe_LocMonitorStep4 : public CTe_LocMonitorStepBase + { + +public: + + CTe_LocMonitorStep4(); + ~CTe_LocMonitorStep4(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + + void CTe_LocMonitorStep4::ReadIniFileValues(); + + TInt CTe_LocMonitorStep4::TestLocInfoAddWlanL(); + TInt CTe_LocMonitorStep4::TestLocInfoAddWcdmaCellL(); + TInt CTe_LocMonitorStep4::TestLocInfoAddGsmCellL(); + TInt CTe_LocMonitorStep4::TestValidateWlanInfoL(); + TInt CTe_LocMonitorStep4::TestWlanNewL(); + TInt CTe_LocMonitorStep4::TestValidateCoordInfoL(); + TInt CTe_LocMonitorStep4::TestCoordNewL(); + TInt CTe_LocMonitorStep4::TestValidateWCDMAInfoHierarchyL(); + TInt CTe_LocMonitorStep4::TestWcdmaAddNCellL(); + TInt CTe_LocMonitorStep4::TestWcdmaSetSC(); + TInt CTe_LocMonitorStep4::TestWcdmaNewL(); + TInt CTe_LocMonitorStep4::TestValidateGSMInfoHierarchyL(); + TInt CTe_LocMonitorStep4::TestGSMAddNCellL(); + TInt CTe_LocMonitorStep4::TestGSMSetRxLev(); + TInt CTe_LocMonitorStep4::TestGSMSetTA(); + TInt CTe_LocMonitorStep4::TestGSMNewL(); + TInt CTe_LocMonitorStep4::TestLocInfoAddCoordL(); + + TInt iProcedure; + +private: + + TPositionInfo* iPosition; + TPositionAreaInfo* iAreaInfo; + TPosAreaReqParams* iAreaReqParams; + + }; + +_LIT(KLocMonitorStep4,"te_locmonitorstep4"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep5.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,74 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep5.h +*/ +#ifndef TE_LOCMONITORSTEP5_H +#define TE_LOCMONITORSTEP5_H + +#include +#include "te_geolocmonitorstepbase.h" +#include +#include +#include +#include "LocInfoConversionHandler.h" + +class CTe_LocMonitorStep5 : public CTe_LocMonitorStepBase + { + +public: + CTe_LocMonitorStep5(); + ~CTe_LocMonitorStep5(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + + TInt RLbsLocInfoConverter_Connect1L(); + TInt RLbsLocInfoConverter_Connect2L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo1L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo2L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo3L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo4L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo5L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo6L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo7L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo8L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo9L(); + TInt RLbsLocInfoConverter_ConvertLocationInfo10L(); + TInt RLbsLocInfoConverter_Cancel1L(); + TInt RLbsLocInfoConverter_Cancel2L(); + TInt RLbsLocInfoConverter_Cancel3L(); + TInt RLbsLocInfoConverter_Cancel4L(); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + + +private: // Data + CLocInfoConversionHandler* iConversionHandler; + + CLocInfoConversionHandler* iConversionHandler1; + }; + +_LIT(KLocMonitorStep5,"te_locmonitorstep5"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep6.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,59 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorStep6.h +*/ +#ifndef TE_LOCMONITORSTEP6_H +#define TE_LOCMONITORSTEP6_H + +#include +#include "te_geolocmonitorstepbase.h" +#include +#include +#include +#include "LocInfoConversionHandler.h" + +class CTe_LocMonitorStep6 : public CTe_LocMonitorStepBase + { + +public: + CTe_LocMonitorStep6(); + ~CTe_LocMonitorStep6(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + + TInt RLbsLocInfoConverter_ConvertLocationInfo6L(); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + + +private: // Data + CLocInfoConversionHandler* iConversionHandler; + + CLocInfoConversionHandler* iConversionHandler1; + }; + +_LIT(KLocMonitorStep6,"te_locmonitorstep6"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep7.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstep7.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep7.h +*/ +#ifndef TE_LOCMONITORSTEP7_H +#define TE_LOCMONITORSTEP7_H + +#include +#include "te_geolocmonitorstepbase.h" +#include +#include +#include +#include "LocInfoConversionHandler.h" + +class CTe_LocMonitorStep7 : public CTe_LocMonitorStepBase + { + +public: + CTe_LocMonitorStep7(); + ~CTe_LocMonitorStep7(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + + TInt RLbsLocInfoConverter_ConvertLocationInfo7L(); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + +private: // Data + CLocInfoConversionHandler* iConversionHandler; + + CLocInfoConversionHandler* iConversionHandler1; + }; + +_LIT(KLocMonitorStep7,"te_locmonitorstep7"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstepbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorstepbase.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,112 @@ +/* +* 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: +* +*/ + + +/** + @file te_geolocmonitorstepbase.h +*/ + +#ifndef TE_LOCMONITORSTEPBASE_H +#define TE_LOCMONITORSTEPBASE_H +#include +#include +#include "lbstimer.h" +#include "rlbslocmonitorsession.h" +#include "rlbslocmonitorareapositioner.h" +#include "lbssatellite.h" +#include "lbsareainfo.h" +#include "lbslocmonitorserverdata.h" +#include "te_geolocmonitorsuitedefs.h" +#include "lbsinternalinterface.h" +#include "lbsnetinternalapi.h" + +#include +#include + + + +/**************************************************************************** +* Base Test Step class for te_geolocmonitorsuite test steps +* +****************************************************************************/ +class CTe_LocMonitorStepBase : public CTestStep + { + +public: + + enum TTestType + { + EPositive, + + ENegative + }; + + virtual ~CTe_LocMonitorStepBase(); + CTe_LocMonitorStepBase(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepPostambleL(); + + /** + * Helper methods. + */ + CLbsPositionInfo* CreatePositionInfoObjectLC(); + + CLbsGsmCellInfo* CreateGsmCellInfoObjectLC(); + + CLbsWcdmaCellInfo* CreateWcdmaCellInfoObjectLC(); + + CLbsWlanInfo* CreateWlanInfoObjectLC(); + + CLbsLocationInfo* CreateLocationInfoObjectLC( TLbsAreaInfoClassType aAreaType ); + + void AppendAreaInfoObjectToLocationInfoL( CLbsLocationInfo* aLocationInfo, + TLbsAreaInfoClassType aAreaType ); + + void CheckPositionConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + + void CheckGsmCellConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + + void CheckWcdmaCellConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + + void CheckWlanConvertedInfoL( CLbsLocationInfo* aLocationInfo, + TTestType aTestType = EPositive ); + + + +protected: + + +private: + + CActiveScheduler* iActiveScheduler; + }; + + +/************************************************************************** +* AO to wait for the Location Monitor database feedback (in a P&S property) +****************************************************************************/ + + + + + + + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorsuitedefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorsuitedefs.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,29 @@ +/* +* 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: +* This file define all the common values thoughout your test project +* +*/ + + +/** + @file te_geolocmonitorsuitedefs.h +*/ +#if (!defined TE_GEOLOCMONITORSUITEDEFS_H) +#define TE_GEOLOCMONITORSUITEDEFS_H + +// For test step panics +_LIT(KTe_geolocMonitorSuitePanic,"Te_geolocMonitorSuite"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorsuiteserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/inc/te_geolocmonitorsuiteserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: +* +*/ + + +#ifndef TE_GEOLOCMONITORSUITE_H +#define TE_GEOLOCMONITORSUITE_H + +#include +#include "lbsnetinternalapi.h" + +class CTe_GeoLocMonitorSuite : public CTestServer + { +public: + static CTe_GeoLocMonitorSuite* NewL(); + virtual CTestStep* CreateTestStep(const TDesC& aStepName); + virtual void ConstructL(const TDesC& aName); + ~CTe_GeoLocMonitorSuite(); + }; + +#endif // TE_GEOLOCMONITORSUITE_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/scripts/te_geolocmonitorsuite.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/scripts/te_geolocmonitorsuite.script Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,188 @@ +// +// 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: +// +//! @File +//! @SYMTestSuiteName te_geolocmonitorsuite.script +//! @SYMScriptTestEnvironment TEF + + +PRINT Run te_geolocmonitorsuite +LOAD_SUITE te_geolocmonitorsuite + +RUN_UTILS DeleteFile c:\config.txt +RUN_UTILS CopyFile c:\testdata\configs\lbsgeolocmonunitconfig.txt c:\config.txt + +START_TESTCASE LBS-LocMonitorSuite-0001 +//! @SYMTestCaseID LBS-LocMonitorSuite-0001 +//! @SYMTestCaseDesc +//! This test ensures that, +//! +//! +//! +//! @SYMTestPriority High +//! @SYMTestType UT +//! @SYMCreationDate +//! @SYMAuthor juanmr +//! @SYMTestStatus 2. Functional +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO1 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO2 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO3 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO4 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO5 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO6 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO7 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO8 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO9 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO10 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO11 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO12 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO13 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO14 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO15 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep1 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLINFO16 + + + +END_TESTCASE LBS-LocMonitorSuite-0001 + +START_TESTCASE LBS-LocMonitorSuite-0002 +//! @SYMTestCaseID LBS-LocMonitorSuite-0002 +//! @SYMTestCaseDesc +//! This test ensures that, +//! +//! +//! +//! @SYMTestPriority High +//! @SYMTestType UT +//! @SYMCreationDate +//! @SYMAuthor bw +//! @SYMTestStatus 2. Functional +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO1 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO2 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO3 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO4 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO5 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO6 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO7 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO8 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO9 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO10 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO11 +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep2 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLINFO12 + +END_TESTCASE LBS-LocMonitorSuite-0002 + + +START_TESTCASE LBS-LocMonitorSuite-0003 +//! @SYMTestCaseID LBS-LocMonitorSuite-0003 +//! @SYMTestCaseDesc +//! This test ensures that, +//! +//! +//! +//! @SYMTestPriority High +//! @SYMTestType UT +//! @SYMCreationDate +//! @SYMAuthor bw +//! @SYMTestStatus 2. Functional +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep3 +END_TESTCASE LBS-LocMonitorSuite-0003 + + +START_TESTCASE LBS-LocMonitorSuite-0004 +//! @SYMTestCaseID LBS-LocMonitorSuite-0004 +//! @SYMTestCaseDesc +//! This test ensures that, +//! +//! +//! +//! @SYMTestPriority High +//! @SYMTestType UT +//! @SYMCreationDate +//! @SYMAuthor bw +//! @SYMTestStatus 2. Functional +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini CREATEGSMCELL +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini SETTATOGSMCELL +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini SETNCELLTOGSMCELL +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEGSMCELLHIERARCHY +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini CREATEWCDMACELL +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini SETSCTOWCDMACELL +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini SETNCELLTOWCDMACELL +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWCDMACELLHIERARCHY +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini CREATECOORDINFO +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATECOORDINFO +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini CREATEWLANINFO +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini VALIDATEWLANINFO +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini ADDCOORDINFOTOLOCINFO +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini ADDGSMINFOTOLOCINFO +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini ADDWCDMAINFOTOLOCINFO +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep4 c:\testdata\configs\te_geolocmonitorsuite.ini ADDWLANINFOTOLOCINFO + +END_TESTCASE LBS-LocMonitorSuite-0004 + + + + +START_TESTCASE LBS-LocMonitorSuite-0005 +//! @SYMTestCaseID LBS-LocMonitorSuite-0005 +//! @SYMTestCaseDesc +//! This test ensures that, +//! +//! +//! +//! @SYMTestPriority High +//! @SYMTestType UT +//! @SYMCreationDate +//! @SYMAuthor bw +//! @SYMTestStatus 2. Functional + +RUN_TEST_STEP 20 te_geolocmonitorsuite te_locmonitorstep5 +END_TESTCASE LBS-LocMonitorSuite-0005 + +START_TESTCASE LBS-LocMonitorSuite-0006 +//! @SYMTestCaseID LBS-LocMonitorSuite-0006 +//! @SYMTestCaseDesc +//! This test ensures that, +//! +//! +//! +//! @SYMTestPriority High +//! @SYMTestType UT +//! @SYMCreationDate +//! @SYMAuthor bw +//! @SYMTestStatus 2. Functional + +RUN_TEST_STEP !PanicCode=0 20 te_geolocmonitorsuite te_locmonitorstep6 +END_TESTCASE LBS-LocMonitorSuite-0006 + + + +START_TESTCASE LBS-LocMonitorSuite-0007 +//! @SYMTestCaseID LBS-LocMonitorSuite-0007 +//! @SYMTestCaseDesc +//! This test ensures that, +//! +//! +//! +//! @SYMTestPriority High +//! @SYMTestType UT +//! @SYMCreationDate +//! @SYMAuthor bw +//! @SYMTestStatus 2. Functional + +RUN_TEST_STEP !PanicCode=0 20 te_geolocmonitorsuite te_locmonitorstep7 +END_TESTCASE LBS-LocMonitorSuite-0007 + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/LocInfoConversionHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/LocInfoConversionHandler.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2010 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: STIF testclass declaration +* +*/ + +#include "LocInfoConversionHandler.h" + +CLocInfoConversionHandler* CLocInfoConversionHandler::NewL() + { + CLocInfoConversionHandler* self = new ( ELeave ) CLocInfoConversionHandler; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +CLocInfoConversionHandler::CLocInfoConversionHandler():CActive( EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +CLocInfoConversionHandler::~CLocInfoConversionHandler() + { + if( IsActive() ) + { + Cancel(); + } + } + +void CLocInfoConversionHandler::Start() + { + iStatus = KRequestPending; + SetActive(); + } + +void CLocInfoConversionHandler::RunL() + { + CActiveScheduler::Stop(); + } + + +void CLocInfoConversionHandler::ConstructL() + { + // Nothign to do here + } + + +void CLocInfoConversionHandler::DoCancel() + { + // Nothign to do here + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep1.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep1.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,134 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep1.cpp +*/ + +#include "te_geolocmonitorstep1.h" +#include "te_geolocmonitorsuitedefs.h" +#include +#include + +CTe_LocMonitorStep1::~CTe_LocMonitorStep1() + { + } + +CTe_LocMonitorStep1::CTe_LocMonitorStep1() + { + SetTestStepName(KLocMonitorStep1); + } + +TVerdict CTe_LocMonitorStep1::doTestStepPreambleL() + { + CTe_LocMonitorStepBase::doTestStepPreambleL(); + return TestStepResult(); + } + + +void CTe_LocMonitorStep1::ReadIniFileValues() + { + + _LIT(KMCC,"MCC"); + _LIT(KMNC,"MNC"); + _LIT(KLAC,"LAC"); + _LIT(KCID,"CID"); + _LIT(KTA,"TA"); + _LIT(KEXPECTEDERROR,"EXPECTEDERROR"); + + + iMCC = -1; + iMNC = -1; + iLAC = -1; + iCID = -1; + iTA = -1; + iExpectedError = KErrNone; + + GetIntFromConfig(ConfigSection(), KMCC, iMCC); + GetIntFromConfig(ConfigSection(), KMNC, iMNC); + GetIntFromConfig(ConfigSection(), KLAC, iLAC); + GetIntFromConfig(ConfigSection(), KCID, iCID); + GetIntFromConfig(ConfigSection(), KTA, iTA); + GetIntFromConfig(ConfigSection(), KEXPECTEDERROR, iExpectedError); + + } + + +TVerdict CTe_LocMonitorStep1::doTestStepL() + { + if (TestStepResult()==EPass) + { + // here, read from .ini file + ReadIniFileValues(); + + + INFO_PRINTF6(_L("TestValidateGSMInfoL(%d,%d,%d,%d,%d)"), iMCC, iMNC, iLAC, iCID, iTA); + + TInt result; + TRAP( result, TestValidateGSMInfoL(iMCC, iMNC, iLAC, iCID, iTA); ); + if (iExpectedError == result) + { + INFO_PRINTF2(_L("TestValidateGSMInfoL passed. Got %d as expected"),iExpectedError); + + } + else + { + INFO_PRINTF3(_L("TestValidateGSMInfoL failed, got error %d and was expecting %d "), result, iExpectedError); + TESTL(0); + } + + } + + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStep1::doTestStepPostambleL() + { + CTe_LocMonitorStepBase::doTestStepPostambleL(); + return TestStepResult(); + } + +// ----------------------------------------------------------------------------- +// Clocationinfodatatypestest::TestValidateGSMInfoL +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + +TInt CTe_LocMonitorStep1::TestValidateGSMInfoL(TInt iMCC, TInt iMNC, TInt iLAC, TInt iCID, TInt iTA) + { + CLbsGsmCellInfo* gsmInfo = CLbsGsmCellInfo::NewL(); + CleanupDeletePushL( gsmInfo ); + + TLbsGsmNeighbourCellInfo nCell; + nCell.SetArfcn( 100 ); + nCell.SetBsic( 30 ); + nCell.SetRxLevel( 20 ); + gsmInfo->AddNeighbouringCellInfoL( &nCell ); + + gsmInfo->SetMobileCountryCode( iMCC ); + gsmInfo->SetMobileNetworkCode( iMNC ); + gsmInfo->SetLocationAreaCode( iLAC); + gsmInfo->SetCellId( iCID); + gsmInfo->SetTimingAdvance( iTA); + + gsmInfo->ValidateDataL(); + + CleanupStack::PopAndDestroy(); // gsmInfo + return KErrNone; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep2.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,138 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep2.cpp +*/ + +#include "te_geolocmonitorstep2.h" +#include "te_geolocmonitorsuitedefs.h" +#include +#include + +CTe_LocMonitorStep2::~CTe_LocMonitorStep2() + { + } + +CTe_LocMonitorStep2::CTe_LocMonitorStep2() + { + SetTestStepName(KLocMonitorStep2); + } + +TVerdict CTe_LocMonitorStep2::doTestStepPreambleL() + { + CTe_LocMonitorStepBase::doTestStepPreambleL(); + return TestStepResult(); + } + + +void CTe_LocMonitorStep2::ReadIniFileValues() + { + + _LIT(KMCC,"MCC"); + _LIT(KMNC,"MNC"); + _LIT(KLAC,"LAC"); + _LIT(KUCID,"UCID"); + _LIT(KSC,"SC"); + _LIT(KEXPECTEDERROR,"EXPECTEDERROR"); + + iMCC = -1; + iMNC = -1; + iLAC =-1; + iUCID = -1; + iSC = -1; + iExpectedError = KErrNone; + + GetIntFromConfig(ConfigSection(), KMCC, iMCC); + GetIntFromConfig(ConfigSection(), KMNC, iMNC); + GetIntFromConfig(ConfigSection(), KLAC, iLAC); + GetIntFromConfig(ConfigSection(), KUCID, iUCID); + GetIntFromConfig(ConfigSection(), KSC, iSC); + GetIntFromConfig(ConfigSection(), KEXPECTEDERROR, iExpectedError); + + } + +// +// Repeatible call to GetLastKnownPositionArea using a TPositionSatelliteInfo +// and a TPositionAreaExtendedInfo object. +// +// This test checks that it is possible to request the last known +// position with area information from the Location Monitor using the above +// mentioned data types. +// +// The call to GetLastKnowPositionArea is conducted twice to check +// repeatibility. +// +TVerdict CTe_LocMonitorStep2::doTestStepL() + { + TPosition receivedPosition; + + if (TestStepResult()==EPass) + { + // here, read from .ini file + ReadIniFileValues(); + + + INFO_PRINTF5(_L("TestValidateWCDMAInfoL(%d,%d,%d,%d)"), iMCC, iMNC, iUCID, iSC); + + TInt result; + + TRAP( result, TestValidateWCDMAInfoL(iMCC,iMNC,iUCID,iSC);); + if (iExpectedError == result) + { + INFO_PRINTF2(_L("TestValidateWCDMAInfoL passed. Got %d as expected"),iExpectedError); + + } + else + { + INFO_PRINTF3(_L("TestValidateWCDMAInfoL failed, got error %d and was expecting %d"), result, iExpectedError); + TESTL(0); + } + } + + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStep2::doTestStepPostambleL() + { + CTe_LocMonitorStepBase::doTestStepPostambleL(); + return TestStepResult(); + } + +TInt CTe_LocMonitorStep2::TestValidateWCDMAInfoL(TInt iMCC, TInt iMNC, TInt iUCID, TInt iSC ) + { + CLbsWcdmaCellInfo* wcdmaInfo = CLbsWcdmaCellInfo::NewL(); + CleanupDeletePushL( wcdmaInfo ); + + TLbsWcdmaNeighbourCellInfo nCell; + nCell.SetUniqueCellId( 100 ); + nCell.SetScramblingCode( 30 ); + nCell.SetPathloss( 100 ); + nCell.SetSignalStrength( 90 ); + wcdmaInfo->AddNeighbouringCellInfoL( &nCell ); + + wcdmaInfo->SetMobileCountryCode( iMCC); + wcdmaInfo->SetMobileNetworkCode( iMNC); + wcdmaInfo->SetUniqueCellId(iUCID); + wcdmaInfo->SetScramblingCode( iSC ); + + wcdmaInfo->ValidateDataL(); + + CleanupStack::PopAndDestroy(); // wcdmaInfo + return KErrNone; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep3.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep3.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,147 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep3.cpp +*/ + +#include +#include + +#include "te_geolocmonitorstep3.h" +#include "te_geolocmonitorsuitedefs.h" +#include +#include + +extern void CleanUpAreaInfoArray(TAny* aArray); + +CTe_LocMonitorStep3::~CTe_LocMonitorStep3() + { + } + +CTe_LocMonitorStep3::CTe_LocMonitorStep3() + { + SetTestStepName(KLocMonitorStep3); + } + +TVerdict CTe_LocMonitorStep3::doTestStepPreambleL() + { + CTe_LocMonitorStepBase::doTestStepPreambleL(); + return TestStepResult(); + } + +// +// Call to GetLastKnownPositionArea using a TPositionInfo +// and a TPositionAreaInfo object. +// +// This test checks that it is possible to request the last known +// position with area information from the Location Monitor using +// the above mentioned data types. +// +TVerdict CTe_LocMonitorStep3::doTestStepL() + { + TPosition expectedPosition, receivedPosition; + TPositionAreaInfo expectedAreaInfo; + + if (TestStepResult()==EPass) + { + INFO_PRINTF1(_L("TestLocInfoAddCoordL()")); + + TInt result; + TRAP( result, TestLocInfoAddCoordL(); ); + if (KErrNone == result) + { + INFO_PRINTF2(_L("TestLocInfoAddCoordL passed. Got %d as expected"),KErrNone); + } + else + { + INFO_PRINTF3(_L("TestLocInfoAddCoordL failed, got error %d and was expecting %d "), result, KErrNone); + TESTL(0); + } + } + + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStep3::doTestStepPostambleL() + { + CTe_LocMonitorStepBase::doTestStepPostambleL(); + return TestStepResult(); + } + +TInt CTe_LocMonitorStep3::TestLocInfoAddCoordL() + { + CBufFlat* buffer = CBufFlat::NewL( 512 ); + CleanupDeletePushL( buffer ); + CLbsLocationInfo* locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + TCoordinate coord( 12.9765, 77.1423, 3000.0 ); + TLocality src( coord, 12.0 ); + src.SetVerticalAccuracy( 10.0 ); + CLbsPositionInfo* pos = CLbsPositionInfo::NewL( src ); + CleanupStack::PushL( pos ); + locInfo->AddAreaInfoL( pos ); + CleanupStack::Pop(); // pos; ownership transferred to instance of CLbsLocationInfo + + RBufWriteStream wStream; + wStream.Open( *buffer ); + CleanupClosePushL( wStream ); + ( (CLbsLocationInfoBase*)locInfo )->ExternaliseL( wStream ); + wStream.CommitL(); + + CleanupStack::PopAndDestroy(); // wStream + CleanupStack::PopAndDestroy(); // locInfo + locInfo = NULL; + + // Read from stream + RBufReadStream rStream; + rStream.Open( *buffer ); + + locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + locInfo->InternaliseL( rStream ); + + RLbsAreaInfoBaseArray coords; + CleanupStack::PushL(TCleanupItem(*CleanUpAreaInfoArray, &coords )); + + locInfo->GetAreaInfoL( coords, CLbsLocationInfo::ELbsPosInfo ); + CLbsPositionInfo* posInfo = static_cast( coords[0] ); + TLocality res; + posInfo->GetLocality( res ); + + if( 12.9765 != res.Latitude() || + 77.1423 != res.Longitude() || + 3000.0 != res.Altitude() || + 12.0 != res.HorizontalAccuracy() || + 10.0 != res.VerticalAccuracy() ) + { + CleanupStack::PopAndDestroy(&coords); + //CleanupStack::PopAndDestroy( &coords ); + CleanupStack::PopAndDestroy( 2 ); + return -1; + } + + // Delete coordinate info + locInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + CleanupStack::PopAndDestroy(&coords); + CleanupStack::PopAndDestroy(2); // locInfo and buffer + return KErrNone; + } + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep4.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep4.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,897 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep4.cpp +*/ + +#include +#include + +#include "te_geolocmonitorstep4.h" +#include "te_geolocmonitorsuitedefs.h" +#include +#include + +extern void CleanUpAreaInfoArray(TAny* aArray); + +CTe_LocMonitorStep4::~CTe_LocMonitorStep4() + { + } + +CTe_LocMonitorStep4::CTe_LocMonitorStep4() + { + SetTestStepName(KLocMonitorStep4); + } + +TVerdict CTe_LocMonitorStep4::doTestStepPreambleL() + { + CTe_LocMonitorStepBase::doTestStepPreambleL(); + return TestStepResult(); + } + + +void CTe_LocMonitorStep4::ReadIniFileValues() + { + _LIT(KPROCEDURE,"PROCEDURE"); + iProcedure = -1; + GetIntFromConfig(ConfigSection(), KPROCEDURE, iProcedure ); + } + + +TVerdict CTe_LocMonitorStep4::doTestStepL() + { + TPosition expectedPosition, receivedPosition; + TPositionAreaInfo expectedAreaInfo; + + if (TestStepResult()==EPass) + { + + // here, read from .ini file + ReadIniFileValues(); + INFO_PRINTF2(_L("Procedure %d"), iProcedure); + + TInt result=KErrNotFound; + + switch(iProcedure) + { + case 1: + result = TestGSMNewL(); + break; + case 2: + result = TestGSMSetTA(); + break; + case 3: + result = TestGSMAddNCellL(); + break; + case 4: + result = TestValidateGSMInfoHierarchyL(); + break; + case 5: + result = TestWcdmaNewL(); + break; + case 6: + result = TestWcdmaSetSC(); + break; + case 7: + result = TestWcdmaAddNCellL(); + break; + case 8: + result = TestValidateWCDMAInfoHierarchyL(); + break; + case 9: + result = TestCoordNewL(); + break; + case 10: + result = TestValidateCoordInfoL(); + break; + case 11: + result = TestWlanNewL(); + break; + case 12: + result = TestValidateWlanInfoL(); + break; + case 13: + result = TestLocInfoAddCoordL(); + break; + case 14: + result = TestLocInfoAddGsmCellL(); + break; + case 15: + result = TestLocInfoAddWcdmaCellL(); + break; + case 16: + result = TestLocInfoAddWlanL(); + break; + + default: + INFO_PRINTF2(_L("Bad Procedure number %d - Not supported"), iProcedure); + TESTL(0); + break; + + } + + if (KErrNone == result) + { + INFO_PRINTF3(_L("Procedure %d passed. Got %d as expected"),iProcedure, KErrNone); + + } + else + { + INFO_PRINTF4(_L("Procedure %d failed, got error %d and was expecting %d "), iProcedure, result, KErrNone); + TESTL(0); + } + } + + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStep4::doTestStepPostambleL() + { + CTe_LocMonitorStepBase::doTestStepPostambleL(); + return TestStepResult(); + } + + + +TInt CTe_LocMonitorStep4::TestGSMNewL( ) + { + INFO_PRINTF1(_L("TestGSMNewL")); + + CLbsGsmCellInfo* gsmInfo = NULL; + TRAPD( err, gsmInfo = CLbsGsmCellInfo::NewL( 3, 4, 56, 78 ) ); + if( KErrNone != err ) + return err; + + if( ( 3 != gsmInfo->MobileCountryCode() ) || + ( 4 != gsmInfo->MobileNetworkCode() ) || + ( 56 != gsmInfo->LocationAreaCode() ) || + ( 78 != gsmInfo->CellId() ) ) + { + delete gsmInfo; + return -1; + } + + delete gsmInfo; + return KErrNone; + } + + + +TInt CTe_LocMonitorStep4::TestGSMSetTA( ) + { + INFO_PRINTF1(_L("TestGSMSetTA")); + CLbsGsmCellInfo* gsmInfo = NULL; + TRAPD( err, gsmInfo = CLbsGsmCellInfo::NewL() ); + if( KErrNone != err ) + return err; + + gsmInfo->SetTimingAdvance( 2 ); + if( 2 != gsmInfo->TimingAdvance() ) + { + delete gsmInfo; + return -1; + } + + delete gsmInfo; + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestGSMSetRxLev( ) + { + INFO_PRINTF1(_L("TestGSMSetRxLev()")); + CLbsGsmCellInfo* gsmInfo = NULL; + TRAPD( err, gsmInfo = CLbsGsmCellInfo::NewL() ); + if( KErrNone != err ) + return err; + + + gsmInfo->SetRxLevel( 10 ); + if( 10 != gsmInfo->RxLevel() ) + { + delete gsmInfo; + return -1; + } + + delete gsmInfo; + return KErrNone; + } + + + +TInt CTe_LocMonitorStep4::TestGSMAddNCellL( ) + { + INFO_PRINTF1(_L("TestGSMAddNCellL()")); + + TLbsGsmNeighbourCellInfo gnCellInfo; + gnCellInfo.SetArfcn(12); + gnCellInfo.SetBsic(13); + gnCellInfo.SetRxLevel(14); + + CLbsGsmCellInfo* gsmInfo = NULL; + TRAPD( err, gsmInfo = CLbsGsmCellInfo::NewL() ); + if( KErrNone != err ) + return err; + CleanupDeletePushL( gsmInfo ); + + gsmInfo->AddNeighbouringCellInfoL( &gnCellInfo ); + + RLbsGsmNeighbourCellInfoArray nCellArray; + CleanupClosePushL( nCellArray ); + gsmInfo->GetNeighbouringCellInfoL( nCellArray ); + TLbsGsmNeighbourCellInfo res = nCellArray[0]; + + if( 12 != res.Arfcn() || 13 != res.Bsic() || 14 != res.RxLevel() ) + { + CleanupStack::PopAndDestroy(&nCellArray); + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + RLbsGsmNeighbourCellInfoArray * ptr = &nCellArray; + + CleanupStack::PopAndDestroy(&nCellArray); + CleanupStack::PopAndDestroy(gsmInfo); + + return KErrNone; + } + + + +TInt CTe_LocMonitorStep4::TestValidateGSMInfoHierarchyL( ) + { + INFO_PRINTF1(_L("TestValidateGSMInfoHierarchyL()")); + + CLbsGsmCellInfo* gsmInfo = CLbsGsmCellInfo::NewL(); + CleanupDeletePushL( gsmInfo ); + + TLbsGsmNeighbourCellInfo nCell; + nCell.SetArfcn( 100 ); + nCell.SetBsic( 30 ); + nCell.SetRxLevel( 20 ); + gsmInfo->AddNeighbouringCellInfoL( &nCell ); + TRAPD( err, gsmInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + + gsmInfo->SetRxLevel( 10 ); + TRAP( err, gsmInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + + gsmInfo->SetTimingAdvance( 200 ); + TRAP( err, gsmInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + + gsmInfo->SetCellId( 455 ); + TRAP( err, gsmInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + + gsmInfo->SetLocationAreaCode( 350 ); + TRAP( err, gsmInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + + gsmInfo->SetMobileNetworkCode( 300 ); + TRAP( err, gsmInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + + gsmInfo->SetMobileCountryCode( 200 ); + TRAP( err, gsmInfo->ValidateDataL() ); + if( KErrNone != err ) + { + CleanupStack::PopAndDestroy(gsmInfo); + return -1; + } + + CleanupStack::PopAndDestroy(gsmInfo); + return KErrNone; + } + + + + +// ***************************************************************************************************************************************** + + + + + +TInt CTe_LocMonitorStep4::TestWcdmaNewL( ) + { + INFO_PRINTF1(_L("TestWcdmaNewL()")); + + CLbsWcdmaCellInfo* wcdmaCell = NULL; + TRAPD( err, wcdmaCell = CLbsWcdmaCellInfo::NewL( 4, 56, 78 ) ); + if( KErrNone != err ) + return err; + + TRAP( err, wcdmaCell->ValidateDataL() ); + if( KErrNone != err ) + return err; + + if( 4 != wcdmaCell->MobileCountryCode() ) + { + delete wcdmaCell; + return -1; + } + + if( 56 != wcdmaCell->MobileNetworkCode() ) + { + delete wcdmaCell; + return -1; + } + + if( 78 != wcdmaCell->UniqueCellId() ) + { + delete wcdmaCell; + return -1; + } + + delete wcdmaCell; + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestWcdmaSetSC( ) + { + INFO_PRINTF1(_L("TestWcdmaSetSC()")); + + CLbsWcdmaCellInfo* wcdmaCell = NULL; + TRAPD( err, wcdmaCell = CLbsWcdmaCellInfo::NewL() ); + if( KErrNone != err ) + return err; + + wcdmaCell->SetScramblingCode( 90 ); + if( 90 != wcdmaCell->ScramblingCode() ) + { + delete wcdmaCell; + return -1; + } + + delete wcdmaCell; + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestWcdmaAddNCellL( ) + { + INFO_PRINTF1(_L("TestWcdmaAddNCellL()")); + TLbsWcdmaNeighbourCellInfo nCell( 78, 90, 47, 100 ); + CLbsWcdmaCellInfo* wcdmaCell = NULL; + + TRAPD( err, wcdmaCell = CLbsWcdmaCellInfo::NewL() ); + if( KErrNone != err ) + return err; + + CleanupDeletePushL( wcdmaCell ); + wcdmaCell->AddNeighbouringCellInfoL( &nCell ); + + RLbsWcdmaNeighbourCellInfoArray nCellArr; + CleanupClosePushL( nCellArr ); + + wcdmaCell->GetNeighbouringCellInfoL( nCellArr ); + TLbsWcdmaNeighbourCellInfo res = nCellArr[0]; + if( 78 != res.UniqueCellId() ) + { + CleanupStack::PopAndDestroy(&nCellArr); + CleanupStack::PopAndDestroy(wcdmaCell); + return -1; + } + + if( 90 != res.ScramblingCode() ) + { + CleanupStack::PopAndDestroy(&nCellArr); + CleanupStack::PopAndDestroy(wcdmaCell); + return -1; + } + CleanupStack::PopAndDestroy(&nCellArr); + CleanupStack::PopAndDestroy(wcdmaCell); + + return KErrNone; + } + + + +TInt CTe_LocMonitorStep4::TestValidateWCDMAInfoHierarchyL( ) + { + INFO_PRINTF1(_L("TestValidateWCDMAInfoHierarchyL(()")); + CLbsWcdmaCellInfo* wcdmaInfo = CLbsWcdmaCellInfo::NewL(); + CleanupDeletePushL( wcdmaInfo ); + + TLbsWcdmaNeighbourCellInfo nCell; + nCell.SetUniqueCellId( 200 ); + nCell.SetScramblingCode( 400 ); + wcdmaInfo->AddNeighbouringCellInfoL( &nCell ); + TRAPD( err, wcdmaInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(wcdmaInfo); + return -1; + } + + wcdmaInfo->SetScramblingCode( 300 ); + TRAP( err, wcdmaInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(wcdmaInfo); + return -1; + } + + wcdmaInfo->SetUniqueCellId( 455 ); + TRAP( err, wcdmaInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(wcdmaInfo); + return -1; + } + + wcdmaInfo->SetMobileNetworkCode( 300 ); + TRAP( err, wcdmaInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(wcdmaInfo); + return -1; + } + + wcdmaInfo->SetMobileCountryCode( 2000 ); + TRAP( err, wcdmaInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(wcdmaInfo); + return -1; + } + + CleanupStack::PopAndDestroy(wcdmaInfo); + return KErrNone; + } + + + +// ************************************************************************************************************************* + + + +TInt CTe_LocMonitorStep4::TestCoordNewL( ) + { + INFO_PRINTF1(_L("TestCoordNewL()")); + CLbsPositionInfo* pos = NULL; + TCoordinate coord( 12.9765, 77.1423, 3000.0 ); + TLocality src( coord, 12.0 ); + src.SetVerticalAccuracy( 10.0 ); + TRAPD( err, pos = CLbsPositionInfo::NewL( src ) ); + if ( KErrNone != err ) + return err; + + TRAP( err, pos->ValidateDataL() ); + if( KErrNone != err ) + return err; + + TLocality loc; + pos->GetLocality( loc ); + if( 12.9765 != loc.Latitude() ) + { + delete pos; + return -1; + } + + if( 77.1423 != loc.Longitude() ) + { + delete pos; + return -1; + } + + if( 3000.0 != loc.Altitude() ) + { + delete pos; + return -1; + } + + if( 12.0 != loc.HorizontalAccuracy() ) + { + delete pos; + return -1; + } + + if( 10.0 != loc.VerticalAccuracy() ) + { + delete pos; + return -1; + } + + delete pos; + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestValidateCoordInfoL( ) + { + INFO_PRINTF1(_L("TestValidateCoordInfoL()")); + + CLbsPositionInfo* pos = CLbsPositionInfo::NewL(); + CleanupDeletePushL( pos ); + TLocality loc; + loc.SetVerticalAccuracy( 50.0 ); + pos->SetLocality( loc ); + TRAPD( err, pos->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(pos); + return -1; + } + + loc.SetHorizontalAccuracy( 40.0 ); + pos->SetLocality( loc ); + TRAP( err, pos->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(pos); + return -1; + } + + TCoordinate coord( 12.9423, 77.1423, 455.0 ); + TLocality loc1( coord, 40.0 ); + pos->SetLocality( loc1 ); + pos->ValidateDataL(); + CleanupStack::PopAndDestroy(pos); + return KErrNone; + } + +// ************************************************************************************************************************* + + +TInt CTe_LocMonitorStep4::TestWlanNewL( ) + { + INFO_PRINTF1(_L("TestWlanNewL()")); + TLbsWlanMacAddress macId; + macId.Append( _L8("FF:FF:FF:FF:FF:FF") ); + + CLbsWlanInfo* wlanInfo = NULL; + TRAPD( err, wlanInfo = CLbsWlanInfo::NewL( macId, 12 ) ); + if( KErrNone != err ) + return err; + + TRAP( err, wlanInfo->ValidateDataL() ); + if( KErrNone != err ) + return err; + + TLbsWlanMacAddress res; + wlanInfo->GetMacAddress( res ); + if( macId != res ) + { + delete wlanInfo; + return -1; + } + + if( 12 != wlanInfo->SignalStrength() ) + { + delete wlanInfo; + return -1; + } + + delete wlanInfo; + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestValidateWlanInfoL( ) + { + INFO_PRINTF1(_L("TestValidateWlanInfoL()")); + CLbsWlanInfo* wlanInfo = CLbsWlanInfo::NewL(); + CleanupDeletePushL( wlanInfo ); + + wlanInfo->SetSignalStrength( 100 ); + TRAPD( err, wlanInfo->ValidateDataL() ); + if( KErrArgument != err ) + { + CleanupStack::PopAndDestroy(wlanInfo); + return -1; + } + + TLbsWlanMacAddress macId; + macId.Append( _L8("FF:FF:FF:FF:FF:FF") ); + wlanInfo->SetMacAddress( macId ); + TRAP( err, wlanInfo->ValidateDataL() ); + if( KErrNone != err ) + { + CleanupStack::PopAndDestroy(wlanInfo); + return -1; + } + + CleanupStack::PopAndDestroy(wlanInfo); // wlanInfo + return KErrNone; + } + +// ************************************************************************************************************************* + + +TInt CTe_LocMonitorStep4::TestLocInfoAddCoordL( ) + { + INFO_PRINTF1(_L("TestLocInfoAddCoordL()")); + CBufFlat* buffer = CBufFlat::NewL( 512 ); + CleanupDeletePushL( buffer ); + CLbsLocationInfo* locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + TCoordinate coord( 12.9765, 77.1423, 3000.0 ); + TLocality src( coord, 12.0 ); + src.SetVerticalAccuracy( 10.0 ); + CLbsPositionInfo* pos = CLbsPositionInfo::NewL( src ); + CleanupStack::PushL( pos ); + locInfo->AddAreaInfoL( pos ); + CleanupStack::Pop(); // pos; ownership transferred to instance of CLbsLocationInfo + + RBufWriteStream wStream; + wStream.Open( *buffer ); + CleanupClosePushL( wStream ); + ( (CLbsLocationInfoBase*)locInfo )->ExternaliseL( wStream ); + wStream.CommitL(); + + CleanupStack::PopAndDestroy(&wStream); + CleanupStack::PopAndDestroy(locInfo); + + locInfo = NULL; + + // Read from stream + RBufReadStream rStream; + rStream.Open( *buffer ); + + locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + ( (CLbsLocationInfoBase*)locInfo )->InternaliseL( rStream ); + + RLbsAreaInfoBaseArray coords; + CleanupStack::PushL(TCleanupItem(*CleanUpAreaInfoArray, &coords )); + + locInfo->GetAreaInfoL( coords, CLbsLocationInfo::ELbsPosInfo ); + CLbsPositionInfo* posInfo = static_cast( coords[0] ); + TLocality res; + posInfo->GetLocality( res ); + + if( 12.9765 != res.Latitude() || + 77.1423 != res.Longitude() || + 3000.0 != res.Altitude() || + 12.0 != res.HorizontalAccuracy() || + 10.0 != res.VerticalAccuracy() ) + { + CleanupStack::PopAndDestroy(&coords); + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return -1; + } + + // Delete coordinate info + locInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + CleanupStack::PopAndDestroy(&coords); + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestLocInfoAddGsmCellL( ) + { + INFO_PRINTF1(_L("TestLocInfoAddGsmCellL()")); + CBufFlat* buffer = CBufFlat::NewL( 512 ); + CleanupDeletePushL( buffer ); + CLbsLocationInfo* locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + CLbsGsmCellInfo* gsmCell = CLbsGsmCellInfo::NewL( 23, 34, 45, 56 ); + CleanupStack::PushL( gsmCell ); + gsmCell->SetTimingAdvance( 10 ); + gsmCell->SetRxLevel( 100 ); + TLbsGsmNeighbourCellInfo nCell( 100, 60, 30 ); + gsmCell->AddNeighbouringCellInfoL( &nCell ); + locInfo->AddAreaInfoL( gsmCell ); + CleanupStack::Pop(); // gsmCell; ownership transferred to instance of CLbsLocationInfo + + RBufWriteStream wStream; + wStream.Open( *buffer ); + CleanupClosePushL( wStream ); + ( (CLbsLocationInfoBase*)locInfo )->ExternaliseL( wStream ); + wStream.CommitL(); + + CleanupStack::PopAndDestroy(&wStream); + CleanupStack::PopAndDestroy(locInfo); + locInfo = NULL; + + // Read from stream + RBufReadStream rStream; + rStream.Open( *buffer ); + + locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + ( (CLbsLocationInfoBase*)locInfo )->InternaliseL( rStream ); + + RLbsAreaInfoBaseArray gsmInfo; + CleanupStack::PushL(TCleanupItem(*CleanUpAreaInfoArray, &gsmInfo )); + + locInfo->GetAreaInfoL( gsmInfo, CLbsLocationInfo::ELbsGsmInfo ); + CLbsGsmCellInfo* posInfo = static_cast( gsmInfo[0] ); + + RLbsGsmNeighbourCellInfoArray nCellArr; + CleanupClosePushL(nCellArr); + posInfo->GetNeighbouringCellInfoL( nCellArr ); + + if( 23 != posInfo->MobileCountryCode() || + 34 != posInfo->MobileNetworkCode() || + 45 != posInfo->LocationAreaCode() || + 56 != posInfo->CellId() || + 10 != posInfo->TimingAdvance() || + 100 != posInfo->RxLevel() || + 100 != nCellArr[0].Arfcn() || + 60 != nCellArr[0].Bsic() || + 30 != nCellArr[0].RxLevel() ) + { + CleanupStack::PopAndDestroy(&nCellArr); + CleanupStack::PopAndDestroy(&gsmInfo); + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return -1; + } + posInfo->ResetNeighbouringCellInfo(); + locInfo->ResetAreaInfo( CLbsLocationInfo::ELbsGsmInfo ); // Reset + CleanupStack::PopAndDestroy(&nCellArr); + CleanupStack::PopAndDestroy(&gsmInfo); + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestLocInfoAddWcdmaCellL( ) + { + INFO_PRINTF1(_L("TestLocInfoAddWcdmaCellL()")); + CBufFlat* buffer = CBufFlat::NewL( 512 ); + CleanupDeletePushL( buffer ); + CLbsLocationInfo* locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + CLbsWcdmaCellInfo* wcdmaCell = CLbsWcdmaCellInfo::NewL( 23, 34, 45 ); + CleanupStack::PushL( wcdmaCell ); + wcdmaCell->SetScramblingCode( 10 ); + TLbsWcdmaNeighbourCellInfo nCell( 100, 60, 47, 100 ); + wcdmaCell->AddNeighbouringCellInfoL( &nCell ); + locInfo->AddAreaInfoL( wcdmaCell ); + CleanupStack::Pop(); // wcdmaCell; ownership transferred to instance of CLbsLocationInfo + + RBufWriteStream wStream; + wStream.Open( *buffer ); + CleanupClosePushL( wStream ); + ( (CLbsLocationInfoBase*)locInfo )->ExternaliseL( wStream ); + wStream.CommitL(); + + CleanupStack::PopAndDestroy(&wStream); + CleanupStack::PopAndDestroy(locInfo); + locInfo = NULL; + + // Read from stream + RBufReadStream rStream; + rStream.Open( *buffer ); + + locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL(locInfo); + ( (CLbsLocationInfoBase*)locInfo )->InternaliseL( rStream ); + + RLbsAreaInfoBaseArray wcdmaInfo; + CleanupStack::PushL(TCleanupItem(*CleanUpAreaInfoArray, &wcdmaInfo )); + + locInfo->GetAreaInfoL( wcdmaInfo, CLbsLocationInfo::ELbsWcdmaInfo ); + CLbsWcdmaCellInfo* posInfo = static_cast( wcdmaInfo[0] ); + + RLbsWcdmaNeighbourCellInfoArray nCellArr; + CleanupClosePushL(nCellArr); + posInfo->GetNeighbouringCellInfoL( nCellArr ); + + if( 23 != posInfo->MobileCountryCode() || 34 != posInfo->MobileNetworkCode() + || 45 != posInfo->UniqueCellId() || 10 != posInfo->ScramblingCode() || + 100 != nCellArr[0].UniqueCellId() || 60 != nCellArr[0].ScramblingCode() || + 47 != nCellArr[0].Pathloss() || 100 != nCellArr[0].SignalStrength() ) + { + CleanupStack::PopAndDestroy(&nCellArr); + CleanupStack::PopAndDestroy(&wcdmaInfo); + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return -1; + } + + posInfo->ResetNeighbouringCellInfo(); + locInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWcdmaInfo ); + CleanupStack::PopAndDestroy(&nCellArr); + CleanupStack::PopAndDestroy(&wcdmaInfo);// Reset + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return KErrNone; + } + + +TInt CTe_LocMonitorStep4::TestLocInfoAddWlanL( ) + { + INFO_PRINTF1(_L("TestLocInfoAddWlanL()")); + CBufFlat* buffer = CBufFlat::NewL( 512 ); + CleanupDeletePushL( buffer ); + CLbsLocationInfo* locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + TLbsWlanMacAddress macId; + macId.Append( _L8("FF:FF:FF:FF:FF:FF") ); + CLbsWlanInfo* wlanInfo = CLbsWlanInfo::NewL( macId, 77 ); + CleanupStack::PushL( wlanInfo ); + locInfo->AddAreaInfoL( wlanInfo ); + CleanupStack::Pop(); // wlanInfo; ownership transferred to instance of CLbsLocationInfo + + RBufWriteStream wStream; + wStream.Open( *buffer ); + CleanupClosePushL( wStream ); + ( (CLbsLocationInfoBase*)locInfo )->ExternaliseL( wStream ); + wStream.CommitL(); + + CleanupStack::PopAndDestroy(&wStream); + CleanupStack::PopAndDestroy(locInfo); + locInfo = NULL; + + // Read from stream + RBufReadStream rStream; + rStream.Open( *buffer ); + + locInfo = CLbsLocationInfo::NewL(); + CleanupDeletePushL( locInfo ); + ( (CLbsLocationInfoBase*)locInfo )->InternaliseL( rStream ); + + RLbsAreaInfoBaseArray wlanInfoArr; + CleanupStack::PushL(TCleanupItem(*CleanUpAreaInfoArray, &wlanInfoArr )); + + locInfo->GetAreaInfoL( wlanInfoArr, CLbsLocationInfo::ELbsWlanInfo ); + + CLbsWlanInfo* posInfo = static_cast( wlanInfoArr[0] ); + TLbsWlanMacAddress macIdRes; + posInfo->GetMacAddress( macIdRes ); + + if( macId != macIdRes || 77 != posInfo->SignalStrength() ) + { + CleanupStack::PopAndDestroy(&wlanInfoArr); + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return -1; + } + // Delete coordinate info + locInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWcdmaInfo ); + CleanupStack::PopAndDestroy(&wlanInfoArr); + CleanupStack::PopAndDestroy(locInfo); + CleanupStack::PopAndDestroy(buffer); + return KErrNone; + } + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep5.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep5.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,1835 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorstep5.cpp +*/ + +#include "te_geolocmonitorstep5.h" +#include "te_geolocmonitorsuitedefs.h" +#include "rlbslocinfoconverter.h" +#include "LocInfoConversionHandler.h" +#include + +// Plug in +const TInt KDummyPluginId = 537007117; +const TInt KSuplPluginId = 537028467; + + +CTe_LocMonitorStep5::~CTe_LocMonitorStep5() + { + } + +CTe_LocMonitorStep5::CTe_LocMonitorStep5() + { + SetTestStepName(KLocMonitorStep5); + } + +TVerdict CTe_LocMonitorStep5::doTestStepPreambleL() + { + CTe_LocMonitorStepBase::doTestStepPreambleL(); + + iConversionHandler = CLocInfoConversionHandler::NewL(); + iConversionHandler1 = CLocInfoConversionHandler::NewL(); + + return TestStepResult(); + } + +// +// This test checks that it is possible to connect a session and +// subsession with the Location Monitor and then close both. +// +TVerdict CTe_LocMonitorStep5::doTestStepL() + { + INFO_PRINTF1(_L("CTe_LocMonitorStep5::doTestStepL() ")); + + if (TestStepResult()==EPass) + { + + // Run all tests sequentially first + RLbsLocInfoConverter_Connect1L(); + RLbsLocInfoConverter_Connect2L(); + RLbsLocInfoConverter_ConvertLocationInfo1L(); + RLbsLocInfoConverter_ConvertLocationInfo2L(); + RLbsLocInfoConverter_ConvertLocationInfo3L(); + RLbsLocInfoConverter_ConvertLocationInfo4L(); + RLbsLocInfoConverter_ConvertLocationInfo5L(); + + RLbsLocInfoConverter_ConvertLocationInfo8L(); + RLbsLocInfoConverter_ConvertLocationInfo9L(); + RLbsLocInfoConverter_ConvertLocationInfo10L(); + RLbsLocInfoConverter_Cancel1L(); + RLbsLocInfoConverter_Cancel2L(); + RLbsLocInfoConverter_Cancel3L(); + RLbsLocInfoConverter_Cancel4L(); + + } + + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStep5::doTestStepPostambleL() + { + delete iConversionHandler; + delete iConversionHandler1; + CTe_LocMonitorStepBase::doTestStepPostambleL(); + return TestStepResult(); + } + + + +// ----------------------------------------------------------------------------- +// CLocInfoConversionUnitTest::RLbsLocInfoConverter_Connect1 +// simple session and subsession. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_Connect1L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_Connect1L()")); + TInt error; + RLbsLocMonitorSession locMonitorSession; + error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + locInfoConverter.Close(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_Connect2 +// Opening multiple subsession from single session +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_Connect2L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_Connect2L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + RLbsLocInfoConverter locInfoConverter1; + CleanupClosePushL( locInfoConverter1 ); + + locInfoConverter.OpenL( locMonitorSession ); + locInfoConverter1.OpenL( locMonitorSession ); + locInfoConverter.Close(); + locInfoConverter1.Close(); + + CleanupStack::PopAndDestroy( 3 ); //locInfoConverter1,locInfoConverter and + //locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo1L +// This test case tests the simple and corner case related +// to RLbsLocInfoConverter::ConvertLocationInfoL +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo1L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo1L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * Case 1: where NULL pointer is passed instead of location info + */ + error = KErrNone; + CLbsLocationInfo* locationInfo = CLbsLocationInfo::NewL(); + CleanupStack::PushL( locationInfo ); + TRAP( error,locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition, + conversionModuleId,iConversionHandler->iStatus )); + if( error!= KErrArgument ) + { + INFO_PRINTF2(_L("Expected return value KErrArgument, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 2: where we pass location info.This is + * just test where this method completes without leaving. + */ + + // Here we append gsmcell info object to the existing location info object. + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + CleanupStack::PopAndDestroy( locationInfo ); + + /** + * Case 3. Empty location info array is passed. + */ + error = KErrNone; + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + TRAP( error,locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus )); + + if( error != KErrArgument ) + { + INFO_PRINTF2(_L("Expected return value KErrArgument, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 4: where we pass location info array.This is + * just test where this method completes without leaving. + */ + + // Here we create locationInfo object with gsm cell info object contained in it. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + CleanupStack::Pop( 2 ); //locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo2L +// This test case tests ConvertLocationInfo when expected information is +// of type ECoordinate +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo2L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo2L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * case 1: Any information regarding the area is passed and + * coordinate corresponding to that area info is expected. + */ + + // Here GSM cell info is passed as input area. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // If the conversion status is KErrNone, check for the corresponding + // converted info. + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * case 2: Pass any information related to multiple area and we expect coordinate information + * corresponding to each area information. + */ + + // Create one more location info object which holds wlan info for which corresponding coordinate + // is expected. + CLbsLocationInfo* locationInfo2 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for coordinate info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfoArray.Append( locationInfo ); + + locationInfoArray.Append( locationInfo2 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Iterate through the array and check for converted info. + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), error); + User::Leave( KErrArgument ); + } + + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo3L +// This test case tests ConvertLocationInfo when expected information is +// of type EGsm +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo3L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo3L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId );; + + /** + * case 1: Pass any area info and we expect GSM cell info + */ + + // Here WLAN info is passed as input area. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionCacheOnly,ELbsConversionOutputGsm, + conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // If the conversion status is success, check for the corresponding + // converted info. + if( error == KErrNone ) + { + CheckGsmCellConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * case 2: Pass any information related to multiple area and we expect GSM cell info + * corresponding to each area information. + */ + + // Create one more location info object which holds coordinate info for which corresponding GSM + // cell info is expected. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for GSM cell info, hence we need to clear it before + // we use it for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsGsmInfo ); + locationInfoArray.Append( locationInfo ); + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionCacheOnly,ELbsConversionOutputGsm, + conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Iterate through the array and check for converted info. + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckGsmCellConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), error); + User::Leave( KErrArgument ); + } + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo4L +//This test case tests ConvertLocationInfo when expected information is +// of type EWcdma +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo4L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo4L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * case 1: Pass any area info pointer and we expect EWcdma type + */ + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionSilent,ELbsConversionOutputWcdma, + conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // If the conversion status is success, check for the corresponding + // converted info. + if( error == KErrNone ) + { + CheckWcdmaCellConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * case 2: Pass any information related to multiple area and we expect wcdma information + * corresponding to each area information. + */ + + // Create one more location info object which holds wlan info for which corresponding WCDMA + // cell info is expected. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for WCDMA info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWcdmaInfo ); + locationInfoArray.Append( locationInfo ); + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionSilent,ELbsConversionOutputWcdma, + conversionModuleId,iConversionHandler->iStatus ); + + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Iterate through the array and check for converted info. + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckWcdmaCellConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( error == KErrNotSupported || error == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), error); + User::Leave( KErrArgument ); + } + + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo5L +// This test case tests ConvertLocationInfo when expected information is +// of type EWlan +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo5L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo5L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * case 1: Pass any area info pointer and we expect EWlan type + */ + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionCacheOnly,ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // If the conversion status is success, check for the corresponding + // converted info. + if( iConversionHandler->iStatus == KErrNone ) + { + CheckWlanConvertedInfoL( locationInfo ); + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( iConversionHandler->iStatus == KErrNotSupported || iConversionHandler->iStatus == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), iConversionHandler->iStatus); + User::Leave( KErrArgument ); + } + + /** + * Case 2: Pass any information related to multiple area and we expect Wlan info + * corresponding to each area information. + */ + + // Create one more location info object which holds coordinate info for which corresponding + // Wlan info is expected. + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaPositionInfoClass ); + + // Before pushing location info object, remove the converted info from it. + // We had requested for wlan info, hence we need to clear it before + // we use it for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsWlanInfo ); + locationInfoArray.Append( locationInfo ); + locationInfoArray.Append( locationInfo1 ); + + TRequestStatus status; + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionCacheOnly,ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus); + iConversionHandler->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Iterate through the array and check for converted info. + if( iConversionHandler->iStatus == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckWlanConvertedInfoL( locationInfo ); + } + } + // KErrNotSupported and KErrNotFound are allowed error codes. + else if( !( iConversionHandler->iStatus == KErrNotSupported || iConversionHandler->iStatus == KErrNotFound ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported or KErrNotFound, got %d)"), iConversionHandler->iStatus); + User::Leave( KErrArgument ); + } + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo6L +// This test case tests the scenario when user tries to request new single +// conversion without waiting for completion of previous one. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo6L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo6L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + // Here in this case input area doesnt matter + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + error = KErrNone; + TRequestStatus status; + + locInfoConverter.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,status ); + + CleanupStack::PopAndDestroy( 2 ); // locationInfo1,locationInfo + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo7L +// This test case tests the scenario when user tries to request new batch +// conversion without waiting for completion of previous one. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo7L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo7L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KNullUidValue );; + + // Here in this case input area doesnt matter + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locationInfoArray.Append( locationInfo ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId ,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locationInfoArray1.Append( locationInfo1 ); + + TRequestStatus status; + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,status ); + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo8L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying same plugin. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo8L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo8L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need to open two subsessions. + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying same conversion uid. + */ + + // Here type of area input doesnt matter. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo9L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying different plugin. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo9L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo9L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need two subsessions + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId1 = TUid::Uid( KDummyPluginId ); + TUid conversionModuleId2 = TUid::Uid( KSuplPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying different conversion uid. + */ + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotFound or KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNotFound or KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo10L +// This test case tests following unsuccessful conversion scenarios: +// 1. Conversion preference not supported by plugin. +// 2. Conversion request by specifying input area type same as requested type. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_ConvertLocationInfo10L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo10L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need two subsessions + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + /** + * Case 2: Users tries to request for coordinate info by specifying + * only coordinate info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaPositionInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 3: Users tries to request for gsm cell info by specifying + * only gsm cell info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaGsmCellInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputGsm,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 4: Users tries to request for wcdma cell info by specifying + * only wcdma cell info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaWcmdaCellInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputWcdma,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 5: Users tries to request for wlan info by specifying + * only wlan info. + */ + locationInfo->ResetAreaInfo(); + AppendAreaInfoObjectToLocationInfoL( locationInfo,ELbsAreaWlanInfoClass ); + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputWlan,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error != KErrNotSupported ) + { + INFO_PRINTF2(_L("Expected return value KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + CleanupStack::PopAndDestroy( 3 ); // locationInfo,locInfoConverter,locMonitorSession + return KErrNone; + } + + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel1L +// This test case tests the scenario when user tries to cancel the request before +// and after the conversion request complete for both single and batch conversion. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel1L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_Cancel1L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + // This can can be done for any area type here EGsm to ECoordinate conversion has + // been used. + + /** + * Case 1: Here single location information conversion is requested + * and cancel is called before the conversion completes. + */ + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + error = iConversionHandler->iStatus.Int(); + // Request should be completed with the error code KErrCancel and + // location info should not have converted information. + if( error == KErrCancel ) + { + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + else + { + INFO_PRINTF2(_L("Expected return value KErrCancel, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * case 2: Here single location information conversion is requested + * and cancel is called after the conversion completes. + */ + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + CActiveScheduler::Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + error = iConversionHandler->iStatus.Int(); + // Request should be completed with the error code KErrNone and + // location info should have converted information. + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone got %d)"), error); + User::Leave( KErrArgument ); + } + + // case 3: Here mutiple location information conversion is + // requested and cancel is called before the conversion completes. + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + // We had requested for coordinate info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfoArray.Append( locationInfo ); + + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + // Request should be completed with the error code KErrCancel and + // location info should not have converted information. + error = iConversionHandler->iStatus.Int(); + + if( error == KErrCancel ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + } + else + { + INFO_PRINTF2(_L("Expected return value KErrCancel, got %d)"), error); + User::Leave( KErrArgument ); + } + + + /** + * case 4: Here mutiple location information conversion is + * requested and cancel is called after the conversion completes. + */ + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + CActiveScheduler::Start(); + locInfoConverter.CancelConvertLocationInfo(); + iConversionHandler->Cancel(); + + // Request should be completed with the error code KErrNone and + // location info should have converted information. + error = iConversionHandler->iStatus.Int(); + + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone got %d)"), error); + User::Leave( KErrArgument ); + } + + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel2L +// This test case tests the scenario when user tries to cancel the conversion request +// from the different subsession for both single and multiple conversion. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel2L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_Cancel2L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need to subsessions. + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + // This can can be done for any area type here EGsm to ECoordinate conversion has + // been used. + + /** + * Case 1: Here single location information conversion is + * requested and cancel is called the different subsession. + */ + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined,ELbsConversionOutputPosition + ,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter1.CancelConvertLocationInfo(); + CActiveScheduler::Start(); + + error = iConversionHandler->iStatus.Int(); + // Request should be completed with the error code KErrNone and + // location info should have converted information. + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo ); + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 2: Here mutiple location information conversion is requested + * and cancel is called from the different subsession. + */ + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + // We had requested for coordinate info, hence we need to clear it before + // we use it as input for next conversion. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfoArray.Append( locationInfo ); + + locationInfoArray.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + locInfoConverter1.CancelConvertLocationInfo(); + CActiveScheduler::Start(); + + // Request should be completed with the error code KErrNone and + // location info should have converted information. + error = iConversionHandler->iStatus.Int(); + + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + CleanupStack::Pop( 3 ); // locationInfo,locationInfo1,locationInfoArray + locationInfoArray.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel3L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying same plugin and we cancel one request +// of two requests. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel3L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_Cancel3L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need to open two subsessions. + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying same conversion uid and + * anyone conversion request is cancelled. + */ + + // Here type of area input doesnt matter. + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here first request is called. + locInfoConverter.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrCancel ) + { + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + else + { + INFO_PRINTF2(_L("Expected return value KErrCancel, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid and + * any one conversion request is cancelled. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here second request is called. + locInfoConverter1.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else + { + INFO_PRINTF2(_L("Expected return value KErrNone, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrCancel ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + } + else + { + INFO_PRINTF2(_L("Expected return value KErrCancel, got %d)"), error); + User::Leave( KErrArgument ); + } + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel4L +// This test case tests the scenario when user tries to request two conversion +// using two subsessions simultaneously specifying different plugin. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep5::RLbsLocInfoConverter_Cancel4L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_Cancel4L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + + // Here we need two subsessions + RLbsLocInfoConverter locInfoConverter,locInfoConverter1; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + CleanupClosePushL( locInfoConverter1 ); + locInfoConverter1.OpenL( locMonitorSession ); + + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + TUid conversionModuleId1 = TUid::Uid( KDummyPluginId ); + TUid conversionModuleId2 = TUid::Uid( KSuplPluginId ); + + /** + * Case 1: Users tries to request 2 simultaneous single conversion + * using 2 subsession specifying different conversion uid + * any one request is cancelled. + */ + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + + locInfoConverter1.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here first request is cancelled. + locInfoConverter.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + error = iConversionHandler->iStatus.Int(); + if( error == KErrCancel ) + { + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrCancel, KErrNotFound, KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrNone ) + { + CheckPositionConvertedInfoL( locationInfo1 ); + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNone, KErrNotFound, KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + /** + * Case 2: Users tries to request 2 simultaneous bulk conversion + * using 2 subsession specifying same conversion uid and + * one conversion request is cancelled. + */ + + // Before we append the location info object to the info array, + // we need to clear the converted info in each object. + locationInfo->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + locationInfo1->ResetAreaInfo( CLbsLocationInfo::ELbsPosInfo ); + + locationInfoArray.Append( locationInfo ); + locationInfoArray1.Append( locationInfo1 ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId1,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locInfoConverter1.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId2,iConversionHandler1->iStatus ); + iConversionHandler1->Start(); + + // Here we cancel 2nd request + locInfoConverter1.CancelConvertLocationInfo(); + + // This is just to block the control till the call back method is called. + // Code after this statement will be resumed when Stop on CActiveScheduler + // is called in the HandleLocationConversion method. + CActiveScheduler::Start(); + + // Here we need to wait till both the request completes.Hence we need to block it once again + // till the 2nd request completes. + if( iConversionHandler->iStatus.Int() == KRequestPending || + iConversionHandler1->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + // Check the converted values in both the conversions. + // Iterate through the array and check for converted info. + error = iConversionHandler->iStatus.Int(); + if( error == KErrNone ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrNone, KErrNotFound, KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + error = iConversionHandler1->iStatus.Int(); + if( error == KErrCancel ) + { + for( TInt i=0;i ( locationInfobase ); + CheckPositionConvertedInfoL( locationInfo,ENegative ); + } + } + else if( !( error == KErrNotFound || error == KErrNotSupported ) ) + { + INFO_PRINTF2(_L("Expected return value KErrCancel, KErrNotFound, KErrNotSupported, got %d)"), error); + User::Leave( KErrArgument ); + } + + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3 ); // locInfoConverter,locInfoConverter1,locMonitorSession + return KErrNone; + } + + + +// [End of File] diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep6.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep6.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,121 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorStep6.cpp +*/ + +#include "te_geolocmonitorStep6.h" +#include "te_geolocmonitorsuitedefs.h" +#include "rlbslocinfoconverter.h" +#include "LocInfoConversionHandler.h" +#include + +// Plug in +const TInt KDummyPluginId = 537007117; +const TInt KSuplPluginId = 537028467; + + +CTe_LocMonitorStep6::~CTe_LocMonitorStep6() + { + } + +CTe_LocMonitorStep6::CTe_LocMonitorStep6() + { + SetTestStepName(KLocMonitorStep6); + } + +TVerdict CTe_LocMonitorStep6::doTestStepPreambleL() + { + CTe_LocMonitorStepBase::doTestStepPreambleL(); + + iConversionHandler = CLocInfoConversionHandler::NewL(); + iConversionHandler1 = CLocInfoConversionHandler::NewL(); + + return TestStepResult(); + } + +// +// This test checks that it is possible to connect a session and +// subsession with the Location Monitor and then close both. +// +TVerdict CTe_LocMonitorStep6::doTestStepL() + { + if (TestStepResult()==EPass) + { + // Test 6 panics with 0, ELocMonitorDuplicateRequest + RLbsLocInfoConverter_ConvertLocationInfo6L(); + } + + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStep6::doTestStepPostambleL() + { + delete iConversionHandler; + delete iConversionHandler1; + CTe_LocMonitorStepBase::doTestStepPostambleL(); + return TestStepResult(); + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep6::RLbsLocInfoConverter_ConvertLocationInfo6L +// This test case tests the scenario when user tries to request new single +// conversion without waiting for completion of previous one. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep6::RLbsLocInfoConverter_ConvertLocationInfo6L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo6L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KDummyPluginId ); + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + // Here in this case input area doesnt matter + locInfoConverter.ConvertLocationInfoL( + *locationInfo,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWcmdaCellInfoClass ); + + error = KErrNone; + TRequestStatus status; + + + locInfoConverter.ConvertLocationInfoL( + *locationInfo1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,status ); + + CleanupStack::PopAndDestroy( 2 ); // locationInfo1,locationInfo + return KErrNone; + } + + +// [End of File] diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep7.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstep7.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,140 @@ +/* +* 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: +* +*/ + + +/** + @file te_locmonitorStep7.cpp +*/ + +#include "te_geolocmonitorStep7.h" +#include "te_geolocmonitorsuitedefs.h" +#include "rlbslocinfoconverter.h" +#include "LocInfoConversionHandler.h" +#include + +// Plug in +const TInt KDummyPluginId = 537007117; +const TInt KSuplPluginId = 537028467; + + +CTe_LocMonitorStep7::~CTe_LocMonitorStep7() + { + } + +CTe_LocMonitorStep7::CTe_LocMonitorStep7() + { + SetTestStepName(KLocMonitorStep7); + } + +TVerdict CTe_LocMonitorStep7::doTestStepPreambleL() + { + CTe_LocMonitorStepBase::doTestStepPreambleL(); + + iConversionHandler = CLocInfoConversionHandler::NewL(); + iConversionHandler1 = CLocInfoConversionHandler::NewL(); + + return TestStepResult(); + } + +// +// This test checks that it is possible to connect a session and +// subsession with the Location Monitor and then close both. +// +TVerdict CTe_LocMonitorStep7::doTestStepL() + { + if (TestStepResult()==EPass) + { + // Test 7 panics with 0, ELocMonitorDuplicateRequest + RLbsLocInfoConverter_ConvertLocationInfo7L(); + } + + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStep7::doTestStepPostambleL() + { + delete iConversionHandler; + delete iConversionHandler1; + CTe_LocMonitorStepBase::doTestStepPostambleL(); + return TestStepResult(); + } + + + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStep7::RLbsLocInfoConverter_ConvertLocationInfo7L +// This test case tests the scenario when user tries to request new batch +// conversion without waiting for completion of previous one. +// ----------------------------------------------------------------------------- +// +TInt CTe_LocMonitorStep7::RLbsLocInfoConverter_ConvertLocationInfo7L() + { + INFO_PRINTF1(_L("*** RLbsLocInfoConverter_ConvertLocationInfo7L()")); + RLbsLocMonitorSession locMonitorSession; + TInt error = locMonitorSession.Connect(); + if( error != KErrNone ) + { + return error; + } + CleanupClosePushL( locMonitorSession ); + RLbsLocInfoConverter locInfoConverter; + CleanupClosePushL( locInfoConverter ); + locInfoConverter.OpenL( locMonitorSession ); + + TUid conversionModuleId = TUid::Uid( KNullUidValue );; + + // Here in this case input area doesnt matter + RPointerArray locationInfoArray; + CleanupClosePushL( locationInfoArray ); + + RPointerArray locationInfoArray1; + CleanupClosePushL( locationInfoArray1 ); + + CLbsLocationInfo* locationInfo = CreateLocationInfoObjectLC( ELbsAreaGsmCellInfoClass ); + + CLbsLocationInfo* locationInfo1 = CreateLocationInfoObjectLC( ELbsAreaWlanInfoClass ); + + locationInfoArray.Append( locationInfo ); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId ,iConversionHandler->iStatus ); + iConversionHandler->Start(); + + locationInfoArray1.Append( locationInfo1 ); + + TRequestStatus status; + + #pragma message("GEOTAGGING TEST ISSUE: How to replicate next lines behaviour: TestModuleIf().SetExitReason(CTestModuleIf::EPanic, 0)") + // TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0); + + locInfoConverter.ConvertLocationInfoL( + locationInfoArray1,ELbsConversionNotDefined, + ELbsConversionOutputPosition,conversionModuleId,status ); + + CleanupStack::Pop(4); // locationInfo1,locationInfoArray1,locationInfo,locationInfoArray + locationInfoArray.ResetAndDestroy(); + locationInfoArray1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 2 ); // locInfoConverter,locMonitorSession + return KErrNone; + } + + + + +// [End of File] diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstepbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorstepbase.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,339 @@ +/* +* 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: +* +*/ + + +/** + @file te_geolocmonitorstepbase.cpp +*/ +#include "te_geolocmonitorstepbase.h" +#include "te_geolocmonitorsuitedefs.h" +#include "tserverstartparams.h" +#include "cserverlaunch.h" +#include "lbslocmonitorserverdata.h" +#include "lbsdevloggermacros.h" + +void CleanUpAreaInfoArray(TAny* aArray) + { + static_cast(aArray)->ResetAndDestroy(); + } + +TVerdict CTe_LocMonitorStepBase::doTestStepPreambleL() + { + LBSLOG(ELogP1, "CTe_LocMonitorStepBase::doTestStepPreambleL()\n"); + // START MEMORY TEST + __UHEAP_MARK; + + // Construct a new ActiveScheduler and install it + iActiveScheduler = new (ELeave) CActiveScheduler(); + CActiveScheduler::Install(iActiveScheduler); + + SetTestStepResult(EPass); + return TestStepResult(); + } + +TVerdict CTe_LocMonitorStepBase::doTestStepPostambleL() + { + LBSLOG(ELogP1, "CTe_LocMonitorStepBase::doTestStepPostambleL()\n"); + + delete iActiveScheduler; + + // END MEMORY TEST + __UHEAP_MARKEND; + + return TestStepResult(); + } + +CTe_LocMonitorStepBase::~CTe_LocMonitorStepBase() + { + LBSLOG(ELogP1, "CTe_LocMonitorStepBase::~CTe_LocMonitorStepBase()\n"); + } + +CTe_LocMonitorStepBase::CTe_LocMonitorStepBase() + { + LBSLOG(ELogP1, "CTe_LocMonitorStepBase::CTe_LocMonitorStepBase()\n"); + } + + +// Helper methods + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CreatePositionObjectLC +// ----------------------------------------------------------------------------- +// +CLbsPositionInfo* CTe_LocMonitorStepBase::CreatePositionInfoObjectLC() + { + INFO_PRINTF1(_L("CreatePositionInfoObjectLC()")); + TLocality locality; + locality.SetCoordinate( 62.5285,23.9385 ); + locality.SetAccuracy( 100,0.0 ); + CLbsPositionInfo* positionInfo = CLbsPositionInfo::NewL( locality ); + CleanupStack::PushL( positionInfo ); + return positionInfo; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CreateGsmCellInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsGsmCellInfo* CTe_LocMonitorStepBase::CreateGsmCellInfoObjectLC() + { + INFO_PRINTF1(_L("CreateGsmCellInfoObjectLC()")); + CLbsGsmCellInfo* gsmCellInfo = CLbsGsmCellInfo::NewL( 100,101,102,103); + CleanupStack::PushL( gsmCellInfo ); + return gsmCellInfo; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CreateWcdmaCellInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsWcdmaCellInfo* CTe_LocMonitorStepBase::CreateWcdmaCellInfoObjectLC() + { + INFO_PRINTF1(_L("CreateWcdmaCellInfoObjectLC()")); + CLbsWcdmaCellInfo* wcdmaCellInfo = CLbsWcdmaCellInfo::NewL( 100,101,102 ); + CleanupStack::PushL( wcdmaCellInfo ); + return wcdmaCellInfo; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CreateWlanInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsWlanInfo* CTe_LocMonitorStepBase::CreateWlanInfoObjectLC() + { + INFO_PRINTF1(_L("CreateWlanInfoObjectLC()")); + TLbsWlanMacAddress macAddress(_L8("10.0.1")); + CLbsWlanInfo* wlanInfo = CLbsWlanInfo::NewL( macAddress,10.1 ); + CleanupStack::PushL( wlanInfo ); + return wlanInfo; + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CreateLocationInfoObjectLC +// ----------------------------------------------------------------------------- +// +CLbsLocationInfo* CTe_LocMonitorStepBase::CreateLocationInfoObjectLC( + TLbsAreaInfoClassType aAreaType ) + { + INFO_PRINTF1(_L("CreateLocationInfoObjectLC()")); + CLbsLocationInfo* locationInfo = CLbsLocationInfo::NewL(); + CleanupStack::PushL( locationInfo ); + AppendAreaInfoObjectToLocationInfoL( locationInfo,aAreaType ); + return locationInfo; + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::AppendAreaInfoObjectToLocationInfoL +// ----------------------------------------------------------------------------- +// +void CTe_LocMonitorStepBase::AppendAreaInfoObjectToLocationInfoL( + CLbsLocationInfo* aLocationInfo, + TLbsAreaInfoClassType aAreaType ) + { + INFO_PRINTF1(_L("AppendAreaInfoObjectToLocationInfoL()")); + + CLbsPositionInfo* positionInfo = NULL; + CLbsGsmCellInfo* gsmCellInfo = NULL; + CLbsWcdmaCellInfo* wcdmaCellInfo = NULL; + CLbsWlanInfo* wlanInfo = NULL; + + switch( aAreaType ) + { + case ELbsAreaPositionInfoClass: + positionInfo = CreatePositionInfoObjectLC(); + aLocationInfo->AddAreaInfoL( positionInfo ); + CleanupStack::Pop( positionInfo ); + break; + + case ELbsAreaGsmCellInfoClass: + gsmCellInfo = CreateGsmCellInfoObjectLC(); + aLocationInfo->AddAreaInfoL( gsmCellInfo ); + CleanupStack::Pop( gsmCellInfo ); + break; + + case ELbsAreaWcmdaCellInfoClass: + wcdmaCellInfo = CreateWcdmaCellInfoObjectLC(); + aLocationInfo->AddAreaInfoL( wcdmaCellInfo ); + CleanupStack::Pop( wcdmaCellInfo ); + break; + + case ELbsAreaWlanInfoClass: + wlanInfo = CreateWlanInfoObjectLC(); + aLocationInfo->AddAreaInfoL( wlanInfo ); + CleanupStack::Pop( wlanInfo ); + break; + + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CheckPositionConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CTe_LocMonitorStepBase::CheckPositionConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + INFO_PRINTF1(_L("CheckPositionConvertedInfoL()")); + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfoL( areaInfoArray,CLbsLocationInfo::ELbsPosInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( aTestType == EPositive ) + { + if( !count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() NOT to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + // and to check out proper ownership of the + // heap items do it again! + + aLocationInfo->GetAreaInfoL( areaInfoArray,CLbsLocationInfo::ELbsPosInfo ); + count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + + if( aTestType == EPositive ) + { + if( !count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() NOT to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CheckGsmCellConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CTe_LocMonitorStepBase::CheckGsmCellConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + INFO_PRINTF1(_L("CheckGsmCellConvertedInfoL()")); + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfoL( areaInfoArray,CLbsLocationInfo::ELbsGsmInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + if( aTestType == EPositive ) + { + if( !count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() NOT to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CheckWcdmaCellConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CTe_LocMonitorStepBase::CheckWcdmaCellConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + INFO_PRINTF1(_L("CheckWcdmaCellConvertedInfoL()")); + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfoL( areaInfoArray,CLbsLocationInfo::ELbsWcdmaInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + if( aTestType == EPositive ) + { + if( !count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() NOT to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + } + +// ----------------------------------------------------------------------------- +// CTe_LocMonitorStepBase::CheckWlanConvertedInfoL +// ----------------------------------------------------------------------------- +// +void CTe_LocMonitorStepBase::CheckWlanConvertedInfoL( CLbsLocationInfo* + aLocationInfo, + TTestType + aTestType ) + { + INFO_PRINTF1(_L("CheckWlanConvertedInfoL()")); + RLbsAreaInfoBaseArray areaInfoArray; + aLocationInfo->GetAreaInfoL( areaInfoArray,CLbsLocationInfo::ELbsWlanInfo ); + TInt count = areaInfoArray.Count(); + areaInfoArray.ResetAndDestroy(); + if( aTestType == EPositive ) + { + if( !count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + else + { + if( count ) + { + INFO_PRINTF2(_L("Expected areaInfoArray.Count() NOT to return a value, got %d)"), count); + User::Leave( KErrArgument ); + } + } + } + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorsuiteserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/src/te_geolocmonitorsuiteserver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,121 @@ +/* +* 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: +* +*/ + +#include "lbsdevloggermacros.h" + +#include "te_geolocmonitorsuiteserver.h" +#include "te_geolocmonitorstep1.h" +#include "te_geolocmonitorstep2.h" +#include "te_geolocmonitorstep3.h" +#include "te_geolocmonitorstep4.h" +#include "te_geolocmonitorstep5.h" +#include "te_geolocmonitorstep6.h" +#include "te_geolocmonitorstep7.h" + + +_LIT(KServerName,"te_geolocmonitorsuite"); + +CTe_GeoLocMonitorSuite* CTe_GeoLocMonitorSuite::NewL() + { + CTe_GeoLocMonitorSuite * server = new (ELeave) CTe_GeoLocMonitorSuite(); + CleanupStack::PushL(server); + + server->ConstructL(KServerName); + CleanupStack::Pop(server); + return server; + } + +void CTe_GeoLocMonitorSuite::ConstructL(const TDesC& aName) + { + CTestServer::ConstructL(aName); + } + +CTe_GeoLocMonitorSuite::~CTe_GeoLocMonitorSuite() + { + } + +LOCAL_C void MainL() + { + // Leave the hooks in for platform security +#if (defined __DATA_CAGING__) + RProcess().DataCaging(RProcess::EDataCagingOn); + RProcess().DataCaging(RProcess::ESecureApiOn); +#endif + CActiveScheduler* sched=NULL; + sched=new(ELeave) CActiveScheduler; + CActiveScheduler::Install(sched); + CTe_GeoLocMonitorSuite* server = NULL; + // Create the CTestServer derived server + TRAPD(err,server = CTe_GeoLocMonitorSuite::NewL()); + if(!err) + { + // Sync with the client and enter the active scheduler + RProcess::Rendezvous(KErrNone); + sched->Start(); + } + delete server; + delete sched; + } + + +GLDEF_C TInt E32Main() +/** + * @return - Standard Epoc error code on process exit + * Secure variant only + * Process entry point. Called by client using RProcess API + */ + { + LBSLOG_BEGIN(); + LBSLOG(ELogP3, "te_geolocmonitorsuite Start()\n"); + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + if(cleanup == NULL) + { + return KErrNoMemory; + } + TRAPD(err,MainL()); + delete cleanup; + __UHEAP_MARKEND; + return err; + } + +CTestStep* CTe_GeoLocMonitorSuite::CreateTestStep(const TDesC& aStepName) +/** + * @return - A CTestStep derived instance + * Secure and non-secure variants + * Implementation of CTestServer pure virtual + */ + { + CTestStep* testStep = NULL; + if(aStepName == KLocMonitorStep1) + testStep = new CTe_LocMonitorStep1(); + else if(aStepName == KLocMonitorStep2) + testStep = new CTe_LocMonitorStep2(); + else if(aStepName == KLocMonitorStep3) + testStep = new CTe_LocMonitorStep3(); + else if(aStepName == KLocMonitorStep4) + testStep = new CTe_LocMonitorStep4(); + else if(aStepName == KLocMonitorStep5) + testStep = new CTe_LocMonitorStep5(); + else if(aStepName == KLocMonitorStep6) + testStep = new CTe_LocMonitorStep6(); + else if(aStepName == KLocMonitorStep7) + testStep = new CTe_LocMonitorStep7(); + + + return testStep; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/testdata/lbsgeolocmonunitconfig.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/testdata/lbsgeolocmonunitconfig.txt Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,51 @@ +// lbslocmonunitconfig.txt +// +// Copyright (c) 2009 Symbian Software Ltd. All rights reserved. +// +// sim.tsy config used for simulating only the network registration +// status +// +//! This config is used for all last known pos area tests that require only one cellid +// Original file name: lbsgeolocmonunitconfig.txt + +[TEST0] +#single +# PhoneId = ,,, , +PhoneId = Generic, 123, 1.1, 1234567890 + +#single +#SubscriberId = , +SubscriberId = 56789012345678 + +# multiple +# Current Network Name +# NetworkInfo= , , , , , " +NetworkInfo = 0, 0, Unknown, UnKn, Unknown_Network, 0 +NetworkInfo = 234, 15, Vodafone, Voda, Vodafone_UK, 0 + +# multiple +# is one of above +# RegStatus = , , +RegStatus = 5000, 5, 0 +RegStatus = 5000, 5, 1 + +# LocationArea = , , . Where is -1 for true and 0 for false?! +LocationArea = 0, 0, 0 +LocationArea = -1, 1911, 36464 + + +# ONStore= , , +ONStore= 5, 50, 60 +# ONStoreEntry= , , , , , +ONStoreEntry = 1, 447511699393, 2, 0, 8, OwnNumber1 + + +# is time in sec while this status is valid. The last record lasts until shutdown. +# - the set here has no effect. Please use NetworkInfo records instead. +# set here applies only to GetCellInfo/NotifyCellInfoChanges calls, which are not used. +# for getting CellId by our code. We use LocationArea records and GetCurrentNetwork/NotifyCurrentNetworkChange instead. +# - The status of cell info. Look at TCellInfoStatus for the list of values. +# CellInfo = , , , , . +CellInfo = 0, 2, 0, 0, 2 +CellInfo = 0, 2, 0, 0, 2 + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/testdata/lbsgeolocmonunitconfigbad.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/testdata/lbsgeolocmonunitconfigbad.txt Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,47 @@ +// config.txt +// +// Copyright (c) 2006 Symbian Software Ltd. All rights reserved. +// +// sim.tsy config used for simulating unavailability of LAC +// for negative unit test of Location Monitor +// + +[TEST0] +# PhoneId = ,,, , +PhoneId = Generic, 123, 1.1, 1234567890 + +#SubscriberId= = , +SubscriberId= 56789012345678 + +# Current Network Name +# NetworkInfo= , , , , , , +# is a network mode. GSM - 2, Unregistered - 1, WCDMA - 6 +NetworkInfo= 123, 456, Vodafone, Voda, Vodafone_UK, 0, 2 + +# LocationArea = , , . Where is -1 for true #and 0 for false. +#LocationArea= 1, 1, 1 + +# RegStatus = , , . +# Where is time in sec while this status is valid. The last record lasts until shutdown. +# - A registration status. Look at TMobilePhoneRegistrationStatus for the list of values. +# is an index of (NetworkInfo+LocationArea) array. It starts from 0. + +# Initial status. Wait for 15 sec here to allow the test to startup. +RegStatus= 15,5,0 + + + +# CellInfo = , , , . +# Where is time in sec while this status is valid. The last record lasts until shutdown. +# - the set here has no effect. Please use NetworkInfo records instead. +# set here applies only to GetCellInfo/NotifyCellInfoChanges calls, which are not used. +# for getting CellId by our code. We use LocationArea records an GetCurrentNetwork/NotifyCurrentNetworkChange instead. +# Test 0 +CellInfo= 23,2,0,0 + + +# ONStore= , , +ONStore= 5, 50, 60 +# ONStoreEntry= , , , , , +ONStoreEntry= 1, 07747012341, 2, 0, 8, OwnNumber1 + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_geolocmonitorsuite/testdata/te_geolocmonitorsuite.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_geolocmonitorsuite/testdata/te_geolocmonitorsuite.ini Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,260 @@ + +[VALIDATEGSMCELLINFO1] +// comment here please! +MCC = 0 +MNC = 0 +LAC = 0 +CID = 0 +TA = 0 +EXPECTEDERROR = 0 + +[VALIDATEGSMCELLINFO2] +MCC = 1 +MNC = 1 +LAC = 1 +CID = 1 +TA = 1 +EXPECTEDERROR = 0 + +[VALIDATEGSMCELLINFO3] +MCC = 1 +MNC = -1 +LAC = -1 +CID = -1 +TA = -1 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO4] +MCC = 1 +MNC = 1 +LAC = -1 +CID = -1 +TA = -1 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO5] +MCC = 1 +MNC = 1 +LAC = 1 +CID = -1 +TA = -1 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO6] +MCC = 1 +MNC = 1 +LAC = 1 +CID = 1 +TA = -1 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO7] +MCC = 1 +MNC = 1 +LAC = 1 +CID = 1 +TA = 1 + +[VALIDATEGSMCELLINFO8] +MCC = 0 +MNC = 0 +LAC = 0 +CID = 0 +TA = 1 + +[VALIDATEGSMCELLINFO9] +MCC = 0 +MNC = 0 +LAC = 0 +CID = 1 +TA = 1 + +[VALIDATEGSMCELLINFO10] +MCC = 0 +MNC = 0 +LAC = 1 +CID = 1 +TA = 1 + +[VALIDATEGSMCELLINFO11] +MCC = 0 +MNC = 1 +LAC = 1 +CID = 1 +TA = 1 + + +[VALIDATEGSMCELLINFO12] +MCC = 1 +MNC = 1 +LAC = 1 +CID = 1 +TA = 2000 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO13] +MCC = 1 +MNC = 1 +LAC = 1 +CID = 65538 +TA = 2000 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO13] +MCC = 1 +MNC = 1 +LAC = 1 +CID = 65538 +TA = 2000 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO14] +MCC = 1 +MNC = 1 +LAC = 65539 +CID = 65538 +TA = 2000 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO15] +MCC = 1 +MNC = 1000 +LAC = 65539 +CID = 65538 +TA = 2000 +EXPECTEDERROR = -6 + +[VALIDATEGSMCELLINFO16] +MCC = 1000 +MNC = 1000 +LAC = 65539 +CID = 65538 +TA = 2000 +EXPECTEDERROR = -6 + +[VALIDATEWCDMACELLINFO1] +MCC = 0 +MNC = 0 +UCID = 0 +SC = 0 + +[VALIDATEWCDMACELLINFO2] +MCC = 1 +MNC = 1 +UCID = 1 +SC = 1 + +[VALIDATEWCDMACELLINFO3] +MCC = 1 +MNC = -1 +UCID = -1 +SC = -1 +EXPECTEDERROR = -6 + +[VALIDATEWCDMACELLINFO4] +MCC = 1 +MNC = 1 +UCID = -1 +SC = -1 +EXPECTEDERROR = -6 + +[VALIDATEWCDMACELLINFO5] +MCC = 1 +MNC = 1 +UCID = 1 +SC = -1 +EXPECTEDERROR = -6 + +[VALIDATEWCDMACELLINFO6] +MCC = 1 +MNC = 1 +UCID = 1 +SC = 1 + +[VALIDATEWCDMACELLINFO7] +MCC = 0 +MNC = 0 +UCID = 0 +SC = 1 + +[VALIDATEWCDMACELLINFO8] +MCC = 0 +MNC = 0 +UCID = 1 +SC = 1 + + +[VALIDATEWCDMACELLINFO9] +MCC = 0 +MNC = 1 +UCID = 1 +SC = 1 + +[VALIDATEWCDMACELLINFO10] +MCC = 1 +MNC = 1 +UCID = 1 +SC = 2000 +EXPECTEDERROR = -6 + +[VALIDATEWCDMACELLINFO11] +MCC = 1 +MNC = 1 +UCID = 268435457 +SC = 2000 +EXPECTEDERROR = -6 + +[VALIDATEWCDMACELLINFO12] +MCC = 1000 +MNC = 1000 +UCID = 268435457 +SC = 2000 +EXPECTEDERROR = -6 + +[CREATEGSMCELL] +PROCEDURE = 1 + +[SETTATOGSMCELL] +PROCEDURE = 2 + +[SETNCELLTOGSMCELL] +PROCEDURE = 3 + +[VALIDATEGSMCELLHIERARCHY] +PROCEDURE = 4 + +[CREATEWCDMACELL] +PROCEDURE = 5 + +[SETSCTOWCDMACELL] +PROCEDURE = 6 + +[SETNCELLTOWCDMACELL] +PROCEDURE = 7 + +[VALIDATEWCDMACELLHIERARCHY] +PROCEDURE = 8 + +[CREATECOORDINFO] +PROCEDURE = 9 + +[VALIDATECOORDINFO] +PROCEDURE = 10 + +[CREATEWLANINFO] +PROCEDURE = 11 + +[VALIDATEWLANINFO] +PROCEDURE = 12 + +[ADDCOORDINFOTOLOCINFO] +PROCEDURE = 13 + +[ADDGSMINFOTOLOCINFO] +PROCEDURE = 14 + +[ADDWCDMAINFOTOLOCINFO] +PROCEDURE = 15 + +[ADDWLANINFOTOLOCINFO] +PROCEDURE = 16 diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,32 @@ +/* +* 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: +* +*/ + + + + + +PRJ_TESTEXPORTS +../scripts/te_LbsLocationInfoConverterSuite.script /epoc32/winscw/c/testdata/scripts/te_lbslocationinfoconvertersuite.script +../scripts/LbsLocationInfoConverter.ini /epoc32/winscw/c/testdata/configs/lbslocationinfoconverter.ini + +//./te_lbslocationmonitordb.iby /epoc32/rom/include/te_lbslocationmonitordb.iby + +PRJ_TESTMMPFILES +te_lbslocationinfoconverter.mmp + + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/group/te_lbslocationinfoconverter.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/group/te_lbslocationinfoconverter.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +/* +* 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: +* +*/ +#ifndef __LBS_TELOCATIONMONITOR_IBY__ +#define __LBS_TELOCATIONMONITOR_IBY__ + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) + +#include + +file=ABI_DIR\DEBUG_DIR\te_lbslocationmonitordb.exe sys\bin\te_lbslocationmonitordb.exe + +data=EPOCROOT##Epoc32\winscw\c\TestData\scripts\te_LbsLocationMonitorDbSuite.script TestData\scripts\te_LbsLocationMonitorDbSuite.script + +#endif // SYMBIAN_EXCLUDE_LOCATION + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/group/te_lbslocationinfoconverter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/group/te_lbslocationinfoconverter.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2006 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: +* +*/ + + +TARGET te_lbslocationinfoconvertersuite.exe +TARGETTYPE exe + +CAPABILITY ALL -TCB + +UID 0x1000007A 0x102869E2 + +VENDORID 0x70000001 + +//MACRO ENABLE_LBS_DEV_LOGGER +MACRO LBS_LOCMONITORDB_TEST + +SOURCEPATH ../src +SOURCE te_lbslocationinfoconvertersuiteserver.cpp +SOURCE te_lbslocationinfoconvertersuitestepbase.cpp +SOURCE step.cpp +SOURCE Te_locationinfoconversionobserver.cpp +SOURCE Te_locationresolverobserver.cpp + + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../inc +USERINCLUDE ../../../lbslocmonitorserver/inc +USERINCLUDE ../../../../locationcore/LbsPartnerCommon/inc + +LIBRARY euser.lib +LIBRARY testexecuteutils.lib +LIBRARY testexecutelogclient.lib +LIBRARY efsrv.lib +LIBRARY lbs.lib + +LIBRARY lbslocationinfodatatypes.lib +LIBRARY lbslocationinfoconverter.lib + + +LIBRARY lbspartnercommon.lib +LIBRARY lbsinternalapi.lib + +SMPSAFE + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/Te_locationinfoconversionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/Te_locationinfoconversionobserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002 - 2007 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: Test module to implement Advanced trigger supervision cases +* +*/ + + + +#ifndef TE_LOCATIONINFOCONVERSIONOBSERVER_H +#define TE_LOCATIONINFOCONVERSIONOBSERVER_H +#include + + + class CTelocationinfoconversionobserver: public CTimer, public MLbsLocationInfoConverterObserver + + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CTelocationinfoconversionobserver* NewL( ); + + /** + * Destructor. + */ + ~CTelocationinfoconversionobserver(); + + + void OnConversionComplete( TInt aStatusCode ); + + void RunL( ); + + void DoCancel( ); + + TInt ConversionResult(); + + // RTimer iTimer; + TRequestStatus iWaitStatus; + + private: + + /** + * C++ default constructor. + */ + CTelocationinfoconversionobserver( ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + + TInt iStatusCode; + + }; + +#endif // TE_LOCATIONINFOCONVERSIONOBSERVER_H + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/Te_locationresolverobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/Te_locationresolverobserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2002 - 2007 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: Test module to implement Advanced trigger supervision cases +* +*/ + + + +#ifndef TE_BASICLOCATIONINFOCONVERSIONOBSERVER_H +#define TE_BASICLOCATIONINFOCONVERSIONOBSERVER_H +#include + + + class CTeLocationResolverObserver: public CTimer, public MLbsLocationResolverObserver + + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CTeLocationResolverObserver* NewL( ); + + /** + * Destructor. + */ + ~CTeLocationResolverObserver(); + + void OnResolveLocationComplete(TInt aStatus, const TLocality& aLocality); + + void RunL( ); + + void DoCancel( ); + + TInt ConversionResult(); + + TInt ConversionLocality(TLocality& aLocality); + + + // RTimer iTimer; + TRequestStatus iWaitStatus; + + private: + + /** + * C++ default constructor. + */ + CTeLocationResolverObserver( ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + + TInt iStatusCode; + TLocality iLocality; + TBool iFromCache; + + }; + +#endif // TE_LOCATIONINFOCONVERSIONOBSERVER_H + +// End of File diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/ctasyncwaiter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/ctasyncwaiter.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2006 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 header file for CT_LbsAsyncWaiter +* +*/ + +/** + @file + @internalTechnology + @test +*/ + +#ifndef __CT_ASYNC_WAITER_H__ +#define __CT_ASYNC_WAITER_H__ + +//epoc includes +#include + +// Implements functions related to active objects +class CT_AsyncWaiter : public CTimer + { +public: + IMPORT_C static CT_AsyncWaiter* NewL(); + ~CT_AsyncWaiter(); + + IMPORT_C void StartAndWait(); + IMPORT_C void StartAndWaitTimer(const TTimeIntervalMicroSeconds32& aTime); + IMPORT_C TInt Result() const; + +private: + CT_AsyncWaiter(); + void ConstructL(); + // from CActive + virtual void RunL(); + virtual void DoCancel(); + +private: + TInt iError; + }; + +#endif // __CT_ASYNC_WAITER_H__ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/step.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/step.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,261 @@ +/* +* Copyright (c) 2007 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: +* +*/ + +#ifndef __STEP_H__ +#define __STEP_H__ +#include +#include "te_lbslocationinfoconvertersuitestepbase.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Te_locationinfoconversionobserver.h" +#include "Te_locationresolverobserver.h" + +class CStep : public CTe_LbsLocationInfoConverterSuiteStepBase + { +public: + CStep(); + ~CStep(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepL(); + virtual TVerdict doTestStepPostambleL(); + + virtual void ConvertLocationInfoL(TInt conversionprefs=0, TInt requestedinfo=0, TInt fntype=0); + virtual void ConvertLocationInfo2L(TInt conversionprefs=0, TInt requestedinfo=0, TInt fntype=0); + + virtual TInt CreateLocationInfoConverterL(); +// virtual TInt SetCoordinateInfoL( CStifItemParser& aItem ); + + virtual void SetGSMCellInfoL( TInt fntype=1, TInt countrycode=-2, TInt networkcode=-2, + TInt locationcode=-2, TInt cellid=-2, TInt timingadvance=-2, TInt Rxlev=-2, TInt nNeignbourcells=0, + TInt arfcn=-2, TInt bsic=-2, TInt NRxlev=-2); + virtual TInt SetGSMCellInfo2L( TInt fntype=1, TInt countrycode=-2, TInt networkcode=-2, + TInt locationcode=-2, TInt cellid=-2, TInt timingadvance=-2, TInt Rxlev=-2, TInt nNeignbourcells=0, + TInt arfcn=-2, TInt bsic=-2, TInt NRxlev=-2); + virtual TInt SetWCDMACellInfoL(TInt fntype, TInt countrycode=-2, + TInt networkcode=-2, TInt cellid=-2, TInt nNeignbourcells=0, TInt scramblingcode=-2, + TInt neighbourucid=-2, TInt neighbourscode=-2, TInt neighbourpathloss=-2, + TInt neighboursignalstrength=-2); + virtual TInt SetWLanInfoL(TInt fntype=1, TInt macidint=-2, TInt signalstrength=-2); + virtual void AddLocationInfoL(); + virtual void AddLocationInfo2L(); + + virtual TInt ValidateLocationInfo(TInt requestedinfo=1); + virtual TInt ValidateLocationInfo2(TInt requestedinfo=1); + virtual TInt MiscL(TInt testcase); + virtual TInt SetConversionPrefs(TLbsConversionPrefs aSetConversionPrefs=0); + virtual TInt GetAndCheckConversionPrefs(TLbsConversionPrefs aSetConversionPrefs=0); + virtual TInt Cleanup(); + +private: + TInt iApiId; + TInt iPluginUid; + CLbsLocationResolver* iLbsLocationResolver; + CLbsLocationResolver* iLbsLocationResolver2; + CLbsLocationInfoConverter* iLbsLocationInfoConverter; + CLbsLocationInfo* iLbsLocationInfo; + CTeLocationResolverObserver* iResolverObserver; + CTeLocationResolverObserver* iResolverObserver2; + CTelocationinfoconversionobserver* iObserver; + RLbsLocationInfoBaseArray iLbsLocationInfoArray; + RLbsLocationInfoBaseArray iLbsLocationInfoArrayTemp; + + // for testing multipls conversions + CTelocationinfoconversionobserver* iObserver2; + CLbsLocationInfoConverter* iLbsLocationInfoConverter2; + CLbsLocationInfo* iLbsLocationInfo2; + + RLbsLocationInfoBaseArray iLbsLocationInfoArray2; + RLbsLocationInfoBaseArray iLbsLocationInfoArrayTemp2; + +private: + void CallL(TInt aId); + void test_2698_4_1_1_1L(); + void test_2698_4_1_1_3L(); + void test_2698_4_1_1_4L(); + void test_2698_4_1_1_5L(); + void test_2698_4_1_1_6L(); + void test_2698_4_1_1_7L(); + void test_2698_4_1_1_8L(); + void test_2698_4_1_1_9L(); + void test_2698_4_1_1_10L(); + void test_2698_4_1_1_11L(); + void test_2698_4_1_1_12L(); + void test_2698_4_1_1_13L(); + void test_2698_4_1_2L(); + void test_2698_4_1_3L(); + void test_2698_4_1_4L(); + void test_2698_4_1_5L(); + void test_2698_4_1_6L(); + void test_2698_4_1_7L(); + void test_2698_4_1_8L(); + void test_2698_4_1_9L(); + void test_2698_4_1_10L(); + void test_2698_4_1_11L(); + void test_2698_4_1_12L(); + void test_2698_4_1_13L(); + void test_2698_4_1_14L(); + void test_2698_4_1_15L(); + void test_2698_4_1_16L(); + void test_2698_4_1_17L(); + void test_2698_4_1_18L(); + void test_2698_4_1_19L(); + void test_2698_4_1_20L(); + void test_2698_4_1_21L(); + void test_2698_4_1_22L(); + void test_2698_4_1_23L(); + void test_2698_4_1_24L(); + void test_2698_4_1_25L(); + void test_2698_4_1_26L(); + void test_2698_4_1_27L(); + void test_2698_4_1_28_1L(); + void test_2698_4_1_28_1_3L(); + void test_2698_4_1_28_1_4L(); + void test_2698_4_1_28_1_5L(); + void test_2698_4_1_28_1_6L(); + void test_2698_4_1_28_1_7L(); + void test_2698_4_1_28_1_8L(); + void test_2698_4_1_28_1_9L(); + void test_2698_4_1_28_1_10L(); + void test_2698_4_1_28_2L(); + void test_2698_4_1_29L(); + void test_2698_4_1_30L(); + void test_2698_4_1_31L(); + void test_2698_4_1_32L(); + void test_2698_4_1_33L(); + void test_2698_4_1_34L(); + void test_2698_4_1_35L(); + void test_2698_4_1_36L(); + void test_2698_4_1_37L(); + void test_2698_4_1_38L(); + void test_2698_4_1_39L(); + void test_2698_4_1_40L(); + void test_2698_4_1_41L(); + void test_2698_4_1_42L(); + void test_2698_4_1_43L(); + void test_2698_4_1_44L(); + void test_2698_4_1_45L(); + void test_2698_4_1_46L(); + void test_2698_4_1_47_1L(); + void test_2698_4_1_47_2L(); + void test_2698_4_1_47_3L(); + void test_2698_4_1_49_1L(); + void test_2698_4_1_49_2L(); + void test_2698_4_1_51L(); + void test_2698_4_1_52L(); + void test_2698_4_1_53L(); + void test_2698_4_2_1L(); + void test_2698_4_2_2L(); + void test_2698_4_2_3L(); + void test_2698_4_2_4L(); + void test_2698_4_2_5L(); + void test_2698_4_2_6L(); + void test_2698_4_2_7L(); + void test_2698_4_2_8L(); + void test_2698_4_2_9L(); + void test_2698_4_2_10L(); + void test_2698_4_2_11L(); + void test_2698_4_2_12L(); + void test_2698_4_2_13L(); + void test_2698_4_2_14L(); + void test_2698_4_2_15L(); + void test_2698_4_2_16L(); + void test_2698_4_2_17L(); + void test_2698_4_2_18L(); + void test_2698_4_2_19L(); + void test_2698_4_2_20L(); + void test_2698_4_2_21L(); + void test_2698_4_2_22L(); + void test_2698_4_3_1_1L(); + void test_2698_4_3_2_1L(); + void test_2698_4_3_2_2L(); + void test_2698_4_3_4L(); + void test_2698_4_3_5L(); + void test_2698_4_3_6L(); + void test_2698_4_3_7L(); + void test_2698_4_3_8L(); + void test_2698_4_3_9L(); + void test_2698_4_3_10L(); + void test_2698_4_4_1L(); + void test_2698_4_4_2L(); + void test_2698_4_4_3L(); + void test_2698_4_4_4L(); + void test_2698_4_5_1L(); + void test_2698_4_5_2L(); + void test_2698_5_1_1L(); + void test_2698_5_1_2L(); + void test_2698_5_1_3L(); + void test_2698_5_1_4L(); + void test_2698_5_1_5L(); + void test_2698_5_1_6L(); + void test_2698_5_1_7L(); + void test_2698_5_1_8L(); + void test_2698_5_1_9L(); + void test_2698_5_1_10L(); + void test_2698_5_1_11L(); + void test_2698_5_1_12L(); + void test_2698_5_1_13L(); + void test_2698_5_1_14L(); + void test_2698_5_1_15L(); + void test_2698_5_1_16L(); + void test_2698_5_1_17L(); + void test_2698_5_1_18L(); + void test_2698_5_1_19L(); + void test_2698_5_1_20L(); + void test_2698_5_1_21L(); + void test_2698_5_1_22L(); + void test_2698_5_1_23L(); + void test_2698_5_1_24L(); + void test_2698_5_1_25L(); + void test_2698_5_1_26L(); + void test_2698_5_1_27L(); + void test_2698_5_2_1L(); + void test_2698_5_2_2L(); + void test_2698_5_2_3L(); + void test_2698_5_2_4L(); + void test_2698_5_2_5L(); + void test_2698_5_2_6L(); + void test_2698_5_3_1L(); + void test_2698_5_3_2L(); + void test_2698_5_3_3L(); + void test_2698_5_3_4L(); + void test_2698_5_4_1L(); + void test_MultipleSessionsOneAfterAnotherL(); + void test_MultipleCoversionsAtSameTimeL(); + void test_MultipleResolversAtSameTimeL(); + void test_SetAndGetConversionPrefs(); + void test_2698_5_4_2L(); + void test_cacheL(); + void test_cache2L(); + void test_cache3L(); + }; + +_LIT(KStep,"Step"); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/te_lbslocationinfoconvertersuitedefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/te_lbslocationinfoconvertersuitedefs.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2004 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: +* +*/ + +#ifndef __TE_LBSLOCATIONMONITOR_SUITE_DEFS_H__ +#define __TE_LBSLOCATIONMONITOR_SUITE_DEFS_H__ + +#include + +// For Backward Compatibility test +_LIT(KTe_BoolNeedResetFromDefault, "resetall"); +// For test step panics +_LIT(KTe_LbsLocationMonitorSuitePanic, "Te_LbsLocationMonitorSuite"); + +_LIT(KErrorCreateTELBSLocationMonitorTestStep, "The test step can not be created: %d"); +_LIT(ErrorUnexpected, "Unexpected error returned:%d"); + +_LIT(KErrorCheckRunBeforeLeaving, "ErrorCheck run before leaving"); +_LIT(KErrorBackwardCompatibilityNotRespected, "The backward compatibility is not respected anymore"); + + + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/te_lbslocationinfoconvertersuiteserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/te_lbslocationinfoconvertersuiteserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2006 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: +* +*/ + + +#ifndef __TE_LBSLOCATIONMONITOR_SERVER_H__ +#define __TE_LBSLOCATIONMONITOR_SERVER_H__ +#include + + +class CTe_LbsLocationMonitorSuite : public CTestServer + { +public: + static CTe_LbsLocationMonitorSuite* NewL(); + // Base class pure virtual override + virtual CTestStep* CreateTestStep(const TDesC& aStepName); + IMPORT_C virtual void ConstructL(const TDesC& aName); + ~CTe_LbsLocationMonitorSuite(); + +private: + }; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/te_lbslocationinfoconvertersuitestepbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/inc/te_lbslocationinfoconvertersuitestepbase.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2004 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: +* +*/ + + +#ifndef __TE_LBSLOCATIONMONITOR_STEP_BASE__ +#define __TE_LBSLOCATIONMONITOR_STEP_BASE__ +#include +#include +#include "ctasyncwaiter.h" + + + +// Please add your include here if you have + +/**************************************************************************** +* The reason to have a new step base is that it is very much possible +* that the all individual test steps have project related common variables +* and members +* and this is the place to define these common variable and members. +* +****************************************************************************/ +class CTe_LbsLocationInfoConverterSuiteStepBase : public CTestStep + { + +public: + virtual ~CTe_LbsLocationInfoConverterSuiteStepBase(); + CTe_LbsLocationInfoConverterSuiteStepBase(); + virtual TVerdict doTestStepPreambleL(); + virtual TVerdict doTestStepPostambleL(); + TInt GetTestCaseId(); + TInt GetTestCaseApi(); + TInt GetPluginUid(); +protected: + void InitWaitersL(); + void DeleteWaiters(); + +protected: + CActiveScheduler* iScheduler; + }; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/scripts/LbsLocationInfoConverter.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/scripts/LbsLocationInfoConverter.ini Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,1388 @@ +[MultipleSessions-1] +tc_id=151 +plugin_uid = 537007117 + +[MultipleSessions-2] +tc_id=152 +plugin_uid = 537007117 + +[MultipleSessions-3] +tc_id=153 +plugin_uid = 537007117 + +[Cache-Test-1] +tc_id=156 +plugin_uid = 537007117 + +[Cache-Test-2] +tc_id=157 +plugin_uid = 537007117 + +[Cache-Test-3] +tc_id=158 +plugin_uid = 537007117 + +[GetAllLocationInfo] +tc_id=0 + +[2698-4-1-1-1] +tc_id=1 +plugin_uid = 537007117 + +[2698-4-2-1-1] +tc_id=1 +plugin_uid = 0 + +[2698-4-1-1-3] +tc_id=2 +plugin_uid = 537007117 + +[2698-4-2-1-3] +tc_id=2 +plugin_uid = 0 + +[2698-4-1-1-4] +tc_id=3 +plugin_uid = 537007117 + +[2698-4-1-1-5] +tc_id=4 +plugin_uid = 537007117 + +[2698-4-1-1-6] +tc_id=5 +plugin_uid = 537007117 + +[2698-4-1-1-7] +tc_id=6 +plugin_uid = 537007117 + +[2698-4-1-1-8] +tc_id=7 +plugin_uid = 537007117 + +[2698-4-2-1-8] +tc_id=7 +plugin_uid = 0 + +[2698-4-1-1-9] +tc_id=8 +plugin_uid = 537007117 + + +[2698-4-2-1-9] +tc_id=8 +plugin_uid = 0 + +[2698-4-1-1-10] +tc_id=9 +plugin_uid = 537007117 + +[2698-4-1-1-11] +tc_id=10 +plugin_uid = 537007117 + +[2698-4-1-1-12] +tc_id=11 +plugin_uid = 537007117 + +[2698-4-1-1-13] +tc_id=12 +plugin_uid = 537007117 + +[2698-4-1-2] +tc_id=13 +plugin_uid = 537007117 + +[2698-4-11-2] +tc_id=13 +plugin_uid = 0 + +[2698-4-1-3] +tc_id=14 +plugin_uid = 537007117 + +[2698-4-1-4] +tc_id=15 +plugin_uid = 537007117 + +[2698-4-1-5] +tc_id=16 +plugin_uid = 537007117 + +[2698-4-1-6] +tc_id=17 +plugin_uid = 537007117 + +[2698-4-1-7] +tc_id=18 +plugin_uid = 537007117 + +[2698-4-1-8] +tc_id=19 +plugin_uid = 537007117 + +[2698-4-1-9] +tc_id=20 +plugin_uid = 537007117 + +[2698-4-1-10] +tc_id=21 +plugin_uid = 537007117 + +[2698-4-1-11] +tc_id=22 +plugin_uid = 537007117 + +[2698-4-1-12] +tc_id=23 +plugin_uid = 537007117 + +[2698-4-1-13] +tc_id=24 +plugin_uid = 537007117 + +[2698-4-1-14] +tc_id=25 +plugin_uid = 537007117 + +[2698-4-1-15] +tc_id=26 +plugin_uid = 537007117 + +[2698-4-1-16] +tc_id=27 +plugin_uid = 537007117 + +[2698-4-1-17] +tc_id=28 +plugin_uid = 537007117 + +[2698-4-1-18] +tc_id=29 +plugin_uid = 537007117 + +[2698-4-1-19] +tc_id=30 +plugin_uid = 537007117 + +[2698-4-1-20] +tc_id=31 +plugin_uid = 537007117 + +[2698-4-1-21] +tc_id=32 +plugin_uid = 537007117 + +[2698-4-1-22] +tc_id=33 +plugin_uid = 537007117 + +[2698-4-1-23] +tc_id=34 +plugin_uid = 537007117 + +[2698-4-1-24] +tc_id=35 +plugin_uid = 537007117 + +[2698-4-1-25] +tc_id=36 +plugin_uid = 537007117 + +[2698-4-1-26] +tc_id=37 +plugin_uid = 537007117 + +[2698-4-1-27] +tc_id=38 +plugin_uid = 537007117 + +[2698-4-1-28-1] +tc_id=39 +plugin_uid = 537007117 + +[2698-4-1-28-1-3] +tc_id=40 +plugin_uid = 537007117 + +[2698-4-1-28-1-4] +tc_id=41 +plugin_uid = 537007117 + +[2698-4-1-28-1-5] +tc_id=42 +plugin_uid = 537007117 + +[2698-4-1-28-1-6] +tc_id=43 +plugin_uid = 537007117 + +[2698-4-1-28-1-7] +tc_id=44 +plugin_uid = 537007117 + +[2698-4-1-28-1-8] +tc_id=45 +plugin_uid = 537007117 + +[2698-4-1-28-1-9] +tc_id=46 +plugin_uid = 537007117 + +[2698-4-1-28-1-10] +tc_id=47 +plugin_uid = 537007117 + +[2698-4-1-28-2] +tc_id=48 +plugin_uid = 537007117 + +[2698-4-11-28-2] +tc_id=48 +plugin_uid = 0 + +[2698-4-1-29] +tc_id=49 +plugin_uid = 537007117 + +[2698-4-1-30] +tc_id=50 +plugin_uid = 537007117 + +[2698-4-1-31] +tc_id=51 +plugin_uid = 537007117 + +[2698-4-1-32] +tc_id=52 +plugin_uid = 537007117 + +[2698-4-1-33] +tc_id=53 +plugin_uid = 537007117 + +[2698-4-1-34] +tc_id=54 +plugin_uid = 537007117 + +[2698-4-1-35] +tc_id=55 +plugin_uid = 537007117 + +[2698-4-1-36] +tc_id=56 +plugin_uid = 537007117 + +[2698-4-1-37] +tc_id=57 +plugin_uid = 537007117 + +[2698-4-1-38] +tc_id=58 +plugin_uid = 537007117 + +[2698-4-1-39] +tc_id=59 +plugin_uid = 537007117 + +[2698-4-1-40] +tc_id=60 +plugin_uid = 537007117 + +[2698-4-1-41] +tc_id=61 +plugin_uid = 537007117 + +[2698-4-1-42] +tc_id=62 +plugin_uid = 537007117 + +[2698-4-1-43] +tc_id=63 +plugin_uid = 537007117 + +[2698-4-1-44] +tc_id=64 +plugin_uid = 537007117 + +[2698-4-1-45] +tc_id=65 +plugin_uid = 537007117 + +[2698-4-1-46] +tc_id=66 +plugin_uid = 537007117 + +[2698-4-1-47-1] +tc_id=67 +plugin_uid = 537007117 + +[2698-4-1-47-2] +tc_id=68 +plugin_uid = 537007117 + +[2698-4-1-47-3] +tc_id=69 +plugin_uid = 537007117 + +[2698-4-1-49-1] +tc_id=70 +plugin_uid = 537007117 + +[2698-4-1-49-2] +tc_id=71 +plugin_uid = 537007117 + +[2698-4-1-51] +tc_id=72 +plugin_uid = 537007117 + +[2698-4-1-52] +tc_id=73 +plugin_uid = 537007117 + +[2698-4-1-53] +tc_id=74 +plugin_uid = 537007117 + +[2698-4-2-1] +tc_id=75 +plugin_uid = 537007117 + +[2698-4-2-2] +tc_id=76 +plugin_uid = 537007117 + +[2698-4-2-3] +tc_id=77 +plugin_uid = 537007117 + +[2698-4-2-4] +tc_id=78 +plugin_uid = 537007117 + +[2698-4-2-5] +tc_id=79 +plugin_uid = 537007117 + +[2698-4-2-6] +tc_id=80 +plugin_uid = 537007117 + +[2698-4-2-7] +tc_id=81 +plugin_uid = 537007117 + +[2698-4-2-8] +tc_id=82 +plugin_uid = 537007117 + +[2698-4-2-9] +tc_id=83 +plugin_uid = 537007117 + +[2698-4-2-10] +tc_id=84 +plugin_uid = 537007117 + +[2698-4-2-11] +tc_id=85 +plugin_uid = 537007117 + +[2698-4-2-12] +tc_id=86 +plugin_uid = 537007117 + +[2698-4-2-13] +tc_id=87 +plugin_uid = 537007117 + +[2698-4-2-14] +tc_id=88 +plugin_uid = 537007117 + +[2698-4-2-15] +tc_id=89 +plugin_uid = 537007117 + +[2698-4-2-16] +tc_id=90 +plugin_uid = 537007117 + +[2698-4-2-17] +tc_id=91 +plugin_uid = 537007117 + +[2698-4-2-18] +tc_id=92 +plugin_uid = 537007117 + +[2698-4-2-19] +tc_id=93 +plugin_uid = 537007117 + +[2698-4-2-20] +tc_id=94 +plugin_uid = 537007117 + +[2698-4-2-21] +tc_id=95 +plugin_uid = 537007117 + +[2698-4-2-22] +tc_id=96 +plugin_uid = 537007117 + +[2698-4-3-1-1] +tc_id=97 +plugin_uid = 537007117 + + +[2698-4-3-2-1] +tc_id=98 +plugin_uid = 537007117 + + +[2698-4-3-2-2] +tc_id=99 +plugin_uid = 537007117 + +[2698-4-3-4] +tc_id=100 +plugin_uid = 537007117 + +[2698-4-3-5] +tc_id=101 +plugin_uid = 537007117 + + +[2698-4-3-6] +tc_id=102 +plugin_uid = 537007117 + + +[2698-4-3-7] +tc_id=103 +plugin_uid = 537007117 + +[2698-4-3-8] +tc_id=104 +plugin_uid = 537007117 + +[2698-4-3-9] +tc_id=105 +plugin_uid = 537007117 + +[2698-4-3-10] +tc_id=106 +plugin_uid = 537007117 + +[2698-4-4-1] +tc_id=107 +plugin_uid = 537007117 + +[2698-4-4-2] +tc_id=108 +plugin_uid = 537007117 + +[2698-4-4-3] +tc_id=109 +plugin_uid = 537007117 + +[2698-4-4-4] +tc_id=110 +plugin_uid = 537007117 + +[2698-4-5-1] +tc_id=111 +plugin_uid = 537007117 + +[2698-4-5-2] +tc_id=112 +plugin_uid = 537007117 + +[2698-5-1-1] +tc_id=113 +plugin_uid = 537007117 + +[2698-5-1-2] +tc_id=114 +plugin_uid = 537007117 + +[2698-5-1-3] +tc_id=115 +plugin_uid = 537007117 + +[2698-5-1-4] +tc_id=116 +plugin_uid = 537007117 + +[2698-5-1-5] +tc_id=117 +plugin_uid = 537007117 + +[2698-5-1-6] +tc_id=118 +plugin_uid = 537007117 + +[2698-5-1-7] +tc_id=119 +plugin_uid = 537007117 + +[2698-5-1-8] +tc_id=120 +plugin_uid = 537007117 + +[2698-5-1-9] +tc_id=121 +plugin_uid = 537007117 + +[2698-5-1-10] +tc_id=122 +plugin_uid = 537007117 + +[2698-5-1-11] +tc_id=123 +plugin_uid = 537007117 + + +[2698-5-1-12] +tc_id=124 +plugin_uid = 537007117 + +[2698-5-1-13] +tc_id=125 +plugin_uid = 537007117 + +[2698-5-1-14] +tc_id=126 +plugin_uid = 537007117 + +[2698-5-1-15] +tc_id=127 +plugin_uid = 537007117 + +[2698-5-1-16] +tc_id=128 +plugin_uid = 537007117 + +[2698-5-1-17] +tc_id=129 +plugin_uid = 537007117 + +[2698-5-1-18] +tc_id=130 +plugin_uid = 537007117 + +[2698-5-1-19] +tc_id=131 +plugin_uid = 537007117 + +[2698-5-1-20] +tc_id=132 +plugin_uid = 537007117 + +[2698-5-1-21] +tc_id=133 +plugin_uid = 537007117 + +[2698-5-1-22] +tc_id=134 +plugin_uid = 537007117 + +[2698-5-1-23] +tc_id=135 +plugin_uid = 537007117 + +[2698-5-1-24] +tc_id=136 +plugin_uid = 537007117 + +[2698-5-1-25] +tc_id=137 +plugin_uid = 537007117 + +[2698-5-1-26] +tc_id=138 +plugin_uid = 537007117 + +[2698-5-1-27] +tc_id=139 +plugin_uid = 537007117 + +[2698-5-2-1] +tc_id=140 +plugin_uid = 537007117 + +[2698-5-2-2] +tc_id=141 +plugin_uid = 537007117 + +[2698-5-2-3] +tc_id=142 +plugin_uid = 537007117 + +[2698-5-2-4] +tc_id=143 +plugin_uid = 537007117 + +[2698-5-2-5] +tc_id=144 +plugin_uid = 537007117 + +[2698-5-2-6] +tc_id=145 +plugin_uid = 537007117 + +[2698-5-3-1] +tc_id=146 +plugin_uid = 537007117 + +[2698-5-3-2] +tc_id=147 +plugin_uid = 537007117 + +[2698-5-3-3] +tc_id=148 +plugin_uid = 537007117 + +[2698-5-3-4] +tc_id=149 +plugin_uid = 537007117 + +[2698-5-4-1] +tc_id=150 +plugin_uid = 537007117 + +[2698-5-4-2] +tc_id=154 +plugin_uid = 10 + +[2698-5-4-3] +tc_id=1 +plugin_uid = 0 + +[2698-4-1-1-1-R] +tc_id=1 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-1-1-R] +tc_id=1 +tc_api=1 +plugin_uid = 0 + +[2698-4-1-1-3-R] +tc_id=2 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-1-3-R] +tc_id=2 +tc_api=1 +plugin_uid = 0 + + +[2698-4-1-1-4-R] +tc_id=3 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-1-5-R] +tc_id=4 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-1-6-R] +tc_id=5 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-1-7-R] +tc_id=6 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-1-8-R] +tc_id=7 +tc_api=1 +plugin_uid = 537007117 + + +[2698-4-2-1-8-R] +tc_id=7 +tc_api=1 +plugin_uid = 0 + +[2698-4-1-1-9-R] +tc_id=8 +tc_api=1 +plugin_uid = 537007117 + + +[2698-4-2-1-9-R] +tc_id=8 +tc_api=1 +plugin_uid = 0 + + +[2698-4-1-1-10-R] +tc_id=9 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-1-11-R] +tc_id=10 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-1-12-R] +tc_id=11 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-1-13-R] +tc_id=12 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-2-R] +tc_id=13 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-11-2-R] +tc_id=13 +tc_api=1 +plugin_uid = 0 + +[2698-4-1-3-R] +tc_id=14 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-4-R] +tc_id=15 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-5-R] +tc_id=16 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-6-R] +tc_id=17 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-7-R] +tc_id=18 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-8-R] +tc_id=19 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-9-R] +tc_id=20 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-10-R] +tc_id=21 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-11-R] +tc_id=22 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-12-R] +tc_id=23 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-13-R] +tc_id=24 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-14-R] +tc_id=25 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-15-R] +tc_id=26 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-16-R] +tc_id=27 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-17-R] +tc_id=28 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-18-R] +tc_id=29 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-19-R] +tc_id=30 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-20-R] +tc_id=31 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-21-R] +tc_id=32 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-22-R] +tc_id=33 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-23-R] +tc_id=34 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-24-R] +tc_id=35 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-25-R] +tc_id=36 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-R] +tc_id=39 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-3-R] +tc_id=40 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-4-R] +tc_id=41 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-5-R] +tc_id=42 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-6-R] +tc_id=43 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-7-R] +tc_id=44 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-8-R] +tc_id=45 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-9-R] +tc_id=46 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-1-10-R] +tc_id=47 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-28-2-R] +tc_id=48 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-11-28-2-R] +tc_id=48 +tc_api=1 +plugin_uid = 0 + + +[2698-4-1-29-R] +tc_id=49 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-30-R] +tc_id=50 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-31-R] +tc_id=51 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-32-R] +tc_id=52 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-33-R] +tc_id=53 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-34-R] +tc_id=54 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-35-R] +tc_id=55 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-36-R] +tc_id=56 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-37-R] +tc_id=57 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-38-R] +tc_id=58 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-39-R] +tc_id=59 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-40-R] +tc_id=60 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-41-R] +tc_id=61 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-42-R] +tc_id=62 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-43-R] +tc_id=63 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-44-R] +tc_id=64 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-45-R] +tc_id=65 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-46-R] +tc_id=66 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-47-1-R] +tc_id=67 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-47-2-R] +tc_id=68 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-47-3-R] +tc_id=69 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-49-1-R] +tc_id=70 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-49-2-R] +tc_id=71 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-1-51-R] +tc_id=72 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-1-R] +tc_id=75 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-2-R] +tc_id=76 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-3-R] +tc_id=77 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-4-R] +tc_id=78 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-5-R] +tc_id=79 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-6-R] +tc_id=80 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-7-R] +tc_id=81 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-8-R] +tc_id=82 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-9-R] +tc_id=83 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-10-R] +tc_id=84 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-11-R] +tc_id=85 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-12-R] +tc_id=86 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-13-R] +tc_id=87 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-14-R] +tc_id=88 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-15-R] +tc_id=89 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-16-R] +tc_id=90 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-17-R] +tc_id=91 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-18-R] +tc_id=92 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-19-R] +tc_id=93 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-20-R] +tc_id=94 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-21-R] +tc_id=95 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-2-22-R] +tc_id=96 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-3-1-1-R] +tc_id=97 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-3-2-1-R] +tc_id=98 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-3-2-2-R] +tc_id=99 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-3-7-R] +tc_id=103 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-3-8-R] +tc_id=104 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-3-9-R] +tc_id=105 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-3-10-R] +tc_id=106 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-4-1-R] +tc_id=107 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-4-2-R] +tc_id=108 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-4-3-R] +tc_id=109 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-4-4-R] +tc_id=110 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-5-1-R] +tc_id=111 +tc_api=1 +plugin_uid = 537007117 + +[2698-4-5-2-R] +tc_id=112 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-1-R] +tc_id=113 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-2-R] +tc_id=114 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-3-R] +tc_id=115 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-4-R] +tc_id=116 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-5-R] +tc_id=117 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-6-R] +tc_id=118 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-7-R] +tc_id=119 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-8-R] +tc_id=120 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-9-R] +tc_id=121 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-10-R] +tc_id=122 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-11-R] +tc_id=123 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-12-R] +tc_id=124 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-13-R] +tc_id=125 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-14-R] +tc_id=126 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-15-R] +tc_id=127 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-16-R] +tc_id=128 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-17-R] +tc_id=129 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-18-R] +tc_id=130 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-21-R] +tc_id=133 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-1-24-R] +tc_id=136 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-2-1-R] +tc_id=140 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-2-2-R] +tc_id=141 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-2-3-R] +tc_id=142 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-2-4-R] +tc_id=143 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-2-5-R] +tc_id=144 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-2-6-R] +tc_id=145 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-3-1-R] +tc_id=146 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-3-2-R] +tc_id=147 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-3-3-R] +tc_id=148 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-3-4-R] +tc_id=149 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-4-1-R] +tc_id=150 +tc_api=1 +plugin_uid = 537007117 + +[2698-5-4-2-R] +tc_id=154 +plugin_uid = 10 + +[SetAndGetConversionPrefs-1] +tc_id=155 +tc_api=1 +plugin_uid = 537007117 diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/scripts/te_LbsLocationInfoConverterSuite.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/scripts/te_LbsLocationInfoConverterSuite.script Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,1516 @@ +LOAD_SUITE te_lbslocationinfoconvertersuite +RUN_UTILS DeleteFile c:\config.txt +RUN_UTILS CopyFile c:\testdata\configs\lbsgeolocmonunitconfig.txt c:\config.txt + +RUN_UTILS DeleteFile c:\private\10281e17\[102869DF]lastknownlocarea.db-journal +RUN_UTILS DeleteFile c:\private\10281e17\[102869DF]lastknownlocarea.db + + +START_TESTCASE LBS-Cache-Test-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini Cache-Test-2 +END_TESTCASE LBS-Cache-Test-2 + + +START_TESTCASE LBS-Cache-Test-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini Cache-Test-1 +END_TESTCASE LBS-Cache-Test-1 + +PRINT now wait for loc monitor to teminate (which it will do after 10 seconds +PRINT this ensures when we try and delete the caches files they are not still in an opened state + +DELAY 12000 + +RUN_UTILS DeleteFile c:\private\10281e17\[102869DF]lastknownlocarea.db-journal +RUN_UTILS DeleteFile c:\private\10281e17\[102869DF]lastknownlocarea.db + +START_TESTCASE LBS-Cache-Test-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini Cache-Test-3 +END_TESTCASE LBS-Cache-Test-3 + + +START_TESTCASE LBS-LocationInfoConverter-MultipleSessions-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini MultipleSessions-1 +END_TESTCASE LBS-LocationInfoConverter-MultipleSessions-1 + +START_TESTCASE LBS-LocationInfoConverter-MultipleSessions-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini MultipleSessions-2 +END_TESTCASE LBS-LocationInfoConverter-MultipleSessions-2 + +START_TESTCASE LBS-LocationInfoConverter-MultipleSessions-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini MultipleSessions-3 +END_TESTCASE LBS-LocationInfoConverter-MultipleSessions-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-1 + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-1 + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-3 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-3 + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-3 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-3 + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-4 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-4 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-5 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-5 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-5 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-6 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-6 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-6 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-7 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-7 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-7 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-8 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-8 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-8 + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-8 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-8 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-8 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-9 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-9 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-9 + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-9 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-9 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-9 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-10 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-10 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-10 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-11 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-11 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-11 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-12 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-12 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-12 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-13 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-13 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-13 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-2 + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-11-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-11-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-3 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-4 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-4 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-5 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-5 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-5 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-6 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-6 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-6 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-7 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-7 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-7 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-8 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-8 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-8 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-9 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-9 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-9 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-10 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-10 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-10 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-11 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-11 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-11 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-12 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-12 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-12 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-13 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-13 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-13 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-14 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-14 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-14 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-15 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-15 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-15 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-16 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-16 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-16 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-17 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-17 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-17 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-18 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-18 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-18 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-19 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-19 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-19 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-20 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-20 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-20 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-21 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-21 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-21 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-22 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-22 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-22 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-23 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-23 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-23 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-24 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-24 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-24 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-25 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-25 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-25 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-26 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-26 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-26 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-27 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-27 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-27 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-3 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-4 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-4 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-5 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-5 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-5 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-6 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-6 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-6 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-7 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-7 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-7 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-8 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-8 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-8 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-9 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-9 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-9 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-10 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-10 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-10 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-2 + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-11-28-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-11-28-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-11-28-2 + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-29 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-29 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-29 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-30 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-30 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-30 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-31 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-31 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-31 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-32 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-32 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-32 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-33 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-33 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-33 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-34 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-34 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-34 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-35 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-35 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-35 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-36 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-36 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-36 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-37 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-37 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-37 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-38 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-38 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-38 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-39 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-39 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-39 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-40 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-40 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-40 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-41 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-41 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-41 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-42 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-42 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-42 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-43 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-43 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-43 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-44 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-44 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-44 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-45 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-45 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-45 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-46 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-46 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-46 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-47-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-47-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-47-3 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-49-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-49-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-51 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-51 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-51 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-52 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-52 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-52 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-53 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-53 +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-53 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-3 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-4 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-4 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-5 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-5 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-5 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-6 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-6 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-6 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-7 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-7 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-7 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-8 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-8 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-8 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-9 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-9 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-9 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-10 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-10 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-10 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-11 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-11 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-11 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-12 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-12 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-12 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-13 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-13 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-13 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-14 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-14 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-14 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-15 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-15 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-15 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-16 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-16 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-16 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-17 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-17 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-17 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-18 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-18 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-18 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-19 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-19 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-19 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-20 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-20 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-20 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-21 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-21 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-21 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-22 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-22 +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-22 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-1-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-1-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-1-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-2-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-2-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-4 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-4 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-5 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-5 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-5 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-6 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-6 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-6 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-7 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-7 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-7 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-8 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-8 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-8 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-9 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-9 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-9 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-10 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-10 +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-10 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-4-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-4-1 +END_TESTCASE LBS-LocationInfoConverter-2698-4-4-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-4-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-4-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-4-2 + + +// Not currently run, possible incorrect automated conversion (-1) +//START_TESTCASE LBS-LocationInfoConverter-2698-4-4-3 +//RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-4-3 +//END_TESTCASE LBS-LocationInfoConverter-2698-4-4-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-4-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-4-4 +END_TESTCASE LBS-LocationInfoConverter-2698-4-4-4 + +// Not currently run, possible incorrect automated conversion (panic 0) +//START_TESTCASE LBS-LocationInfoConverter-2698-4-5-1 +//RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-5-1 +//END_TESTCASE LBS-LocationInfoConverter-2698-4-5-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-5-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-5-2 +END_TESTCASE LBS-LocationInfoConverter-2698-4-5-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-1 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-2 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-3 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-4 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-4 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-5 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-5 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-5 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-6 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-6 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-6 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-7 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-7 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-7 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-8 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-8 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-8 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-9 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-9 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-9 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-10 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-10 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-10 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-11 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-11 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-11 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-12 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-12 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-12 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-13 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-13 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-13 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-14 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-14 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-14 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-15 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-15 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-15 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-16 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-16 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-16 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-17 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-17 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-17 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-18 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-18 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-18 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-19 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-19 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-19 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-20 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-20 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-20 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-21 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-21 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-21 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-22 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-22 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-22 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-23 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-23 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-23 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-24 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-24 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-24 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-25 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-25 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-25 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-26 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-26 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-26 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-27 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-27 +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-27 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-1 +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-2 +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-3 +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-4 +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-4 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-5 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-5 +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-5 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-6 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-6 +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-6 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-3-1 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-3-1 +END_TESTCASE LBS-LocationInfoConverter-2698-5-3-1 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-3-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-3-2 +END_TESTCASE LBS-LocationInfoConverter-2698-5-3-2 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-3-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-3-3 +END_TESTCASE LBS-LocationInfoConverter-2698-5-3-3 + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-3-4 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-3-4 +END_TESTCASE LBS-LocationInfoConverter-2698-5-3-4 + + +Negative test needs rewrite +//START_TESTCASE LBS-LocationInfoConverter-2698-5-4-1 +//RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-4-1 +//END_TESTCASE LBS-LocationInfoConverter-2698-5-4-1 + + +//Test with plugin id 10 +START_TESTCASE LBS-LocationInfoConverter-2698-5-4-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-4-2 +END_TESTCASE LBS-LocationInfoConverter-2698-5-4-2 + +////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////// + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-1-R + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-1-R + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-3-R + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-3-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-4-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-4-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-4-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-5-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-5-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-5-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-6-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-6-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-6-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-7-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-7-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-7-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-8-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-8-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-8-R + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-8-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-8-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-8-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-9-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-9-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-9-R + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-9-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-9-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-9-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-10-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-10-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-10-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-11-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-11-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-11-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-12-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-12-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-12-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-13-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-1-13-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-1-13-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-2-R + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-11-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-11-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-11-2-R + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-3-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-4-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-4-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-4-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-5-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-5-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-5-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-6-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-6-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-6-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-7-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-7-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-7-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-8-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-8-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-8-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-9-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-9-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-9-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-10-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-10-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-10-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-11-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-11-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-11-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-12-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-12-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-12-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-13-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-13-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-13-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-14-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-14-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-14-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-15-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-15-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-15-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-16-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-16-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-16-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-17-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-17-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-17-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-18-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-18-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-18-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-19-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-19-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-19-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-20-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-20-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-20-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-21-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-21-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-21-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-22-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-22-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-22-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-23-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-23-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-23-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-24-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-24-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-24-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-25-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-25-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-25-R + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-3-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-4-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-4-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-4-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-5-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-5-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-5-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-6-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-6-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-6-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-7-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-7-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-7-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-8-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-8-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-8-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-9-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-9-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-9-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-10-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-1-10-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-1-10-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-28-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-28-2-R + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-4-11-28-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-11-28-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-11-28-2-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-29-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-29-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-29-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-30-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-30-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-30-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-31-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-31-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-31-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-32-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-32-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-32-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-33-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-33-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-33-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-34-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-34-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-34-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-35-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-35-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-35-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-36-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-36-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-36-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-37-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-37-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-37-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-38-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-38-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-38-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-39-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-39-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-39-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-40-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-40-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-40-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-41-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-41-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-41-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-42-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-42-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-42-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-43-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-43-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-43-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-44-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-44-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-44-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-45-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-45-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-45-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-46-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-46-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-46-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-47-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-47-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-2-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-47-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-47-3-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-49-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-49-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-49-2-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-1-51-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-1-51-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-1-51-R + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-2-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-3-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-4-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-4-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-4-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-5-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-5-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-5-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-6-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-6-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-6-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-7-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-7-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-7-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-8-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-8-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-8-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-9-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-9-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-9-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-10-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-10-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-10-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-11-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-11-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-11-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-12-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-12-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-12-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-13-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-13-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-13-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-14-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-14-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-14-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-15-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-15-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-15-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-16-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-16-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-16-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-17-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-17-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-17-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-18-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-18-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-18-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-19-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-19-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-19-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-20-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-20-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-20-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-21-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-21-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-21-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-2-22-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-2-22-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-2-22-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-1-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-1-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-1-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-2-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-2-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-2-2-R + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-7-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-7-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-7-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-8-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-8-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-8-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-9-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-9-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-9-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-3-10-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-3-10-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-3-10-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-5-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-5-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-5-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-4-5-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-4-5-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-4-5-2-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-2-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-3-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-4-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-4-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-4-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-5-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-5-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-5-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-6-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-6-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-6-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-9-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-9-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-9-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-10-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-10-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-10-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-11-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-11-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-11-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-12-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-12-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-12-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-13-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-13-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-13-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-14-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-14-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-14-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-15-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-15-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-15-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-16-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-16-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-16-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-17-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-17-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-17-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-18-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-18-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-18-R + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-21-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-21-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-21-R + +START_TESTCASE LBS-LocationInfoConverter-2698-5-1-24-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-1-24-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-1-24-R + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-1-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-2-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-2-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-3-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-3-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-3-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-5-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-5-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-5-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-2-6-R +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-2-6-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-2-6-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-3-1-R +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-3-1-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-3-1-R + + +START_TESTCASE LBS-LocationInfoConverter-2698-5-3-2 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-3-2 +END_TESTCASE LBS-LocationInfoConverter-2698-5-3-2 + +//Test with plugin id 10 +START_TESTCASE LBS-LocationInfoConverter-2698-5-4-2-R +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-4-2-R +END_TESTCASE LBS-LocationInfoConverter-2698-5-4-2-R + +START_TESTCASE LBS-LocationInfoConverter-SetAndGetConversionPrefs-1 +RUN_TEST_STEP 10 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini SetAndGetConversionPrefs-1 +END_TESTCASE LBS-LocationInfoConverter-SetAndGetConversionPrefs-1 + +//Delete the cenrep file out of the way to test behaviour when it's not found +RUN_UTILS DeleteFile c:\private\10202be9\20026814.txt + +//Test with plugin id 0 +START_TESTCASE LBS-LocationInfoConverter-2698-5-4-3 +RUN_TEST_STEP 100 te_lbslocationinfoconvertersuite Step c:\testdata\configs\LbsLocationInfoConverter.ini 2698-5-4-3 +END_TESTCASE LBS-LocationInfoConverter-2698-5-4-3 + +// now wait for loc monitor to teminate (which it will do after 10 seconds - +// this ensures that we pick up any memory leaks detected when the heap is checked in +// the loc monitor's destructor. If we don't have this delay then you will not see +// any heap check panics! + +PRINT now wait for loc monitor to teminate (which it will do after 10 seconds +PRINT this ensures that we pick up any memory leaks detected when the heap is checked in +PRINT the loc monitor's destructor. If we don't have this delay then you will not see any heap check panics! + + +DELAY 12000 + + + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/Te_locationinfoconversionobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/Te_locationinfoconversionobserver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002 - 2007 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: Test module to implement Advanced trigger supervision cases +* +*/ + + + +// INCLUDE FILES +#include +#include "Te_locationinfoconversionobserver.h" + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::CTriggerFireObserver +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTelocationinfoconversionobserver::CTelocationinfoconversionobserver( ):CTimer( CTimer::EPriorityStandard ) + { + + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTelocationinfoconversionobserver::ConstructL() + { + iStatusCode=KErrGeneral; + CTimer::ConstructL(); + + } + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTelocationinfoconversionobserver* CTelocationinfoconversionobserver::NewL( ) + { + + CTelocationinfoconversionobserver* self = new (ELeave) CTelocationinfoconversionobserver( ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop(); + return self; + + } + +// Destructor +CTelocationinfoconversionobserver::~CTelocationinfoconversionobserver() + { + Cancel(); + } + +void CTelocationinfoconversionobserver::OnConversionComplete( TInt aStatusCode ) + { + iStatusCode = aStatusCode; + CActiveScheduler::Stop(); + } + +TInt CTelocationinfoconversionobserver::ConversionResult() + { + return iStatusCode; + } + + + +void CTelocationinfoconversionobserver::RunL( ) + { + iStatusCode = KErrCancel; + CActiveScheduler::Stop(); + + } + +void CTelocationinfoconversionobserver::DoCancel( ) + { + + + } + +//End of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/Te_locationresolverobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/Te_locationresolverobserver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2002 - 2007 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: Test module to implement Advanced trigger supervision cases +* +*/ + + + +// INCLUDE FILES +#include +#include "Te_locationresolverobserver.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::CTriggerFireObserver +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTeLocationResolverObserver::CTeLocationResolverObserver( ):CTimer( CTimer::EPriorityStandard ) + { + + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTeLocationResolverObserver::ConstructL() + { + iStatusCode=KErrGeneral; + CTimer::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTeLocationResolverObserver* CTeLocationResolverObserver::NewL( ) + { + + CTeLocationResolverObserver* self = new (ELeave) CTeLocationResolverObserver( ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop(); + return self; + + } + +// Destructor +CTeLocationResolverObserver::~CTeLocationResolverObserver() + { + Cancel(); + } + + +void CTeLocationResolverObserver::OnResolveLocationComplete(TInt aStatus, const TLocality& aLocality) + { + iStatusCode = aStatus; + + if (iStatusCode == KErrNone) + { + TReal64 lat = aLocality.Latitude(); + TReal64 lng = aLocality.Longitude(); + TReal32 alt =aLocality.Altitude(); + TPositionDatumId datum = aLocality.Datum(); + TReal32 horAcc = aLocality.HorizontalAccuracy(); + TReal32 vertAcc = aLocality.VerticalAccuracy(); + + iLocality = aLocality; + + // the horAcc is interesting ... + // when the locality is not delivered from the cache then the hor acc is that returned by the test plugin + // when it comes out of the cahche then it's the loc monitor that sets it according to + // the country code e.t.c + // similarly for the vertical accuracy ... its set to Nan when brought out of the cache + // but its whatever came from the converter otherwise. + + + // this test ensures that when a locality comes out of the cash that + // vertical accuracy is a Nan. So we can use this to check that + // values come out of the cache when they should. + if (Math::IsNaN(vertAcc)) + { + iFromCache = ETrue; + } + else + { + iFromCache = EFalse; + } + } + CActiveScheduler::Stop(); + } + + + +TInt CTeLocationResolverObserver::ConversionResult() + { + return iStatusCode; + } + +TInt CTeLocationResolverObserver::ConversionLocality(TLocality& aLocality) + { + aLocality = iLocality; + return iFromCache; + } + + +void CTeLocationResolverObserver::RunL( ) + { + iStatusCode = KErrCancel; + CActiveScheduler::Stop(); + + } + +void CTeLocationResolverObserver::DoCancel( ) + { + + + } + +//End of file diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/step.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/step.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,5112 @@ +/* +* Copyright (c) 2007 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: +* +*/ + +#include "step.h" +#include "te_lbslocationinfoconvertersuitedefs.h" + +#include "Te_locationinfoconversionobserver.h" + +#include + +// the test code sets the timing advance in the GSM vell info to this value +// which instructs the test converter to constuct TLocalitys with +// latitude ser to country code, longitude set to +// network code and altitiude set to local area code +const TInt KTimingAdvanceSpecialValue= 254; + +const TInt KTimingAdvanceSaveToCacheTrue= 253; + +const TInt KTimingAdvanceSaveToCacheFalse= 252; + +CStep::~CStep() +/** + * Destructor + */ + { + + } + +CStep::CStep() +/** + * Constructor + */ + { + SetTestStepName(KStep); + } + +TVerdict CStep::doTestStepPreambleL() +/** + * @return - TVerdict code + * Override of base class virtual + */ + { + CTe_LbsLocationInfoConverterSuiteStepBase::doTestStepPreambleL(); + return TestStepResult(); + } + + +TVerdict CStep::doTestStepL() +/** + * @return - TVerdict code + * This test check that KErrArgument is returned when calling the Get function for the + * KLbsSpecialFeatureMaximumRequestDelay entry with an out of range delay value. + */ + { + TInt id = GetTestCaseId(); + iApiId = GetTestCaseApi(); + iPluginUid = GetPluginUid(); + + __UHEAP_MARK; + CallL(id); + __UHEAP_MARKEND; + return TestStepResult(); + } + + + +TVerdict CStep::doTestStepPostambleL() +/** + * @return - TVerdict code + */ + { + + return TestStepResult(); + } + + + + + + + +// ----------------------------------------------------------------------------- +// CStep::CreateLocationInfoConverterL +// Creates and initializes Location info converter object +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CStep::CreateLocationInfoConverterL() + { + TUid uid = TUid::Uid(iPluginUid); + iLbsLocationInfo = CLbsLocationInfo::NewL(); + + if(iApiId == 0) + { + iObserver = CTelocationinfoconversionobserver::NewL(); + iObserver->Version(); + if(iPluginUid!=0) + { + iLbsLocationInfoConverter = CLbsLocationInfoConverter::NewL(*iObserver,uid); + } + else + { + iLbsLocationInfoConverter = CLbsLocationInfoConverter::NewL(*iObserver); + } + } + else + { + iResolverObserver = CTeLocationResolverObserver::NewL(); + iResolverObserver->Version(); + if(iPluginUid!=0) + { + iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid); + } + else + { + iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver); + } + } + + return KErrNone; + + } + +//// ----------------------------------------------------------------------------- +//// CStep::SetCoordinateInfoL +//// Converts one location info to its corresponding position info. +//// (other items were commented in a header). +//// ----------------------------------------------------------------------------- +//// +//TInt CStep::SetCoordinateInfoL(CStifItemParser& aItem ) +// { +// TInt fntype; +// aItem.GetNextInt(fntype); +// TPtrC Llatidude,Llongitude,Laltidude,Lhoracc,LVerAcc; +// aItem.GetNextString( KLatitude, Llatidude); +// aItem.GetNextString( KLongitude, Llongitude); +// aItem.GetNextString( KAltitude, Laltidude); +// aItem.GetNextString( KHorizontalAccuracy, Lhoracc); +// aItem.GetNextString( KVerticalAccuracy, LVerAcc); +// +// TReal64 latitude =0 ; +// TLex16 lat(Llatidude); +// lat.Val(latitude); +// +// TReal64 longitude =0; +// TLex16 longi(Llongitude); +// longi.Val(longitude); +// +// TReal32 Altitude =0; +// TLex16 Alt(Laltidude); +// Alt.Val(Altitude); +// +// TReal32 HorizontalAccuracy =0; +// TLex16 HA(Lhoracc); +// HA.Val(HorizontalAccuracy); +// +// TReal32 VerticalAccuracy =0; +// TLex16 VA(LVerAcc); +// VA.Val(VerticalAccuracy); +// TLocality Locality; +// if(latitude!=0 && longitude!=0 && Altitude==0) +// { +// Locality.SetCoordinate(latitude,longitude); +// } +// else if (latitude!=0 && longitude!=0 && Altitude!=0) +// { +// Locality.SetCoordinate(latitude,longitude,Altitude); +// } +// +// +// if(HorizontalAccuracy!=0 ) +// { +// Locality.SetHorizontalAccuracy(HorizontalAccuracy); +// } +// if(VerticalAccuracy!=0 ) +// { +// Locality.SetVerticalAccuracy(VerticalAccuracy); +// } +// +// CLbsPositionInfo* Posinfo; +// if(fntype==1) +// { +// Posinfo=CLbsPositionInfo::NewL( Locality); +// } +// else if(fntype==2) +// { +// Posinfo=CLbsPositionInfo::NewL(); +// Posinfo->SetLocality(Locality); +// } +// +// ilbslocationinfo->AddAreaInfoL(Posinfo); +// return KErrNone; +// } + + +// ----------------------------------------------------------------------------- +// CStep::SetGSMCellInfoL +// . +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CStep::SetGSMCellInfoL( TInt fntype, TInt countrycode, TInt networkcode, + TInt locationcode, TInt cellid, TInt timingadvance, TInt Rxlev, TInt nNeignbourcells, + TInt arfcn, TInt bsic, TInt NRxlev) + { + INFO_PRINTF5(_L("SetGSMCellInfoL(CC=%d, NC=%d, LC=%d CID=%d)"),countrycode,networkcode,locationcode,cellid); + CLbsGsmCellInfo* gsmcellinfo; + if(fntype==1) + { + gsmcellinfo=CLbsGsmCellInfo::NewL( countrycode,networkcode,locationcode,cellid); + if(timingadvance!=-2) + { + gsmcellinfo->SetTimingAdvance(timingadvance); + } + if(Rxlev!=-2) + { + gsmcellinfo->SetRxLevel(Rxlev); + } + if(nNeignbourcells!=0) + { + TLbsGsmNeighbourCellInfo neighbourcell; + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + + } + } + } + else if(fntype==2) + { + gsmcellinfo=CLbsGsmCellInfo::NewL(); + if(countrycode!=-2) + { + gsmcellinfo->SetMobileCountryCode(countrycode); + } + if(networkcode!=-2) + { + gsmcellinfo->SetMobileNetworkCode(networkcode); + } + if(locationcode!=-2) + { + gsmcellinfo->SetLocationAreaCode(locationcode); + } + if(cellid!=-2) + { + gsmcellinfo->SetCellId(cellid); + } + if(timingadvance!=-2) + { + gsmcellinfo->SetTimingAdvance(timingadvance); + } + if(Rxlev!=-2) + { + gsmcellinfo->SetRxLevel(Rxlev); + } + if(nNeignbourcells!=0) + { + + + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + + } + } + } + + iLbsLocationInfo->AddAreaInfoL(gsmcellinfo); + + } + +TInt CStep::SetGSMCellInfo2L( TInt fntype, TInt countrycode, TInt networkcode, + TInt locationcode, TInt cellid, TInt timingadvance, TInt Rxlev, TInt nNeignbourcells, + TInt arfcn, TInt bsic, TInt NRxlev) + { + INFO_PRINTF5(_L("SetGSMCellInfo2L(CC=%d, NC=%d, LC=%d CID=%d)"),countrycode,networkcode,locationcode,cellid); + + CLbsGsmCellInfo* gsmcellinfo; + if(fntype==1) + { + gsmcellinfo=CLbsGsmCellInfo::NewL( countrycode,networkcode,locationcode,cellid); + if(timingadvance!=-2) + { + gsmcellinfo->SetTimingAdvance(timingadvance); + } + if(Rxlev!=-2) + { + gsmcellinfo->SetRxLevel(Rxlev); + } + if(nNeignbourcells!=0) + { + TLbsGsmNeighbourCellInfo neighbourcell; + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + + } + } + } + else if(fntype==2) + { + gsmcellinfo=CLbsGsmCellInfo::NewL(); + if(countrycode!=-2) + { + gsmcellinfo->SetMobileCountryCode(countrycode); + } + if(networkcode!=-2) + { + gsmcellinfo->SetMobileNetworkCode(networkcode); + } + if(locationcode!=-2) + { + gsmcellinfo->SetLocationAreaCode(locationcode); + } + if(cellid!=-2) + { + gsmcellinfo->SetCellId(cellid); + } + if(timingadvance!=-2) + { + gsmcellinfo->SetTimingAdvance(timingadvance); + } + if(Rxlev!=-2) + { + gsmcellinfo->SetRxLevel(Rxlev); + } + if(nNeignbourcells!=0) + { + + + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + + } + } + } + + iLbsLocationInfo2->AddAreaInfoL(gsmcellinfo); + return KErrNone; + } +// ----------------------------------------------------------------------------- +// CStep::SetWCDMACellInfoL +// . +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CStep::SetWCDMACellInfoL(TInt fntype, TInt countrycode, + TInt networkcode, TInt cellid, TInt nNeignbourcells, TInt scramblingcode, + TInt neighbourucid, TInt neighbourscode, TInt neighbourpathloss, + TInt neighboursignalstrength) + { + CLbsWcdmaCellInfo* wcdmacellinfo; + if(fntype==1) + { + wcdmacellinfo=CLbsWcdmaCellInfo::NewL( countrycode,networkcode,cellid); + if(scramblingcode!=-2) + { + wcdmacellinfo->SetScramblingCode(scramblingcode); + } + if(nNeignbourcells!=0) + { + TLbsWcdmaNeighbourCellInfo neighbourcell; + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + } + } + } + else if(fntype==2) + { + wcdmacellinfo=CLbsWcdmaCellInfo::NewL(); + if(countrycode!=-2) + { + wcdmacellinfo->SetMobileCountryCode(countrycode); + } + if(networkcode!=-2) + { + wcdmacellinfo->SetMobileNetworkCode(networkcode); + } + if(cellid!=-2) + { + wcdmacellinfo->SetUniqueCellId(cellid); + } + if(scramblingcode!=-2) + { + wcdmacellinfo->SetScramblingCode(scramblingcode); + } + if(nNeignbourcells!=0) + { + for(TInt i =0 ; iAddNeighbouringCellInfoL(&neighbourcell); + } + } + } + + iLbsLocationInfo->AddAreaInfoL(wcdmacellinfo); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CStep::SetWLanInfoL +// . +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CStep::SetWLanInfoL(TInt fntype, TInt macidint, TInt signalstrength) + { + TBuf8<6> macidbuf; + macidbuf.AppendNum(macidint); + CLbsWlanInfo* wlaninfo; + if(fntype==1) + { + wlaninfo=CLbsWlanInfo::NewL( macidbuf,signalstrength); + } + else if(fntype==2) + { + wlaninfo=CLbsWlanInfo::NewL(); + if (macidbuf.Length()!=0) + { + wlaninfo->SetMacAddress(macidbuf); + } + if(signalstrength!=-2) + { + wlaninfo->SetSignalStrength(signalstrength); + } + } + iLbsLocationInfo->AddAreaInfoL(wlaninfo); + return KErrNone; + } +// ----------------------------------------------------------------------------- +// CStep::AddLocationInfoL +// Converts one location info to its corresponding position info. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CStep::AddLocationInfoL() + { + TInt nTimes =1; + iLbsLocationInfoArrayTemp.Append(iLbsLocationInfo); + for (TInt i=0 ; iConvertLocationInfoL(*iLbsLocationInfoArray[0],conversionprefs,requestedinfo); + } + else if (fntype==2) + { + iLbsLocationInfoConverter->ConvertLocationInfoL(iLbsLocationInfoArray,conversionprefs,requestedinfo); + } + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray[0]); + iLbsLocationResolver->ResolveLocationL(*input); + } + + CActiveScheduler::Start(); + + } + +void CStep::ConvertLocationInfo2L(TInt conversionprefs, TInt requestedinfo, TInt fntype) + { + + if(iApiId == 0) + { + if(fntype==0) + { + iLbsLocationInfoConverter2->ConvertLocationInfoL(*iLbsLocationInfoArray2[0],conversionprefs,requestedinfo); + } + else if (fntype==2) + { + iLbsLocationInfoConverter2->ConvertLocationInfoL(iLbsLocationInfoArray2,conversionprefs,requestedinfo); + } + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray2[0]); + iLbsLocationResolver2->ResolveLocationL(*input); + } + + CActiveScheduler::Start(); + + } +// ----------------------------------------------------------------------------- +// CStep::CancelConvertLocationInfo +// Converts one location info to its corresponding position info. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CStep::MiscL(TInt testcase) + { + switch(testcase) + { + case 1: + if(iApiId == 0) + { + iLbsLocationInfoConverter->ConvertLocationInfoL(*iLbsLocationInfo,0,1); + iLbsLocationInfoConverter->CancelConvertLocationInfo(); + iObserver->After(1500000); + CActiveScheduler::Start(); + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray[0]); + iLbsLocationResolver->ResolveLocationL(*input); + iLbsLocationResolver->CancelResolveLocation(); + iResolverObserver->After(1500000); + CActiveScheduler::Start(); + } + break; + case 2: + if(iApiId == 0) + { + iLbsLocationInfoConverter->ConvertLocationInfoL(*iLbsLocationInfo,0,1); + CActiveScheduler::Start(); + iLbsLocationInfoConverter->CancelConvertLocationInfo(); + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray[0]); + iLbsLocationResolver->ResolveLocationL(*input); + CActiveScheduler::Start(); + iLbsLocationResolver->CancelResolveLocation(); + } + break; + case 3: + if(iApiId == 0) + { + iLbsLocationInfoConverter->CancelConvertLocationInfo(); + return KErrNone; + } + else + { + iLbsLocationResolver->CancelResolveLocation(); + return KErrNone; + } + break; + case 4: +// TODO +// TestModuleIf().SetExitReason( CTestModuleIf::EPanic, 0); + if(iApiId == 0) + { + iLbsLocationInfoConverter->ConvertLocationInfoL(*iLbsLocationInfo,0,1); + iLbsLocationInfoConverter->ConvertLocationInfoL(*iLbsLocationInfo,0,1); + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray[0]); + iLbsLocationResolver->ResolveLocationL(*input); + iLbsLocationResolver->ResolveLocationL(*input); + } + break; + case 5: + if(iApiId == 0) + { + iLbsLocationInfoConverter->ConvertLocationInfoL(iLbsLocationInfoArray,0,1); + iLbsLocationInfoConverter->CancelConvertLocationInfo(); + iObserver->After(1500000); + CActiveScheduler::Start(); + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray[0]); + iLbsLocationResolver->ResolveLocationL(*input); + iLbsLocationResolver->CancelResolveLocation(); + iResolverObserver->After(1500000); + CActiveScheduler::Start(); + } + break; + case 6: + if(iApiId == 0) + { + iLbsLocationInfoConverter->ConvertLocationInfoL(iLbsLocationInfoArray,0,1); + CActiveScheduler::Start(); + iLbsLocationInfoConverter->CancelConvertLocationInfo(); + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray[0]); + iLbsLocationResolver->ResolveLocationL(*input); + CActiveScheduler::Start(); + iLbsLocationResolver->CancelResolveLocation(); + } + break; + case 7: + if(iApiId == 0) + { + iLbsLocationInfoConverter->CancelConvertLocationInfo(); + return KErrNone; + } + else + { + iLbsLocationResolver->CancelResolveLocation(); + return KErrNone; + } + break; + case 8: + if(iApiId == 0) + { + iLbsLocationInfoConverter->ConvertLocationInfoL(iLbsLocationInfoArray,0,1); + iLbsLocationInfoConverter->ConvertLocationInfoL(iLbsLocationInfoArray,0,1); + } + else + { + CLbsLocationInfo* input = static_cast(iLbsLocationInfoArray[0]); + iLbsLocationResolver->ResolveLocationL(*input); + iLbsLocationResolver->ResolveLocationL(*input); + } + break; + } + + if(iApiId == 0) + { + return iObserver->ConversionResult(); + } + else + { + return iResolverObserver->ConversionResult(); + } + } + + + +TInt CStep::ValidateLocationInfo(TInt requestedinfo) + { + if(iApiId == 0) + { + if( iObserver->ConversionResult() == KErrNone ) + { + if(requestedinfo ==1) + { + TInt count = iLbsLocationInfoArray.Count(); + for(TInt i=0; i PosInfoList; + TRAPD(error, static_cast(iLbsLocationInfoArray[i])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo)); + if (KErrNone != error) + { + PosInfoList.ResetAndDestroy(); + PosInfoList.Close(); + return error; + } + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + PosInfoList.Close(); + if(count2>=1) + { + return KErrNone; + } + } + } + } + + return iObserver->ConversionResult(); + } + else + { + if( iResolverObserver->ConversionResult() == KErrNone ) + { + if(requestedinfo ==1) + { + TInt count = iLbsLocationInfoArray.Count(); + for(TInt i=0; i PosInfoList; + TRAPD(error, static_cast(iLbsLocationInfoArray[i])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo)); + if (KErrNone != error) + { + PosInfoList.ResetAndDestroy(); + PosInfoList.Close(); + return error; + } + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + PosInfoList.Close(); + if(count2>=1) + { + return KErrNone; + } + } + } + } + return iResolverObserver->ConversionResult(); + } + } + + +TInt CStep::ValidateLocationInfo2(TInt requestedinfo) + { + if(iApiId == 0) + { + if( iObserver2->ConversionResult() == KErrNotSupported || + iObserver2->ConversionResult() == KErrNotFound ) + return KErrNone; + + if( iObserver2->ConversionResult() == KErrNone ) + { + if(requestedinfo ==1) + { + TInt count = iLbsLocationInfoArray2.Count(); + for(TInt i=0; i PosInfoList; + static_cast(iLbsLocationInfoArray2[i])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo); + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + PosInfoList.Close(); + if(count2>=1) + { + return KErrNone; + } + } + return KErrGeneral; + } + } + + return iObserver2->ConversionResult(); + } + else + { + if( iResolverObserver2->ConversionResult() == KErrNotSupported || + iResolverObserver2->ConversionResult() == KErrNotFound ) + return KErrNone; + + if( iResolverObserver2->ConversionResult() == KErrNone ) + { + if(requestedinfo ==1) + { + TInt count = iLbsLocationInfoArray2.Count(); + for(TInt i=0; i PosInfoList; + static_cast(iLbsLocationInfoArray2[i])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo); + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + PosInfoList.Close(); + if(count2>=1) + { + return KErrNone; + } + } + } + } + return iResolverObserver->ConversionResult(); + } + } + + +// ----------------------------------------------------------------------------- +// CStep::SetConversionPrefs +// Converts one location info to its corresponding position info. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CStep::SetConversionPrefs(TLbsConversionPrefs aSetConversionPrefs) + { + TRAPD( err, + if(iApiId != 0) + { + err = iLbsLocationResolver->SetConversionPreferences(aSetConversionPrefs); + } + ) + + if (err) + return err; + else + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CStep::GetAndCheckConversionPrefs +// Converts one location info to its corresponding position info. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CStep::GetAndCheckConversionPrefs(TLbsConversionPrefs aSetConversionPrefs) + { + TRAPD( err, + if(iApiId != 0) + { + TLbsConversionPrefs readConversionPrefs = iLbsLocationResolver->ConversionPreferences(); + if (readConversionPrefs != aSetConversionPrefs) + { + err = KErrGeneral; + } + } + ) + if (err) + return err; + else + return KErrNone; + } + + + +TInt CStep::Cleanup() + { + if(iLbsLocationInfo) + { + delete iLbsLocationInfo; + iLbsLocationInfo = NULL; + } + if(iLbsLocationInfoConverter) + { + delete iLbsLocationInfoConverter; + iLbsLocationInfoConverter = NULL; + } + if(iLbsLocationResolver) + { + delete iLbsLocationResolver; + iLbsLocationResolver = NULL; + } + if(iObserver) + { + delete iObserver; + iObserver = NULL; + } + if(iResolverObserver) + { + delete iResolverObserver; + iResolverObserver = NULL; + } + iLbsLocationInfoArrayTemp.ResetAndDestroy(); + iLbsLocationInfoArray.Reset(); + + return KErrNone; + } + +void CStep::test_2698_4_1_1_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 404, 49, 16, 7141); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(1, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 0, 0, 0, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 999, 999, 65535, 65535); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_5L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, -1, 0, 0, 0); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_6L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, -1, 0, 0); + + AddLocationInfoL(); + + TRAP (err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_7L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, -1, 0); + + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP (err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_8L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, -1); + + AddLocationInfoL(); + + TRAP (err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_9L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 1000, 0, 0, 0); + + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_10L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 1000, 0, 0); + + AddLocationInfoL(); + + TRAP (err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_11L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 65536, 0); + + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_12L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 65536); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_1_13L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 30); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 999); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 0); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_5L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 1000); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_6L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, -1); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_7L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_8L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 999); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_9L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 0); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_10L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 1000); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_11L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, -1); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_12L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_13L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 65535); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_14L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 0); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_15L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 65536); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_16L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, -1); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_17L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 65535); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_18L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 0); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_19L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 65536); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_20L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, -1); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_21L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 30, 255); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_22L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 30, 0); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_23L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 30, -1); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_24L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 200, 300, 30, 256); + + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_25L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + + AddLocationInfoL(); + + ConvertLocationInfoL(1, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_26L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + ConvertLocationInfoL(2, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_27L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + ConvertLocationInfoL(4, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 0, 0, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 999, 999, 65535); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_5L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, -1, 200, 300); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_6L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, -1, 300); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_7L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_8L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 1000, 200, 300); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_9L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 1000, 300); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_1_10L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 268435456); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_28_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_29L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_30L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 999); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_31L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_32L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 1000); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_33L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_34L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_35L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 999); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_36L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_37L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 1000); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_38L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_39L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 65535); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_40L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_41L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 268435456); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_42L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_43L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30, 0, 511); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_44L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_45L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30, 512); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_46L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_47_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 200); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_47_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_47_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(2, 100, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_49_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_49_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_51L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(1, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_52L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(2, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_1_53L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(2, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(4, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, 1, 0, 1, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 3, 63, 1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 2, 3, 10, 1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 1, -1, 1, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_5L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 1, 64, 1, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_6L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 0, 63, 1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_7L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_8L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 1, 63, 1, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_9L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 1, 63, 1, 1024); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_10L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 1, 63, 0, 1023); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_11L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_12L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 1, 63, -1, 1023); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_13L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 1, 63, 64, 1023); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_14L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 0, 15, 46, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_15L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 0, 268435455, 15, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_16L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 2, 15, 44, 15, 46, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_17L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -1, 15); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_18L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 268435456, 15); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_19L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 0, 0, 0, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_20L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_21L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 0, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_2_22L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 268435455, 512); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_1_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_2_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_2_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(1, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_5L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(2, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_6L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(2, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_7L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_8L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 255); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_9L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, -1); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_3_10L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 256); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_4_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + err = MiscL(1); + if(err != KErrCancel) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_4_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 255); + if(err != KErrNone) User::Leave(err); + err = MiscL(1); + if(err != KErrCancel) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_4_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + err = MiscL(2); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_4_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + err = MiscL(3); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_4_5_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + if(iApiId == 0) + { + err = MiscL(4); + if(err != KErrNone) User::Leave(err); + } + else + { + TRAPD(leaveErr, MiscL(4)); + if(leaveErr != KErrInUse) User::Leave(leaveErr); + CActiveScheduler::Start(); + } + + Cleanup(); + +}; + + +void CStep::test_2698_4_5_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, 60, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, 60, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 511, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_5L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_6L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_7L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_8L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_9L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 1000, -1, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_10L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, 1, 64, 64, 1023); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_11L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -1, 1, 63, 63, 1023); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_12L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, 1, 63, 63, 1023); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_13L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 511, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 1000, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_14L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 268435456, 511); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 511, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_15L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 512, 1, 268435455, 511); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_16L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 511, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_17L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, 63, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_18L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(1, 1, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_19L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, 63, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, 63, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(2, 1, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_20L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, -2, 63, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, 63, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(4, 1, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_21L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 511, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(1, 1, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_22L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 511, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(2, 1, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_23L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, 511, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(4, 1, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_24L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(0, 0, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_25L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(0, 2, 2); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNotSupported) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_1_26L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, -2, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 4, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(iApiId == 0) + { + if(err != KErrNotSupported) User::Leave(err); + } + Cleanup(); + +}; + + +void CStep::test_2698_5_1_27L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30, 1, -2, 268435455, 511, 47, 0); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWCDMACellInfoL(1, 100, 200, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 40, 63, 1, 1023, 63, 63); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 8, 2)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_2_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_2_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 200000, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 200000, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_2_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_2_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_2_5L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 256); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 2)); + if(err != KErrArgument) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_2_6L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(1, 100000, 3); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30, 63, 1, 63, 1023); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + TRAP(err,ConvertLocationInfoL(0, 1, 0)); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_3_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = MiscL(5); + if(err != KErrCancel) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_3_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = SetWLanInfoL(2, 100000, 255); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = MiscL(5); + if(err != KErrCancel) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_3_3L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = MiscL(6); + // Unsure of the correct result here, should be an error after cancellation? + if(err != KErrNotFound) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_3_4L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = MiscL(7); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + +void CStep::test_2698_5_4_1L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 100, 200, 300, 30); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + err = MiscL(8); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +}; + + + +void CStep::test_MultipleSessionsOneAfterAnotherL() +{ + TInt err = KErrNone; + TUint Uidinteger = 537007117; // Example + TUid uid = TUid::Uid( Uidinteger ); + iLbsLocationInfo = CLbsLocationInfo::NewLC(); + CleanupStack::Pop(iLbsLocationInfo); + + iObserver = CTelocationinfoconversionobserver::NewL(); + iLbsLocationInfoConverter = CLbsLocationInfoConverter::NewL(*iObserver,uid); + TBuf8<6> macidbuf; + TInt macidint = 1; + macidbuf.AppendNum(macidint); + CLbsWlanInfo* wlaninfo; + TInt signalstrength = 20; + wlaninfo=CLbsWlanInfo::NewL( macidbuf,signalstrength); + iLbsLocationInfo->AddAreaInfoL(wlaninfo); + + iLbsLocationInfoArrayTemp.Append(iLbsLocationInfo); + + iLbsLocationInfoArray.Append(iLbsLocationInfo); + + iLbsLocationInfo = CLbsLocationInfo::NewL(); + + iLbsLocationInfoConverter->ConvertLocationInfoL(iLbsLocationInfoArray,ELbsConversionSilent,ELbsConversionOutputPosition); + + + CActiveScheduler::Start(); + + if( iObserver->ConversionResult() == KErrNone ) + { + RPointerArray PosInfoList; + static_cast(iLbsLocationInfoArray[0])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo); + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + } + + // Cleanup(); + + err = KErrNone; + TUint Uidinteger2 = 537007117; // Example + TUid uid2 = TUid::Uid( Uidinteger2 ); + iLbsLocationInfo2 = CLbsLocationInfo::NewL(); + + iObserver2 = CTelocationinfoconversionobserver::NewL(); + iLbsLocationInfoConverter2 = CLbsLocationInfoConverter::NewL(*iObserver2,uid2); + TBuf8<6> macidbuf2; + TInt macidint2 = 1; + macidbuf2.AppendNum(macidint2); + CLbsWlanInfo* wlaninfo2; + TInt signalstrength2 = 20; + wlaninfo2=CLbsWlanInfo::NewL( macidbuf2,signalstrength2); + iLbsLocationInfo2->AddAreaInfoL(wlaninfo2); + + iLbsLocationInfoArrayTemp.Append(iLbsLocationInfo2); + + iLbsLocationInfoArray.Append(iLbsLocationInfo2); + + iLbsLocationInfo2 = CLbsLocationInfo::NewL(); + + iLbsLocationInfoConverter2->ConvertLocationInfoL(iLbsLocationInfoArray,ELbsConversionSilent,ELbsConversionOutputPosition); + + CActiveScheduler::Start(); + + if( iObserver2->ConversionResult() == KErrNone ) + { + RPointerArray PosInfoList; + static_cast(iLbsLocationInfoArray[0])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo); + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + } + + Cleanup(); + + if(iLbsLocationInfo2) + { + delete iLbsLocationInfo2; + iLbsLocationInfo2 = NULL; + } + if(iLbsLocationInfoConverter2) + { + delete iLbsLocationInfoConverter2; + iLbsLocationInfoConverter2 = NULL; + } + + if(iObserver2) + { + delete iObserver2; + iObserver2 = NULL; + } + +}; + +void CStep::test_MultipleCoversionsAtSameTimeL() +{ // two conversion at same time! + TInt err = KErrNone; + TUint Uidinteger = 537007117; // Example + TUid uid = TUid::Uid( Uidinteger ); + iLbsLocationInfo = CLbsLocationInfo::NewL(); + + iObserver = CTelocationinfoconversionobserver::NewL(); + iLbsLocationInfoConverter = CLbsLocationInfoConverter::NewL(*iObserver,uid); + TBuf8<6> macidbuf; + TInt macidint = 1; + macidbuf.AppendNum(macidint); + CLbsWlanInfo* wlaninfo; + TInt signalstrength = 20; + wlaninfo=CLbsWlanInfo::NewL( macidbuf,signalstrength); + iLbsLocationInfo->AddAreaInfoL(wlaninfo); + + iLbsLocationInfoArrayTemp.Append(iLbsLocationInfo); + + iLbsLocationInfoArray.Append(iLbsLocationInfo); + + iLbsLocationInfo = CLbsLocationInfo::NewL(); + + err = KErrNone; + TUint Uidinteger2 = 537007117; // Example + TUid uid2 = TUid::Uid( Uidinteger2 ); + iLbsLocationInfo2 = CLbsLocationInfo::NewL(); + + iObserver2 = CTelocationinfoconversionobserver::NewL(); + iLbsLocationInfoConverter2 = CLbsLocationInfoConverter::NewL(*iObserver2,uid2); + TBuf8<6> macidbuf2; + TInt macidint2 = 1; + macidbuf2.AppendNum(macidint2); + CLbsWlanInfo* wlaninfo2; + TInt signalstrength2 = 20; + wlaninfo2=CLbsWlanInfo::NewL( macidbuf2,signalstrength2); + iLbsLocationInfo2->AddAreaInfoL(wlaninfo2); + + iLbsLocationInfoArrayTemp2.Append(iLbsLocationInfo2); + + iLbsLocationInfoArray2.Append(iLbsLocationInfo2); + + iLbsLocationInfo2 = CLbsLocationInfo::NewL(); + + iLbsLocationInfoConverter->ConvertLocationInfoL(iLbsLocationInfoArray,ELbsConversionSilent,ELbsConversionOutputPosition); + iLbsLocationInfoConverter2->ConvertLocationInfoL(iLbsLocationInfoArray2,ELbsConversionSilent,ELbsConversionOutputPosition); + + CActiveScheduler::Start(); + + TInt error = iObserver->ConversionResult(); + if( error == KErrNone ) + { + RPointerArray PosInfoList; + static_cast(iLbsLocationInfoArray[0])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo); + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + } + else + { + INFO_PRINTF2(_L("iObserver->ConversionResulterror = %d"), error); + + } + + CActiveScheduler::Start(); + + error = iObserver2->ConversionResult(); + if( error == KErrNone ) + { + RPointerArray PosInfoList; + static_cast(iLbsLocationInfoArray2[0])->GetAreaInfoL(PosInfoList,CLbsLocationInfo::ELbsPosInfo); + TInt count2 = PosInfoList.Count(); + PosInfoList.ResetAndDestroy(); + } + else + { + INFO_PRINTF2(_L("iObserver->ConversionResult error = %d"), error); + User::Leave(error); + } + + Cleanup(); + + if(iLbsLocationInfo2) + { + delete iLbsLocationInfo2; + iLbsLocationInfo2 = NULL; + } + if(iLbsLocationInfoConverter2) + { + delete iLbsLocationInfoConverter2; + iLbsLocationInfoConverter2 = NULL; + } + + if(iObserver2) + { + delete iObserver2; + iObserver2 = NULL; + } + iLbsLocationInfoArrayTemp2.ResetAndDestroy(); + iLbsLocationInfoArray2.Reset(); +}; + +void CStep::test_MultipleResolversAtSameTimeL() +{ + TInt err = KErrNone; + + iApiId =1; // use resolver + + + TUint Uidinteger = 537007117; // Example + TUid uid = TUid::Uid( Uidinteger ); + iLbsLocationInfo = CLbsLocationInfo::NewL(); + + iResolverObserver = CTeLocationResolverObserver::NewL(); + iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid); + + + iLbsLocationInfo2 = CLbsLocationInfo::NewL(); + + iResolverObserver2 = CTeLocationResolverObserver::NewL(); + iLbsLocationResolver2 = CLbsLocationResolver::NewL(*iResolverObserver2,uid); + + SetGSMCellInfoL(1, 404, 49, 16, 7141); + if(err != KErrNone) User::Leave(err); + + err = SetGSMCellInfo2L(1, 404, 49, 16, 7141); + if(err != KErrNone) User::Leave(err); + + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + + AddLocationInfo2L(); + if(err != KErrNone) User::Leave(err); + + ConvertLocationInfoL(1, 1, 0); + + ConvertLocationInfo2L(1, 1, 0); + + err = ValidateLocationInfo(); + if(err != KErrNone) User::Leave(err); + + err = ValidateLocationInfo2(); + if(err != KErrNone) User::Leave(err); + Cleanup(); + +// + + if(iLbsLocationInfo2) + { + delete iLbsLocationInfo2; + iLbsLocationInfo2 = NULL; + } + if(iLbsLocationInfoConverter2) + { + delete iLbsLocationInfoConverter2; + iLbsLocationInfoConverter2 = NULL; + } + if(iLbsLocationResolver2) + { + delete iLbsLocationResolver2; + iLbsLocationResolver2 = NULL; + } + if(iObserver2) + { + delete iObserver2; + iObserver2 = NULL; + } + if(iResolverObserver2) + { + delete iResolverObserver2; + iResolverObserver2 = NULL; + } + iLbsLocationInfoArrayTemp2.ResetAndDestroy(); + iLbsLocationInfoArray2.Reset(); + + // +}; + + + +void CStep::test_2698_5_4_2L() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + SetGSMCellInfoL(1, 404, 49, 16, 7141); + if(err != KErrNone) User::Leave(err); + AddLocationInfoL(); + if(err != KErrNone) User::Leave(err); + ConvertLocationInfoL(1, 1, 0); + if(err != KErrNone) User::Leave(err); + err = ValidateLocationInfo(); + if(err != KErrNotFound) User::Leave(err); + Cleanup(); +}; + + +void CStep::test_SetAndGetConversionPrefs() +{ + TInt err = KErrNone; + + err = CreateLocationInfoConverterL(); + if(err != KErrNone) User::Leave(err); + err = GetAndCheckConversionPrefs(0);//default value ELbsConversionNotDefined (0x0000) + if(err != KErrNone) User::Leave(err); + err = SetConversionPrefs(4); //ELbsConversionPrompt(0x0004) + if(err != KErrNone) User::Leave(err); + err = GetAndCheckConversionPrefs(4); + if(err != KErrNone) User::Leave(err); + err = SetConversionPrefs(15); + if(err != KErrArgument) User::Leave(err); + err = SetConversionPrefs(999999999); + if(err != KErrArgument) User::Leave(err); + err = GetAndCheckConversionPrefs(4); //Check if previously set value has been retained + if(err != KErrNone) User::Leave(err); + err = SetConversionPrefs(64); //Is a valid value though the current max in the enum list is only 4 + if(err != KErrNone) User::Leave(err); + err = GetAndCheckConversionPrefs(64); //Check if previously set value has been retained + if(err != KErrNone) User::Leave(err); + + Cleanup(); +}; + +typedef struct + { + TInt countryCode; + TInt networkCode; + TInt locationCode; + TInt cellId; + TBool fromPlugin; + } +sGsmInfo; + +/* + * Here, we test the mode where localities coming from the converter are cache. + * Thus the third and forth localities should come from the cache and NOT the + * plugin + */ +const TInt KTestCacheArraySize= 4; +sGsmInfo testArray[KTestCacheArraySize] = { + {44, 49, 16, 714, ETrue }, + {45, 50, 17, 714, ETrue}, + {45, 50, 17, 714, EFalse}, + {45, 50, 17, 714, EFalse} +}; + + +void CStep::test_cacheL() +{ + TInt err = KErrNone; + iApiId =1; // use resolver + + TUint Uidinteger = 537007117; + TUid uid = TUid::Uid( Uidinteger ); + + for (TUint i = 0; i < KTestCacheArraySize; i++) + { + TRAPD(leaveErr, iLbsLocationInfo = CLbsLocationInfo::NewL()); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("iLbsLocationInfo = CLbsLocationInfo::NewL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,iResolverObserver = CTeLocationResolverObserver::NewL()); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("CTeLocationResolverObserver::NewL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid)); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid) LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,SetGSMCellInfoL(1, + testArray[i].countryCode, + testArray[i].networkCode, + testArray[i].locationCode, + testArray[i].cellId , KTimingAdvanceSpecialValue)); // timing advance 254 is special! + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("SetGSMCellInfoL LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr, AddLocationInfoL()); + if( KErrNone !=leaveErr) + { + INFO_PRINTF2(_L("AddLocationInfoL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr, ConvertLocationInfoL(1, 1, 0)); + if( KErrNone !=leaveErr) + { + INFO_PRINTF2(_L("ConvertLocationInfoL(1, 1, 0)) LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TInt err = ValidateLocationInfo(); + if( KErrNone !=err) + { + INFO_PRINTF2(_L("ValidateLocationInfo() returns error =%d"), err); + User::Leave(err); + } + + TLocality locality; + TBool fromCache = iResolverObserver->ConversionLocality(locality); + + TReal64 lat = locality.Latitude(); + TReal64 lng = locality.Longitude(); + TReal32 alt = locality.Altitude(); + + TInt cCode = testArray[i].countryCode; + if (cCode != (TInt)lat) + { + INFO_PRINTF2(_L("VcCode != (TInt)lat error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + TInt nCode = testArray[i].networkCode; + if (nCode != (TInt)lng) + { + INFO_PRINTF2(_L("nCode != (TInt)lng error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + TInt lCode = testArray[i].locationCode; + if (lCode != (TInt)alt) + { + INFO_PRINTF2(_L("lCode != (TInt)alt error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + + if (fromCache) + { + INFO_PRINTF4(_L("From Cache(lat=%Lf, lng=%Lf, alt=%f"),lat,lng,alt); + if (testArray[i].fromPlugin) + { + INFO_PRINTF1(_L("Test failed - Position got from Cache bit should have come from plugin")); + User::Leave(KErrGeneral); + } + } + else + { // from plugin! + INFO_PRINTF4(_L("From plugin(lat=%Lf, lng=%Lf, alt=%f"),lat,lng,alt); + if (!testArray[i].fromPlugin) + { + INFO_PRINTF1(_L("Test failed - Position got from plugin but should have come from Cache")); + User::Leave(KErrGeneral); + } + } + Cleanup(); + } // end of for loop +}; + +const TInt KTest2ArraySize= 4; + +/* + * Here all four converts should from the cache as the + * loc monitor has been instructed NOT to put things into the cache. + * The timing advance is used by the test (in an adhoc way!) + * to instruct the test plugin to tell the loc monitor NOT to put stuff + * in the cache + */ +sGsmInfo testArray2[KTest2ArraySize] = { + {44, 49, 16, 7141, ETrue }, + {45, 50, 17, 714, ETrue}, + {45, 50, 17, 714, ETrue}, + {45, 50, 17, 714, ETrue} + +}; +void CStep::test_cache2L() +{ + TInt err = KErrNone; + + iApiId =1; // use resolver + + TUint Uidinteger = 537007117; // Example + TUid uid = TUid::Uid( Uidinteger ); + + for (TUint i = 0; i < KTest2ArraySize; i++) + { + TRAPD(leaveErr, iLbsLocationInfo = CLbsLocationInfo::NewL()); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("iLbsLocationInfo = CLbsLocationInfo::NewL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,iResolverObserver = CTeLocationResolverObserver::NewL()); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("CTeLocationResolverObserver::NewL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid)); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid) LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,SetGSMCellInfoL(1, + testArray2[i].countryCode, + testArray2[i].networkCode, + testArray2[i].locationCode, + testArray2[i].cellId , KTimingAdvanceSaveToCacheFalse)); // timing advance is special! + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("SetGSMCellInfoL LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr, AddLocationInfoL()); + if( KErrNone !=leaveErr) + { + INFO_PRINTF2(_L("AddLocationInfoL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr, ConvertLocationInfoL(1, 1, 0)); + if( KErrNone !=leaveErr) + { + INFO_PRINTF2(_L("ConvertLocationInfoL(1, 1, 0)) LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TInt err = ValidateLocationInfo(); + if( KErrNone !=err) + { + INFO_PRINTF2(_L("ValidateLocationInfo() returns error =%d"), err); + User::Leave(err); + } + + TLocality locality; + TBool fromCache = iResolverObserver->ConversionLocality(locality); + + TReal64 lat = locality.Latitude(); + TReal64 lng = locality.Longitude(); + TReal32 alt = locality.Altitude(); + + TInt cCode = testArray2[i].countryCode; + if (cCode != (TInt)lat) + { + INFO_PRINTF2(_L("VcCode != (TInt)lat error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + TInt nCode = testArray2[i].networkCode; + if (nCode != (TInt)lng) + { + INFO_PRINTF2(_L("nCode != (TInt)lng error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + TInt lCode = testArray2[i].locationCode; + if (lCode != (TInt)alt) + { + INFO_PRINTF2(_L("lCode != (TInt)alt error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + + if (fromCache) + { + INFO_PRINTF4(_L("From Cache(lat=%Lf, lng=%Lf, alt=%f"),lat,lng,alt); + if (testArray2[i].fromPlugin) + { + INFO_PRINTF1(_L("Test failed - Position got from Cache bit should have come from plugin")); + User::Leave(KErrGeneral); + } + } + else + { // from plugin! + INFO_PRINTF4(_L("From plugin(lat=%Lf, lng=%Lf, alt=%f"),lat,lng,alt); + if (!testArray2[i].fromPlugin) + { + INFO_PRINTF1(_L("Test failed - Position got from plugin but should have come from Cache")); + User::Leave(KErrGeneral); + } + } + Cleanup(); + } // end of for loop +}; + + + +/* this tests the cache behaviour when a non-exact match occurs. + * For example, when cache contains + * CC=A, NC=B, LC=C, CID=D Lat=20.0, Long=30.0 Acc=5.0m + * and we look up + * CC=A, NC=B, LC=X, CID=Y + * then CC=A, NC=B results in a partial match occurs and the accuracy + * of Lat=20.0, Long=30.0 is the accuracy associated with a + * partial CC=A, NC=B match (1000000.0) + * Notes: + * CC=A, NC=B, LC=C, CID=D Lat=20.0, Long=30.0 Acc=5.0m + * followed by + * CC=A, NC=B, LC=C, CID=D Lat=20.0, Long=30.1 Acc=5.1m + * results inn a single entry of + * CC=A, NC=B, LC=C, CID=D Lat=20.0, Long=30.1 Acc=5.1m in cache + * KWlanAccuracy = 100.0; - not used currently + * KCellFullAccuracy = 3000.0; CC and NC and LC and CID + * KCellLocationAccuracy = 30000.0; CC and NC and LC match + * KCellCountryAccuracy = 1000000.0; CC only or CC + NC + * + * If in cache we have: + * CC=A, NC=B, LC=C, CID=D Lat=20.0, Long=30.0 Acc=5.0m + * CC=A, NC=B, LC=C, CID=E Lat=20.1, Long=30.0 Acc=6.0m + * + * and we try to match + * CC=A, NC=B, LC=C + * then we get from the cache the most recent and not the most accurate + * Lat=20.1, Long=30.0 Acc=3000.0 + * + */ + + +typedef struct + { + TInt countryCode; // -> lat of position composed by plugin + TInt networkCode; // -> long of position composed by plugin + TInt locationCode; // -> alt of position composed by plugin + TInt cellId; // -> horizontal accuracy of position composed by plugin + TBool fromPlugin; // when false then it is expected that locality comes out of cache + TInt expectedHorAccuracyWhenFromCache; // and these values below are the expected values + TInt expectedLatitudeWhenFromCache; + TInt expectedLongitudeWhenFromCache; // note absence of Vertical accuracy + // here - as it is set to Nan by the lc monitor + } +sGsmInfoExtended; + +const TInt KTestArraySize= 18; + +sGsmInfoExtended testArray3[KTestArraySize] = { +// test the case where there a non-exact match +// and the position returned by the plugin is less accurate +// than the one deduced from the cache +// cc nc lc cid + + {44, 49, 16, 714, ETrue, -1, -1, -1}, //stored in cash + {45, 50, 17, 714, ETrue, -1, -1, -1}, + {45, 50, 17, 30001, EFalse, 30000, 45, 50},// not saved in cache - cc and nc and lc match with plugins less accurate than cached + {45, 50, 18, 1000001, EFalse, 1000000,45, 50},// not saved in cache - cc and nc match with plugins less accurate than cached + {45, 51, 18, 1000001, EFalse, 1000000,45, 50},// not saved in cache -cc only match with plugins less accurate than cached + {45, 50, 17, 714, EFalse, 3000, 45, 50},// exact match - to cellid level + // regardless, should use cache + // test the case where there a non-exact match + // and the position returned by the plugin is more accurate + // than the one deduced from the cache + {54, 49, 16, 714, ETrue, -1, -1, -1}, + {55, 50, 17, 714, ETrue, -1, -1, -1}, + {55, 50, 17, 2999, ETrue, -1, -1, -1}, // cc and nc and lc match with plugins less accurate than cached + {55, 50, 18, 29999, ETrue, -1, -1, -1}, // cc and nc match with plugins less accurate than cached + {55, 51, 18, 999999, ETrue, -1, -1, -1}, // cc only match with plugins less accurate than cached + {55, 50, 17, 714, EFalse, 3000, 55, 50}, // exact match - to cellid level + // regardless, should use cache + // now check that cache contains all the exact matches it should + // note that several of the entries above were NOT saved in cache + // because the value returned by the plugin was not accurate enough + {44, 49, 16, 714, EFalse, 3000, 44, 49}, + {45, 50, 17, 714, EFalse, 3000, 45, 50}, + {45, 50, 17, 714, EFalse, 3000, 45, 50}, + {54, 49, 16, 714, EFalse, 3000, 54, 49}, + {45, 50, 17, 714, EFalse, 3000, 45, 50}, + {45, 50, 17, 714, EFalse, 3000, 45, 50} +}; + +void CStep::test_cache3L() +{ + TInt err = KErrNone; + + iApiId =1; // use resolver + + TUint Uidinteger = 537007117; // Example + TUid uid = TUid::Uid( Uidinteger ); + + for (TUint i = 0; i < KTestArraySize; i++) + { + + TRAPD(leaveErr, iLbsLocationInfo = CLbsLocationInfo::NewL()); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("iLbsLocationInfo = CLbsLocationInfo::NewL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,iResolverObserver = CTeLocationResolverObserver::NewL()); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("CTeLocationResolverObserver::NewL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid)); + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("iLbsLocationResolver = CLbsLocationResolver::NewL(*iResolverObserver,uid) LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr,SetGSMCellInfoL(1, + testArray3[i].countryCode, + testArray3[i].networkCode, + testArray3[i].locationCode, + testArray3[i].cellId , KTimingAdvanceSaveToCacheTrue)); // timing advance is special! + if (KErrNone != leaveErr ) + { + INFO_PRINTF2(_L("SetGSMCellInfoL LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr, AddLocationInfoL()); + if( KErrNone !=leaveErr) + { + INFO_PRINTF2(_L("AddLocationInfoL() LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TRAP(leaveErr, ConvertLocationInfoL(1, 1, 0)); + if( KErrNone !=leaveErr) + { + INFO_PRINTF2(_L("ConvertLocationInfoL(1, 1, 0)) LEAVES, error =%d"), leaveErr); + User::Leave(leaveErr); + } + + TInt err = ValidateLocationInfo(); + if( KErrNone !=err) + { + INFO_PRINTF2(_L("ValidateLocationInfo() returns error =%d"), err); + User::Leave(err); + } + + TLocality locality; + TBool fromCache = iResolverObserver->ConversionLocality(locality); + + TReal64 lat = locality.Latitude(); + TReal64 lng = locality.Longitude(); + TReal32 alt = locality.Altitude(); + + TReal32 horAcc = locality.HorizontalAccuracy(); + + + + if (fromCache) + { + INFO_PRINTF5(_L("From Cache(lat=%Lf, lng=%Lf, alt=%f horacc=%f"),lat,lng,alt,horAcc); + if (testArray3[i].fromPlugin) + { + INFO_PRINTF1(_L("Test failed - Position got from Cache bit should have come from plugin")); + User::Leave(KErrGeneral); + } + // now check horizontal accuracy + TInt expectedAccuracy = testArray3[i].expectedHorAccuracyWhenFromCache; + if ( expectedAccuracy != (TInt)horAcc) + { + INFO_PRINTF1(_L("Test failed - incorrect horizontal accuracy read from plugin")); + INFO_PRINTF3(_L("Expected %d and got %d"),expectedAccuracy,(TInt)horAcc); + + User::Leave(KErrGeneral); + } + // now check latitude + TInt expectedLatitude = testArray3[i].expectedLatitudeWhenFromCache; + if ( expectedLatitude != (TInt)lat) + { + INFO_PRINTF1(_L("Test failed - incorrect latitude read from plugin")); + INFO_PRINTF3(_L("Expected %d and got %d"),expectedLatitude,(TInt)lat); + + User::Leave(KErrGeneral); + } + + // now check longitude + TInt expectedLongitude = testArray3[i].expectedLongitudeWhenFromCache; + if ( expectedLongitude != (TInt)lng) + { + INFO_PRINTF1(_L("Test failed - incorrect Longitude read from plugin")); + INFO_PRINTF3(_L("Expected %d and got %d"),expectedLongitude,(TInt)lng); + + User::Leave(KErrGeneral); + } + + } + else + { // from plugin! + INFO_PRINTF5(_L("From plugin(lat=%Lf, lng=%Lf, alt=%f horacc=%f"),lat,lng,alt,horAcc); + if (!testArray3[i].fromPlugin) + { + INFO_PRINTF1(_L("Test failed - Position got from plugin but should have come from Cache")); + User::Leave(KErrGeneral); + } + // now check horizontal accuracy + TInt cellId = testArray3[i].cellId; + if ( cellId != (TInt)horAcc) + { + INFO_PRINTF1(_L("Test failed - incorrect horizontal accuracy read from plugin")); + INFO_PRINTF3(_L("Expected %d and got %d"),cellId,(TInt)horAcc); + + User::Leave(KErrGeneral); + } + TInt cCode = testArray3[i].countryCode; + if (cCode != (TInt)lat) + { + INFO_PRINTF2(_L("VcCode != (TInt)lat error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + TInt nCode = testArray3[i].networkCode; + if (nCode != (TInt)lng) + { + INFO_PRINTF2(_L("nCode != (TInt)lng error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + TInt lCode = testArray3[i].locationCode; + if (lCode != (TInt)alt) + { + INFO_PRINTF2(_L("lCode != (TInt)alt error =%d"), KErrGeneral); + + User::Leave(KErrGeneral); + } + + } + Cleanup(); + } // end of for loop +}; +void CStep::CallL(TInt aId) +{ + switch(aId) + { +// case 0: GetAllLocationInfoL(); break; + case KErrNotFound: + INFO_PRINTF1(_L("Test case not found")); + User::Leave(KErrNotFound); + break; + + case 1: test_2698_4_1_1_1L(); break; + case 2: test_2698_4_1_1_3L(); break; + case 3: test_2698_4_1_1_4L(); break; + case 4: test_2698_4_1_1_5L(); break; + case 5: test_2698_4_1_1_6L(); break; + case 6: test_2698_4_1_1_7L(); break; + case 7: test_2698_4_1_1_8L(); break; + case 8: test_2698_4_1_1_9L(); break; + case 9: test_2698_4_1_1_10L(); break; + case 10: test_2698_4_1_1_11L(); break; + case 11: test_2698_4_1_1_12L(); break; + case 12: test_2698_4_1_1_13L(); break; + case 13: test_2698_4_1_2L(); break; + case 14: test_2698_4_1_3L(); break; + case 15: test_2698_4_1_4L(); break; + case 16: test_2698_4_1_5L(); break; + case 17: test_2698_4_1_6L(); break; + case 18: test_2698_4_1_7L(); break; + case 19: test_2698_4_1_8L(); break; + case 20: test_2698_4_1_9L(); break; + case 21: test_2698_4_1_10L(); break; + case 22: test_2698_4_1_11L(); break; + case 23: test_2698_4_1_12L(); break; + case 24: test_2698_4_1_13L(); break; + case 25: test_2698_4_1_14L(); break; + case 26: test_2698_4_1_15L(); break; + case 27: test_2698_4_1_16L(); break; + case 28: test_2698_4_1_17L(); break; + case 29: test_2698_4_1_18L(); break; + case 30: test_2698_4_1_19L(); break; + case 31: test_2698_4_1_20L(); break; + case 32: test_2698_4_1_21L(); break; + case 33: test_2698_4_1_22L(); break; + case 34: test_2698_4_1_23L(); break; + case 35: test_2698_4_1_24L(); break; + case 36: test_2698_4_1_25L(); break; + case 37: test_2698_4_1_26L(); break; + case 38: test_2698_4_1_27L(); break; + case 39: test_2698_4_1_28_1L(); break; + case 40: test_2698_4_1_28_1_3L(); break; + case 41: test_2698_4_1_28_1_4L(); break; + case 42: test_2698_4_1_28_1_5L(); break; + case 43: test_2698_4_1_28_1_6L(); break; + case 44: test_2698_4_1_28_1_7L(); break; + case 45: test_2698_4_1_28_1_8L(); break; + case 46: test_2698_4_1_28_1_9L(); break; + case 47: test_2698_4_1_28_1_10L(); break; + case 48: test_2698_4_1_28_2L(); break; + case 49: test_2698_4_1_29L(); break; + case 50: test_2698_4_1_30L(); break; + case 51: test_2698_4_1_31L(); break; + case 52: test_2698_4_1_32L(); break; + case 53: test_2698_4_1_33L(); break; + case 54: test_2698_4_1_34L(); break; + case 55: test_2698_4_1_35L(); break; + case 56: test_2698_4_1_36L(); break; + case 57: test_2698_4_1_37L(); break; + case 58: test_2698_4_1_38L(); break; + case 59: test_2698_4_1_39L(); break; + case 60: test_2698_4_1_40L(); break; + case 61: test_2698_4_1_41L(); break; + case 62: test_2698_4_1_42L(); break; + case 63: test_2698_4_1_43L(); break; + case 64: test_2698_4_1_44L(); break; + case 65: test_2698_4_1_45L(); break; + case 66: test_2698_4_1_46L(); break; + case 67: test_2698_4_1_47_1L(); break; + case 68: test_2698_4_1_47_2L(); break; + case 69: test_2698_4_1_47_3L(); break; + case 70: test_2698_4_1_49_1L(); break; + case 71: test_2698_4_1_49_2L(); break; + case 72: test_2698_4_1_51L(); break; + case 73: test_2698_4_1_52L(); break; + case 74: test_2698_4_1_53L(); break; + case 75: test_2698_4_2_1L(); break; + case 76: test_2698_4_2_2L(); break; + case 77: test_2698_4_2_3L(); break; + case 78: test_2698_4_2_4L(); break; + case 79: test_2698_4_2_5L(); break; + case 80: test_2698_4_2_6L(); break; + case 81: test_2698_4_2_7L(); break; + case 82: test_2698_4_2_8L(); break; + case 83: test_2698_4_2_9L(); break; + case 84: test_2698_4_2_10L(); break; + case 85: test_2698_4_2_11L(); break; + case 86: test_2698_4_2_12L(); break; + case 87: test_2698_4_2_13L(); break; + case 88: test_2698_4_2_14L(); break; + case 89: test_2698_4_2_15L(); break; + case 90: test_2698_4_2_16L(); break; + case 91: test_2698_4_2_17L(); break; + case 92: test_2698_4_2_18L(); break; + case 93: test_2698_4_2_19L(); break; + case 94: test_2698_4_2_20L(); break; + case 95: test_2698_4_2_21L(); break; + case 96: test_2698_4_2_22L(); break; + case 97: test_2698_4_3_1_1L(); break; + case 98: test_2698_4_3_2_1L(); break; + case 99: test_2698_4_3_2_2L(); break; + case 100: test_2698_4_3_4L(); break; + case 101: test_2698_4_3_5L(); break; + case 102: test_2698_4_3_6L(); break; + case 103: test_2698_4_3_7L(); break; + case 104: test_2698_4_3_8L(); break; + case 105: test_2698_4_3_9L(); break; + case 106: test_2698_4_3_10L(); break; + case 107: test_2698_4_4_1L(); break; + case 108: test_2698_4_4_2L(); break; + case 109: test_2698_4_4_3L(); break; + case 110: test_2698_4_4_4L(); break; + case 111: test_2698_4_5_1L(); break; + case 112: test_2698_4_5_2L(); break; + case 113: test_2698_5_1_1L(); break; + case 114: test_2698_5_1_2L(); break; + case 115: test_2698_5_1_3L(); break; + case 116: test_2698_5_1_4L(); break; + case 117: test_2698_5_1_5L(); break; + case 118: test_2698_5_1_6L(); break; + case 119: test_2698_5_1_7L(); break; + case 120: test_2698_5_1_8L(); break; + case 121: test_2698_5_1_9L(); break; + case 122: test_2698_5_1_10L(); break; + case 123: test_2698_5_1_11L(); break; + case 124: test_2698_5_1_12L(); break; + case 125: test_2698_5_1_13L(); break; + case 126: test_2698_5_1_14L(); break; + case 127: test_2698_5_1_15L(); break; + case 128: test_2698_5_1_16L(); break; + case 129: test_2698_5_1_17L(); break; + case 130: test_2698_5_1_18L(); break; + case 131: test_2698_5_1_19L(); break; + case 132: test_2698_5_1_20L(); break; + case 133: test_2698_5_1_21L(); break; + case 134: test_2698_5_1_22L(); break; + case 135: test_2698_5_1_23L(); break; + case 136: test_2698_5_1_24L(); break; + case 137: test_2698_5_1_25L(); break; + case 138: test_2698_5_1_26L(); break; + case 139: test_2698_5_1_27L(); break; + case 140: test_2698_5_2_1L(); break; + case 141: test_2698_5_2_2L(); break; + case 142: test_2698_5_2_3L(); break; + case 143: test_2698_5_2_4L(); break; + case 144: test_2698_5_2_5L(); break; + case 145: test_2698_5_2_6L(); break; + case 146: test_2698_5_3_1L(); break; + case 147: test_2698_5_3_2L(); break; + case 148: test_2698_5_3_3L(); break; + case 149: test_2698_5_3_4L(); break; + case 150: test_2698_5_4_1L(); break; + case 151: test_MultipleCoversionsAtSameTimeL(); break; + case 152: test_MultipleSessionsOneAfterAnotherL(); break; + case 153: test_MultipleResolversAtSameTimeL(); break; + case 154: test_2698_5_4_2L(); break; + case 155: test_SetAndGetConversionPrefs(); break; + case 156: test_cacheL(); break; + case 157: test_cache2L(); break; + case 158: test_cache3L(); break; + }; +}; diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/te_lbslocationinfoconvertersuiteserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/te_lbslocationinfoconvertersuiteserver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2005 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: +* +*/ + + +#include "te_lbslocationinfoconvertersuiteserver.h" +#include "step.h" + +#include "te_lbslocationinfoconvertersuitedefs.h" +_LIT(KServerName,"te_lbslocationinfoconvertersuite"); +CTe_LbsLocationMonitorSuite* CTe_LbsLocationMonitorSuite::NewL() +/** + * @return - Instance of the test server + * Same code for Secure and non-secure variants + * Called inside the MainL() function to create and start the + * CTestServer derived server. + */ + { + CTe_LbsLocationMonitorSuite * server = new (ELeave) CTe_LbsLocationMonitorSuite(); + CleanupStack::PushL(server); + + server->ConstructL(KServerName); + CleanupStack::Pop(server); + return server; + } + +void CTe_LbsLocationMonitorSuite::ConstructL(const TDesC& aName) + { + CTestServer::ConstructL(aName); + + } + +CTe_LbsLocationMonitorSuite::~CTe_LbsLocationMonitorSuite() + { + + } + + + +// Secure variants much simpler +// For EKA2, just an E32Main and a MainL() +LOCAL_C void MainL() +/** + * Secure variant + * Much simpler, uses the new Rendezvous() call to sync with the client + */ + { + // Leave the hooks in for platform security +#if (defined __DATA_CAGING__) + RProcess().DataCaging(RProcess::EDataCagingOn); + RProcess().DataCaging(RProcess::ESecureApiOn); +#endif + CActiveScheduler* sched=NULL; + sched=new(ELeave) CActiveScheduler; + CActiveScheduler::Install(sched); + CTe_LbsLocationMonitorSuite* server = NULL; + // Create the CTestServer derived server + TRAPD(err,server = CTe_LbsLocationMonitorSuite::NewL()); + if(!err) + { + // Sync with the client and enter the active scheduler + RProcess::Rendezvous(KErrNone); + sched->Start(); + } + delete server; + delete sched; + } + + + +GLDEF_C TInt E32Main() +/** + * @return - Standard Epoc error code on process exit + * Secure variant only + * Process entry point. Called by client using RProcess API + */ + { + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + if(cleanup == NULL) + { + return KErrNoMemory; + } + TRAPD(err,MainL()); + delete cleanup; + __UHEAP_MARKEND; + return err; + } + + +CTestStep* CTe_LbsLocationMonitorSuite::CreateTestStep(const TDesC& aStepName) +/** + * @return - A CTestStep derived instance + * Secure and non-secure variants + * Implementation of CTestServer pure virtual + */ + { + CTestStep* testStep = NULL; + + TRAPD(err, + if(aStepName == KStep) + testStep = new(ELeave) CStep(); + ); + if(KErrNone != err) + { + INFO_PRINTF2(KErrorCreateTELBSLocationMonitorTestStep, err); + } + + return testStep; + } diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/te_lbslocationinfoconvertersuitestepbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/te_lbslocationinforconvertertef/src/te_lbslocationinfoconvertersuitestepbase.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2006 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: +* +*/ + + +#include "te_lbslocationinfoconvertersuitestepbase.h" + + +TVerdict CTe_LbsLocationInfoConverterSuiteStepBase::doTestStepPreambleL() +/** + * @return - TVerdict + * Implementation of CTestStep base class virtual + * It is used for doing all initialisation common to derived classes in here. + * Make it being able to leave if there are any errors here as there's no point in + * trying to run a test step if anything fails. + * The leave will be picked up by the framework. + */ + { + iScheduler = new(ELeave) CActiveScheduler(); + CActiveScheduler::Install(iScheduler); + + SetTestStepResult(EPass); + return TestStepResult(); + } + +TVerdict CTe_LbsLocationInfoConverterSuiteStepBase::doTestStepPostambleL() +/** + * @return - TVerdict + * Implementation of CTestStep base class virtual + * It is used for doing all after test treatment common to derived classes in here. + * Make it being able to leave + * The leave will be picked up by the framework. + */ + { + return TestStepResult(); + } + +CTe_LbsLocationInfoConverterSuiteStepBase::~CTe_LbsLocationInfoConverterSuiteStepBase() + { + + } + +CTe_LbsLocationInfoConverterSuiteStepBase::CTe_LbsLocationInfoConverterSuiteStepBase() + { + + } + + +TInt CTe_LbsLocationInfoConverterSuiteStepBase::GetTestCaseId() + { + TInt testCaseId(KErrNotFound); + // Ini file key names for test cases + _LIT(KTestCaseId, "tc_id"); + TInt err = GetIntFromConfig(ConfigSection(), KTestCaseId, testCaseId); + return testCaseId; + } + +TInt CTe_LbsLocationInfoConverterSuiteStepBase::GetTestCaseApi() + { + TInt testCaseApi(0); + // Ini file key names for test cases + _LIT(KTestCaseApi, "tc_api"); + TInt err = GetIntFromConfig(ConfigSection(), KTestCaseApi, testCaseApi); + return testCaseApi; + } + +TInt CTe_LbsLocationInfoConverterSuiteStepBase::GetPluginUid() + { + TInt pluginUid(KErrNotFound); + // Ini file key names for test cases + _LIT(KPluginUid, "plugin_uid"); + TInt err = GetIntFromConfig(ConfigSection(), KPluginUid, pluginUid); + return pluginUid; + } +void CTe_LbsLocationInfoConverterSuiteStepBase::InitWaitersL() + { + + } + + +void CTe_LbsLocationInfoConverterSuiteStepBase::DeleteWaiters() + { + + } + diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/testlocationmonitor/inc/clbsconversionpositionersubsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/testlocationmonitor/inc/clbsconversionpositionersubsession.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,76 @@ +/* +* 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: +* +*/ + + +#ifndef CLBSCONVERSIONPOSITIONERSUBSESSION_H_ +#define CLBSCONVERSIONPOSITIONERSUBSESSION_H_ + + +#include +#include "tserverstartparams.h" +#include "csecureasbase.h" +#include "csecureserverbase.h" +#include "csecuresessionbase.h" +#include "csecuresessionsubsessionbase.h" +#include "csubsessionbase.h" +#include "messageutils.h" +#include "clbslocmonitorutils.h" + +class CLbsLocMonitorServer; + +/* + Server side subsession of the Location Monitor server. + This subsession handles client's requests for the + location info conversion. +*/ +class CLbsConversionPositionerSubsession : public CBase, + public MSubSessionImpl + { +public: + static CLbsConversionPositionerSubsession* NewL(); + + ~CLbsConversionPositionerSubsession(); + + // From MSubSessionImpl + virtual void DispatchL(const RMessage2& aMessage); + virtual void DispatchError(const RMessage2& aMessage, TInt aError); + virtual void CreateSubSessionL(const RMessage2& aMessage, const CSecureServerBase* aServer); + virtual void CloseSubSession(); + + // via MSubSessionImpl::MRelease + void VirtualRelease(); + +protected: + CLbsConversionPositionerSubsession(); + void ConstructL(); + + // + // action methods. + // + void GetPositionL(const RMessage2& aMessage); + void CancelGetPositionL(const RMessage2& aMessage); + void SetLastKnownPositionL(const RMessage2& aMessage); + +private: + + CLbsLocMonitorServer* iLocMonitorServer; + + // Unique ID of this subsession + CLbsLocMonitorUtils::sessionAndSubSessionId iSubsessionId; + }; + +#endif /*CLBSCONVERSIONPOSITIONERSUBSESSION_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/testlocationmonitor/inc/clbslocmonitorconversionhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/testlocationmonitor/inc/clbslocmonitorconversionhandler.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,254 @@ +/* +* 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: Declaration of CLbsLocMonitorConversionHandler class. +* +*/ + +#ifndef CLBSLOCMONITORCONVERSIONHANDLER_H_ +#define CLBSLOCMONITORCONVERSIONHANDLER_H_ + +#include +#include +#include +#include "mlbsconversioncompleteobserver.h" +#include "rlbslocmonitordb.h" + +/** + * This class is responsible for requesting location conversion from + * the plug in and later to handle the converted information. + */ +class CLbsLocMonitorConversionHandler : public CActive, + public MLbsLocInfoConverterPluginObserver + { +public: + /** + * Validation info assosciated with each client + */ + struct TValidationInfo + { + TSecureId iClientSecureId; + }; /** + * This represent different state of conversion handler. + */ + enum TState + { + EStateIdle, + EStateValidation, + EStateConversion, + EStateCacheSave, + EStateCacheSaveComplete + }; + +public: + /** + * Creates new instance of CLbsLocMonitorConversionHandler object. + */ + static CLbsLocMonitorConversionHandler* NewL( + MLbsConversionCompleteObserver& + aConversionCompleteObserver, + TUid aConversionPluginUid ); + + /** + * Destructor + */ + ~CLbsLocMonitorConversionHandler(); + + /** + * Returns the size of converted location information to the client. + */ + void GetConvertLocationInfoSizeL(const RMessage2& aMessage); + + /** + * Returns the converted location information to the client. + */ + void GetConvertedLocationInfoL(const RMessage2& aMessage); + + /** + * Cancel location info conversion. + */ + void CancelLocationInfoConversionL(const RMessage2& aMessage); + + /** + * Returns Uid of conversion plugin that is loaded. + */ + TUid ConversionPluginUid(); + + /** + * Returns ETrue is any message corresponding to subsession id + * is present in the handler. + */ + TBool IsMessagePresent(const RMessage2& aMessage); + + /** + * Returns ETrue if secure id and subsession id matches else EFalse. + */ + TBool CompareMessage(const RMessage2& aSrc,const RMessage2& aDes); + + + TReal32 AccuracyFromMatchLevel(TPositionAreaExtendedInfo::TArea aMatchlevel); + + + +public: // from MLbsLocInfoConverterPluginObserver + virtual void OnConversionComplete(TInt aStatusCode); + + virtual void OnValidationComplete(TInt aStatusCode); + +protected: // from CActive + void RunL(); + void DoCancel(); + +private: + /** + * Constructor. + */ + CLbsLocMonitorConversionHandler(MLbsConversionCompleteObserver& + aConversionCompleteObserver); + + /** + * Symbian 2 phase constructor. + */ + void ConstructL(TUid aConversionPluginUid); + + /** + * Processes the request which is recently validated. + */ + TInt ProcessRequestL(); + + /** + * Loads the conversion module specified by client. + */ + void LoadConversionPluginL(TUid aConversionModuleId); + + /** + * Writes converted position information to the stream. + */ + void WriteAreaInfoL(RBufWriteStream& aWriteStream, + CLbsLocationInfo::TAreaInfoMask aAreaInfoMask); + + /** + * Completes client's message. + */ + void CompleteRequest(const RMessage2& aMessage,TInt aReason); + + /** + * This is called after each conversion request complete + */ + void RequestCompleteL(); + + + void WriteResultToBufferL(); + + + /** + * Fills in partial results from cache where they are better than those returned from the plugin + */ + void FillInPartialL(); + + /** + * Sends requests from iRequestedInfo to the cacne and uses the result to + * fill in iCacheLookupResults, the RunL will decide which responses to + * write back into iRequestedInfo and send back to the client + */ + TBool CacheLookupL(); + + /* + * Writes any cellid + location pairs received as part of a query back into + * the cache + */ + TBool CacheSaveL(); + +private: // Member variables + /** + * Handle to conversion complete observer + */ + MLbsConversionCompleteObserver& iConversionCompleteObserver; + + /** + * Conversion request. + */ + RMessage2 iConversionRequest; + + /** + * Validation request array. + */ + RArray iValidationRequestQueue; + + /** + * Pointer to conversion plugin + */ + CLbsLocInfoConverterPluginBase* iLocInfoConverterPlugIn; + + /** + * Handle to buffer that contains converted information. + */ + CBufFlat* iBuffer; + + /** + * Client specified request info + */ + TLbsConversionOutputInfoMask iRequestedInfo; + + /** + * Location information array passed from client. + */ + RLbsLocationInfoArray iLocationInfoArray; + + + /** + * A subset of location information array passed from client. + * requests that have been solved by the cache are ommitted + * this array DOES NOT OWN its contents and should not destroy them. + * as the ownership remains with iLocationInfoArray + */ + RLbsLocationInfoArray iSubsetLocationInfoArray; + + /** + * Uid of currently loaded conversion plug in + */ + TUid iConversionPluginId; + + /** + * State of conversion handler. + */ + TState iState; + + /** + * Secure id of client that has outstanding request + */ + TSecureId iCurrentRequestSecureId; + + /** + * Subsession id of client that has outstanding request + */ + TInt iCurrentRequestSubsessionId; + + + /* + * Cache lookup results + */ + RArray iCachePartialResults; + + + /** + * Cache for lookups + */ + RLbsLocMonitorDb iCache; + + + TInt iSavedToCacheCount; + + }; + +#endif /*CLBSLOCMONITORCONVERSIONHANDLER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/testlocationmonitor/inc/clbslocmonitorpluginresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/testlocationmonitor/inc/clbslocmonitorpluginresolver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,86 @@ +/* +* 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: Declaration of CLbsLocMonitorPluginResolver class +* +*/ + +#ifndef CLBSLOCMONITORPLUGINRESOLVER_H_ +#define CLBSLOCMONITORPLUGINRESOLVER_H_ + +#include +#include + +/** + * This class is responsible for choosing the default converter plugin based + * on vendorid and plugin priority. + * + */ +class CLbsLocMonitorPluginResolver : public CActive + { +public: + /** + * Constructs new object of CLbsLocMonitorPluginResolver. + */ + static CLbsLocMonitorPluginResolver* NewL(); + + /** + * Destructor. + */ + ~CLbsLocMonitorPluginResolver(); + + /** + * Returns uid of default converter. + * @param[out] aConverterPluginUid Default converter plugin id. + * @return KErrNotFound If none of converter plugin available. + */ + TInt DefaultConverterUid(TUid& aConverterPluginUid); + +protected: // From CActive + void RunL(); + void DoCancel(); + + +private: + /** + * Default constructor. + */ + CLbsLocMonitorPluginResolver(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Finds default converter plugin + */ + void FindDefaultConverterPluginL(); + + /** + * + */ + TInt PriorityInfo(const TDesC8& aOpaqueData); +private: // Member variables + + /** + * Pointer to ecom session + */ + REComSession* iEcomSession; + + /** + * Default converter plugin uid. + */ + TUid iDefaultConverterPluginId; + }; +#endif /* CLBSLOCMONITORPLUGINRESOLVER_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/testlocationmonitor/inc/lbslocmonitorclientconsts.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/testlocationmonitor/inc/lbslocmonitorclientconsts.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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: +* +*/ + + +#ifndef LBSLOCMONITORCLIENTCONSTS_H_ +#define LBSLOCMONITORCLIENTCONSTS_H_ + +#include +#include + +/** + * Message parameters index in a message of RMessage2. The server has to use + * the parameter index defined below to write and read data into the IPC message. + */ + +// This position in the IPC is used by the client library to receive +// buffer size. +const TInt KParamBufferSize = 0; + + +// This position in the IPC is used by the client library to send location +// information. +const TInt KParamLocationInfo = 1; + +// This position in the IPC is used by the client library to send client preferences. +const TInt KParamClientPrefs = 2; + +// This position in the IPC is used by the server to send converted info +const TInt KParamConvertedInfo = 0; + +/** + * This structure holds conversion prefs,location info mask and + * the conversion module id. + */ +struct TLbsClientPrefs + { + TLbsConversionPrefs iConversionPrefs; + + TLbsConversionOutputInfoMask iRequestedInfo; + + TUid iConverterModuleId; + }; + +#endif /*LBSLOCMONITORCLIENTCONSTS_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/testlocationmonitor/inc/locmonitorsettingskeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/testlocationmonitor/inc/locmonitorsettingskeys.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2006 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: Defines the cenrep keys of location monitor +* +*/ + + +#ifndef LOCMONITORSETTINGSKEYS_H +#define LOCMONITORSETTINGSKEYS_H + +// CONSTANTS + +// ENUMERATION FOR CENTRAL REPOSITORY KEYS +enum TCenRepKeys + { + EPhoneVendorId = 0x00000001, + }; + +// CENTRAL REPOSITORY UID +const TUid KCRUidLocMonitorSettings = {0x20026814}; + + +#endif // LOCMONITORSETTINGSKEYS_H diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/locmonitor/test/testlocationmonitor/inc/mlbsconversioncompleteobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/locmonitor/test/testlocationmonitor/inc/mlbsconversioncompleteobserver.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: +* +*/ + +#ifndef MLBSCONVERSIONCOMPLETEOBSERVER_H_ +#define MLBSCONVERSIONCOMPLETEOBSERVER_H_ + +// Forward declarations +class CLbsLocMonitorConversionHandler; + +/** + * Class that needs to implement this interface to listen + * to conversion complete event from the handler. + * + */ +class MLbsConversionCompleteObserver + { +public: + virtual void HandleConversionComplete( CLbsLocMonitorConversionHandler* + aConversionHandler ) = 0; + }; + + +#endif /*MLBSCONVERSIONCOMPLETEOBSERVER_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/networkgateway/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmgmt/networkgateway/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +// Copyright (c) 2005-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: +// + +#include "../test/netprotocoltest/group/bld.inf" +#include "../test/te_lbsnetgateway/group/bld.inf" + + +// Main projects, in build order +PRJ_EXPORTS +./lbsnetgateway.iby /epoc32/rom/include/lbsnetgateway.iby + +PRJ_MMPFILES +lbsnetgateway.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationmgmt/networkgateway/src/netgateway.cpp --- a/locationmgmt/networkgateway/src/netgateway.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationmgmt/networkgateway/src/netgateway.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/inc/EPos_CPosModulesStatus.h --- a/locationrequestmgmt/locationserver/inc/EPos_CPosModulesStatus.h Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/locationserver/inc/EPos_CPosModulesStatus.h Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/src/EPos_CPosModulesStatus.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPosModulesStatus.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPosModulesStatus.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPosServer.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -41,6 +41,7 @@ #include "EPos_CPosLocMonitorReqHandlerHub.h" #include "EPos_Global.h" +#include "lbspositioningstatusprops.h" // CONSTANTS _LIT(KPosResourceFile, "\\private\\101F97B2\\eposserver.rsc"); @@ -134,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(); @@ -180,10 +214,11 @@ DEBUG_TRACE("Setting Location Settings observer...", __LINE__) iModuleSettings->AddListenerL(*this); + // Define the MO Positioning Status property + LbsPositioningStatusProps::InitializeMoPropertyL(); + DEBUG_TRACE("Starting server active object...", __LINE__) StartL(KPositionServerName); - - } /** @@ -203,7 +238,6 @@ */ CPosServer::~CPosServer() { - delete iLocMonitorReqHandlerHub; delete iShutdown; @@ -211,7 +245,7 @@ delete iModuleSettings; delete iBackupListener; - + // This is needed because CPositioner might have used ECom (PSYs) REComSession::FinalClose(); } diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/src/EPos_CPosSubSession.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPosSubSession.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPosSubSession.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/src/EPos_CPositionRequest.cpp --- a/locationrequestmgmt/locationserver/src/EPos_CPositionRequest.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/locationserver/src/EPos_CPositionRequest.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -37,7 +37,6 @@ - // CONSTANTS #ifdef _DEBUG _LIT(KTraceFileName, "EPos_CPositionRequest.cpp"); @@ -166,7 +165,7 @@ } __ASSERT_DEBUG(iPositioner, DebugPanic(EPosServerPanicPositionerNotInitialized)); - + iMessage = aMessage; // Store parameter here in case of leave. // Clear previous position data diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/test/testLocMonitorServer/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/locationserver/test/testLocMonitorServer/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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: +* +*/ + + +PRJ_TESTMMPFILES +testlocmonitorserver.mmp + +PRJ_TESTEXPORTS +testlocmonitorserver.iby /epoc32/rom/include/testlocmonitorserver.iby diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/test/testLocServer/group/testlocserver.mmp --- a/locationrequestmgmt/locationserver/test/testLocServer/group/testlocserver.mmp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/locationserver/test/testLocServer/group/testlocserver.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/locationserver/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/locationserver/traces/OstTraceDefinitions.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ + +#include +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsPrivacyController/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsPrivacyController/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,28 @@ +// Copyright (c) 2005-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: +// + +// Main projects, in build order +PRJ_EXPORTS +../inc/LbsPrivacyController.h lbs/lbsprivacycontroller.h + +lbsprivacycontroller.iby /epoc32/rom/include/lbsprivacycontroller.iby + + +PRJ_MMPFILES +LbsPrivacyController.mmp + +PRJ_TESTEXPORTS + +PRJ_TESTMMPFILES diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsPrivacyExtNotifiers/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsPrivacyExtNotifiers/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,31 @@ +// Copyright (c) 2005-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: +// + +// Main projects, in build order +PRJ_EXPORTS +../inc/lbsprivacyextnotifiers.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsprivacyextnotifiers.h) + +lbsprivacyexnotifiers.iby /epoc32/rom/include/lbsprivacyexnotifiers.iby + + +PRJ_MMPFILES +LbsPrivacyExtNotifiers.mmp + +PRJ_TESTEXPORTS + +PRJ_TESTMMPFILES +../test/lbsexamplenotifier.mmp +../test/lbsprivacynotifiertest.mmp +../test/lbsprivacyextnotifierstest.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsQueryAndNotification/PrivacyDataTypes/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsQueryAndNotification/PrivacyDataTypes/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +// Copyright (c) 2005-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: +// + + + + +PRJ_EXPORTS +../inc/EPos_CPosRequestor.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/epos_cposrequestor.h) +../inc/EPos_Privacy.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/epos_privacy.h) +../inc/EPos_CPosServiceRequestor.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/epos_cposservicerequestor.h) +../inc/EPos_CPosContactRequestor.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/epos_cposcontactrequestor.h) +../inc/EPos_RPosRequestorStack.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/epos_rposrequestorstack.h) + +lbsprivacydatatypes.iby /epoc32/rom/include/lbsprivacydatatypes.iby + + +PRJ_MMPFILES +EPos_PrivacyTypes.mmp diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsQueryAndNotification/QueryAndNotificationAPI/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsQueryAndNotification/QueryAndNotificationAPI/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +// Copyright (c) 2005-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: +// + + + +PRJ_EXPORTS +../inc/EPos_PrivacyNotifier.hrh /epoc32/include/lbs/epos_privacynotifier.hrh + + +// File needs to be exported to allow UI layer to access it. Otherwise code duplication/differentiation will occur. +../inc/EPos_TPosQNInputData.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/epos_tposqninputdata.h) + + +// End of file diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsQueryAndNotification/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/LbsQueryAndNotification/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,17 @@ +// Copyright (c) 2007-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: +// + +#include "../PrivacyDataTypes/group/bld.inf" +#include "../QueryAndNotificationAPI/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LBSPrivacyNotification/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,20 @@ +// Copyright (c) 2007-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: +// + +#include "../LbsPrivacyController/group/bld.inf" +#include "../LbsPrivacyExtNotifiers/group/bld.inf" +#ifdef SYMBIAN_LOCATION_PRIVACY_V2 + #include "../LbsQueryAndNotification/group/bld.inf" +#endif diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LbsX3P/LbsX3PApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LbsX3P/LbsX3PApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +// Copyright (c) 2005-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: +// + +PRJ_EXPORTS +../inc/LbsX3P.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/lbsx3p.h) + +lbsx3p.iby /epoc32/rom/include/lbsx3p.iby + + +PRJ_MMPFILES +LbsX3PApi.mmp + +PRJ_TESTMMPFILES +../test/LbsX3PExample.mmp + diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/LbsX3P/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationrequestmgmt/networkrequesthandler/LbsX3P/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,18 @@ +// Copyright (c) 2005-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: +// + +// Main projects, in build order +#include "../LbsX3PApi/group/bld.inf" + diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/inc/EPos_CPosDialogCtrl.h --- a/locationrequestmgmt/networkrequesthandler/inc/EPos_CPosDialogCtrl.h Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/inc/EPos_CPosDialogCtrl.h Tue Jul 13 12:25:28 2010 +0100 @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "EPos_PrivacyInternal.h" #include @@ -209,7 +209,8 @@ void DeferNotificationL(); void CreateNotificationAndEnqueueL(); - + void UpdateProperty(); + private: // Data RNotifier iNotifier; RArray iRequestQueue; diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/src/lbsnetworkrequesthandler.cpp --- a/locationrequestmgmt/networkrequesthandler/src/lbsnetworkrequesthandler.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/src/lbsnetworkrequesthandler.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/src/lbsnrhx3pserver.cpp --- a/locationrequestmgmt/networkrequesthandler/src/lbsnrhx3pserver.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/src/lbsnrhx3pserver.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -314,6 +314,7 @@ RThread client; aMessage.Client(client); iClientUid = client.SecureId(); + client.Close(); } } } diff -r 2965a06983dc -r 81c9bee26a45 locationrequestmgmt/networkrequesthandler/src/privacyandlocationrequesthandler.cpp --- a/locationrequestmgmt/networkrequesthandler/src/privacyandlocationrequesthandler.cpp Mon May 03 13:50:32 2010 +0300 +++ b/locationrequestmgmt/networkrequesthandler/src/privacyandlocationrequesthandler.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -15,6 +15,12 @@ #include #include +#include + +#ifdef SYMBIAN_FEATURE_MANAGER + #include + #include +#endif // LBS-specific #include @@ -25,6 +31,8 @@ #include "nrhpanic.h" #include "lbsdevloggermacros.h" #include "lbsqualityprofile.h" +#include "lbsrootcenrepdefs.h" +#include "lbspositioningstatusprops.h" #include "privacyandlocationrequesthandler.h" @@ -93,6 +101,10 @@ iFsmArray.ResetAndDestroy(); + // force the count of active network initiated positioning sessions to 0 + // this supports the pre-APE centric architecture wherein the NRH is + // destroyed on completion of network initiated positioning. + RProperty::Set(iPosStatusCategory, KLbsNiPositioningStatusKey, 0); delete iEmergencyFsm; delete iAgpsInterface; @@ -161,6 +173,24 @@ } 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 // 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); + TInt posStatusCategory; + err = rep->Get(KNiPositioningStatusAPIKey, posStatusCategory); + User::LeaveIfError(err); + CleanupStack::PopAndDestroy(rep); + iPosStatusCategory = TUid::Uid(posStatusCategory); } @@ -685,6 +715,36 @@ { return iNetRegStatus; } + +// increments the P&S key tracking mobile terminated positioning requests +void CPrivacyAndLocationHandler::IncrementPositioningStatus() + { + TInt count; + RProperty::Get(iPosStatusCategory, KLbsNiPositioningStatusKey, count); + RProperty::Set(iPosStatusCategory, KLbsNiPositioningStatusKey, count+1); + } + +// decrements the P&S key tracking mobile terminated positioning requests +// if location management is supported. In the alternative architecture, +// the NRH is not aware of the positioning session's progress, but is +// transient. Therefore the positioning status is set to zero in the +// class destructor. +void CPrivacyAndLocationHandler::DecrementPositioningStatus() + { + if (iLocationManagementSupported) + { + TInt count; + RProperty::Get(iPosStatusCategory, KLbsNiPositioningStatusKey, count); + if(count>0) + { + RProperty::Set(iPosStatusCategory, KLbsNiPositioningStatusKey, count-1); + } + else + { + LBSLOG_ERR(ELogP3, "CPrivacyAndLocationHandler::DecrementPositioningStatus() - Incorrect Positioning Status count\n"); + } + } + } /** @@ -915,7 +975,7 @@ if(aSessionId == iFsm->SessionId()) { iFsm->ExitData().SetExitData(TPrivLocStateExitData::EExitSessionComplete, aReason); - iFsm->ChangeState(CLbsPrivLocFsm::EStateIdle, aSessionId); + iFsm->ChangeState(CLbsPrivLocFsm::EStateIdle, aSessionId); } } @@ -1054,6 +1114,17 @@ return iFsm->PrivLocHandler().NetworkRegistrationStatus(); } +/* + * increments the network initiated positioning status count + * and remembers that it has done + */ +void CLbsPrivLocStateBase::IncrementPositioningStatus() + { + iFsm->PrivLocHandler().IncrementPositioningStatus(); + iFsm->WasPositioningStatusIncremented() = ETrue; + } + + // ----------------------------------------------------------------------------- // // ----------------------- Class CLbsPrivLocIdleState -------------------- @@ -1129,7 +1200,7 @@ // The request relates to a rejected privacy request // or a request for this session which has already been answered. // In either case, it should be refused. The message is sent to the - // network gateway as apart of exit from the state, but we want to + // network gateway as a part of exit from the state, but we want to // remain in Idle state. iFsm->ExitData().SetExitData(TPrivLocStateExitData::EExitCancelledByPrivacyController, KErrAccessDenied); iFsm->ChangeState(CLbsPrivLocFsm::EStateIdle, aSessionId); @@ -1183,6 +1254,7 @@ const TLbsNetPosRequestPrivacyInt& aNetPosRequestPrivacy) { iFsm->SessionType() = aSessionType; + iFsm->ExternalRequestType() = aExternalRequestInfo.RequestType(); iFsm->ExitData().SetExitData(TPrivLocStateExitData::EExitPrivacyRequestReceived, KErrNone); TPrivLocWaitPrivResponseParams privacyRequestParams( aSessionId, aSessionType, @@ -1292,7 +1364,7 @@ } } - // For MtLrs the Protcol module should not + // For MtLrs the Protocol module should not // send a REF position until after we have sent the Priv response to the PM // Inform network of the privacy response for normal privacy requests. @@ -1366,6 +1438,13 @@ // Tell the AGPS handler that we are going to start a location request soon. AgpsInterface()->PreStartPositioning(iFsm->SessionId(), iFsm->IsEmergency()); + // Set the Positioning Status for the UI indicator. + // Not done for silent requests. + if (iFsm->ExternalRequestType() < TLbsExternalRequestInfo::ERequestSingleShotSilent) + { + IncrementPositioningStatus(); + } + if(iFsm->LocReqReceived()) { TPrivLocWaitLocationUpdateParams updateRequestParams(iFsm->SessionId(), @@ -2487,7 +2566,8 @@ iRefPosProcessed(EFalse), iLocReqReceived(EFalse), iReqCancelled(EFalse), - iWasPrivacyResponseReceivedStateExited(EFalse) + iWasPrivacyResponseReceivedStateExited(EFalse), + iPositioningStatusIncremented(EFalse) { } @@ -2612,6 +2692,14 @@ { LBSLOG3(ELogP3, "FSM(%d) OnSessionComplete reason=%d",iSessionId.SessionNum(),aReason); iCurrentState->OnSessionComplete(aSessionId, aReason); + + // update the positioning status. Note this is updated only if it was previously + // incremented as a result of this session. + if (WasPositioningStatusIncremented()) + { + PrivLocHandler().DecrementPositioningStatus(); + WasPositioningStatusIncremented() = EFalse; + } } // ----------------------------------------------------------------------------- diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1rrlp/inc/RRLP-Components.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1rrlp/inc/RRLP-Components.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,3859 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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". +// + +/** + * This file was generated by the Objective Systems ASN1C Compiler + * (http://www.obj-sys.com). + */ + +#ifndef RRLP_COMPONENTS_H +#define RRLP_COMPONENTS_H + +#include +#include +#include "rtkey.h" +#include "rtpersrc/asn1PerCppTypes.h" +#include "ASN1CSeqOfList.h" + +/** + * Header file for ASN.1 module RRLP-Components + */ +/**************************************************************/ +/* */ +/* Accuracy */ +/* */ +/**************************************************************/ + +#define TV_Accuracy (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_Accuracy; + +IMPORT_C int asn1PE_Accuracy (OSCTXT* pctxt, ASN1T_Accuracy value); + +IMPORT_C int asn1PD_Accuracy (OSCTXT* pctxt, ASN1T_Accuracy* pvalue); + +IMPORT_C void asn1Print_Accuracy + (const char* name, ASN1T_Accuracy* pvalue); + +/**************************************************************/ +/* */ +/* AccuracyOpt */ +/* */ +/**************************************************************/ + +#define TV_AccuracyOpt (TM_UNIV|TM_CONS|16) + +struct ASN1T_AccuracyOpt { + struct { + unsigned accuracyPresent : 1; + } m; + ASN1T_Accuracy accuracy; + IMPORT_C ASN1T_AccuracyOpt (); +} ; + +IMPORT_C int asn1PE_AccuracyOpt (OSCTXT* pctxt, ASN1T_AccuracyOpt* pvalue); + +IMPORT_C int asn1PD_AccuracyOpt (OSCTXT* pctxt, ASN1T_AccuracyOpt* pvalue); + +IMPORT_C void asn1Print_AccuracyOpt + (const char* name, ASN1T_AccuracyOpt* pvalue); + +/**************************************************************/ +/* */ +/* MethodType */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_MethodType_msAssisted 1 +#define T_MethodType_msBased 2 +#define T_MethodType_msBasedPref 3 +#define T_MethodType_msAssistedPref 4 + +struct ASN1T_MethodType { + int t; + union { + /* t = 1 */ + ASN1T_AccuracyOpt *msAssisted; + /* t = 2 */ + ASN1T_Accuracy msBased; + /* t = 3 */ + ASN1T_Accuracy msBasedPref; + /* t = 4 */ + ASN1T_Accuracy msAssistedPref; + } u; +} ; + +IMPORT_C int asn1PE_MethodType (OSCTXT* pctxt, ASN1T_MethodType* pvalue); + +IMPORT_C int asn1PD_MethodType (OSCTXT* pctxt, ASN1T_MethodType* pvalue); + +IMPORT_C void asn1Print_MethodType + (const char* name, ASN1T_MethodType* pvalue); + +IMPORT_C void asn1Free_MethodType (OSCTXT *pctxt, ASN1T_MethodType* pvalue); + +/**************************************************************/ +/* */ +/* PositionMethod */ +/* */ +/**************************************************************/ + +#define TV_PositionMethod (TM_UNIV|TM_PRIM|10) + +struct PositionMethod { + enum Root { + eotd = 0, + gps = 1, + gpsOrEOTD = 2 + } ; +} ; + +typedef OSUINT32 ASN1T_PositionMethod; + +IMPORT_C int asn1PE_PositionMethod (OSCTXT* pctxt, ASN1T_PositionMethod value); + +IMPORT_C int asn1PD_PositionMethod (OSCTXT* pctxt, ASN1T_PositionMethod* pvalue); + +IMPORT_C void asn1Print_PositionMethod + (const char* name, ASN1T_PositionMethod* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_PositionMethod_ToString (OSINT32 value); + +IMPORT_C int ASN1T_PositionMethod_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_PositionMethod* pvalue); + +/**************************************************************/ +/* */ +/* MeasureResponseTime */ +/* */ +/**************************************************************/ + +#define TV_MeasureResponseTime (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_MeasureResponseTime; + +IMPORT_C int asn1PE_MeasureResponseTime (OSCTXT* pctxt, ASN1T_MeasureResponseTime value); + +IMPORT_C int asn1PD_MeasureResponseTime (OSCTXT* pctxt, ASN1T_MeasureResponseTime* pvalue); + +IMPORT_C void asn1Print_MeasureResponseTime + (const char* name, ASN1T_MeasureResponseTime* pvalue); + +/**************************************************************/ +/* */ +/* UseMultipleSets */ +/* */ +/**************************************************************/ + +#define TV_UseMultipleSets (TM_UNIV|TM_PRIM|10) + +struct UseMultipleSets { + enum Root { + multipleSets = 0, + oneSet = 1 + } ; +} ; + +typedef OSUINT32 ASN1T_UseMultipleSets; + +IMPORT_C int asn1PE_UseMultipleSets (OSCTXT* pctxt, ASN1T_UseMultipleSets value); + +IMPORT_C int asn1PD_UseMultipleSets (OSCTXT* pctxt, ASN1T_UseMultipleSets* pvalue); + +IMPORT_C void asn1Print_UseMultipleSets + (const char* name, ASN1T_UseMultipleSets* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_UseMultipleSets_ToString (OSINT32 value); + +IMPORT_C int ASN1T_UseMultipleSets_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_UseMultipleSets* pvalue); + +/**************************************************************/ +/* */ +/* EnvironmentCharacter */ +/* */ +/**************************************************************/ + +#define TV_EnvironmentCharacter (TM_UNIV|TM_PRIM|10) + +struct EnvironmentCharacter { + enum Root { + badArea = 0, + notBadArea = 1, + mixedArea = 2 + } ; +} ; + +typedef OSUINT32 ASN1T_EnvironmentCharacter; + +IMPORT_C int asn1PE_EnvironmentCharacter (OSCTXT* pctxt, ASN1T_EnvironmentCharacter value); + +IMPORT_C int asn1PD_EnvironmentCharacter (OSCTXT* pctxt, ASN1T_EnvironmentCharacter* pvalue); + +IMPORT_C void asn1Print_EnvironmentCharacter + (const char* name, ASN1T_EnvironmentCharacter* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_EnvironmentCharacter_ToString (OSINT32 value); + +IMPORT_C int ASN1T_EnvironmentCharacter_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_EnvironmentCharacter* pvalue); + +/**************************************************************/ +/* */ +/* PositionInstruct */ +/* */ +/**************************************************************/ + +#define TV_PositionInstruct (TM_UNIV|TM_CONS|16) + +struct ASN1T_PositionInstruct { + struct { + unsigned environmentCharacterPresent : 1; + } m; + ASN1T_MethodType methodType; + ASN1T_PositionMethod positionMethod; + ASN1T_MeasureResponseTime measureResponseTime; + ASN1T_UseMultipleSets useMultipleSets; + ASN1T_EnvironmentCharacter environmentCharacter; + IMPORT_C ASN1T_PositionInstruct (); +} ; + +IMPORT_C int asn1PE_PositionInstruct (OSCTXT* pctxt, ASN1T_PositionInstruct* pvalue); + +IMPORT_C int asn1PD_PositionInstruct (OSCTXT* pctxt, ASN1T_PositionInstruct* pvalue); + +IMPORT_C void asn1Print_PositionInstruct + (const char* name, ASN1T_PositionInstruct* pvalue); + +IMPORT_C void asn1Free_PositionInstruct (OSCTXT *pctxt, ASN1T_PositionInstruct* pvalue); + +/**************************************************************/ +/* */ +/* BCCHCarrier */ +/* */ +/**************************************************************/ + +#define TV_BCCHCarrier (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_BCCHCarrier; + +IMPORT_C int asn1PE_BCCHCarrier (OSCTXT* pctxt, ASN1T_BCCHCarrier value); + +IMPORT_C int asn1PD_BCCHCarrier (OSCTXT* pctxt, ASN1T_BCCHCarrier* pvalue); + +IMPORT_C void asn1Print_BCCHCarrier + (const char* name, ASN1T_BCCHCarrier* pvalue); + +/**************************************************************/ +/* */ +/* BSIC */ +/* */ +/**************************************************************/ + +#define TV_BSIC (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_BSIC; + +IMPORT_C int asn1PE_BSIC (OSCTXT* pctxt, ASN1T_BSIC value); + +IMPORT_C int asn1PD_BSIC (OSCTXT* pctxt, ASN1T_BSIC* pvalue); + +IMPORT_C void asn1Print_BSIC + (const char* name, ASN1T_BSIC* pvalue); + +/**************************************************************/ +/* */ +/* TimeSlotScheme */ +/* */ +/**************************************************************/ + +#define TV_TimeSlotScheme (TM_UNIV|TM_PRIM|10) + +struct TimeSlotScheme { + enum Root { + equalLength = 0, + variousLength = 1 + } ; +} ; + +typedef OSUINT32 ASN1T_TimeSlotScheme; + +IMPORT_C int asn1PE_TimeSlotScheme (OSCTXT* pctxt, ASN1T_TimeSlotScheme value); + +IMPORT_C int asn1PD_TimeSlotScheme (OSCTXT* pctxt, ASN1T_TimeSlotScheme* pvalue); + +IMPORT_C void asn1Print_TimeSlotScheme + (const char* name, ASN1T_TimeSlotScheme* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_TimeSlotScheme_ToString (OSINT32 value); + +IMPORT_C int ASN1T_TimeSlotScheme_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_TimeSlotScheme* pvalue); + +/**************************************************************/ +/* */ +/* Ext_GeographicalInformation */ +/* */ +/**************************************************************/ + +#define TV_Ext_GeographicalInformation (TM_UNIV|TM_PRIM|4) + +struct ASN1T_Ext_GeographicalInformation { + OSUINT32 numocts; + OSOCTET data[20]; + // ctors + ASN1T_Ext_GeographicalInformation () : numocts(0) {} + ASN1T_Ext_GeographicalInformation (OSUINT32 _numocts, const OSOCTET* _data) : + numocts (_numocts) { + OSCRTLMEMCPY (data, _data, OSRTMIN (numocts, sizeof(data))); + } + ASN1T_Ext_GeographicalInformation (const char* cstring) { + if (strlen(cstring) > 0) { + numocts = OSRTMIN ((OSCRTLSTRLEN(cstring)+1), sizeof(data)); + OSCRTLSTRNCPY ((char*)data, cstring, sizeof(data)); + } + else numocts = 0; + } + // assignment operators + ASN1T_Ext_GeographicalInformation& operator= (const char* cstring) { + if (strlen(cstring) > 0) { + numocts = OSRTMIN ((OSCRTLSTRLEN(cstring)+1), sizeof(data)); + OSCRTLSTRNCPY ((char*)data, cstring, sizeof(data)); + } + else numocts = 0; + return *this; + } +} ; + +IMPORT_C int asn1PE_Ext_GeographicalInformation (OSCTXT* pctxt, ASN1T_Ext_GeographicalInformation* pvalue); + +IMPORT_C int asn1PD_Ext_GeographicalInformation (OSCTXT* pctxt, ASN1T_Ext_GeographicalInformation* pvalue); + +IMPORT_C void asn1Print_Ext_GeographicalInformation + (const char* name, ASN1T_Ext_GeographicalInformation* pvalue); + +/**************************************************************/ +/* */ +/* BTSPosition */ +/* */ +/**************************************************************/ + +#define TV_BTSPosition (TM_UNIV|TM_PRIM|4) + +typedef ASN1T_Ext_GeographicalInformation ASN1T_BTSPosition; + +IMPORT_C int asn1PE_BTSPosition (OSCTXT* pctxt, ASN1T_BTSPosition* pvalue); + +IMPORT_C int asn1PD_BTSPosition (OSCTXT* pctxt, ASN1T_BTSPosition* pvalue); + +IMPORT_C void asn1Print_BTSPosition + (const char* name, ASN1T_BTSPosition* pvalue); + +/**************************************************************/ +/* */ +/* ReferenceAssistData */ +/* */ +/**************************************************************/ + +#define TV_ReferenceAssistData (TM_UNIV|TM_CONS|16) + +struct ASN1T_ReferenceAssistData { + struct { + unsigned btsPositionPresent : 1; + } m; + ASN1T_BCCHCarrier bcchCarrier; + ASN1T_BSIC bsic; + ASN1T_TimeSlotScheme timeSlotScheme; + ASN1T_BTSPosition btsPosition; + IMPORT_C ASN1T_ReferenceAssistData (); +} ; + +IMPORT_C int asn1PE_ReferenceAssistData (OSCTXT* pctxt, ASN1T_ReferenceAssistData* pvalue); + +IMPORT_C int asn1PD_ReferenceAssistData (OSCTXT* pctxt, ASN1T_ReferenceAssistData* pvalue); + +IMPORT_C void asn1Print_ReferenceAssistData + (const char* name, ASN1T_ReferenceAssistData* pvalue); + +/**************************************************************/ +/* */ +/* MultiFrameOffset */ +/* */ +/**************************************************************/ + +#define TV_MultiFrameOffset (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_MultiFrameOffset; + +IMPORT_C int asn1PE_MultiFrameOffset (OSCTXT* pctxt, ASN1T_MultiFrameOffset value); + +IMPORT_C int asn1PD_MultiFrameOffset (OSCTXT* pctxt, ASN1T_MultiFrameOffset* pvalue); + +IMPORT_C void asn1Print_MultiFrameOffset + (const char* name, ASN1T_MultiFrameOffset* pvalue); + +/**************************************************************/ +/* */ +/* RoughRTD */ +/* */ +/**************************************************************/ + +#define TV_RoughRTD (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_RoughRTD; + +IMPORT_C int asn1PE_RoughRTD (OSCTXT* pctxt, ASN1T_RoughRTD value); + +IMPORT_C int asn1PD_RoughRTD (OSCTXT* pctxt, ASN1T_RoughRTD* pvalue); + +IMPORT_C void asn1Print_RoughRTD + (const char* name, ASN1T_RoughRTD* pvalue); + +/**************************************************************/ +/* */ +/* FineRTD */ +/* */ +/**************************************************************/ + +#define TV_FineRTD (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_FineRTD; + +IMPORT_C int asn1PE_FineRTD (OSCTXT* pctxt, ASN1T_FineRTD value); + +IMPORT_C int asn1PD_FineRTD (OSCTXT* pctxt, ASN1T_FineRTD* pvalue); + +IMPORT_C void asn1Print_FineRTD + (const char* name, ASN1T_FineRTD* pvalue); + +/**************************************************************/ +/* */ +/* RelDistance */ +/* */ +/**************************************************************/ + +#define TV_RelDistance (TM_UNIV|TM_PRIM|2) + +typedef OSINT32 ASN1T_RelDistance; + +IMPORT_C int asn1PE_RelDistance (OSCTXT* pctxt, ASN1T_RelDistance value); + +IMPORT_C int asn1PD_RelDistance (OSCTXT* pctxt, ASN1T_RelDistance* pvalue); + +IMPORT_C void asn1Print_RelDistance + (const char* name, ASN1T_RelDistance* pvalue); + +/**************************************************************/ +/* */ +/* RelativeAlt */ +/* */ +/**************************************************************/ + +#define TV_RelativeAlt (TM_UNIV|TM_PRIM|2) + +typedef OSINT16 ASN1T_RelativeAlt; + +IMPORT_C int asn1PE_RelativeAlt (OSCTXT* pctxt, ASN1T_RelativeAlt value); + +IMPORT_C int asn1PD_RelativeAlt (OSCTXT* pctxt, ASN1T_RelativeAlt* pvalue); + +IMPORT_C void asn1Print_RelativeAlt + (const char* name, ASN1T_RelativeAlt* pvalue); + +/**************************************************************/ +/* */ +/* ReferenceWGS84 */ +/* */ +/**************************************************************/ + +#define TV_ReferenceWGS84 (TM_UNIV|TM_CONS|16) + +struct ASN1T_ReferenceWGS84 { + struct { + unsigned relativeAltPresent : 1; + } m; + ASN1T_RelDistance relativeNorth; + ASN1T_RelDistance relativeEast; + ASN1T_RelativeAlt relativeAlt; + IMPORT_C ASN1T_ReferenceWGS84 (); +} ; + +IMPORT_C int asn1PE_ReferenceWGS84 (OSCTXT* pctxt, ASN1T_ReferenceWGS84* pvalue); + +IMPORT_C int asn1PD_ReferenceWGS84 (OSCTXT* pctxt, ASN1T_ReferenceWGS84* pvalue); + +IMPORT_C void asn1Print_ReferenceWGS84 + (const char* name, ASN1T_ReferenceWGS84* pvalue); + +/**************************************************************/ +/* */ +/* CalcAssistanceBTS */ +/* */ +/**************************************************************/ + +#define TV_CalcAssistanceBTS (TM_UNIV|TM_CONS|16) + +struct ASN1T_CalcAssistanceBTS { + ASN1T_FineRTD fineRTD; + ASN1T_ReferenceWGS84 referenceWGS84; + IMPORT_C ASN1T_CalcAssistanceBTS (); +} ; + +IMPORT_C int asn1PE_CalcAssistanceBTS (OSCTXT* pctxt, ASN1T_CalcAssistanceBTS* pvalue); + +IMPORT_C int asn1PD_CalcAssistanceBTS (OSCTXT* pctxt, ASN1T_CalcAssistanceBTS* pvalue); + +IMPORT_C void asn1Print_CalcAssistanceBTS + (const char* name, ASN1T_CalcAssistanceBTS* pvalue); + +/**************************************************************/ +/* */ +/* MsrAssistBTS */ +/* */ +/**************************************************************/ + +#define TV_MsrAssistBTS (TM_UNIV|TM_CONS|16) + +struct ASN1T_MsrAssistBTS { + struct { + unsigned calcAssistanceBTSPresent : 1; + } m; + ASN1T_BCCHCarrier bcchCarrier; + ASN1T_BSIC bsic; + ASN1T_MultiFrameOffset multiFrameOffset; + ASN1T_TimeSlotScheme timeSlotScheme; + ASN1T_RoughRTD roughRTD; + ASN1T_CalcAssistanceBTS calcAssistanceBTS; + IMPORT_C ASN1T_MsrAssistBTS (); +} ; + +IMPORT_C int asn1PE_MsrAssistBTS (OSCTXT* pctxt, ASN1T_MsrAssistBTS* pvalue); + +IMPORT_C int asn1PD_MsrAssistBTS (OSCTXT* pctxt, ASN1T_MsrAssistBTS* pvalue); + +IMPORT_C void asn1Print_MsrAssistBTS + (const char* name, ASN1T_MsrAssistBTS* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfMsrAssistBTS */ +/* */ +/**************************************************************/ + +#define TV_SeqOfMsrAssistBTS (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_MsrAssistBTS */ +typedef ASN1TSeqOfList ASN1T_SeqOfMsrAssistBTS; + +class ASN1C_SeqOfMsrAssistBTS : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfMsrAssistBTS& msgData; +public: + IMPORT_C ASN1C_SeqOfMsrAssistBTS (ASN1T_SeqOfMsrAssistBTS& data); + IMPORT_C ASN1C_SeqOfMsrAssistBTS (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfMsrAssistBTS& data); + ASN1C_SeqOfMsrAssistBTS (ASN1CType& ccobj, ASN1T_SeqOfMsrAssistBTS& data); + IMPORT_C ASN1C_SeqOfMsrAssistBTS (OSRTContext &context, ASN1T_SeqOfMsrAssistBTS& data + ); + void Append (ASN1T_MsrAssistBTS* elem); + ASN1T_MsrAssistBTS* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfMsrAssistBTS (OSCTXT* pctxt, ASN1T_SeqOfMsrAssistBTS* pvalue); + +IMPORT_C int asn1PD_SeqOfMsrAssistBTS (OSCTXT* pctxt, ASN1T_SeqOfMsrAssistBTS* pvalue); + +IMPORT_C void asn1Print_SeqOfMsrAssistBTS + (const char* name, ASN1T_SeqOfMsrAssistBTS* pvalue); + +IMPORT_C void asn1Free_SeqOfMsrAssistBTS (OSCTXT *pctxt, ASN1T_SeqOfMsrAssistBTS* pvalue); + +/**************************************************************/ +/* */ +/* MsrAssistData */ +/* */ +/**************************************************************/ + +#define TV_MsrAssistData (TM_UNIV|TM_CONS|16) + +struct ASN1T_MsrAssistData { + ASN1T_SeqOfMsrAssistBTS msrAssistList; + IMPORT_C ASN1T_MsrAssistData (); +} ; + +IMPORT_C int asn1PE_MsrAssistData (OSCTXT* pctxt, ASN1T_MsrAssistData* pvalue); + +IMPORT_C int asn1PD_MsrAssistData (OSCTXT* pctxt, ASN1T_MsrAssistData* pvalue); + +IMPORT_C void asn1Print_MsrAssistData + (const char* name, ASN1T_MsrAssistData* pvalue); + +IMPORT_C void asn1Free_MsrAssistData (OSCTXT *pctxt, ASN1T_MsrAssistData* pvalue); + +/**************************************************************/ +/* */ +/* AssistBTSData */ +/* */ +/**************************************************************/ + +#define TV_AssistBTSData (TM_UNIV|TM_CONS|16) + +struct ASN1T_AssistBTSData { + struct { + unsigned calcAssistanceBTSPresent : 1; + } m; + ASN1T_BSIC bsic; + ASN1T_MultiFrameOffset multiFrameOffset; + ASN1T_TimeSlotScheme timeSlotScheme; + ASN1T_RoughRTD roughRTD; + ASN1T_CalcAssistanceBTS calcAssistanceBTS; + IMPORT_C ASN1T_AssistBTSData (); +} ; + +IMPORT_C int asn1PE_AssistBTSData (OSCTXT* pctxt, ASN1T_AssistBTSData* pvalue); + +IMPORT_C int asn1PD_AssistBTSData (OSCTXT* pctxt, ASN1T_AssistBTSData* pvalue); + +IMPORT_C void asn1Print_AssistBTSData + (const char* name, ASN1T_AssistBTSData* pvalue); + +/**************************************************************/ +/* */ +/* SystemInfoAssistBTS */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_SystemInfoAssistBTS_notPresent 1 +#define T_SystemInfoAssistBTS_present 2 + +struct ASN1T_SystemInfoAssistBTS { + int t; + union { + /* t = 1 */ + /* t = 2 */ + ASN1T_AssistBTSData *present; + } u; +} ; + +IMPORT_C int asn1PE_SystemInfoAssistBTS (OSCTXT* pctxt, ASN1T_SystemInfoAssistBTS* pvalue); + +IMPORT_C int asn1PD_SystemInfoAssistBTS (OSCTXT* pctxt, ASN1T_SystemInfoAssistBTS* pvalue); + +IMPORT_C void asn1Print_SystemInfoAssistBTS + (const char* name, ASN1T_SystemInfoAssistBTS* pvalue); + +IMPORT_C void asn1Free_SystemInfoAssistBTS (OSCTXT *pctxt, ASN1T_SystemInfoAssistBTS* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfSystemInfoAssistBTS */ +/* */ +/**************************************************************/ + +#define TV_SeqOfSystemInfoAssistBTS (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_SystemInfoAssistBTS */ +typedef ASN1TSeqOfList ASN1T_SeqOfSystemInfoAssistBTS; + +class ASN1C_SeqOfSystemInfoAssistBTS : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfSystemInfoAssistBTS& msgData; +public: + IMPORT_C ASN1C_SeqOfSystemInfoAssistBTS (ASN1T_SeqOfSystemInfoAssistBTS& data); + IMPORT_C ASN1C_SeqOfSystemInfoAssistBTS (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfSystemInfoAssistBTS& data); + ASN1C_SeqOfSystemInfoAssistBTS (ASN1CType& ccobj, ASN1T_SeqOfSystemInfoAssistBTS& data); + IMPORT_C ASN1C_SeqOfSystemInfoAssistBTS (OSRTContext &context + , ASN1T_SeqOfSystemInfoAssistBTS& data); + void Append (ASN1T_SystemInfoAssistBTS* elem); + ASN1T_SystemInfoAssistBTS* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfSystemInfoAssistBTS (OSCTXT* pctxt, ASN1T_SeqOfSystemInfoAssistBTS* pvalue); + +IMPORT_C int asn1PD_SeqOfSystemInfoAssistBTS (OSCTXT* pctxt, ASN1T_SeqOfSystemInfoAssistBTS* pvalue); + +IMPORT_C void asn1Print_SeqOfSystemInfoAssistBTS + (const char* name, ASN1T_SeqOfSystemInfoAssistBTS* pvalue); + +IMPORT_C void asn1Free_SeqOfSystemInfoAssistBTS (OSCTXT *pctxt, ASN1T_SeqOfSystemInfoAssistBTS* pvalue); + +/**************************************************************/ +/* */ +/* SystemInfoAssistData */ +/* */ +/**************************************************************/ + +#define TV_SystemInfoAssistData (TM_UNIV|TM_CONS|16) + +struct ASN1T_SystemInfoAssistData { + ASN1T_SeqOfSystemInfoAssistBTS systemInfoAssistList; + IMPORT_C ASN1T_SystemInfoAssistData (); +} ; + +IMPORT_C int asn1PE_SystemInfoAssistData (OSCTXT* pctxt, ASN1T_SystemInfoAssistData* pvalue); + +IMPORT_C int asn1PD_SystemInfoAssistData (OSCTXT* pctxt, ASN1T_SystemInfoAssistData* pvalue); + +IMPORT_C void asn1Print_SystemInfoAssistData + (const char* name, ASN1T_SystemInfoAssistData* pvalue); + +IMPORT_C void asn1Free_SystemInfoAssistData (OSCTXT *pctxt, ASN1T_SystemInfoAssistData* pvalue); + +/**************************************************************/ +/* */ +/* GPSTOW23b */ +/* */ +/**************************************************************/ + +#define TV_GPSTOW23b (TM_UNIV|TM_PRIM|2) + +typedef OSUINT32 ASN1T_GPSTOW23b; + +IMPORT_C int asn1PE_GPSTOW23b (OSCTXT* pctxt, ASN1T_GPSTOW23b value); + +IMPORT_C int asn1PD_GPSTOW23b (OSCTXT* pctxt, ASN1T_GPSTOW23b* pvalue); + +IMPORT_C void asn1Print_GPSTOW23b + (const char* name, ASN1T_GPSTOW23b* pvalue); + +/**************************************************************/ +/* */ +/* GPSWeek */ +/* */ +/**************************************************************/ + +#define TV_GPSWeek (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_GPSWeek; + +IMPORT_C int asn1PE_GPSWeek (OSCTXT* pctxt, ASN1T_GPSWeek value); + +IMPORT_C int asn1PD_GPSWeek (OSCTXT* pctxt, ASN1T_GPSWeek* pvalue); + +IMPORT_C void asn1Print_GPSWeek + (const char* name, ASN1T_GPSWeek* pvalue); + +/**************************************************************/ +/* */ +/* GPSTime */ +/* */ +/**************************************************************/ + +#define TV_GPSTime (TM_UNIV|TM_CONS|16) + +struct ASN1T_GPSTime { + ASN1T_GPSTOW23b gpsTOW23b; + ASN1T_GPSWeek gpsWeek; + IMPORT_C ASN1T_GPSTime (); +} ; + +IMPORT_C int asn1PE_GPSTime (OSCTXT* pctxt, ASN1T_GPSTime* pvalue); + +IMPORT_C int asn1PD_GPSTime (OSCTXT* pctxt, ASN1T_GPSTime* pvalue); + +IMPORT_C void asn1Print_GPSTime + (const char* name, ASN1T_GPSTime* pvalue); + +/**************************************************************/ +/* */ +/* FrameNumber */ +/* */ +/**************************************************************/ + +#define TV_FrameNumber (TM_UNIV|TM_PRIM|2) + +typedef OSUINT32 ASN1T_FrameNumber; + +IMPORT_C int asn1PE_FrameNumber (OSCTXT* pctxt, ASN1T_FrameNumber value); + +IMPORT_C int asn1PD_FrameNumber (OSCTXT* pctxt, ASN1T_FrameNumber* pvalue); + +IMPORT_C void asn1Print_FrameNumber + (const char* name, ASN1T_FrameNumber* pvalue); + +/**************************************************************/ +/* */ +/* TimeSlot */ +/* */ +/**************************************************************/ + +#define TV_TimeSlot (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_TimeSlot; + +IMPORT_C int asn1PE_TimeSlot (OSCTXT* pctxt, ASN1T_TimeSlot value); + +IMPORT_C int asn1PD_TimeSlot (OSCTXT* pctxt, ASN1T_TimeSlot* pvalue); + +IMPORT_C void asn1Print_TimeSlot + (const char* name, ASN1T_TimeSlot* pvalue); + +/**************************************************************/ +/* */ +/* BitNumber */ +/* */ +/**************************************************************/ + +#define TV_BitNumber (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_BitNumber; + +IMPORT_C int asn1PE_BitNumber (OSCTXT* pctxt, ASN1T_BitNumber value); + +IMPORT_C int asn1PD_BitNumber (OSCTXT* pctxt, ASN1T_BitNumber* pvalue); + +IMPORT_C void asn1Print_BitNumber + (const char* name, ASN1T_BitNumber* pvalue); + +/**************************************************************/ +/* */ +/* GSMTime */ +/* */ +/**************************************************************/ + +#define TV_GSMTime (TM_UNIV|TM_CONS|16) + +struct ASN1T_GSMTime { + ASN1T_BCCHCarrier bcchCarrier; + ASN1T_BSIC bsic; + ASN1T_FrameNumber frameNumber; + ASN1T_TimeSlot timeSlot; + ASN1T_BitNumber bitNumber; + IMPORT_C ASN1T_GSMTime (); +} ; + +IMPORT_C int asn1PE_GSMTime (OSCTXT* pctxt, ASN1T_GSMTime* pvalue); + +IMPORT_C int asn1PD_GSMTime (OSCTXT* pctxt, ASN1T_GSMTime* pvalue); + +IMPORT_C void asn1Print_GSMTime + (const char* name, ASN1T_GSMTime* pvalue); + +/**************************************************************/ +/* */ +/* SatelliteID */ +/* */ +/**************************************************************/ + +#define TV_SatelliteID (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_SatelliteID; + +IMPORT_C int asn1PE_SatelliteID (OSCTXT* pctxt, ASN1T_SatelliteID value); + +IMPORT_C int asn1PD_SatelliteID (OSCTXT* pctxt, ASN1T_SatelliteID* pvalue); + +IMPORT_C void asn1Print_SatelliteID + (const char* name, ASN1T_SatelliteID* pvalue); + +/**************************************************************/ +/* */ +/* TLMWord */ +/* */ +/**************************************************************/ + +#define TV_TLMWord (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_TLMWord; + +IMPORT_C int asn1PE_TLMWord (OSCTXT* pctxt, ASN1T_TLMWord value); + +IMPORT_C int asn1PD_TLMWord (OSCTXT* pctxt, ASN1T_TLMWord* pvalue); + +IMPORT_C void asn1Print_TLMWord + (const char* name, ASN1T_TLMWord* pvalue); + +/**************************************************************/ +/* */ +/* AntiSpoofFlag */ +/* */ +/**************************************************************/ + +#define TV_AntiSpoofFlag (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_AntiSpoofFlag; + +IMPORT_C int asn1PE_AntiSpoofFlag (OSCTXT* pctxt, ASN1T_AntiSpoofFlag value); + +IMPORT_C int asn1PD_AntiSpoofFlag (OSCTXT* pctxt, ASN1T_AntiSpoofFlag* pvalue); + +IMPORT_C void asn1Print_AntiSpoofFlag + (const char* name, ASN1T_AntiSpoofFlag* pvalue); + +/**************************************************************/ +/* */ +/* AlertFlag */ +/* */ +/**************************************************************/ + +#define TV_AlertFlag (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_AlertFlag; + +IMPORT_C int asn1PE_AlertFlag (OSCTXT* pctxt, ASN1T_AlertFlag value); + +IMPORT_C int asn1PD_AlertFlag (OSCTXT* pctxt, ASN1T_AlertFlag* pvalue); + +IMPORT_C void asn1Print_AlertFlag + (const char* name, ASN1T_AlertFlag* pvalue); + +/**************************************************************/ +/* */ +/* TLMReservedBits */ +/* */ +/**************************************************************/ + +#define TV_TLMReservedBits (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_TLMReservedBits; + +IMPORT_C int asn1PE_TLMReservedBits (OSCTXT* pctxt, ASN1T_TLMReservedBits value); + +IMPORT_C int asn1PD_TLMReservedBits (OSCTXT* pctxt, ASN1T_TLMReservedBits* pvalue); + +IMPORT_C void asn1Print_TLMReservedBits + (const char* name, ASN1T_TLMReservedBits* pvalue); + +/**************************************************************/ +/* */ +/* GPSTOWAssistElement */ +/* */ +/**************************************************************/ + +#define TV_GPSTOWAssistElement (TM_UNIV|TM_CONS|16) + +struct ASN1T_GPSTOWAssistElement { + ASN1T_SatelliteID satelliteID; + ASN1T_TLMWord tlmWord; + ASN1T_AntiSpoofFlag antiSpoof; + ASN1T_AlertFlag alert; + ASN1T_TLMReservedBits tlmRsvdBits; + IMPORT_C ASN1T_GPSTOWAssistElement (); +} ; + +IMPORT_C int asn1PE_GPSTOWAssistElement (OSCTXT* pctxt, ASN1T_GPSTOWAssistElement* pvalue); + +IMPORT_C int asn1PD_GPSTOWAssistElement (OSCTXT* pctxt, ASN1T_GPSTOWAssistElement* pvalue); + +IMPORT_C void asn1Print_GPSTOWAssistElement + (const char* name, ASN1T_GPSTOWAssistElement* pvalue); + +/**************************************************************/ +/* */ +/* GPSTOWAssist */ +/* */ +/**************************************************************/ + +#define TV_GPSTOWAssist (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_GPSTOWAssistElement */ +typedef ASN1TSeqOfList ASN1T_GPSTOWAssist; + +class ASN1C_GPSTOWAssist : +public ASN1CSeqOfList +{ +protected: + ASN1T_GPSTOWAssist& msgData; +public: + IMPORT_C ASN1C_GPSTOWAssist (ASN1T_GPSTOWAssist& data); + IMPORT_C ASN1C_GPSTOWAssist (OSRTMessageBufferIF& msgBuf, ASN1T_GPSTOWAssist& data); + ASN1C_GPSTOWAssist (ASN1CType& ccobj, ASN1T_GPSTOWAssist& data); + IMPORT_C ASN1C_GPSTOWAssist (OSRTContext &context, ASN1T_GPSTOWAssist& data); + void Append (ASN1T_GPSTOWAssistElement* elem); + ASN1T_GPSTOWAssistElement* NewElement (); +} ; + +IMPORT_C int asn1PE_GPSTOWAssist (OSCTXT* pctxt, ASN1T_GPSTOWAssist* pvalue); + +IMPORT_C int asn1PD_GPSTOWAssist (OSCTXT* pctxt, ASN1T_GPSTOWAssist* pvalue); + +IMPORT_C void asn1Print_GPSTOWAssist + (const char* name, ASN1T_GPSTOWAssist* pvalue); + +IMPORT_C void asn1Free_GPSTOWAssist (OSCTXT *pctxt, ASN1T_GPSTOWAssist* pvalue); + +/**************************************************************/ +/* */ +/* ReferenceTime */ +/* */ +/**************************************************************/ + +#define TV_ReferenceTime (TM_UNIV|TM_CONS|16) + +struct ASN1T_ReferenceTime { + struct { + unsigned gsmTimePresent : 1; + unsigned gpsTowAssistPresent : 1; + } m; + ASN1T_GPSTime gpsTime; + ASN1T_GSMTime gsmTime; + ASN1T_GPSTOWAssist gpsTowAssist; + IMPORT_C ASN1T_ReferenceTime (); +} ; + +IMPORT_C int asn1PE_ReferenceTime (OSCTXT* pctxt, ASN1T_ReferenceTime* pvalue); + +IMPORT_C int asn1PD_ReferenceTime (OSCTXT* pctxt, ASN1T_ReferenceTime* pvalue); + +IMPORT_C void asn1Print_ReferenceTime + (const char* name, ASN1T_ReferenceTime* pvalue); + +IMPORT_C void asn1Free_ReferenceTime (OSCTXT *pctxt, ASN1T_ReferenceTime* pvalue); + +/**************************************************************/ +/* */ +/* RefLocation */ +/* */ +/**************************************************************/ + +#define TV_RefLocation (TM_UNIV|TM_CONS|16) + +struct ASN1T_RefLocation { + ASN1T_Ext_GeographicalInformation threeDLocation; + IMPORT_C ASN1T_RefLocation (); +} ; + +IMPORT_C int asn1PE_RefLocation (OSCTXT* pctxt, ASN1T_RefLocation* pvalue); + +IMPORT_C int asn1PD_RefLocation (OSCTXT* pctxt, ASN1T_RefLocation* pvalue); + +IMPORT_C void asn1Print_RefLocation + (const char* name, ASN1T_RefLocation* pvalue); + +/**************************************************************/ +/* */ +/* SatElement */ +/* */ +/**************************************************************/ + +#define TV_SatElement (TM_UNIV|TM_CONS|16) + +struct ASN1T_SatElement { + ASN1T_SatelliteID satelliteID; + OSUINT8 iode; + OSUINT8 udre; + OSINT16 pseudoRangeCor; + OSINT8 rangeRateCor; + OSINT8 deltaPseudoRangeCor2; + OSINT8 deltaRangeRateCor2; + OSINT8 deltaPseudoRangeCor3; + OSINT8 deltaRangeRateCor3; + IMPORT_C ASN1T_SatElement (); +} ; + +IMPORT_C int asn1PE_SatElement (OSCTXT* pctxt, ASN1T_SatElement* pvalue); + +IMPORT_C int asn1PD_SatElement (OSCTXT* pctxt, ASN1T_SatElement* pvalue); + +IMPORT_C void asn1Print_SatElement + (const char* name, ASN1T_SatElement* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfSatElement */ +/* */ +/**************************************************************/ + +#define TV_SeqOfSatElement (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_SatElement */ +typedef ASN1TSeqOfList ASN1T_SeqOfSatElement; + +class ASN1C_SeqOfSatElement : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfSatElement& msgData; +public: + IMPORT_C ASN1C_SeqOfSatElement (ASN1T_SeqOfSatElement& data); + IMPORT_C ASN1C_SeqOfSatElement (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfSatElement& data); + ASN1C_SeqOfSatElement (ASN1CType& ccobj, ASN1T_SeqOfSatElement& data); + IMPORT_C ASN1C_SeqOfSatElement (OSRTContext &context, ASN1T_SeqOfSatElement& data); + void Append (ASN1T_SatElement* elem); + ASN1T_SatElement* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfSatElement (OSCTXT* pctxt, ASN1T_SeqOfSatElement* pvalue); + +IMPORT_C int asn1PD_SeqOfSatElement (OSCTXT* pctxt, ASN1T_SeqOfSatElement* pvalue); + +IMPORT_C void asn1Print_SeqOfSatElement + (const char* name, ASN1T_SeqOfSatElement* pvalue); + +IMPORT_C void asn1Free_SeqOfSatElement (OSCTXT *pctxt, ASN1T_SeqOfSatElement* pvalue); + +/**************************************************************/ +/* */ +/* DGPSCorrections */ +/* */ +/**************************************************************/ + +#define TV_DGPSCorrections (TM_UNIV|TM_CONS|16) + +struct ASN1T_DGPSCorrections { + OSUINT32 gpsTOW; + OSUINT8 status; + ASN1T_SeqOfSatElement satList; + IMPORT_C ASN1T_DGPSCorrections (); +} ; + +IMPORT_C int asn1PE_DGPSCorrections (OSCTXT* pctxt, ASN1T_DGPSCorrections* pvalue); + +IMPORT_C int asn1PD_DGPSCorrections (OSCTXT* pctxt, ASN1T_DGPSCorrections* pvalue); + +IMPORT_C void asn1Print_DGPSCorrections + (const char* name, ASN1T_DGPSCorrections* pvalue); + +IMPORT_C void asn1Free_DGPSCorrections (OSCTXT *pctxt, ASN1T_DGPSCorrections* pvalue); + +/**************************************************************/ +/* */ +/* EphemerisSubframe1Reserved */ +/* */ +/**************************************************************/ + +#define TV_EphemerisSubframe1Reserved (TM_UNIV|TM_CONS|16) + +struct ASN1T_EphemerisSubframe1Reserved { + OSUINT32 reserved1; + OSUINT32 reserved2; + OSUINT32 reserved3; + OSUINT16 reserved4; + IMPORT_C ASN1T_EphemerisSubframe1Reserved (); +} ; + +IMPORT_C int asn1PE_EphemerisSubframe1Reserved (OSCTXT* pctxt, ASN1T_EphemerisSubframe1Reserved* pvalue); + +IMPORT_C int asn1PD_EphemerisSubframe1Reserved (OSCTXT* pctxt, ASN1T_EphemerisSubframe1Reserved* pvalue); + +IMPORT_C void asn1Print_EphemerisSubframe1Reserved + (const char* name, ASN1T_EphemerisSubframe1Reserved* pvalue); + +/**************************************************************/ +/* */ +/* UncompressedEphemeris */ +/* */ +/**************************************************************/ + +#define TV_UncompressedEphemeris (TM_UNIV|TM_CONS|16) + +struct ASN1T_UncompressedEphemeris { + OSUINT8 ephemCodeOnL2; + OSUINT8 ephemURA; + OSUINT8 ephemSVhealth; + OSUINT16 ephemIODC; + OSUINT8 ephemL2Pflag; + ASN1T_EphemerisSubframe1Reserved ephemSF1Rsvd; + OSINT8 ephemTgd; + OSUINT16 ephemToc; + OSINT8 ephemAF2; + OSINT16 ephemAF1; + OSINT32 ephemAF0; + OSINT16 ephemCrs; + OSINT16 ephemDeltaN; + OSINT32 ephemM0; + OSINT16 ephemCuc; + OSUINT32 ephemE; + OSINT16 ephemCus; + OSUINT32 ephemAPowerHalf; + OSUINT16 ephemToe; + OSUINT8 ephemFitFlag; + OSUINT8 ephemAODA; + OSINT16 ephemCic; + OSINT32 ephemOmegaA0; + OSINT16 ephemCis; + OSINT32 ephemI0; + OSINT16 ephemCrc; + OSINT32 ephemW; + OSINT32 ephemOmegaADot; + OSINT16 ephemIDot; + IMPORT_C ASN1T_UncompressedEphemeris (); +} ; + +IMPORT_C int asn1PE_UncompressedEphemeris (OSCTXT* pctxt, ASN1T_UncompressedEphemeris* pvalue); + +IMPORT_C int asn1PD_UncompressedEphemeris (OSCTXT* pctxt, ASN1T_UncompressedEphemeris* pvalue); + +IMPORT_C void asn1Print_UncompressedEphemeris + (const char* name, ASN1T_UncompressedEphemeris* pvalue); + +/**************************************************************/ +/* */ +/* SatStatus */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_SatStatus_newSatelliteAndModelUC 1 +#define T_SatStatus_oldSatelliteAndModel 2 +#define T_SatStatus_newNaviModelUC 3 +#define T_SatStatus_extElem1 4 + +struct ASN1T_SatStatus { + int t; + union { + /* t = 1 */ + ASN1T_UncompressedEphemeris *newSatelliteAndModelUC; + /* t = 2 */ + /* t = 3 */ + ASN1T_UncompressedEphemeris *newNaviModelUC; + /* t = 4 */ + } u; +} ; + +IMPORT_C int asn1PE_SatStatus (OSCTXT* pctxt, ASN1T_SatStatus* pvalue); + +IMPORT_C int asn1PD_SatStatus (OSCTXT* pctxt, ASN1T_SatStatus* pvalue); + +IMPORT_C void asn1Print_SatStatus + (const char* name, ASN1T_SatStatus* pvalue); + +IMPORT_C void asn1Free_SatStatus (OSCTXT *pctxt, ASN1T_SatStatus* pvalue); + +/**************************************************************/ +/* */ +/* NavModelElement */ +/* */ +/**************************************************************/ + +#define TV_NavModelElement (TM_UNIV|TM_CONS|16) + +struct ASN1T_NavModelElement { + ASN1T_SatelliteID satelliteID; + ASN1T_SatStatus satStatus; + IMPORT_C ASN1T_NavModelElement (); +} ; + +IMPORT_C int asn1PE_NavModelElement (OSCTXT* pctxt, ASN1T_NavModelElement* pvalue); + +IMPORT_C int asn1PD_NavModelElement (OSCTXT* pctxt, ASN1T_NavModelElement* pvalue); + +IMPORT_C void asn1Print_NavModelElement + (const char* name, ASN1T_NavModelElement* pvalue); + +IMPORT_C void asn1Free_NavModelElement (OSCTXT *pctxt, ASN1T_NavModelElement* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfNavModelElement */ +/* */ +/**************************************************************/ + +#define TV_SeqOfNavModelElement (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_NavModelElement */ +typedef ASN1TSeqOfList ASN1T_SeqOfNavModelElement; + +class ASN1C_SeqOfNavModelElement : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfNavModelElement& msgData; +public: + IMPORT_C ASN1C_SeqOfNavModelElement (ASN1T_SeqOfNavModelElement& data); + IMPORT_C ASN1C_SeqOfNavModelElement (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfNavModelElement& data); + ASN1C_SeqOfNavModelElement (ASN1CType& ccobj, ASN1T_SeqOfNavModelElement& data); + IMPORT_C ASN1C_SeqOfNavModelElement (OSRTContext &context + , ASN1T_SeqOfNavModelElement& data); + void Append (ASN1T_NavModelElement* elem); + ASN1T_NavModelElement* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfNavModelElement (OSCTXT* pctxt, ASN1T_SeqOfNavModelElement* pvalue); + +IMPORT_C int asn1PD_SeqOfNavModelElement (OSCTXT* pctxt, ASN1T_SeqOfNavModelElement* pvalue); + +IMPORT_C void asn1Print_SeqOfNavModelElement + (const char* name, ASN1T_SeqOfNavModelElement* pvalue); + +IMPORT_C void asn1Free_SeqOfNavModelElement (OSCTXT *pctxt, ASN1T_SeqOfNavModelElement* pvalue); + +/**************************************************************/ +/* */ +/* NavigationModelRrlp */ +/* */ +/**************************************************************/ + +#define TV_NavigationModelRrlp (TM_UNIV|TM_CONS|16) + +struct ASN1T_NavigationModelRrlp { + ASN1T_SeqOfNavModelElement navModelList; + IMPORT_C ASN1T_NavigationModelRrlp (); +} ; + +IMPORT_C int asn1PE_NavigationModelRrlp (OSCTXT* pctxt, ASN1T_NavigationModelRrlp* pvalue); + +IMPORT_C int asn1PD_NavigationModelRrlp (OSCTXT* pctxt, ASN1T_NavigationModelRrlp* pvalue); + +IMPORT_C void asn1Print_NavigationModelRrlp + (const char* name, ASN1T_NavigationModelRrlp* pvalue); + +IMPORT_C void asn1Free_NavigationModelRrlp (OSCTXT *pctxt, ASN1T_NavigationModelRrlp* pvalue); + +/**************************************************************/ +/* */ +/* IonosphericModel */ +/* */ +/**************************************************************/ + +#define TV_IonosphericModel (TM_UNIV|TM_CONS|16) + +struct ASN1T_IonosphericModel { + OSINT8 alfa0; + OSINT8 alfa1; + OSINT8 alfa2; + OSINT8 alfa3; + OSINT8 beta0; + OSINT8 beta1; + OSINT8 beta2; + OSINT8 beta3; + IMPORT_C ASN1T_IonosphericModel (); +} ; + +IMPORT_C int asn1PE_IonosphericModel (OSCTXT* pctxt, ASN1T_IonosphericModel* pvalue); + +IMPORT_C int asn1PD_IonosphericModel (OSCTXT* pctxt, ASN1T_IonosphericModel* pvalue); + +IMPORT_C void asn1Print_IonosphericModel + (const char* name, ASN1T_IonosphericModel* pvalue); + +/**************************************************************/ +/* */ +/* UTCModel */ +/* */ +/**************************************************************/ + +#define TV_UTCModel (TM_UNIV|TM_CONS|16) + +struct ASN1T_UTCModel { + OSINT32 utcA1; + OSINT32 utcA0; + OSUINT8 utcTot; + OSUINT8 utcWNt; + OSINT8 utcDeltaTls; + OSUINT8 utcWNlsf; + OSINT8 utcDN; + OSINT8 utcDeltaTlsf; + IMPORT_C ASN1T_UTCModel (); +} ; + +IMPORT_C int asn1PE_UTCModel (OSCTXT* pctxt, ASN1T_UTCModel* pvalue); + +IMPORT_C int asn1PD_UTCModel (OSCTXT* pctxt, ASN1T_UTCModel* pvalue); + +IMPORT_C void asn1Print_UTCModel + (const char* name, ASN1T_UTCModel* pvalue); + +/**************************************************************/ +/* */ +/* AlmanacElement */ +/* */ +/**************************************************************/ + +#define TV_AlmanacElement (TM_UNIV|TM_CONS|16) + +struct ASN1T_AlmanacElement { + ASN1T_SatelliteID satelliteID; + OSUINT16 almanacE; + OSUINT8 alamanacToa; + OSINT16 almanacKsii; + OSINT16 almanacOmegaDot; + OSUINT8 almanacSVhealth; + OSUINT32 almanacAPowerHalf; + OSINT32 almanacOmega0; + OSINT32 almanacW; + OSINT32 almanacM0; + OSINT16 almanacAF0; + OSINT16 almanacAF1; + IMPORT_C ASN1T_AlmanacElement (); +} ; + +IMPORT_C int asn1PE_AlmanacElement (OSCTXT* pctxt, ASN1T_AlmanacElement* pvalue); + +IMPORT_C int asn1PD_AlmanacElement (OSCTXT* pctxt, ASN1T_AlmanacElement* pvalue); + +IMPORT_C void asn1Print_AlmanacElement + (const char* name, ASN1T_AlmanacElement* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfAlmanacElement */ +/* */ +/**************************************************************/ + +#define TV_SeqOfAlmanacElement (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_AlmanacElement */ +typedef ASN1TSeqOfList ASN1T_SeqOfAlmanacElement; + +class ASN1C_SeqOfAlmanacElement : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfAlmanacElement& msgData; +public: + IMPORT_C ASN1C_SeqOfAlmanacElement (ASN1T_SeqOfAlmanacElement& data); + IMPORT_C ASN1C_SeqOfAlmanacElement (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfAlmanacElement& data); + ASN1C_SeqOfAlmanacElement (ASN1CType& ccobj, ASN1T_SeqOfAlmanacElement& data); + IMPORT_C ASN1C_SeqOfAlmanacElement (OSRTContext &context + , ASN1T_SeqOfAlmanacElement& data); + void Append (ASN1T_AlmanacElement* elem); + ASN1T_AlmanacElement* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfAlmanacElement (OSCTXT* pctxt, ASN1T_SeqOfAlmanacElement* pvalue); + +IMPORT_C int asn1PD_SeqOfAlmanacElement (OSCTXT* pctxt, ASN1T_SeqOfAlmanacElement* pvalue); + +IMPORT_C void asn1Print_SeqOfAlmanacElement + (const char* name, ASN1T_SeqOfAlmanacElement* pvalue); + +IMPORT_C void asn1Free_SeqOfAlmanacElement (OSCTXT *pctxt, ASN1T_SeqOfAlmanacElement* pvalue); + +/**************************************************************/ +/* */ +/* Almanac */ +/* */ +/**************************************************************/ + +#define TV_Almanac (TM_UNIV|TM_CONS|16) + +struct ASN1T_Almanac { + OSUINT8 alamanacWNa; + ASN1T_SeqOfAlmanacElement almanacList; + IMPORT_C ASN1T_Almanac (); +} ; + +IMPORT_C int asn1PE_Almanac (OSCTXT* pctxt, ASN1T_Almanac* pvalue); + +IMPORT_C int asn1PD_Almanac (OSCTXT* pctxt, ASN1T_Almanac* pvalue); + +IMPORT_C void asn1Print_Almanac + (const char* name, ASN1T_Almanac* pvalue); + +IMPORT_C void asn1Free_Almanac (OSCTXT *pctxt, ASN1T_Almanac* pvalue); + +/**************************************************************/ +/* */ +/* TimeRelation */ +/* */ +/**************************************************************/ + +#define TV_TimeRelation (TM_UNIV|TM_CONS|16) + +struct ASN1T_TimeRelation { + struct { + unsigned gsmTimePresent : 1; + } m; + ASN1T_GPSTOW23b gpsTOW; + ASN1T_GSMTime gsmTime; + IMPORT_C ASN1T_TimeRelation (); +} ; + +IMPORT_C int asn1PE_TimeRelation (OSCTXT* pctxt, ASN1T_TimeRelation* pvalue); + +IMPORT_C int asn1PD_TimeRelation (OSCTXT* pctxt, ASN1T_TimeRelation* pvalue); + +IMPORT_C void asn1Print_TimeRelation + (const char* name, ASN1T_TimeRelation* pvalue); + +/**************************************************************/ +/* */ +/* AddionalDopplerFields */ +/* */ +/**************************************************************/ + +#define TV_AddionalDopplerFields (TM_UNIV|TM_CONS|16) + +struct ASN1T_AddionalDopplerFields { + OSUINT8 doppler1; + OSUINT8 dopplerUncertainty; + IMPORT_C ASN1T_AddionalDopplerFields (); +} ; + +IMPORT_C int asn1PE_AddionalDopplerFields (OSCTXT* pctxt, ASN1T_AddionalDopplerFields* pvalue); + +IMPORT_C int asn1PD_AddionalDopplerFields (OSCTXT* pctxt, ASN1T_AddionalDopplerFields* pvalue); + +IMPORT_C void asn1Print_AddionalDopplerFields + (const char* name, ASN1T_AddionalDopplerFields* pvalue); + +/**************************************************************/ +/* */ +/* AddionalAngleFields */ +/* */ +/**************************************************************/ + +#define TV_AddionalAngleFields (TM_UNIV|TM_CONS|16) + +struct ASN1T_AddionalAngleFields { + OSUINT8 azimuth; + OSUINT8 elevation; + IMPORT_C ASN1T_AddionalAngleFields (); +} ; + +IMPORT_C int asn1PE_AddionalAngleFields (OSCTXT* pctxt, ASN1T_AddionalAngleFields* pvalue); + +IMPORT_C int asn1PD_AddionalAngleFields (OSCTXT* pctxt, ASN1T_AddionalAngleFields* pvalue); + +IMPORT_C void asn1Print_AddionalAngleFields + (const char* name, ASN1T_AddionalAngleFields* pvalue); + +/**************************************************************/ +/* */ +/* AcquisElement */ +/* */ +/**************************************************************/ + +#define TV_AcquisElement (TM_UNIV|TM_CONS|16) + +struct ASN1T_AcquisElement { + struct { + unsigned addionalDopplerPresent : 1; + unsigned addionalAnglePresent : 1; + } m; + ASN1T_SatelliteID svid; + OSINT16 doppler0; + ASN1T_AddionalDopplerFields addionalDoppler; + OSUINT16 codePhase; + OSUINT8 intCodePhase; + OSUINT8 gpsBitNumber; + OSUINT8 codePhaseSearchWindow; + ASN1T_AddionalAngleFields addionalAngle; + IMPORT_C ASN1T_AcquisElement (); +} ; + +IMPORT_C int asn1PE_AcquisElement (OSCTXT* pctxt, ASN1T_AcquisElement* pvalue); + +IMPORT_C int asn1PD_AcquisElement (OSCTXT* pctxt, ASN1T_AcquisElement* pvalue); + +IMPORT_C void asn1Print_AcquisElement + (const char* name, ASN1T_AcquisElement* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfAcquisElement */ +/* */ +/**************************************************************/ + +#define TV_SeqOfAcquisElement (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_AcquisElement */ +typedef ASN1TSeqOfList ASN1T_SeqOfAcquisElement; + +class ASN1C_SeqOfAcquisElement : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfAcquisElement& msgData; +public: + IMPORT_C ASN1C_SeqOfAcquisElement (ASN1T_SeqOfAcquisElement& data); + IMPORT_C ASN1C_SeqOfAcquisElement (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfAcquisElement& data); + ASN1C_SeqOfAcquisElement (ASN1CType& ccobj, ASN1T_SeqOfAcquisElement& data); + IMPORT_C ASN1C_SeqOfAcquisElement (OSRTContext &context + , ASN1T_SeqOfAcquisElement& data); + void Append (ASN1T_AcquisElement* elem); + ASN1T_AcquisElement* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfAcquisElement (OSCTXT* pctxt, ASN1T_SeqOfAcquisElement* pvalue); + +IMPORT_C int asn1PD_SeqOfAcquisElement (OSCTXT* pctxt, ASN1T_SeqOfAcquisElement* pvalue); + +IMPORT_C void asn1Print_SeqOfAcquisElement + (const char* name, ASN1T_SeqOfAcquisElement* pvalue); + +IMPORT_C void asn1Free_SeqOfAcquisElement (OSCTXT *pctxt, ASN1T_SeqOfAcquisElement* pvalue); + +/**************************************************************/ +/* */ +/* AcquisAssist */ +/* */ +/**************************************************************/ + +#define TV_AcquisAssist (TM_UNIV|TM_CONS|16) + +struct ASN1T_AcquisAssist { + ASN1T_TimeRelation timeRelation; + ASN1T_SeqOfAcquisElement acquisList; + IMPORT_C ASN1T_AcquisAssist (); +} ; + +IMPORT_C int asn1PE_AcquisAssist (OSCTXT* pctxt, ASN1T_AcquisAssist* pvalue); + +IMPORT_C int asn1PD_AcquisAssist (OSCTXT* pctxt, ASN1T_AcquisAssist* pvalue); + +IMPORT_C void asn1Print_AcquisAssist + (const char* name, ASN1T_AcquisAssist* pvalue); + +IMPORT_C void asn1Free_AcquisAssist (OSCTXT *pctxt, ASN1T_AcquisAssist* pvalue); + +/**************************************************************/ +/* */ +/* SeqOf_BadSatelliteSet */ +/* */ +/**************************************************************/ + +#define TV_SeqOf_BadSatelliteSet (TM_UNIV|TM_CONS|16) + +typedef struct ASN1T_SeqOf_BadSatelliteSet { + OSUINT32 n; + ASN1T_SatelliteID elem[32]; + ASN1T_SeqOf_BadSatelliteSet () : n (0) {} +} ASN1T_SeqOf_BadSatelliteSet; + +IMPORT_C int asn1PE_SeqOf_BadSatelliteSet (OSCTXT* pctxt, ASN1T_SeqOf_BadSatelliteSet* pvalue); + +IMPORT_C int asn1PD_SeqOf_BadSatelliteSet (OSCTXT* pctxt, ASN1T_SeqOf_BadSatelliteSet* pvalue); + +IMPORT_C void asn1Print_SeqOf_BadSatelliteSet + (const char* name, ASN1T_SeqOf_BadSatelliteSet* pvalue); + +/**************************************************************/ +/* */ +/* ControlHeader */ +/* */ +/**************************************************************/ + +#define TV_ControlHeader (TM_UNIV|TM_CONS|16) + +struct ASN1T_ControlHeader { + struct { + unsigned referenceTimePresent : 1; + unsigned refLocationPresent : 1; + unsigned dgpsCorrectionsPresent : 1; + unsigned navigationModelPresent : 1; + unsigned ionosphericModelPresent : 1; + unsigned utcModelPresent : 1; + unsigned almanacPresent : 1; + unsigned acquisAssistPresent : 1; + unsigned realTimeIntegrityPresent : 1; + } m; + ASN1T_ReferenceTime referenceTime; + ASN1T_RefLocation refLocation; + ASN1T_DGPSCorrections dgpsCorrections; + ASN1T_NavigationModelRrlp navigationModel; + ASN1T_IonosphericModel ionosphericModel; + ASN1T_UTCModel utcModel; + ASN1T_Almanac almanac; + ASN1T_AcquisAssist acquisAssist; + ASN1T_SeqOf_BadSatelliteSet realTimeIntegrity; + IMPORT_C ASN1T_ControlHeader (); +} ; + +IMPORT_C int asn1PE_ControlHeader (OSCTXT* pctxt, ASN1T_ControlHeader* pvalue); + +IMPORT_C int asn1PD_ControlHeader (OSCTXT* pctxt, ASN1T_ControlHeader* pvalue); + +IMPORT_C void asn1Print_ControlHeader + (const char* name, ASN1T_ControlHeader* pvalue); + +IMPORT_C void asn1Free_ControlHeader (OSCTXT *pctxt, ASN1T_ControlHeader* pvalue); + +/**************************************************************/ +/* */ +/* GPS_AssistData */ +/* */ +/**************************************************************/ + +#define TV_GPS_AssistData (TM_UNIV|TM_CONS|16) + +struct ASN1T_GPS_AssistData { + ASN1T_ControlHeader controlHeader; + IMPORT_C ASN1T_GPS_AssistData (); +} ; + +IMPORT_C int asn1PE_GPS_AssistData (OSCTXT* pctxt, ASN1T_GPS_AssistData* pvalue); + +IMPORT_C int asn1PD_GPS_AssistData (OSCTXT* pctxt, ASN1T_GPS_AssistData* pvalue); + +IMPORT_C void asn1Print_GPS_AssistData + (const char* name, ASN1T_GPS_AssistData* pvalue); + +IMPORT_C void asn1Free_GPS_AssistData (OSCTXT *pctxt, ASN1T_GPS_AssistData* pvalue); + +/**************************************************************/ +/* */ +/* PrivateExtension */ +/* */ +/**************************************************************/ + +#define TV_PrivateExtension (TM_UNIV|TM_CONS|16) + +struct ASN1T_PrivateExtension { + struct { + unsigned extTypePresent : 1; + } m; + ASN1TObjId extId; + ASN1TOpenType extType; + IMPORT_C ASN1T_PrivateExtension (); +} ; + +IMPORT_C int asn1PE_PrivateExtension (OSCTXT* pctxt, ASN1T_PrivateExtension* pvalue); + +IMPORT_C int asn1PD_PrivateExtension (OSCTXT* pctxt, ASN1T_PrivateExtension* pvalue); + +IMPORT_C void asn1Print_PrivateExtension + (const char* name, ASN1T_PrivateExtension* pvalue); + +IMPORT_C void asn1Free_PrivateExtension (OSCTXT *pctxt, ASN1T_PrivateExtension* pvalue); + +/**************************************************************/ +/* */ +/* PrivateExtensionList */ +/* */ +/**************************************************************/ + +#define TV_PrivateExtensionList (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_PrivateExtension */ +typedef ASN1TSeqOfList ASN1T_PrivateExtensionList; + +class ASN1C_PrivateExtensionList : +public ASN1CSeqOfList +{ +protected: + ASN1T_PrivateExtensionList& msgData; +public: + IMPORT_C ASN1C_PrivateExtensionList (ASN1T_PrivateExtensionList& data); + IMPORT_C ASN1C_PrivateExtensionList (OSRTMessageBufferIF& msgBuf + , ASN1T_PrivateExtensionList& data); + ASN1C_PrivateExtensionList (ASN1CType& ccobj, ASN1T_PrivateExtensionList& data); + IMPORT_C ASN1C_PrivateExtensionList (OSRTContext &context + , ASN1T_PrivateExtensionList& data); + void Append (ASN1T_PrivateExtension* elem); + ASN1T_PrivateExtension* NewElement (); +} ; + +IMPORT_C int asn1PE_PrivateExtensionList (OSCTXT* pctxt, ASN1T_PrivateExtensionList* pvalue); + +IMPORT_C int asn1PD_PrivateExtensionList (OSCTXT* pctxt, ASN1T_PrivateExtensionList* pvalue); + +IMPORT_C void asn1Print_PrivateExtensionList + (const char* name, ASN1T_PrivateExtensionList* pvalue); + +IMPORT_C void asn1Free_PrivateExtensionList (OSCTXT *pctxt, ASN1T_PrivateExtensionList* pvalue); + +/**************************************************************/ +/* */ +/* PCS_Extensions */ +/* */ +/**************************************************************/ + +#define TV_PCS_Extensions (TM_UNIV|TM_CONS|16) + +struct ASN1T_PCS_Extensions { + OSOCTET __dummy__; + IMPORT_C ASN1T_PCS_Extensions (); +} ; + +IMPORT_C int asn1PE_PCS_Extensions (OSCTXT* pctxt, ASN1T_PCS_Extensions* pvalue); + +IMPORT_C int asn1PD_PCS_Extensions (OSCTXT* pctxt, ASN1T_PCS_Extensions* pvalue); + +IMPORT_C void asn1Print_PCS_Extensions + (const char* name, ASN1T_PCS_Extensions* pvalue); + +/**************************************************************/ +/* */ +/* ExtensionContainer */ +/* */ +/**************************************************************/ + +#define TV_ExtensionContainer (TM_UNIV|TM_CONS|16) + +struct ASN1T_ExtensionContainer { + struct { + unsigned privateExtensionListPresent : 1; + unsigned pcs_ExtensionsPresent : 1; + } m; + ASN1T_PrivateExtensionList privateExtensionList; + ASN1T_PCS_Extensions pcs_Extensions; + IMPORT_C ASN1T_ExtensionContainer (); +} ; + +IMPORT_C int asn1PE_ExtensionContainer (OSCTXT* pctxt, ASN1T_ExtensionContainer* pvalue); + +IMPORT_C int asn1PD_ExtensionContainer (OSCTXT* pctxt, ASN1T_ExtensionContainer* pvalue); + +IMPORT_C void asn1Print_ExtensionContainer + (const char* name, ASN1T_ExtensionContainer* pvalue); + +IMPORT_C void asn1Free_ExtensionContainer (OSCTXT *pctxt, ASN1T_ExtensionContainer* pvalue); + +/**************************************************************/ +/* */ +/* ExpectedOTD */ +/* */ +/**************************************************************/ + +#define TV_ExpectedOTD (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_ExpectedOTD; + +IMPORT_C int asn1PE_ExpectedOTD (OSCTXT* pctxt, ASN1T_ExpectedOTD value); + +IMPORT_C int asn1PD_ExpectedOTD (OSCTXT* pctxt, ASN1T_ExpectedOTD* pvalue); + +IMPORT_C void asn1Print_ExpectedOTD + (const char* name, ASN1T_ExpectedOTD* pvalue); + +/**************************************************************/ +/* */ +/* ExpOTDUncertainty */ +/* */ +/**************************************************************/ + +#define TV_ExpOTDUncertainty (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_ExpOTDUncertainty; + +IMPORT_C int asn1PE_ExpOTDUncertainty (OSCTXT* pctxt, ASN1T_ExpOTDUncertainty value); + +IMPORT_C int asn1PD_ExpOTDUncertainty (OSCTXT* pctxt, ASN1T_ExpOTDUncertainty* pvalue); + +IMPORT_C void asn1Print_ExpOTDUncertainty + (const char* name, ASN1T_ExpOTDUncertainty* pvalue); + +/**************************************************************/ +/* */ +/* MsrAssistBTS_R98_ExpOTD */ +/* */ +/**************************************************************/ + +#define TV_MsrAssistBTS_R98_ExpOTD (TM_UNIV|TM_CONS|16) + +struct ASN1T_MsrAssistBTS_R98_ExpOTD { + ASN1T_ExpectedOTD expectedOTD; + ASN1T_ExpOTDUncertainty expOTDUncertainty; + IMPORT_C ASN1T_MsrAssistBTS_R98_ExpOTD (); +} ; + +IMPORT_C int asn1PE_MsrAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_MsrAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C int asn1PD_MsrAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_MsrAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Print_MsrAssistBTS_R98_ExpOTD + (const char* name, ASN1T_MsrAssistBTS_R98_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfMsrAssistBTS_R98_ExpOTD */ +/* */ +/**************************************************************/ + +#define TV_SeqOfMsrAssistBTS_R98_ExpOTD (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_MsrAssistBTS_R98_ExpOTD */ +typedef ASN1TSeqOfList ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD; + +class ASN1C_SeqOfMsrAssistBTS_R98_ExpOTD : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD& msgData; +public: + IMPORT_C ASN1C_SeqOfMsrAssistBTS_R98_ExpOTD + (ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD& data); + IMPORT_C ASN1C_SeqOfMsrAssistBTS_R98_ExpOTD (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD& data); + ASN1C_SeqOfMsrAssistBTS_R98_ExpOTD (ASN1CType& ccobj, ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD& data); + IMPORT_C ASN1C_SeqOfMsrAssistBTS_R98_ExpOTD (OSRTContext &context + , ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD& data); + void Append (ASN1T_MsrAssistBTS_R98_ExpOTD* elem); + ASN1T_MsrAssistBTS_R98_ExpOTD* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfMsrAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C int asn1PD_SeqOfMsrAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Print_SeqOfMsrAssistBTS_R98_ExpOTD + (const char* name, ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Free_SeqOfMsrAssistBTS_R98_ExpOTD (OSCTXT *pctxt, ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* MsrAssistData_R98_ExpOTD */ +/* */ +/**************************************************************/ + +#define TV_MsrAssistData_R98_ExpOTD (TM_UNIV|TM_CONS|16) + +struct ASN1T_MsrAssistData_R98_ExpOTD { + ASN1T_SeqOfMsrAssistBTS_R98_ExpOTD msrAssistList_R98_ExpOTD; + IMPORT_C ASN1T_MsrAssistData_R98_ExpOTD (); +} ; + +IMPORT_C int asn1PE_MsrAssistData_R98_ExpOTD (OSCTXT* pctxt, ASN1T_MsrAssistData_R98_ExpOTD* pvalue); + +IMPORT_C int asn1PD_MsrAssistData_R98_ExpOTD (OSCTXT* pctxt, ASN1T_MsrAssistData_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Print_MsrAssistData_R98_ExpOTD + (const char* name, ASN1T_MsrAssistData_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Free_MsrAssistData_R98_ExpOTD (OSCTXT *pctxt, ASN1T_MsrAssistData_R98_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* AssistBTSData_R98_ExpOTD */ +/* */ +/**************************************************************/ + +#define TV_AssistBTSData_R98_ExpOTD (TM_UNIV|TM_CONS|16) + +struct ASN1T_AssistBTSData_R98_ExpOTD { + ASN1T_ExpectedOTD expectedOTD; + ASN1T_ExpOTDUncertainty expOTDuncertainty; + IMPORT_C ASN1T_AssistBTSData_R98_ExpOTD (); +} ; + +IMPORT_C int asn1PE_AssistBTSData_R98_ExpOTD (OSCTXT* pctxt, ASN1T_AssistBTSData_R98_ExpOTD* pvalue); + +IMPORT_C int asn1PD_AssistBTSData_R98_ExpOTD (OSCTXT* pctxt, ASN1T_AssistBTSData_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Print_AssistBTSData_R98_ExpOTD + (const char* name, ASN1T_AssistBTSData_R98_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* SystemInfoAssistBTS_R98_ExpOTD */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_SystemInfoAssistBTS_R98_ExpOTD_notPresent 1 +#define T_SystemInfoAssistBTS_R98_ExpOTD_present 2 + +struct ASN1T_SystemInfoAssistBTS_R98_ExpOTD { + int t; + union { + /* t = 1 */ + /* t = 2 */ + ASN1T_AssistBTSData_R98_ExpOTD *present; + } u; +} ; + +IMPORT_C int asn1PE_SystemInfoAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SystemInfoAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C int asn1PD_SystemInfoAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SystemInfoAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Print_SystemInfoAssistBTS_R98_ExpOTD + (const char* name, ASN1T_SystemInfoAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Free_SystemInfoAssistBTS_R98_ExpOTD (OSCTXT *pctxt, ASN1T_SystemInfoAssistBTS_R98_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfSystemInfoAssistBTS_R98_ExpOTD */ +/* */ +/**************************************************************/ + +#define TV_SeqOfSystemInfoAssistBTS_R98_ExpOTD (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_SystemInfoAssistBTS_R98_ExpOTD */ +typedef ASN1TSeqOfList ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD; + +class ASN1C_SeqOfSystemInfoAssistBTS_R98_ExpOTD : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD& msgData; +public: + IMPORT_C ASN1C_SeqOfSystemInfoAssistBTS_R98_ExpOTD + (ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD& data); + IMPORT_C ASN1C_SeqOfSystemInfoAssistBTS_R98_ExpOTD (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD& data); + ASN1C_SeqOfSystemInfoAssistBTS_R98_ExpOTD (ASN1CType& ccobj, ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD& data); + IMPORT_C ASN1C_SeqOfSystemInfoAssistBTS_R98_ExpOTD (OSRTContext &context + , ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD& data); + void Append (ASN1T_SystemInfoAssistBTS_R98_ExpOTD* elem); + ASN1T_SystemInfoAssistBTS_R98_ExpOTD* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfSystemInfoAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C int asn1PD_SeqOfSystemInfoAssistBTS_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Print_SeqOfSystemInfoAssistBTS_R98_ExpOTD + (const char* name, ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Free_SeqOfSystemInfoAssistBTS_R98_ExpOTD (OSCTXT *pctxt, ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* SystemInfoAssistData_R98_ExpOTD */ +/* */ +/**************************************************************/ + +#define TV_SystemInfoAssistData_R98_ExpOTD (TM_UNIV|TM_CONS|16) + +struct ASN1T_SystemInfoAssistData_R98_ExpOTD { + ASN1T_SeqOfSystemInfoAssistBTS_R98_ExpOTD systemInfoAssistListR98_ExpOTD; + IMPORT_C ASN1T_SystemInfoAssistData_R98_ExpOTD (); +} ; + +IMPORT_C int asn1PE_SystemInfoAssistData_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SystemInfoAssistData_R98_ExpOTD* pvalue); + +IMPORT_C int asn1PD_SystemInfoAssistData_R98_ExpOTD (OSCTXT* pctxt, ASN1T_SystemInfoAssistData_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Print_SystemInfoAssistData_R98_ExpOTD + (const char* name, ASN1T_SystemInfoAssistData_R98_ExpOTD* pvalue); + +IMPORT_C void asn1Free_SystemInfoAssistData_R98_ExpOTD (OSCTXT *pctxt, ASN1T_SystemInfoAssistData_R98_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* Rel98_Ext_ExpOTD */ +/* */ +/**************************************************************/ + +#define TV_Rel98_Ext_ExpOTD (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel98_Ext_ExpOTD { + struct { + unsigned msrAssistData_R98_ExpOTDPresent : 1; + unsigned systemInfoAssistData_R98_ExpOTDPresent : 1; + } m; + ASN1T_MsrAssistData_R98_ExpOTD msrAssistData_R98_ExpOTD; + ASN1T_SystemInfoAssistData_R98_ExpOTD systemInfoAssistData_R98_ExpOTD; + IMPORT_C ASN1T_Rel98_Ext_ExpOTD (); +} ; + +IMPORT_C int asn1PE_Rel98_Ext_ExpOTD (OSCTXT* pctxt, ASN1T_Rel98_Ext_ExpOTD* pvalue); + +IMPORT_C int asn1PD_Rel98_Ext_ExpOTD (OSCTXT* pctxt, ASN1T_Rel98_Ext_ExpOTD* pvalue); + +IMPORT_C void asn1Print_Rel98_Ext_ExpOTD + (const char* name, ASN1T_Rel98_Ext_ExpOTD* pvalue); + +IMPORT_C void asn1Free_Rel98_Ext_ExpOTD (OSCTXT *pctxt, ASN1T_Rel98_Ext_ExpOTD* pvalue); + +/**************************************************************/ +/* */ +/* GPSReferenceTimeUncertainty */ +/* */ +/**************************************************************/ + +#define TV_GPSReferenceTimeUncertainty (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_GPSReferenceTimeUncertainty; + +IMPORT_C int asn1PE_GPSReferenceTimeUncertainty (OSCTXT* pctxt, ASN1T_GPSReferenceTimeUncertainty value); + +IMPORT_C int asn1PD_GPSReferenceTimeUncertainty (OSCTXT* pctxt, ASN1T_GPSReferenceTimeUncertainty* pvalue); + +IMPORT_C void asn1Print_GPSReferenceTimeUncertainty + (const char* name, ASN1T_GPSReferenceTimeUncertainty* pvalue); + +/**************************************************************/ +/* */ +/* Rel98_MsrPosition_Req_Extension */ +/* */ +/**************************************************************/ + +#define TV_Rel98_MsrPosition_Req_Extension (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel98_MsrPosition_Req_Extension { + struct { + unsigned rel98_Ext_ExpOTDPresent : 1; + unsigned gpsTimeAssistanceMeasurementRequestPresent : 1; + unsigned gpsReferenceTimeUncertaintyPresent : 1; + } m; + ASN1T_Rel98_Ext_ExpOTD rel98_Ext_ExpOTD; + ASN1T_GPSReferenceTimeUncertainty gpsReferenceTimeUncertainty; + IMPORT_C ASN1T_Rel98_MsrPosition_Req_Extension (); +} ; + +IMPORT_C int asn1PE_Rel98_MsrPosition_Req_Extension (OSCTXT* pctxt, ASN1T_Rel98_MsrPosition_Req_Extension* pvalue); + +IMPORT_C int asn1PD_Rel98_MsrPosition_Req_Extension (OSCTXT* pctxt, ASN1T_Rel98_MsrPosition_Req_Extension* pvalue); + +IMPORT_C void asn1Print_Rel98_MsrPosition_Req_Extension + (const char* name, ASN1T_Rel98_MsrPosition_Req_Extension* pvalue); + +IMPORT_C void asn1Free_Rel98_MsrPosition_Req_Extension (OSCTXT *pctxt, ASN1T_Rel98_MsrPosition_Req_Extension* pvalue); + +/**************************************************************/ +/* */ +/* Extended_reference */ +/* */ +/**************************************************************/ + +#define TV_Extended_reference (TM_UNIV|TM_CONS|16) + +struct ASN1T_Extended_reference { + OSUINT8 smlc_code; + OSUINT32 transaction_ID; + IMPORT_C ASN1T_Extended_reference (); +} ; + +IMPORT_C int asn1PE_Extended_reference (OSCTXT* pctxt, ASN1T_Extended_reference* pvalue); + +IMPORT_C int asn1PD_Extended_reference (OSCTXT* pctxt, ASN1T_Extended_reference* pvalue); + +IMPORT_C void asn1Print_Extended_reference + (const char* name, ASN1T_Extended_reference* pvalue); + +/**************************************************************/ +/* */ +/* Rel5_MsrPosition_Req_Extension */ +/* */ +/**************************************************************/ + +#define TV_Rel5_MsrPosition_Req_Extension (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel5_MsrPosition_Req_Extension { + ASN1T_Extended_reference extended_reference; + IMPORT_C ASN1T_Rel5_MsrPosition_Req_Extension (); +} ; + +IMPORT_C int asn1PE_Rel5_MsrPosition_Req_Extension (OSCTXT* pctxt, ASN1T_Rel5_MsrPosition_Req_Extension* pvalue); + +IMPORT_C int asn1PD_Rel5_MsrPosition_Req_Extension (OSCTXT* pctxt, ASN1T_Rel5_MsrPosition_Req_Extension* pvalue); + +IMPORT_C void asn1Print_Rel5_MsrPosition_Req_Extension + (const char* name, ASN1T_Rel5_MsrPosition_Req_Extension* pvalue); + +/**************************************************************/ +/* */ +/* MsrPosition_Req */ +/* */ +/**************************************************************/ + +#define TV_MsrPosition_Req (TM_UNIV|TM_CONS|16) + +struct ASN1T_MsrPosition_Req { + struct { + unsigned referenceAssistDataPresent : 1; + unsigned msrAssistDataPresent : 1; + unsigned systemInfoAssistDataPresent : 1; + unsigned gps_AssistDataPresent : 1; + unsigned extensionContainerPresent : 1; + unsigned rel98_MsrPosition_Req_extensionPresent : 1; + unsigned rel5_MsrPosition_Req_extensionPresent : 1; + } m; + ASN1T_PositionInstruct positionInstruct; + ASN1T_ReferenceAssistData referenceAssistData; + ASN1T_MsrAssistData msrAssistData; + ASN1T_SystemInfoAssistData systemInfoAssistData; + ASN1T_GPS_AssistData gps_AssistData; + ASN1T_ExtensionContainer extensionContainer; + ASN1T_Rel98_MsrPosition_Req_Extension rel98_MsrPosition_Req_extension; + ASN1T_Rel5_MsrPosition_Req_Extension rel5_MsrPosition_Req_extension; + IMPORT_C ASN1T_MsrPosition_Req (); +} ; + +IMPORT_C int asn1PE_MsrPosition_Req (OSCTXT* pctxt, ASN1T_MsrPosition_Req* pvalue); + +IMPORT_C int asn1PD_MsrPosition_Req (OSCTXT* pctxt, ASN1T_MsrPosition_Req* pvalue); + +IMPORT_C void asn1Print_MsrPosition_Req + (const char* name, ASN1T_MsrPosition_Req* pvalue); + +IMPORT_C void asn1Free_MsrPosition_Req (OSCTXT *pctxt, ASN1T_MsrPosition_Req* pvalue); + +/**************************************************************/ +/* */ +/* ReferenceRelation */ +/* */ +/**************************************************************/ + +#define TV_ReferenceRelation (TM_UNIV|TM_PRIM|10) + +struct ReferenceRelation { + enum Root { + secondBTSThirdSet = 0, + secondBTSSecondSet = 1, + firstBTSFirstSet = 2 + } ; +} ; + +typedef OSUINT32 ASN1T_ReferenceRelation; + +IMPORT_C int asn1PE_ReferenceRelation (OSCTXT* pctxt, ASN1T_ReferenceRelation value); + +IMPORT_C int asn1PD_ReferenceRelation (OSCTXT* pctxt, ASN1T_ReferenceRelation* pvalue); + +IMPORT_C void asn1Print_ReferenceRelation + (const char* name, ASN1T_ReferenceRelation* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_ReferenceRelation_ToString (OSINT32 value); + +IMPORT_C int ASN1T_ReferenceRelation_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_ReferenceRelation* pvalue); + +/**************************************************************/ +/* */ +/* MultipleSets */ +/* */ +/**************************************************************/ + +#define TV_MultipleSets (TM_UNIV|TM_CONS|16) + +struct ASN1T_MultipleSets { + struct { + unsigned referenceRelationPresent : 1; + } m; + OSUINT8 nbrOfSets; + OSUINT8 nbrOfReferenceBTSs; + ASN1T_ReferenceRelation referenceRelation; + IMPORT_C ASN1T_MultipleSets (); +} ; + +IMPORT_C int asn1PE_MultipleSets (OSCTXT* pctxt, ASN1T_MultipleSets* pvalue); + +IMPORT_C int asn1PD_MultipleSets (OSCTXT* pctxt, ASN1T_MultipleSets* pvalue); + +IMPORT_C void asn1Print_MultipleSets + (const char* name, ASN1T_MultipleSets* pvalue); + +/**************************************************************/ +/* */ +/* BSICAndCarrier */ +/* */ +/**************************************************************/ + +#define TV_BSICAndCarrier (TM_UNIV|TM_CONS|16) + +struct ASN1T_BSICAndCarrier { + ASN1T_BCCHCarrier carrier; + ASN1T_BSIC bsic; + IMPORT_C ASN1T_BSICAndCarrier (); +} ; + +IMPORT_C int asn1PE_BSICAndCarrier (OSCTXT* pctxt, ASN1T_BSICAndCarrier* pvalue); + +IMPORT_C int asn1PD_BSICAndCarrier (OSCTXT* pctxt, ASN1T_BSICAndCarrier* pvalue); + +IMPORT_C void asn1Print_BSICAndCarrier + (const char* name, ASN1T_BSICAndCarrier* pvalue); + +/**************************************************************/ +/* */ +/* CellID */ +/* */ +/**************************************************************/ + +#define TV_CellID (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_CellID; + +IMPORT_C int asn1PE_CellID (OSCTXT* pctxt, ASN1T_CellID value); + +IMPORT_C int asn1PD_CellID (OSCTXT* pctxt, ASN1T_CellID* pvalue); + +IMPORT_C void asn1Print_CellID + (const char* name, ASN1T_CellID* pvalue); + +/**************************************************************/ +/* */ +/* RequestIndex */ +/* */ +/**************************************************************/ + +#define TV_RequestIndex (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_RequestIndex; + +IMPORT_C int asn1PE_RequestIndex (OSCTXT* pctxt, ASN1T_RequestIndex value); + +IMPORT_C int asn1PD_RequestIndex (OSCTXT* pctxt, ASN1T_RequestIndex* pvalue); + +IMPORT_C void asn1Print_RequestIndex + (const char* name, ASN1T_RequestIndex* pvalue); + +/**************************************************************/ +/* */ +/* SystemInfoIndex */ +/* */ +/**************************************************************/ + +#define TV_SystemInfoIndex (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_SystemInfoIndex; + +IMPORT_C int asn1PE_SystemInfoIndex (OSCTXT* pctxt, ASN1T_SystemInfoIndex value); + +IMPORT_C int asn1PD_SystemInfoIndex (OSCTXT* pctxt, ASN1T_SystemInfoIndex* pvalue); + +IMPORT_C void asn1Print_SystemInfoIndex + (const char* name, ASN1T_SystemInfoIndex* pvalue); + +/**************************************************************/ +/* */ +/* LAC */ +/* */ +/**************************************************************/ + +#define TV_LAC (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_LAC; + +IMPORT_C int asn1PE_LAC (OSCTXT* pctxt, ASN1T_LAC value); + +IMPORT_C int asn1PD_LAC (OSCTXT* pctxt, ASN1T_LAC* pvalue); + +IMPORT_C void asn1Print_LAC + (const char* name, ASN1T_LAC* pvalue); + +/**************************************************************/ +/* */ +/* CellIDAndLAC */ +/* */ +/**************************************************************/ + +#define TV_CellIDAndLAC (TM_UNIV|TM_CONS|16) + +struct ASN1T_CellIDAndLAC { + ASN1T_LAC referenceLAC; + ASN1T_CellID referenceCI; + IMPORT_C ASN1T_CellIDAndLAC (); +} ; + +IMPORT_C int asn1PE_CellIDAndLAC (OSCTXT* pctxt, ASN1T_CellIDAndLAC* pvalue); + +IMPORT_C int asn1PD_CellIDAndLAC (OSCTXT* pctxt, ASN1T_CellIDAndLAC* pvalue); + +IMPORT_C void asn1Print_CellIDAndLAC + (const char* name, ASN1T_CellIDAndLAC* pvalue); + +/**************************************************************/ +/* */ +/* ReferenceIdentityType */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_ReferenceIdentityType_bsicAndCarrier 1 +#define T_ReferenceIdentityType_ci 2 +#define T_ReferenceIdentityType_requestIndex 3 +#define T_ReferenceIdentityType_systemInfoIndex 4 +#define T_ReferenceIdentityType_ciAndLAC 5 + +struct ASN1T_ReferenceIdentityType { + int t; + union { + /* t = 1 */ + ASN1T_BSICAndCarrier *bsicAndCarrier; + /* t = 2 */ + ASN1T_CellID ci; + /* t = 3 */ + ASN1T_RequestIndex requestIndex; + /* t = 4 */ + ASN1T_SystemInfoIndex systemInfoIndex; + /* t = 5 */ + ASN1T_CellIDAndLAC *ciAndLAC; + } u; +} ; + +IMPORT_C int asn1PE_ReferenceIdentityType (OSCTXT* pctxt, ASN1T_ReferenceIdentityType* pvalue); + +IMPORT_C int asn1PD_ReferenceIdentityType (OSCTXT* pctxt, ASN1T_ReferenceIdentityType* pvalue); + +IMPORT_C void asn1Print_ReferenceIdentityType + (const char* name, ASN1T_ReferenceIdentityType* pvalue); + +IMPORT_C void asn1Free_ReferenceIdentityType (OSCTXT *pctxt, ASN1T_ReferenceIdentityType* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfReferenceIdentityType */ +/* */ +/**************************************************************/ + +#define TV_SeqOfReferenceIdentityType (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_ReferenceIdentityType */ +typedef ASN1TSeqOfList ASN1T_SeqOfReferenceIdentityType; + +class ASN1C_SeqOfReferenceIdentityType : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfReferenceIdentityType& msgData; +public: + IMPORT_C ASN1C_SeqOfReferenceIdentityType (ASN1T_SeqOfReferenceIdentityType& data); + IMPORT_C ASN1C_SeqOfReferenceIdentityType (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfReferenceIdentityType& data); + ASN1C_SeqOfReferenceIdentityType (ASN1CType& ccobj, ASN1T_SeqOfReferenceIdentityType& data); + IMPORT_C ASN1C_SeqOfReferenceIdentityType (OSRTContext &context + , ASN1T_SeqOfReferenceIdentityType& data); + void Append (ASN1T_ReferenceIdentityType* elem); + ASN1T_ReferenceIdentityType* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfReferenceIdentityType (OSCTXT* pctxt, ASN1T_SeqOfReferenceIdentityType* pvalue); + +IMPORT_C int asn1PD_SeqOfReferenceIdentityType (OSCTXT* pctxt, ASN1T_SeqOfReferenceIdentityType* pvalue); + +IMPORT_C void asn1Print_SeqOfReferenceIdentityType + (const char* name, ASN1T_SeqOfReferenceIdentityType* pvalue); + +IMPORT_C void asn1Free_SeqOfReferenceIdentityType (OSCTXT *pctxt, ASN1T_SeqOfReferenceIdentityType* pvalue); + +/**************************************************************/ +/* */ +/* ReferenceIdentity */ +/* */ +/**************************************************************/ + +#define TV_ReferenceIdentity (TM_UNIV|TM_CONS|16) + +struct ASN1T_ReferenceIdentity { + ASN1T_SeqOfReferenceIdentityType refBTSList; + IMPORT_C ASN1T_ReferenceIdentity (); +} ; + +IMPORT_C int asn1PE_ReferenceIdentity (OSCTXT* pctxt, ASN1T_ReferenceIdentity* pvalue); + +IMPORT_C int asn1PD_ReferenceIdentity (OSCTXT* pctxt, ASN1T_ReferenceIdentity* pvalue); + +IMPORT_C void asn1Print_ReferenceIdentity + (const char* name, ASN1T_ReferenceIdentity* pvalue); + +IMPORT_C void asn1Free_ReferenceIdentity (OSCTXT *pctxt, ASN1T_ReferenceIdentity* pvalue); + +/**************************************************************/ +/* */ +/* ModuloTimeSlot */ +/* */ +/**************************************************************/ + +#define TV_ModuloTimeSlot (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_ModuloTimeSlot; + +IMPORT_C int asn1PE_ModuloTimeSlot (OSCTXT* pctxt, ASN1T_ModuloTimeSlot value); + +IMPORT_C int asn1PD_ModuloTimeSlot (OSCTXT* pctxt, ASN1T_ModuloTimeSlot* pvalue); + +IMPORT_C void asn1Print_ModuloTimeSlot + (const char* name, ASN1T_ModuloTimeSlot* pvalue); + +/**************************************************************/ +/* */ +/* RefQuality */ +/* */ +/**************************************************************/ + +#define TV_RefQuality (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_RefQuality; + +IMPORT_C int asn1PE_RefQuality (OSCTXT* pctxt, ASN1T_RefQuality value); + +IMPORT_C int asn1PD_RefQuality (OSCTXT* pctxt, ASN1T_RefQuality* pvalue); + +IMPORT_C void asn1Print_RefQuality + (const char* name, ASN1T_RefQuality* pvalue); + +/**************************************************************/ +/* */ +/* NumOfMeasurements */ +/* */ +/**************************************************************/ + +#define TV_NumOfMeasurements (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_NumOfMeasurements; + +IMPORT_C int asn1PE_NumOfMeasurements (OSCTXT* pctxt, ASN1T_NumOfMeasurements value); + +IMPORT_C int asn1PD_NumOfMeasurements (OSCTXT* pctxt, ASN1T_NumOfMeasurements* pvalue); + +IMPORT_C void asn1Print_NumOfMeasurements + (const char* name, ASN1T_NumOfMeasurements* pvalue); + +/**************************************************************/ +/* */ +/* TOA_MeasurementsOfRef */ +/* */ +/**************************************************************/ + +#define TV_TOA_MeasurementsOfRef (TM_UNIV|TM_CONS|16) + +struct ASN1T_TOA_MeasurementsOfRef { + ASN1T_RefQuality refQuality; + ASN1T_NumOfMeasurements numOfMeasurements; + IMPORT_C ASN1T_TOA_MeasurementsOfRef (); +} ; + +IMPORT_C int asn1PE_TOA_MeasurementsOfRef (OSCTXT* pctxt, ASN1T_TOA_MeasurementsOfRef* pvalue); + +IMPORT_C int asn1PD_TOA_MeasurementsOfRef (OSCTXT* pctxt, ASN1T_TOA_MeasurementsOfRef* pvalue); + +IMPORT_C void asn1Print_TOA_MeasurementsOfRef + (const char* name, ASN1T_TOA_MeasurementsOfRef* pvalue); + +/**************************************************************/ +/* */ +/* StdResolution */ +/* */ +/**************************************************************/ + +#define TV_StdResolution (TM_UNIV|TM_PRIM|2) + +typedef OSUINT8 ASN1T_StdResolution; + +IMPORT_C int asn1PE_StdResolution (OSCTXT* pctxt, ASN1T_StdResolution value); + +IMPORT_C int asn1PD_StdResolution (OSCTXT* pctxt, ASN1T_StdResolution* pvalue); + +IMPORT_C void asn1Print_StdResolution + (const char* name, ASN1T_StdResolution* pvalue); + +/**************************************************************/ +/* */ +/* MultiFrameCarrier */ +/* */ +/**************************************************************/ + +#define TV_MultiFrameCarrier (TM_UNIV|TM_CONS|16) + +struct ASN1T_MultiFrameCarrier { + ASN1T_BCCHCarrier bcchCarrier; + ASN1T_MultiFrameOffset multiFrameOffset; + IMPORT_C ASN1T_MultiFrameCarrier (); +} ; + +IMPORT_C int asn1PE_MultiFrameCarrier (OSCTXT* pctxt, ASN1T_MultiFrameCarrier* pvalue); + +IMPORT_C int asn1PD_MultiFrameCarrier (OSCTXT* pctxt, ASN1T_MultiFrameCarrier* pvalue); + +IMPORT_C void asn1Print_MultiFrameCarrier + (const char* name, ASN1T_MultiFrameCarrier* pvalue); + +/**************************************************************/ +/* */ +/* NeighborIdentity */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_NeighborIdentity_bsicAndCarrier 1 +#define T_NeighborIdentity_ci 2 +#define T_NeighborIdentity_multiFrameCarrier 3 +#define T_NeighborIdentity_requestIndex 4 +#define T_NeighborIdentity_systemInfoIndex 5 +#define T_NeighborIdentity_ciAndLAC 6 + +struct ASN1T_NeighborIdentity { + int t; + union { + /* t = 1 */ + ASN1T_BSICAndCarrier *bsicAndCarrier; + /* t = 2 */ + ASN1T_CellID ci; + /* t = 3 */ + ASN1T_MultiFrameCarrier *multiFrameCarrier; + /* t = 4 */ + ASN1T_RequestIndex requestIndex; + /* t = 5 */ + ASN1T_SystemInfoIndex systemInfoIndex; + /* t = 6 */ + ASN1T_CellIDAndLAC *ciAndLAC; + } u; +} ; + +IMPORT_C int asn1PE_NeighborIdentity (OSCTXT* pctxt, ASN1T_NeighborIdentity* pvalue); + +IMPORT_C int asn1PD_NeighborIdentity (OSCTXT* pctxt, ASN1T_NeighborIdentity* pvalue); + +IMPORT_C void asn1Print_NeighborIdentity + (const char* name, ASN1T_NeighborIdentity* pvalue); + +IMPORT_C void asn1Free_NeighborIdentity (OSCTXT *pctxt, ASN1T_NeighborIdentity* pvalue); + +/**************************************************************/ +/* */ +/* EOTDQuality */ +/* */ +/**************************************************************/ + +#define TV_EOTDQuality (TM_UNIV|TM_CONS|16) + +struct ASN1T_EOTDQuality { + OSUINT8 nbrOfMeasurements; + OSUINT8 stdOfEOTD; + IMPORT_C ASN1T_EOTDQuality (); +} ; + +IMPORT_C int asn1PE_EOTDQuality (OSCTXT* pctxt, ASN1T_EOTDQuality* pvalue); + +IMPORT_C int asn1PD_EOTDQuality (OSCTXT* pctxt, ASN1T_EOTDQuality* pvalue); + +IMPORT_C void asn1Print_EOTDQuality + (const char* name, ASN1T_EOTDQuality* pvalue); + +/**************************************************************/ +/* */ +/* OTDValue */ +/* */ +/**************************************************************/ + +#define TV_OTDValue (TM_UNIV|TM_PRIM|2) + +typedef OSUINT16 ASN1T_OTDValue; + +IMPORT_C int asn1PE_OTDValue (OSCTXT* pctxt, ASN1T_OTDValue value); + +IMPORT_C int asn1PD_OTDValue (OSCTXT* pctxt, ASN1T_OTDValue* pvalue); + +IMPORT_C void asn1Print_OTDValue + (const char* name, ASN1T_OTDValue* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MeasurementWithID */ +/* */ +/**************************************************************/ + +#define TV_OTD_MeasurementWithID (TM_UNIV|TM_CONS|16) + +struct ASN1T_OTD_MeasurementWithID { + ASN1T_NeighborIdentity neighborIdentity; + ASN1T_ModuloTimeSlot nborTimeSlot; + ASN1T_EOTDQuality eotdQuality; + ASN1T_OTDValue otdValue; + IMPORT_C ASN1T_OTD_MeasurementWithID (); +} ; + +IMPORT_C int asn1PE_OTD_MeasurementWithID (OSCTXT* pctxt, ASN1T_OTD_MeasurementWithID* pvalue); + +IMPORT_C int asn1PD_OTD_MeasurementWithID (OSCTXT* pctxt, ASN1T_OTD_MeasurementWithID* pvalue); + +IMPORT_C void asn1Print_OTD_MeasurementWithID + (const char* name, ASN1T_OTD_MeasurementWithID* pvalue); + +IMPORT_C void asn1Free_OTD_MeasurementWithID (OSCTXT *pctxt, ASN1T_OTD_MeasurementWithID* pvalue); + +/**************************************************************/ +/* */ +/* OTD_FirstSetMsrs */ +/* */ +/**************************************************************/ + +#define TV_OTD_FirstSetMsrs (TM_UNIV|TM_CONS|16) + +typedef ASN1T_OTD_MeasurementWithID ASN1T_OTD_FirstSetMsrs; + +IMPORT_C int asn1PE_OTD_FirstSetMsrs (OSCTXT* pctxt, ASN1T_OTD_FirstSetMsrs* pvalue); + +IMPORT_C int asn1PD_OTD_FirstSetMsrs (OSCTXT* pctxt, ASN1T_OTD_FirstSetMsrs* pvalue); + +IMPORT_C void asn1Print_OTD_FirstSetMsrs + (const char* name, ASN1T_OTD_FirstSetMsrs* pvalue); + +IMPORT_C void asn1Free_OTD_FirstSetMsrs (OSCTXT *pctxt, ASN1T_OTD_FirstSetMsrs* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfOTD_FirstSetMsrs */ +/* */ +/**************************************************************/ + +#define TV_SeqOfOTD_FirstSetMsrs (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_OTD_FirstSetMsrs */ +typedef ASN1TSeqOfList ASN1T_SeqOfOTD_FirstSetMsrs; + +class ASN1C_SeqOfOTD_FirstSetMsrs : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfOTD_FirstSetMsrs& msgData; +public: + IMPORT_C ASN1C_SeqOfOTD_FirstSetMsrs (ASN1T_SeqOfOTD_FirstSetMsrs& data); + IMPORT_C ASN1C_SeqOfOTD_FirstSetMsrs (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfOTD_FirstSetMsrs& data); + ASN1C_SeqOfOTD_FirstSetMsrs (ASN1CType& ccobj, ASN1T_SeqOfOTD_FirstSetMsrs& data); + IMPORT_C ASN1C_SeqOfOTD_FirstSetMsrs (OSRTContext &context + , ASN1T_SeqOfOTD_FirstSetMsrs& data); + void Append (ASN1T_OTD_FirstSetMsrs* elem); + ASN1T_OTD_FirstSetMsrs* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfOTD_FirstSetMsrs (OSCTXT* pctxt, ASN1T_SeqOfOTD_FirstSetMsrs* pvalue); + +IMPORT_C int asn1PD_SeqOfOTD_FirstSetMsrs (OSCTXT* pctxt, ASN1T_SeqOfOTD_FirstSetMsrs* pvalue); + +IMPORT_C void asn1Print_SeqOfOTD_FirstSetMsrs + (const char* name, ASN1T_SeqOfOTD_FirstSetMsrs* pvalue); + +IMPORT_C void asn1Free_SeqOfOTD_FirstSetMsrs (OSCTXT *pctxt, ASN1T_SeqOfOTD_FirstSetMsrs* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MsrElementFirst */ +/* */ +/**************************************************************/ + +#define TV_OTD_MsrElementFirst (TM_UNIV|TM_CONS|16) + +struct ASN1T_OTD_MsrElementFirst { + struct { + unsigned toaMeasurementsOfRefPresent : 1; + unsigned taCorrectionPresent : 1; + unsigned otd_FirstSetMsrsPresent : 1; + } m; + OSUINT16 refFrameNumber; + ASN1T_ModuloTimeSlot referenceTimeSlot; + ASN1T_TOA_MeasurementsOfRef toaMeasurementsOfRef; + ASN1T_StdResolution stdResolution; + OSUINT16 taCorrection; + ASN1T_SeqOfOTD_FirstSetMsrs otd_FirstSetMsrs; + IMPORT_C ASN1T_OTD_MsrElementFirst (); +} ; + +IMPORT_C int asn1PE_OTD_MsrElementFirst (OSCTXT* pctxt, ASN1T_OTD_MsrElementFirst* pvalue); + +IMPORT_C int asn1PD_OTD_MsrElementFirst (OSCTXT* pctxt, ASN1T_OTD_MsrElementFirst* pvalue); + +IMPORT_C void asn1Print_OTD_MsrElementFirst + (const char* name, ASN1T_OTD_MsrElementFirst* pvalue); + +IMPORT_C void asn1Free_OTD_MsrElementFirst (OSCTXT *pctxt, ASN1T_OTD_MsrElementFirst* pvalue); + +/**************************************************************/ +/* */ +/* OTD_Measurement */ +/* */ +/**************************************************************/ + +#define TV_OTD_Measurement (TM_UNIV|TM_CONS|16) + +struct ASN1T_OTD_Measurement { + ASN1T_ModuloTimeSlot nborTimeSlot; + ASN1T_EOTDQuality eotdQuality; + ASN1T_OTDValue otdValue; + IMPORT_C ASN1T_OTD_Measurement (); +} ; + +IMPORT_C int asn1PE_OTD_Measurement (OSCTXT* pctxt, ASN1T_OTD_Measurement* pvalue); + +IMPORT_C int asn1PD_OTD_Measurement (OSCTXT* pctxt, ASN1T_OTD_Measurement* pvalue); + +IMPORT_C void asn1Print_OTD_Measurement + (const char* name, ASN1T_OTD_Measurement* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MsrsOfOtherSets */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_OTD_MsrsOfOtherSets_identityNotPresent 1 +#define T_OTD_MsrsOfOtherSets_identityPresent 2 + +struct ASN1T_OTD_MsrsOfOtherSets { + int t; + union { + /* t = 1 */ + ASN1T_OTD_Measurement *identityNotPresent; + /* t = 2 */ + ASN1T_OTD_MeasurementWithID *identityPresent; + } u; +} ; + +IMPORT_C int asn1PE_OTD_MsrsOfOtherSets (OSCTXT* pctxt, ASN1T_OTD_MsrsOfOtherSets* pvalue); + +IMPORT_C int asn1PD_OTD_MsrsOfOtherSets (OSCTXT* pctxt, ASN1T_OTD_MsrsOfOtherSets* pvalue); + +IMPORT_C void asn1Print_OTD_MsrsOfOtherSets + (const char* name, ASN1T_OTD_MsrsOfOtherSets* pvalue); + +IMPORT_C void asn1Free_OTD_MsrsOfOtherSets (OSCTXT *pctxt, ASN1T_OTD_MsrsOfOtherSets* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfOTD_MsrsOfOtherSets */ +/* */ +/**************************************************************/ + +#define TV_SeqOfOTD_MsrsOfOtherSets (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_OTD_MsrsOfOtherSets */ +typedef ASN1TSeqOfList ASN1T_SeqOfOTD_MsrsOfOtherSets; + +class ASN1C_SeqOfOTD_MsrsOfOtherSets : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfOTD_MsrsOfOtherSets& msgData; +public: + IMPORT_C ASN1C_SeqOfOTD_MsrsOfOtherSets (ASN1T_SeqOfOTD_MsrsOfOtherSets& data); + IMPORT_C ASN1C_SeqOfOTD_MsrsOfOtherSets (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfOTD_MsrsOfOtherSets& data); + ASN1C_SeqOfOTD_MsrsOfOtherSets (ASN1CType& ccobj, ASN1T_SeqOfOTD_MsrsOfOtherSets& data); + IMPORT_C ASN1C_SeqOfOTD_MsrsOfOtherSets (OSRTContext &context + , ASN1T_SeqOfOTD_MsrsOfOtherSets& data); + void Append (ASN1T_OTD_MsrsOfOtherSets* elem); + ASN1T_OTD_MsrsOfOtherSets* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfOTD_MsrsOfOtherSets (OSCTXT* pctxt, ASN1T_SeqOfOTD_MsrsOfOtherSets* pvalue); + +IMPORT_C int asn1PD_SeqOfOTD_MsrsOfOtherSets (OSCTXT* pctxt, ASN1T_SeqOfOTD_MsrsOfOtherSets* pvalue); + +IMPORT_C void asn1Print_SeqOfOTD_MsrsOfOtherSets + (const char* name, ASN1T_SeqOfOTD_MsrsOfOtherSets* pvalue); + +IMPORT_C void asn1Free_SeqOfOTD_MsrsOfOtherSets (OSCTXT *pctxt, ASN1T_SeqOfOTD_MsrsOfOtherSets* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MsrElementRest */ +/* */ +/**************************************************************/ + +#define TV_OTD_MsrElementRest (TM_UNIV|TM_CONS|16) + +struct ASN1T_OTD_MsrElementRest { + struct { + unsigned toaMeasurementsOfRefPresent : 1; + unsigned taCorrectionPresent : 1; + unsigned otd_MsrsOfOtherSetsPresent : 1; + } m; + OSUINT16 refFrameNumber; + ASN1T_ModuloTimeSlot referenceTimeSlot; + ASN1T_TOA_MeasurementsOfRef toaMeasurementsOfRef; + ASN1T_StdResolution stdResolution; + OSUINT16 taCorrection; + ASN1T_SeqOfOTD_MsrsOfOtherSets otd_MsrsOfOtherSets; + IMPORT_C ASN1T_OTD_MsrElementRest (); +} ; + +IMPORT_C int asn1PE_OTD_MsrElementRest (OSCTXT* pctxt, ASN1T_OTD_MsrElementRest* pvalue); + +IMPORT_C int asn1PD_OTD_MsrElementRest (OSCTXT* pctxt, ASN1T_OTD_MsrElementRest* pvalue); + +IMPORT_C void asn1Print_OTD_MsrElementRest + (const char* name, ASN1T_OTD_MsrElementRest* pvalue); + +IMPORT_C void asn1Free_OTD_MsrElementRest (OSCTXT *pctxt, ASN1T_OTD_MsrElementRest* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfOTD_MsrElementRest */ +/* */ +/**************************************************************/ + +#define TV_SeqOfOTD_MsrElementRest (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_OTD_MsrElementRest */ +typedef ASN1TSeqOfList ASN1T_SeqOfOTD_MsrElementRest; + +class ASN1C_SeqOfOTD_MsrElementRest : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfOTD_MsrElementRest& msgData; +public: + IMPORT_C ASN1C_SeqOfOTD_MsrElementRest (ASN1T_SeqOfOTD_MsrElementRest& data); + IMPORT_C ASN1C_SeqOfOTD_MsrElementRest (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfOTD_MsrElementRest& data); + ASN1C_SeqOfOTD_MsrElementRest (ASN1CType& ccobj, ASN1T_SeqOfOTD_MsrElementRest& data); + IMPORT_C ASN1C_SeqOfOTD_MsrElementRest (OSRTContext &context + , ASN1T_SeqOfOTD_MsrElementRest& data); + void Append (ASN1T_OTD_MsrElementRest* elem); + ASN1T_OTD_MsrElementRest* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfOTD_MsrElementRest (OSCTXT* pctxt, ASN1T_SeqOfOTD_MsrElementRest* pvalue); + +IMPORT_C int asn1PD_SeqOfOTD_MsrElementRest (OSCTXT* pctxt, ASN1T_SeqOfOTD_MsrElementRest* pvalue); + +IMPORT_C void asn1Print_SeqOfOTD_MsrElementRest + (const char* name, ASN1T_SeqOfOTD_MsrElementRest* pvalue); + +IMPORT_C void asn1Free_SeqOfOTD_MsrElementRest (OSCTXT *pctxt, ASN1T_SeqOfOTD_MsrElementRest* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MeasureInfo */ +/* */ +/**************************************************************/ + +#define TV_OTD_MeasureInfo (TM_UNIV|TM_CONS|16) + +struct ASN1T_OTD_MeasureInfo { + struct { + unsigned otdMsrRestSetsPresent : 1; + } m; + ASN1T_OTD_MsrElementFirst otdMsrFirstSets; + ASN1T_SeqOfOTD_MsrElementRest otdMsrRestSets; + IMPORT_C ASN1T_OTD_MeasureInfo (); +} ; + +IMPORT_C int asn1PE_OTD_MeasureInfo (OSCTXT* pctxt, ASN1T_OTD_MeasureInfo* pvalue); + +IMPORT_C int asn1PD_OTD_MeasureInfo (OSCTXT* pctxt, ASN1T_OTD_MeasureInfo* pvalue); + +IMPORT_C void asn1Print_OTD_MeasureInfo + (const char* name, ASN1T_OTD_MeasureInfo* pvalue); + +IMPORT_C void asn1Free_OTD_MeasureInfo (OSCTXT *pctxt, ASN1T_OTD_MeasureInfo* pvalue); + +/**************************************************************/ +/* */ +/* FixType */ +/* */ +/**************************************************************/ + +#define TV_FixType (TM_UNIV|TM_PRIM|2) + +struct FixType { + enum Root { + twoDFix = 0, + threeDFix = 1 + } ; +} ; + +typedef OSUINT8 ASN1T_FixType; + +IMPORT_C int asn1PE_FixType (OSCTXT* pctxt, ASN1T_FixType value); + +IMPORT_C int asn1PD_FixType (OSCTXT* pctxt, ASN1T_FixType* pvalue); + +IMPORT_C void asn1Print_FixType + (const char* name, ASN1T_FixType* pvalue); + +/**************************************************************/ +/* */ +/* LocationInfo */ +/* */ +/**************************************************************/ + +#define TV_LocationInfo (TM_UNIV|TM_CONS|16) + +struct ASN1T_LocationInfo { + struct { + unsigned gpsTOWPresent : 1; + } m; + OSUINT16 refFrame; + OSUINT32 gpsTOW; + ASN1T_FixType fixType; + ASN1T_Ext_GeographicalInformation posEstimate; + IMPORT_C ASN1T_LocationInfo (); +} ; + +IMPORT_C int asn1PE_LocationInfo (OSCTXT* pctxt, ASN1T_LocationInfo* pvalue); + +IMPORT_C int asn1PD_LocationInfo (OSCTXT* pctxt, ASN1T_LocationInfo* pvalue); + +IMPORT_C void asn1Print_LocationInfo + (const char* name, ASN1T_LocationInfo* pvalue); + +/**************************************************************/ +/* */ +/* GPSTOW24b */ +/* */ +/**************************************************************/ + +#define TV_GPSTOW24b (TM_UNIV|TM_PRIM|2) + +typedef OSUINT32 ASN1T_GPSTOW24b; + +IMPORT_C int asn1PE_GPSTOW24b (OSCTXT* pctxt, ASN1T_GPSTOW24b value); + +IMPORT_C int asn1PD_GPSTOW24b (OSCTXT* pctxt, ASN1T_GPSTOW24b* pvalue); + +IMPORT_C void asn1Print_GPSTOW24b + (const char* name, ASN1T_GPSTOW24b* pvalue); + +/**************************************************************/ +/* */ +/* MpathIndic */ +/* */ +/**************************************************************/ + +#define TV_MpathIndic (TM_UNIV|TM_PRIM|10) + +struct MpathIndic { + enum Root { + notMeasured = 0, + low = 1, + medium = 2, + high = 3 + } ; +} ; + +typedef OSUINT32 ASN1T_MpathIndic; + +IMPORT_C int asn1PE_MpathIndic (OSCTXT* pctxt, ASN1T_MpathIndic value); + +IMPORT_C int asn1PD_MpathIndic (OSCTXT* pctxt, ASN1T_MpathIndic* pvalue); + +IMPORT_C void asn1Print_MpathIndic + (const char* name, ASN1T_MpathIndic* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_MpathIndic_ToString (OSINT32 value); + +IMPORT_C int ASN1T_MpathIndic_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_MpathIndic* pvalue); + +/**************************************************************/ +/* */ +/* GPS_MsrElement */ +/* */ +/**************************************************************/ + +#define TV_GPS_MsrElement (TM_UNIV|TM_CONS|16) + +struct ASN1T_GPS_MsrElement { + ASN1T_SatelliteID satelliteID; + OSUINT8 cNo; + OSINT16 doppler; + OSUINT16 wholeChips; + OSUINT16 fracChips; + ASN1T_MpathIndic mpathIndic; + OSUINT8 pseuRangeRMSErr; + IMPORT_C ASN1T_GPS_MsrElement (); +} ; + +IMPORT_C int asn1PE_GPS_MsrElement (OSCTXT* pctxt, ASN1T_GPS_MsrElement* pvalue); + +IMPORT_C int asn1PD_GPS_MsrElement (OSCTXT* pctxt, ASN1T_GPS_MsrElement* pvalue); + +IMPORT_C void asn1Print_GPS_MsrElement + (const char* name, ASN1T_GPS_MsrElement* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfGPS_MsrElement */ +/* */ +/**************************************************************/ + +#define TV_SeqOfGPS_MsrElement (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_GPS_MsrElement */ +typedef ASN1TSeqOfList ASN1T_SeqOfGPS_MsrElement; + +class ASN1C_SeqOfGPS_MsrElement : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfGPS_MsrElement& msgData; +public: + IMPORT_C ASN1C_SeqOfGPS_MsrElement (ASN1T_SeqOfGPS_MsrElement& data); + IMPORT_C ASN1C_SeqOfGPS_MsrElement (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfGPS_MsrElement& data); + IMPORT_C ASN1C_SeqOfGPS_MsrElement (ASN1CType& ccobj, ASN1T_SeqOfGPS_MsrElement& data); + IMPORT_C ASN1C_SeqOfGPS_MsrElement (OSRTContext &context + , ASN1T_SeqOfGPS_MsrElement& data); + IMPORT_C void Append (ASN1T_GPS_MsrElement* elem); + IMPORT_C ASN1T_GPS_MsrElement* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfGPS_MsrElement (OSCTXT* pctxt, ASN1T_SeqOfGPS_MsrElement* pvalue); + +IMPORT_C int asn1PD_SeqOfGPS_MsrElement (OSCTXT* pctxt, ASN1T_SeqOfGPS_MsrElement* pvalue); + +IMPORT_C void asn1Print_SeqOfGPS_MsrElement + (const char* name, ASN1T_SeqOfGPS_MsrElement* pvalue); + +IMPORT_C void asn1Free_SeqOfGPS_MsrElement (OSCTXT *pctxt, ASN1T_SeqOfGPS_MsrElement* pvalue); + +/**************************************************************/ +/* */ +/* GPS_MsrSetElement */ +/* */ +/**************************************************************/ + +#define TV_GPS_MsrSetElement (TM_UNIV|TM_CONS|16) + +struct ASN1T_GPS_MsrSetElement { + struct { + unsigned refFramePresent : 1; + } m; + OSUINT16 refFrame; + ASN1T_GPSTOW24b gpsTOW; + ASN1T_SeqOfGPS_MsrElement gps_msrList; + IMPORT_C ASN1T_GPS_MsrSetElement (); +} ; + +IMPORT_C int asn1PE_GPS_MsrSetElement (OSCTXT* pctxt, ASN1T_GPS_MsrSetElement* pvalue); + +IMPORT_C int asn1PD_GPS_MsrSetElement (OSCTXT* pctxt, ASN1T_GPS_MsrSetElement* pvalue); + +IMPORT_C void asn1Print_GPS_MsrSetElement + (const char* name, ASN1T_GPS_MsrSetElement* pvalue); + +IMPORT_C void asn1Free_GPS_MsrSetElement (OSCTXT *pctxt, ASN1T_GPS_MsrSetElement* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfGPS_MsrSetElement */ +/* */ +/**************************************************************/ + +#define TV_SeqOfGPS_MsrSetElement (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_GPS_MsrSetElement */ +typedef ASN1TSeqOfList ASN1T_SeqOfGPS_MsrSetElement; + +class ASN1C_SeqOfGPS_MsrSetElement : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfGPS_MsrSetElement& msgData; +public: + IMPORT_C ASN1C_SeqOfGPS_MsrSetElement (ASN1T_SeqOfGPS_MsrSetElement& data); + IMPORT_C ASN1C_SeqOfGPS_MsrSetElement (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfGPS_MsrSetElement& data); + IMPORT_C ASN1C_SeqOfGPS_MsrSetElement (ASN1CType& ccobj, ASN1T_SeqOfGPS_MsrSetElement& data); + IMPORT_C ASN1C_SeqOfGPS_MsrSetElement (OSRTContext &context + , ASN1T_SeqOfGPS_MsrSetElement& data); + IMPORT_C void Append (ASN1T_GPS_MsrSetElement* elem); + IMPORT_C ASN1T_GPS_MsrSetElement* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfGPS_MsrSetElement (OSCTXT* pctxt, ASN1T_SeqOfGPS_MsrSetElement* pvalue); + +IMPORT_C int asn1PD_SeqOfGPS_MsrSetElement (OSCTXT* pctxt, ASN1T_SeqOfGPS_MsrSetElement* pvalue); + +IMPORT_C void asn1Print_SeqOfGPS_MsrSetElement + (const char* name, ASN1T_SeqOfGPS_MsrSetElement* pvalue); + +IMPORT_C void asn1Free_SeqOfGPS_MsrSetElement (OSCTXT *pctxt, ASN1T_SeqOfGPS_MsrSetElement* pvalue); + +/**************************************************************/ +/* */ +/* GPS_MeasureInfo */ +/* */ +/**************************************************************/ + +#define TV_GPS_MeasureInfo (TM_UNIV|TM_CONS|16) + +struct ASN1T_GPS_MeasureInfo { + ASN1T_SeqOfGPS_MsrSetElement gpsMsrSetList; + IMPORT_C ASN1T_GPS_MeasureInfo (); +} ; + +IMPORT_C int asn1PE_GPS_MeasureInfo (OSCTXT* pctxt, ASN1T_GPS_MeasureInfo* pvalue); + +IMPORT_C int asn1PD_GPS_MeasureInfo (OSCTXT* pctxt, ASN1T_GPS_MeasureInfo* pvalue); + +IMPORT_C void asn1Print_GPS_MeasureInfo + (const char* name, ASN1T_GPS_MeasureInfo* pvalue); + +IMPORT_C void asn1Free_GPS_MeasureInfo (OSCTXT *pctxt, ASN1T_GPS_MeasureInfo* pvalue); + +/**************************************************************/ +/* */ +/* LocErrorReason */ +/* */ +/**************************************************************/ + +#define TV_LocErrorReason (TM_UNIV|TM_PRIM|10) + +struct LocErrorReason { + enum Root { + unDefined = 0, + notEnoughBTSs = 1, + notEnoughSats = 2, + eotdLocCalAssDataMissing = 3, + eotdAssDataMissing = 4, + gpsLocCalAssDataMissing = 5, + gpsAssDataMissing = 6, + methodNotSupported = 7, + notProcessed = 8, + refBTSForGPSNotServingBTS = 9, + refBTSForEOTDNotServingBTS = 10 + } ; +} ; + +typedef OSUINT32 ASN1T_LocErrorReason; + +IMPORT_C int asn1PE_LocErrorReason (OSCTXT* pctxt, ASN1T_LocErrorReason value); + +IMPORT_C int asn1PD_LocErrorReason (OSCTXT* pctxt, ASN1T_LocErrorReason* pvalue); + +IMPORT_C void asn1Print_LocErrorReason + (const char* name, ASN1T_LocErrorReason* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_LocErrorReason_ToString (OSINT32 value); + +IMPORT_C int ASN1T_LocErrorReason_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_LocErrorReason* pvalue); + +/**************************************************************/ +/* */ +/* GPSAssistanceData */ +/* */ +/**************************************************************/ + +#define TV_GPSAssistanceData (TM_UNIV|TM_PRIM|4) + +struct ASN1T_GPSAssistanceData { + OSUINT32 numocts; + OSOCTET data[40]; + // ctors + ASN1T_GPSAssistanceData () : numocts(0) {} + ASN1T_GPSAssistanceData (OSUINT32 _numocts, const OSOCTET* _data) : + numocts (_numocts) { + OSCRTLMEMCPY (data, _data, OSRTMIN (numocts, sizeof(data))); + } + ASN1T_GPSAssistanceData (const char* cstring) { + if (strlen(cstring) > 0) { + numocts = OSRTMIN ((OSCRTLSTRLEN(cstring)+1), sizeof(data)); + OSCRTLSTRNCPY ((char*)data, cstring, sizeof(data)); + } + else numocts = 0; + } + // assignment operators + ASN1T_GPSAssistanceData& operator= (const char* cstring) { + if (strlen(cstring) > 0) { + numocts = OSRTMIN ((OSCRTLSTRLEN(cstring)+1), sizeof(data)); + OSCRTLSTRNCPY ((char*)data, cstring, sizeof(data)); + } + else numocts = 0; + return *this; + } +} ; + +IMPORT_C int asn1PE_GPSAssistanceData (OSCTXT* pctxt, ASN1T_GPSAssistanceData* pvalue); + +IMPORT_C int asn1PD_GPSAssistanceData (OSCTXT* pctxt, ASN1T_GPSAssistanceData* pvalue); + +IMPORT_C void asn1Print_GPSAssistanceData + (const char* name, ASN1T_GPSAssistanceData* pvalue); + +/**************************************************************/ +/* */ +/* AdditionalAssistanceData */ +/* */ +/**************************************************************/ + +#define TV_AdditionalAssistanceData (TM_UNIV|TM_CONS|16) + +struct ASN1T_AdditionalAssistanceData { + struct { + unsigned gpsAssistanceDataPresent : 1; + unsigned extensionContainerPresent : 1; + } m; + ASN1T_GPSAssistanceData gpsAssistanceData; + ASN1T_ExtensionContainer extensionContainer; + IMPORT_C ASN1T_AdditionalAssistanceData (); +} ; + +IMPORT_C int asn1PE_AdditionalAssistanceData (OSCTXT* pctxt, ASN1T_AdditionalAssistanceData* pvalue); + +IMPORT_C int asn1PD_AdditionalAssistanceData (OSCTXT* pctxt, ASN1T_AdditionalAssistanceData* pvalue); + +IMPORT_C void asn1Print_AdditionalAssistanceData + (const char* name, ASN1T_AdditionalAssistanceData* pvalue); + +IMPORT_C void asn1Free_AdditionalAssistanceData (OSCTXT *pctxt, ASN1T_AdditionalAssistanceData* pvalue); + +/**************************************************************/ +/* */ +/* LocationError */ +/* */ +/**************************************************************/ + +#define TV_LocationError (TM_UNIV|TM_CONS|16) + +struct ASN1T_LocationError { + struct { + unsigned additionalAssistanceDataPresent : 1; + } m; + ASN1T_LocErrorReason locErrorReason; + ASN1T_AdditionalAssistanceData additionalAssistanceData; + IMPORT_C ASN1T_LocationError (); +} ; + +IMPORT_C int asn1PE_LocationError (OSCTXT* pctxt, ASN1T_LocationError* pvalue); + +IMPORT_C int asn1PD_LocationError (OSCTXT* pctxt, ASN1T_LocationError* pvalue); + +IMPORT_C void asn1Print_LocationError + (const char* name, ASN1T_LocationError* pvalue); + +IMPORT_C void asn1Free_LocationError (OSCTXT *pctxt, ASN1T_LocationError* pvalue); + +/**************************************************************/ +/* */ +/* SeqOfOTD_FirstSetMsrs_R98_Ext */ +/* */ +/**************************************************************/ + +#define TV_SeqOfOTD_FirstSetMsrs_R98_Ext (TM_UNIV|TM_CONS|16) + +/* List of ASN1T_OTD_FirstSetMsrs */ +typedef ASN1TSeqOfList ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext; + +class ASN1C_SeqOfOTD_FirstSetMsrs_R98_Ext : +public ASN1CSeqOfList +{ +protected: + ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext& msgData; +public: + IMPORT_C ASN1C_SeqOfOTD_FirstSetMsrs_R98_Ext + (ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext& data); + IMPORT_C ASN1C_SeqOfOTD_FirstSetMsrs_R98_Ext (OSRTMessageBufferIF& msgBuf + , ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext& data); + ASN1C_SeqOfOTD_FirstSetMsrs_R98_Ext (ASN1CType& ccobj, ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext& data); + IMPORT_C ASN1C_SeqOfOTD_FirstSetMsrs_R98_Ext (OSRTContext &context + , ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext& data); + void Append (ASN1T_OTD_FirstSetMsrs* elem); + ASN1T_OTD_FirstSetMsrs* NewElement (); +} ; + +IMPORT_C int asn1PE_SeqOfOTD_FirstSetMsrs_R98_Ext (OSCTXT* pctxt, ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext* pvalue); + +IMPORT_C int asn1PD_SeqOfOTD_FirstSetMsrs_R98_Ext (OSCTXT* pctxt, ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext* pvalue); + +IMPORT_C void asn1Print_SeqOfOTD_FirstSetMsrs_R98_Ext + (const char* name, ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext* pvalue); + +IMPORT_C void asn1Free_SeqOfOTD_FirstSetMsrs_R98_Ext (OSCTXT *pctxt, ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MsrElementFirst_R98_Ext */ +/* */ +/**************************************************************/ + +#define TV_OTD_MsrElementFirst_R98_Ext (TM_UNIV|TM_CONS|16) + +struct ASN1T_OTD_MsrElementFirst_R98_Ext { + struct { + unsigned otd_FirstSetMsrs_R98_ExtPresent : 1; + } m; + ASN1T_SeqOfOTD_FirstSetMsrs_R98_Ext otd_FirstSetMsrs_R98_Ext; + IMPORT_C ASN1T_OTD_MsrElementFirst_R98_Ext (); +} ; + +IMPORT_C int asn1PE_OTD_MsrElementFirst_R98_Ext (OSCTXT* pctxt, ASN1T_OTD_MsrElementFirst_R98_Ext* pvalue); + +IMPORT_C int asn1PD_OTD_MsrElementFirst_R98_Ext (OSCTXT* pctxt, ASN1T_OTD_MsrElementFirst_R98_Ext* pvalue); + +IMPORT_C void asn1Print_OTD_MsrElementFirst_R98_Ext + (const char* name, ASN1T_OTD_MsrElementFirst_R98_Ext* pvalue); + +IMPORT_C void asn1Free_OTD_MsrElementFirst_R98_Ext (OSCTXT *pctxt, ASN1T_OTD_MsrElementFirst_R98_Ext* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MeasureInfo_R98_Ext */ +/* */ +/**************************************************************/ + +#define TV_OTD_MeasureInfo_R98_Ext (TM_UNIV|TM_CONS|16) + +struct ASN1T_OTD_MeasureInfo_R98_Ext { + ASN1T_OTD_MsrElementFirst_R98_Ext otdMsrFirstSets_R98_Ext; + IMPORT_C ASN1T_OTD_MeasureInfo_R98_Ext (); +} ; + +IMPORT_C int asn1PE_OTD_MeasureInfo_R98_Ext (OSCTXT* pctxt, ASN1T_OTD_MeasureInfo_R98_Ext* pvalue); + +IMPORT_C int asn1PD_OTD_MeasureInfo_R98_Ext (OSCTXT* pctxt, ASN1T_OTD_MeasureInfo_R98_Ext* pvalue); + +IMPORT_C void asn1Print_OTD_MeasureInfo_R98_Ext + (const char* name, ASN1T_OTD_MeasureInfo_R98_Ext* pvalue); + +IMPORT_C void asn1Free_OTD_MeasureInfo_R98_Ext (OSCTXT *pctxt, ASN1T_OTD_MeasureInfo_R98_Ext* pvalue); + +/**************************************************************/ +/* */ +/* Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo */ +/* */ +/**************************************************************/ + +#define TV_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo { + struct { + unsigned otd_MeasureInfo_R98_ExtPresent : 1; + } m; + ASN1T_OTD_MeasureInfo_R98_Ext otd_MeasureInfo_R98_Ext; + IMPORT_C ASN1T_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo (); +} ; + +IMPORT_C int asn1PE_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo (OSCTXT* pctxt, ASN1T_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo* pvalue); + +IMPORT_C int asn1PD_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo (OSCTXT* pctxt, ASN1T_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo* pvalue); + +IMPORT_C void asn1Print_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo + (const char* name, ASN1T_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo* pvalue); + +IMPORT_C void asn1Free_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo (OSCTXT *pctxt, ASN1T_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo* pvalue); + +/**************************************************************/ +/* */ +/* GPSTimeAssistanceMeasurements */ +/* */ +/**************************************************************/ + +#define TV_GPSTimeAssistanceMeasurements (TM_UNIV|TM_CONS|16) + +struct ASN1T_GPSTimeAssistanceMeasurements { + struct { + unsigned gpsTowSubmsPresent : 1; + unsigned deltaTowPresent : 1; + unsigned gpsReferenceTimeUncertaintyPresent : 1; + } m; + OSUINT8 referenceFrameMSB; + OSUINT16 gpsTowSubms; + OSUINT8 deltaTow; + ASN1T_GPSReferenceTimeUncertainty gpsReferenceTimeUncertainty; + IMPORT_C ASN1T_GPSTimeAssistanceMeasurements (); +} ; + +IMPORT_C int asn1PE_GPSTimeAssistanceMeasurements (OSCTXT* pctxt, ASN1T_GPSTimeAssistanceMeasurements* pvalue); + +IMPORT_C int asn1PD_GPSTimeAssistanceMeasurements (OSCTXT* pctxt, ASN1T_GPSTimeAssistanceMeasurements* pvalue); + +IMPORT_C void asn1Print_GPSTimeAssistanceMeasurements + (const char* name, ASN1T_GPSTimeAssistanceMeasurements* pvalue); + +/**************************************************************/ +/* */ +/* Rel_98_MsrPosition_Rsp_Extension */ +/* */ +/**************************************************************/ + +#define TV_Rel_98_MsrPosition_Rsp_Extension (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel_98_MsrPosition_Rsp_Extension { + struct { + unsigned timeAssistanceMeasurementsPresent : 1; + } m; + ASN1T_Rel_98_MsrPosition_Rsp_Extension_rel_98_Ext_MeasureInfo rel_98_Ext_MeasureInfo; + ASN1T_GPSTimeAssistanceMeasurements timeAssistanceMeasurements; + IMPORT_C ASN1T_Rel_98_MsrPosition_Rsp_Extension (); +} ; + +IMPORT_C int asn1PE_Rel_98_MsrPosition_Rsp_Extension (OSCTXT* pctxt, ASN1T_Rel_98_MsrPosition_Rsp_Extension* pvalue); + +IMPORT_C int asn1PD_Rel_98_MsrPosition_Rsp_Extension (OSCTXT* pctxt, ASN1T_Rel_98_MsrPosition_Rsp_Extension* pvalue); + +IMPORT_C void asn1Print_Rel_98_MsrPosition_Rsp_Extension + (const char* name, ASN1T_Rel_98_MsrPosition_Rsp_Extension* pvalue); + +IMPORT_C void asn1Free_Rel_98_MsrPosition_Rsp_Extension (OSCTXT *pctxt, ASN1T_Rel_98_MsrPosition_Rsp_Extension* pvalue); + +/**************************************************************/ +/* */ +/* OTD_MeasureInfo_5_Ext */ +/* */ +/**************************************************************/ + +#define TV_OTD_MeasureInfo_5_Ext (TM_UNIV|TM_CONS|16) + +typedef ASN1T_SeqOfOTD_MsrElementRest ASN1T_OTD_MeasureInfo_5_Ext; + +IMPORT_C int asn1PE_OTD_MeasureInfo_5_Ext (OSCTXT* pctxt, ASN1T_OTD_MeasureInfo_5_Ext* pvalue); + +IMPORT_C int asn1PD_OTD_MeasureInfo_5_Ext (OSCTXT* pctxt, ASN1T_OTD_MeasureInfo_5_Ext* pvalue); + +IMPORT_C void asn1Print_OTD_MeasureInfo_5_Ext + (const char* name, ASN1T_OTD_MeasureInfo_5_Ext* pvalue); + +IMPORT_C void asn1Free_OTD_MeasureInfo_5_Ext (OSCTXT *pctxt, ASN1T_OTD_MeasureInfo_5_Ext* pvalue); + +/**************************************************************/ +/* */ +/* UlPseudoSegInd */ +/* */ +/**************************************************************/ + +#define TV_UlPseudoSegInd (TM_UNIV|TM_PRIM|10) + +struct UlPseudoSegInd { + enum Root { + firstOfMany = 0, + secondOfMany = 1 + } ; +} ; + +typedef OSUINT32 ASN1T_UlPseudoSegInd; + +IMPORT_C int asn1PE_UlPseudoSegInd (OSCTXT* pctxt, ASN1T_UlPseudoSegInd value); + +IMPORT_C int asn1PD_UlPseudoSegInd (OSCTXT* pctxt, ASN1T_UlPseudoSegInd* pvalue); + +IMPORT_C void asn1Print_UlPseudoSegInd + (const char* name, ASN1T_UlPseudoSegInd* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_UlPseudoSegInd_ToString (OSINT32 value); + +IMPORT_C int ASN1T_UlPseudoSegInd_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_UlPseudoSegInd* pvalue); + +/**************************************************************/ +/* */ +/* Rel_5_MsrPosition_Rsp_Extension */ +/* */ +/**************************************************************/ + +#define TV_Rel_5_MsrPosition_Rsp_Extension (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel_5_MsrPosition_Rsp_Extension { + struct { + unsigned extended_referencePresent : 1; + unsigned otd_MeasureInfo_5_ExtPresent : 1; + unsigned ulPseudoSegIndPresent : 1; + } m; + ASN1T_Extended_reference extended_reference; + ASN1T_OTD_MeasureInfo_5_Ext otd_MeasureInfo_5_Ext; + ASN1T_UlPseudoSegInd ulPseudoSegInd; + IMPORT_C ASN1T_Rel_5_MsrPosition_Rsp_Extension (); +} ; + +IMPORT_C int asn1PE_Rel_5_MsrPosition_Rsp_Extension (OSCTXT* pctxt, ASN1T_Rel_5_MsrPosition_Rsp_Extension* pvalue); + +IMPORT_C int asn1PD_Rel_5_MsrPosition_Rsp_Extension (OSCTXT* pctxt, ASN1T_Rel_5_MsrPosition_Rsp_Extension* pvalue); + +IMPORT_C void asn1Print_Rel_5_MsrPosition_Rsp_Extension + (const char* name, ASN1T_Rel_5_MsrPosition_Rsp_Extension* pvalue); + +IMPORT_C void asn1Free_Rel_5_MsrPosition_Rsp_Extension (OSCTXT *pctxt, ASN1T_Rel_5_MsrPosition_Rsp_Extension* pvalue); + +/**************************************************************/ +/* */ +/* MsrPosition_Rsp */ +/* */ +/**************************************************************/ + +#define TV_MsrPosition_Rsp (TM_UNIV|TM_CONS|16) + +struct ASN1T_MsrPosition_Rsp { + struct { + unsigned multipleSetsPresent : 1; + unsigned referenceIdentityPresent : 1; + unsigned otd_MeasureInfoPresent : 1; + unsigned locationInfoPresent : 1; + unsigned gps_MeasureInfoPresent : 1; + unsigned locationErrorPresent : 1; + unsigned extensionContainerPresent : 1; + unsigned rel_98_MsrPosition_Rsp_ExtensionPresent : 1; + unsigned rel_5_MsrPosition_Rsp_ExtensionPresent : 1; + } m; + ASN1T_MultipleSets multipleSets; + ASN1T_ReferenceIdentity referenceIdentity; + ASN1T_OTD_MeasureInfo otd_MeasureInfo; + ASN1T_LocationInfo locationInfo; + ASN1T_GPS_MeasureInfo gps_MeasureInfo; + ASN1T_LocationError locationError; + ASN1T_ExtensionContainer extensionContainer; + ASN1T_Rel_98_MsrPosition_Rsp_Extension rel_98_MsrPosition_Rsp_Extension; + ASN1T_Rel_5_MsrPosition_Rsp_Extension rel_5_MsrPosition_Rsp_Extension; + IMPORT_C ASN1T_MsrPosition_Rsp (); +} ; + +IMPORT_C int asn1PE_MsrPosition_Rsp (OSCTXT* pctxt, ASN1T_MsrPosition_Rsp* pvalue); + +IMPORT_C int asn1PD_MsrPosition_Rsp (OSCTXT* pctxt, ASN1T_MsrPosition_Rsp* pvalue); + +IMPORT_C void asn1Print_MsrPosition_Rsp + (const char* name, ASN1T_MsrPosition_Rsp* pvalue); + +IMPORT_C void asn1Free_MsrPosition_Rsp (OSCTXT *pctxt, ASN1T_MsrPosition_Rsp* pvalue); + +/**************************************************************/ +/* */ +/* MoreAssDataToBeSent */ +/* */ +/**************************************************************/ + +#define TV_MoreAssDataToBeSent (TM_UNIV|TM_PRIM|10) + +struct MoreAssDataToBeSent { + enum Root { + noMoreMessages = 0, + moreMessagesOnTheWay = 1 + } ; +} ; + +typedef OSUINT32 ASN1T_MoreAssDataToBeSent; + +IMPORT_C int asn1PE_MoreAssDataToBeSent (OSCTXT* pctxt, ASN1T_MoreAssDataToBeSent value); + +IMPORT_C int asn1PD_MoreAssDataToBeSent (OSCTXT* pctxt, ASN1T_MoreAssDataToBeSent* pvalue); + +IMPORT_C void asn1Print_MoreAssDataToBeSent + (const char* name, ASN1T_MoreAssDataToBeSent* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_MoreAssDataToBeSent_ToString (OSINT32 value); + +IMPORT_C int ASN1T_MoreAssDataToBeSent_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_MoreAssDataToBeSent* pvalue); + +/**************************************************************/ +/* */ +/* Rel98_AssistanceData_Extension */ +/* */ +/**************************************************************/ + +#define TV_Rel98_AssistanceData_Extension (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel98_AssistanceData_Extension { + struct { + unsigned rel98_Ext_ExpOTDPresent : 1; + unsigned gpsTimeAssistanceMeasurementRequestPresent : 1; + unsigned gpsReferenceTimeUncertaintyPresent : 1; + } m; + ASN1T_Rel98_Ext_ExpOTD rel98_Ext_ExpOTD; + ASN1T_GPSReferenceTimeUncertainty gpsReferenceTimeUncertainty; + IMPORT_C ASN1T_Rel98_AssistanceData_Extension (); +} ; + +IMPORT_C int asn1PE_Rel98_AssistanceData_Extension (OSCTXT* pctxt, ASN1T_Rel98_AssistanceData_Extension* pvalue); + +IMPORT_C int asn1PD_Rel98_AssistanceData_Extension (OSCTXT* pctxt, ASN1T_Rel98_AssistanceData_Extension* pvalue); + +IMPORT_C void asn1Print_Rel98_AssistanceData_Extension + (const char* name, ASN1T_Rel98_AssistanceData_Extension* pvalue); + +IMPORT_C void asn1Free_Rel98_AssistanceData_Extension (OSCTXT *pctxt, ASN1T_Rel98_AssistanceData_Extension* pvalue); + +/**************************************************************/ +/* */ +/* Rel5_AssistanceData_Extension */ +/* */ +/**************************************************************/ + +#define TV_Rel5_AssistanceData_Extension (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel5_AssistanceData_Extension { + ASN1T_Extended_reference extended_reference; + IMPORT_C ASN1T_Rel5_AssistanceData_Extension (); +} ; + +IMPORT_C int asn1PE_Rel5_AssistanceData_Extension (OSCTXT* pctxt, ASN1T_Rel5_AssistanceData_Extension* pvalue); + +IMPORT_C int asn1PD_Rel5_AssistanceData_Extension (OSCTXT* pctxt, ASN1T_Rel5_AssistanceData_Extension* pvalue); + +IMPORT_C void asn1Print_Rel5_AssistanceData_Extension + (const char* name, ASN1T_Rel5_AssistanceData_Extension* pvalue); + +/**************************************************************/ +/* */ +/* AssistanceData */ +/* */ +/**************************************************************/ + +#define TV_AssistanceData (TM_UNIV|TM_CONS|16) + +struct ASN1T_AssistanceData { + struct { + unsigned referenceAssistDataPresent : 1; + unsigned msrAssistDataPresent : 1; + unsigned systemInfoAssistDataPresent : 1; + unsigned gps_AssistDataPresent : 1; + unsigned moreAssDataToBeSentPresent : 1; + unsigned extensionContainerPresent : 1; + unsigned rel98_AssistanceData_ExtensionPresent : 1; + unsigned rel5_AssistanceData_ExtensionPresent : 1; + } m; + ASN1T_ReferenceAssistData referenceAssistData; + ASN1T_MsrAssistData msrAssistData; + ASN1T_SystemInfoAssistData systemInfoAssistData; + ASN1T_GPS_AssistData gps_AssistData; + ASN1T_MoreAssDataToBeSent moreAssDataToBeSent; + ASN1T_ExtensionContainer extensionContainer; + ASN1T_Rel98_AssistanceData_Extension rel98_AssistanceData_Extension; + ASN1T_Rel5_AssistanceData_Extension rel5_AssistanceData_Extension; + IMPORT_C ASN1T_AssistanceData (); +} ; + +IMPORT_C int asn1PE_AssistanceData (OSCTXT* pctxt, ASN1T_AssistanceData* pvalue); + +IMPORT_C int asn1PD_AssistanceData (OSCTXT* pctxt, ASN1T_AssistanceData* pvalue); + +IMPORT_C void asn1Print_AssistanceData + (const char* name, ASN1T_AssistanceData* pvalue); + +IMPORT_C void asn1Free_AssistanceData (OSCTXT *pctxt, ASN1T_AssistanceData* pvalue); + +/**************************************************************/ +/* */ +/* ErrorCodes */ +/* */ +/**************************************************************/ + +#define TV_ErrorCodes (TM_UNIV|TM_PRIM|10) + +struct ErrorCodes { + enum Root { + unDefined = 0, + missingComponet = 1, + incorrectData = 2, + missingIEorComponentElement = 3, + messageTooShort = 4, + unknowReferenceNumber = 5 + } ; +} ; + +typedef OSUINT32 ASN1T_ErrorCodes; + +IMPORT_C int asn1PE_ErrorCodes (OSCTXT* pctxt, ASN1T_ErrorCodes value); + +IMPORT_C int asn1PD_ErrorCodes (OSCTXT* pctxt, ASN1T_ErrorCodes* pvalue); + +IMPORT_C void asn1Print_ErrorCodes + (const char* name, ASN1T_ErrorCodes* pvalue); + +IMPORT_C const OSUTF8CHAR* ASN1T_ErrorCodes_ToString (OSINT32 value); + +IMPORT_C int ASN1T_ErrorCodes_ToEnum (OSCTXT* pctxt, + const OSUTF8CHAR* value, ASN1T_ErrorCodes* pvalue); + +/**************************************************************/ +/* */ +/* Rel_5_ProtocolError_Extension */ +/* */ +/**************************************************************/ + +#define TV_Rel_5_ProtocolError_Extension (TM_UNIV|TM_CONS|16) + +struct ASN1T_Rel_5_ProtocolError_Extension { + struct { + unsigned extended_referencePresent : 1; + } m; + ASN1T_Extended_reference extended_reference; + IMPORT_C ASN1T_Rel_5_ProtocolError_Extension (); +} ; + +IMPORT_C int asn1PE_Rel_5_ProtocolError_Extension (OSCTXT* pctxt, ASN1T_Rel_5_ProtocolError_Extension* pvalue); + +IMPORT_C int asn1PD_Rel_5_ProtocolError_Extension (OSCTXT* pctxt, ASN1T_Rel_5_ProtocolError_Extension* pvalue); + +IMPORT_C void asn1Print_Rel_5_ProtocolError_Extension + (const char* name, ASN1T_Rel_5_ProtocolError_Extension* pvalue); + +/**************************************************************/ +/* */ +/* ProtocolError */ +/* */ +/**************************************************************/ + +#define TV_ProtocolError (TM_UNIV|TM_CONS|16) + +struct ASN1T_ProtocolError { + struct { + unsigned extensionContainerPresent : 1; + unsigned rel_5_ProtocolError_ExtensionPresent : 1; + } m; + ASN1T_ErrorCodes errorCause; + ASN1T_ExtensionContainer extensionContainer; + ASN1T_Rel_5_ProtocolError_Extension rel_5_ProtocolError_Extension; + IMPORT_C ASN1T_ProtocolError (); +} ; + +IMPORT_C int asn1PE_ProtocolError (OSCTXT* pctxt, ASN1T_ProtocolError* pvalue); + +IMPORT_C int asn1PD_ProtocolError (OSCTXT* pctxt, ASN1T_ProtocolError* pvalue); + +IMPORT_C void asn1Print_ProtocolError + (const char* name, ASN1T_ProtocolError* pvalue); + +IMPORT_C void asn1Free_ProtocolError (OSCTXT *pctxt, ASN1T_ProtocolError* pvalue); + +/**************************************************************/ +/* */ +/* SLR_Arg_PCS_Extensions */ +/* */ +/**************************************************************/ + +#define TV_SLR_Arg_PCS_Extensions (TM_UNIV|TM_CONS|16) + +struct ASN1T_SLR_Arg_PCS_Extensions { + struct { + unsigned na_ESRK_RequestPresent : 1; + } m; + OSOCTET __dummy__; + IMPORT_C ASN1T_SLR_Arg_PCS_Extensions (); +} ; + +IMPORT_C int asn1PE_SLR_Arg_PCS_Extensions (OSCTXT* pctxt, ASN1T_SLR_Arg_PCS_Extensions* pvalue); + +IMPORT_C int asn1PD_SLR_Arg_PCS_Extensions (OSCTXT* pctxt, ASN1T_SLR_Arg_PCS_Extensions* pvalue); + +IMPORT_C void asn1Print_SLR_Arg_PCS_Extensions + (const char* name, ASN1T_SLR_Arg_PCS_Extensions* pvalue); + +/**************************************************************/ +/* */ +/* SLR_ArgExtensionContainer */ +/* */ +/**************************************************************/ + +#define TV_SLR_ArgExtensionContainer (TM_UNIV|TM_CONS|16) + +struct ASN1T_SLR_ArgExtensionContainer : public ASN1TPDU { + struct { + unsigned privateExtensionListPresent : 1; + unsigned slr_Arg_PCS_ExtensionsPresent : 1; + } m; + ASN1T_PrivateExtensionList privateExtensionList; + ASN1T_SLR_Arg_PCS_Extensions slr_Arg_PCS_Extensions; + IMPORT_C ASN1T_SLR_ArgExtensionContainer (); + IMPORT_C ~ASN1T_SLR_ArgExtensionContainer (); +} ; + +class ASN1C_SLR_ArgExtensionContainer : +public ASN1CType +{ +protected: + ASN1T_SLR_ArgExtensionContainer& msgData; +public: + IMPORT_C ASN1C_SLR_ArgExtensionContainer (ASN1T_SLR_ArgExtensionContainer& data); + IMPORT_C ASN1C_SLR_ArgExtensionContainer (OSRTMessageBufferIF& msgBuf + , ASN1T_SLR_ArgExtensionContainer& data); + IMPORT_C ASN1C_SLR_ArgExtensionContainer (OSRTContext &context + , ASN1T_SLR_ArgExtensionContainer& data); + + inline ASN1T_SLR_ArgExtensionContainer& getData () { return msgData; } + inline const ASN1T_SLR_ArgExtensionContainer& getData () const { return msgData; } + + // standard encode/decode methods (defined in ASN1CType base class): + // int Encode (); + // int Decode (); + + // stream encode/decode methods: + IMPORT_C int EncodeTo (OSRTMessageBufferIF& msgBuf); + IMPORT_C int DecodeFrom (OSRTMessageBufferIF& msgBuf); + + IMPORT_C void Print (const char* name); +} ; + +IMPORT_C int asn1PE_SLR_ArgExtensionContainer (OSCTXT* pctxt, ASN1T_SLR_ArgExtensionContainer* pvalue); + +IMPORT_C int asn1PD_SLR_ArgExtensionContainer (OSCTXT* pctxt, ASN1T_SLR_ArgExtensionContainer* pvalue); + +IMPORT_C void asn1Print_SLR_ArgExtensionContainer + (const char* name, ASN1T_SLR_ArgExtensionContainer* pvalue); + +IMPORT_C void asn1Free_SLR_ArgExtensionContainer (OSCTXT *pctxt, ASN1T_SLR_ArgExtensionContainer* pvalue); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1rrlp/inc/RRLP-Messages.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1rrlp/inc/RRLP-Messages.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,113 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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". +// + +/** + * This file was generated by the Objective Systems ASN1C Compiler + * (http://www.obj-sys.com). + */ +#ifndef RRLP_MESSAGES_H +#define RRLP_MESSAGES_H + +#include +#include +#include "rtkey.h" +#include "rtpersrc/asn1PerCppTypes.h" +#include "RRLP-Components.h" + +/** + * Header file for ASN.1 module RRLP-Messages + */ +/**************************************************************/ +/* */ +/* RRLP_Component */ +/* */ +/**************************************************************/ + +/* Choice tag constants */ + +#define T_RRLP_Component_msrPositionReq 1 +#define T_RRLP_Component_msrPositionRsp 2 +#define T_RRLP_Component_assistanceData 3 +#define T_RRLP_Component_assistanceDataAck 4 +#define T_RRLP_Component_protocolError 5 +#define T_RRLP_Component_extElem1 6 + +struct ASN1T_RRLP_Component { + int t; + union { + /* t = 1 */ + ASN1T_MsrPosition_Req *msrPositionReq; + /* t = 2 */ + ASN1T_MsrPosition_Rsp *msrPositionRsp; + /* t = 3 */ + ASN1T_AssistanceData *assistanceData; + /* t = 4 */ + /* t = 5 */ + ASN1T_ProtocolError *protocolError; + /* t = 6 */ + } u; +} ; + +IMPORT_C int asn1PE_RRLP_Component (OSCTXT* pctxt, ASN1T_RRLP_Component* pvalue); + +IMPORT_C int asn1PD_RRLP_Component (OSCTXT* pctxt, ASN1T_RRLP_Component* pvalue); + +IMPORT_C void asn1Print_RRLP_Component + (const char* name, ASN1T_RRLP_Component* pvalue); + +IMPORT_C void asn1Free_RRLP_Component (OSCTXT *pctxt, ASN1T_RRLP_Component* pvalue); + +/**************************************************************/ +/* */ +/* PDU */ +/* */ +/**************************************************************/ + +#define TV_PDU (TM_UNIV|TM_CONS|16) + +struct ASN1T_PDU : public ASN1TPDU { + OSUINT8 referenceNumber; + ASN1T_RRLP_Component component; + IMPORT_C ASN1T_PDU (); + IMPORT_C ~ASN1T_PDU (); +} ; + +class ASN1C_PDU : +public ASN1CType +{ +protected: + ASN1T_PDU& msgData; +public: + IMPORT_C ASN1C_PDU (ASN1T_PDU& data); + IMPORT_C ASN1C_PDU (OSRTMessageBufferIF& msgBuf, ASN1T_PDU& data); + IMPORT_C ASN1C_PDU (OSRTContext &context, ASN1T_PDU& data); + + inline ASN1T_PDU& getData () { return msgData; } + inline const ASN1T_PDU& getData () const { return msgData; } + + // standard encode/decode methods (defined in ASN1CType base class): + // int Encode (); + // int Decode (); + + // stream encode/decode methods: + IMPORT_C int EncodeTo (OSRTMessageBufferIF& msgBuf); + IMPORT_C int DecodeFrom (OSRTMessageBufferIF& msgBuf); + + IMPORT_C void Print (); +} ; + +IMPORT_C int asn1PE_PDU (OSCTXT* pctxt, ASN1T_PDU* pvalue); + +IMPORT_C int asn1PD_PDU (OSCTXT* pctxt, ASN1T_PDU* pvalue); + +IMPORT_C void asn1Print_PDU + (const char* name, ASN1T_PDU* pvalue); + +IMPORT_C void asn1Free_PDU (OSCTXT *pctxt, ASN1T_PDU* pvalue); + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1rrlp/inc/rtkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1rrlp/inc/rtkey.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,35 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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". +// + +/** + * This file was generated by the Objective Systems ASN1C Compiler + * (http://www.obj-sys.com). + */ +#ifndef _RTKEY_H_ +#define _RTKEY_H_ + +static const unsigned char _rtkey[] = { +0x50, 0x65, 0xdb, 0x99, 0x8d, 0x2c, 0xb7, 0xae, +0xd4, 0xb4, 0xf7, 0x60, 0xb3, 0x6e, 0x9e, 0xb4, +0x0b, 0xbf, 0xfa, 0x08, 0x45, 0x22, 0x5a, 0xb0, +0x42, 0x09, 0x8b, 0x42, 0xa3, 0xbd, 0x6d, 0x92, +0xe8, 0xda, 0x75, 0xa5, 0x8b, 0xac, 0xc5, 0x43, +0x89, 0x5e, 0x40, 0x30, 0x4c, 0x42, 0xf4, 0x94, +0x53, 0xa5, 0xf7, 0xe4, 0x33, 0x31, 0x71, 0xe3, +0xd1, 0x86, 0x31, 0x8d, 0x20, 0xfb, 0x91, 0x3d, +0xa2, 0x89, 0x77, 0x13, 0xd9, 0xe0, 0x07, 0xa1, +0x1b, 0x71, 0xce, 0xe5, 0x84, 0x5b, 0x33, 0xfc, +0xf8, 0x93, 0xad, 0x31, 0x42, 0x99, 0x68, 0x89 +} ; +#define rtInitContext(pctxt) \ +rtInitContextUsingKey(pctxt,_rtkey,sizeof(_rtkey)) + +#define rtNewContext() \ +rtNewContextUsingKey(_rtkey,sizeof(_rtkey)) + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CBitStr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CBitStr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1CBitStr.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CGeneralizedTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CGeneralizedTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1CGeneralizedTime.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CSeqOfList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CSeqOfList.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1CSeqOfList.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1CTime.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CUTCTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1CUTCTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,17 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +#include "rtsrc/ASN1CUTCTime.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1Context.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1Context.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1Context.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1TObjId.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1TObjId.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1TObjId.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1TOctStr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1TOctStr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1TOctStr.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1TTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/ASN1TTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/ASN1TTime.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CEvtHndlr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CEvtHndlr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1CEvtHndlr.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CharSet.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CharSet.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1CharSet.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CppEvtHndlr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CppEvtHndlr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1CppEvtHndlr.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CppTypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1CppTypes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1CppTypes.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1ErrCodes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1ErrCodes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1ErrCodes.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1PerCppTypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1PerCppTypes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,395 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// +// + +// CHANGE LOG +// Date Init Description +// 07/14/02 ED Lowercase method names +// 10/31/03 CZ Class descriptions +// 11/04/03 CZ Augment Documentation +// +// + +/** + * @file asn1PerCppTypes.h + * PER C++ type and class definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1PERCPPTYPES_H_ +#define _ASN1PERCPPTYPES_H_ + +#include "rtpersrc/asn1per.h" +#include "rtsrc/asn1CppTypes.h" + +/** @defgroup percppruntime PER C++ Runtime Classes. + * @{ + */ +/** + * The ASN.1 C++ runtime classes are wrapper classes that provide an + * object-oriented interface to the ASN.1 C runtime library functions. These + * classes are derived from the common classes documented in the ASN1C C/C++ + * Common Runtime Functions manual and are specific the Packed Encoding Rules + * (PER). +*/ + +/** @defgroup permsgbuffclas PER Message Buffer Classes + * These classes manage the buffers for encoding and decoding ASN.1 PER + * messages. @{ +*/ + +// ASN.1 PER message buffer class +/** + * The ASN1PERMessageBuffer class is derived from the ASN1MessageBuffer base + * class. It is the base class for the ASN1PEREncodeBuffer and + * ASN1PERDecodeBuffer derived classes. It contains variables and methods + * specific to encoding or decoding ASN.1 messages using the Packed Encoding + * Rules (PER). It is used to manage the buffer into which an ASN.1 message is + * to be encoded or decoded. +*/ +class EXTPERCLASS ASN1PERMessageBuffer : public ASN1MessageBuffer { + protected: + + /** + * This constructor does not set a PER input source. It is used by + * the derived encode buffer classes. Use the getStatus() method to + * determine if an error has occured during initialization. + * + * @param bufferType Type of message buffer that is being created (for + * example, PEREncode or PERDecode). + * @param aligned Flag indicating if aligned (TRUE) or unaligned + * (FALSE) encoding should be done. + */ + EXTPERMETHOD ASN1PERMessageBuffer (Type bufferType, OSBOOL aligned); + + + /** + * This constructor allows a memory buffer holding a binary PER message + * to be specified. Use the getStatus() method to determine if an error + * has occured during initialization. + * + * @param bufferType Type of message buffer that is being created (for + * example, PEREncode or PERDecode). + * @param pMsgBuf A pointer to a fixed size message buffer to recieve + * the encoded message. + * @param msgBufLen Size of the fixed-size message buffer. + * @param aligned Flag indicating if aligned (TRUE) or unaligned + * (FALSE) encoding should be done. + */ + EXTPERMETHOD ASN1PERMessageBuffer (Type bufferType, OSOCTET* pMsgBuf, + size_t msgBufLen, OSBOOL aligned); + + /** + * This constructor allows a memory buffer holding a binary PER message + * to be specified. It also allows a pre-existing context to be associated + * with this buffer. Use the getStatus() method to determine if an error + * has occured during initialization. + * + * @param bufferType Type of message buffer that is being created (for + * example, PEREncode or PERDecode). + * @param pMsgBuf A pointer to a fixed size message buffer to recieve + * the encoded message. + * @param msgBufLen Size of the fixed-size message buffer. + * @param aligned Flag indicating if aligned (TRUE) or unaligned + * (FALSE) encoding should be done. + * @param pContext A pointer to an OSRTContext structure. + */ + EXTPERMETHOD ASN1PERMessageBuffer (Type bufferType, OSOCTET* pMsgBuf, + size_t msgBufLen, OSBOOL aligned, OSRTContext *pContext); + public: + + /** + * This method outputs a binary dump of the current buffer contents to + * stdout. + * + * @param varname char pointer to current buffer + */ + inline void binDump (const char* varname) { + pu_bindump (mpContext->getPtr(), (char*)varname); + } + + /** + * This method outputs a hexadecimal dump of the current buffer contents to + * stdout. + * + * @param - none + */ + inline void hexDump () { + pu_hexdump (mpContext->getPtr()); + } + + /** + * This method returns the length of a previously encoded PER message. + * + * @param - none + */ + inline size_t getMsgLen () { + return pu_getMsgLen (mpContext->getPtr()); + } + + /** + * This method turns PER diagnostic tracing on or off. + * + * This enables the collection of the bit statistics inside the PER library + * functions that can be displayed using the binDump method. + * + * @param value Boolean value indicating whether tracing should be on + * (true) or off (false). + */ + inline void setTrace (OSBOOL value) { + pu_setTrace (mpContext->getPtr(), value); + } + + /** + * This method sets a buffer to receive the encoded message. + * + * @param pMsgBuf A pointer to a memory buffer to use to encode a + * message. The buffer should be declared as an array + * of unsigned characters (OSOCTETs). This parameter + * can be set to NULL to specify dynamic encoding + * (i.e., the encode functions will dynamically + * allocate a buffer for the message). + * @param msgBufLen The length of the memory buffer in bytes. If pMsgBuf + * is NULL, this parameter specifies the initial size + * of the dynamic buffer; if 0 - the default size will + * be used. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTPERMETHOD int setBuffer (const OSOCTET* pMsgBuf, size_t msgBufLen); + + // deprecated methods + inline void BinDump (const char* varname) { binDump (varname); } + inline void HexDump () { hexDump (); } + inline int GetMsgLen () { return (int)getMsgLen (); } + inline void SetTrace (OSBOOL value) { setTrace (value); } +} ; + +// ASN.1 PER encode message buffer class +/** + * The ASN1PEREncodeBuffer class is derived from the ASN1PERMessageBuffer base + * class. It contains variables and methods specific to encoding ASN.1 + * messages. It is used to manage the buffer into which an ASN.1 PER message + * is to be encoded. + */ +class EXTPERCLASS ASN1PEREncodeBuffer : public ASN1PERMessageBuffer { + public: + /** + * The ASN1PEREncodeBuffer class has three overloaded constructors: This + * version that takes one argument, aligned flag (dynamic encoding version). + * Use getStatus() method to determine has error occured during the + * initialization or not. + * + * @param aligned Flag indicating if aligned (TRUE) or unaligned + * (FALSE) encoding should be done. + */ + ASN1PEREncodeBuffer (OSBOOL aligned) : + ASN1PERMessageBuffer (PEREncode, aligned) {} + + /** + * The ASN1PEREncodeBuffer class has three overloaded constructors: This + * version that takes a message buffer and size argument and an aligned flag + * argument (static encoding version). Use getStatus() method to determine + * has error occured during the initialization or not. + * + * @param pMsgBuf A pointer to a fixed-size message buffer to receive + * the encoded message. + * @param msgBufLen Size of the fixed-size message buffer. + * @param aligned Flag indicating if aligned (TRUE) or unaligned + * (FALSE) encoding should be done. + */ + ASN1PEREncodeBuffer (OSOCTET* pMsgBuf, size_t msgBufLen, OSBOOL aligned) + : ASN1PERMessageBuffer (PEREncode, pMsgBuf, msgBufLen, aligned) {} + + + /** + * The ASN1PEREncodeBuffer class has three overloaded constructors: This + * version that takes a message buffer and size argument and an aligned flag + * argument (static encoding version). Use getStatus() method to determine + * has error occured during the initialization or not. + * + * @param pMsgBuf A pointer to a fixed-size message buffer to receive + * the encoded message. + * @param msgBufLen Size of the fixed-size message buffer. + * @param aligned Flag indicating if aligned (TRUE) or unaligned + * (FALSE) encoding should be done. + * @param pContext A pointer to an OSRTContext structure created by + * the user. + */ + ASN1PEREncodeBuffer (OSOCTET *pMsgBuf, size_t msgBufLen, OSBOOL aligned, + OSRTContext *pContext) : ASN1PERMessageBuffer (PEREncode, pMsgBuf, + msgBufLen, aligned, pContext) { } + + /** + * This method returns the length (in bits) of the encoded message. + * + * @return Length(in bits)of encoded message + */ + inline size_t getMsgBitCnt () { + return pe_GetMsgBitCnt (mpContext->getPtr()); + } + + /** + * This method returns a copy of the current encoded message. Memory is + * allocated for the message using the 'new' operation. It is the user's + * responsibility to free the memory using 'delete'. + * + * @return Pointer to copy of encoded message. It is the user's + * responsibility to release the memory using the + * 'delete' operator (i.e., delete [] ptr;) + */ + virtual EXTPERMETHOD OSOCTET* getMsgCopy (); + + /** + * This method returns the internal pointer to the current encoded message. + * + * @return Pointer to encoded message. + */ + virtual EXTPERMETHOD const OSOCTET* getMsgPtr (); + + /** + * This method reinitializes the encode buffer pointer to allow a new + * message to be encoded. This makes it possible to reuse one message buffer + * object in a loop to encode multiple messages. After this method is + * called, any previously encoded message in the buffer will be overwritten + * on the next encode call. + * + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTPERMETHOD int init (); + + /** + * This method checks the type of the message buffer. + * + * @param bufferType Enumerated identifier specifying a derived class. The + * only possible value for this class is PEREncode. + * @return Boolean result of the match operation. True if this + * is the class corresponding to the identifier + * argument. + */ + virtual OSBOOL isA (int bufferType) { + return bufferType == PEREncode; + } + + // deprecated methods + inline int GetMsgBitCnt () { return (int)getMsgBitCnt(); } + +} ; + +// ASN.1 PER decode message buffer class +/** + * The ASN1PERDecodeBuffer class is derived from the ASN1PERMessageBuffer base + * class. It contains variables and methods specific to decoding ASN.1 PER + * messages. It is used to manage the input buffer containing the ASN.1 message + * to be decoded. This class has 3 overloaded constructors. + * + + */ +class EXTPERCLASS ASN1PERDecodeBuffer : public ASN1PERMessageBuffer { + public: + /** + * This is a default constructor. Use getStatus() method to determine has + * error occured during the initialization or not. + * + * @param aligned Flag indicating if the message was encoded using + * aligned (TRUE)* or unaligned (FALSE) encoding. + */ + ASN1PERDecodeBuffer (OSBOOL aligned) : + ASN1PERMessageBuffer (PERDecode, aligned) + {} + + /** + * This constructor is used to describe the message to be decoded. Use + * getStatus() method to determine has error occured during the + * initialization or not. + * + * @param pMsgBuf A pointer to the message to be decoded. + * @param msgBufLen Length of the message buffer. + * @param aligned Flag indicating if the message was encoded using + * aligned (TRUE) * or unaligned (FALSE) encoding. + */ + ASN1PERDecodeBuffer (const OSOCTET* pMsgBuf, + size_t msgBufLen, OSBOOL aligned) : + ASN1PERMessageBuffer (PERDecode, (OSOCTET*)pMsgBuf, msgBufLen, aligned) + {} + + /** + * This constructor is used to describe the message to be decoded. Use + * getStatus() method to determine has error occured during the + * initialization or not. + * + * @param pMsgBuf A pointer to the message to be decoded. + * @param msgBufLen Length of the message buffer. + * @param aligned Flag indicating if the message was encoded using + * aligned (TRUE) * or unaligned (FALSE) encoding. + * @param pContext A pointer to an OSRTContext structure created by + * the user. + */ + ASN1PERDecodeBuffer (const OSOCTET* pMsgBuf, + size_t msgBufLen, OSBOOL aligned, + OSRTContext *pContext) : + ASN1PERMessageBuffer (PERDecode, (OSOCTET*)pMsgBuf, msgBufLen, aligned, + pContext) {} + + /** + * This constructor takes a pointer to the path of a file containing + * a binary PER message to be decoded. + * + * @param filePath Complete file path and name of file to read. + * @param aligned Flag indicating if the message was encoded using + * aligned (TRUE) * or unaligned (FALSE) encoding. + */ + EXTPERMETHOD ASN1PERDecodeBuffer (const char* filePath, OSBOOL aligned); + + /** + * This method checks the type of the message buffer. + * + * @param bufferType Enumerated identifier specifying a derived class. The + * only possible value for this class is PERDecode. + * @return Boolean result of the match operation. True if this + * is the class corresponding to the identifier + * argument. + */ + virtual OSBOOL isA (int bufferType) { + return bufferType == PERDecode; + } + + /** + * This method reads the file into the buffer to decode. + * + * @param filePath The zero-terminated string containing the path to the + * file. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTPERMETHOD int readBinaryFile (const char* filePath); +} ; + + +/** @}permsgbuffclas + +*/ +/** @}percppruntime + + */ +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1compat.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1compat.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1compat.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1intl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1intl.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1intl.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1per.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1per.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,2348 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/* +// CHANGE LOG +// Date Init Description +// 04/30/02 AB Added Universal string routines +// 05/08/02 AB Added p?_oid64 prototypes +// 05/10/02 AB Added RELATIVE-OID +// 10/15/02 ED Changes to PER permitted alphabet constraint +// handling. +// 10/27/02 AB Int64/UInt64 encode/decode funcs added +// 11/06/02 AB PD_BYTE_ALIGN0 added +// 10/31/03 CZ Expand mainpage text. +// +// +*/ +/** + * @file rtpersrc/asn1per.h + * ASN.1 runtime constants, data structure definitions, and functions to + * support the Packet Encoding Rules (PER) as defined in the ITU-T X.691 + * standard. + */ + +/** + * @mainpage ASN1C PER Runtime Classes and Library Functions + * + * The ASN.1 C++ runtime classes are wrapper classes that provide + * an object-oriented interface to the ASN.1 C runtime library functions. + * The classes described in this manual are derived from the common + * classes documented in the ASN1C C/C++ Common runtime manual. + * They are specific to the Packed Encoding Rules (PER)as defined in + * the X.691 ITU-T standard. These PER specific C++ runtime classes + * include the PER message buffer classes. + * + * The ASN.1 PER Runtime Library contains the low-level + * constants, types, and functions that are assembled by the compiler + * to encode/decode more complex structures. + * + * This library consists of the following items: + *
  • A global include file ("rtpersrc/asn1per.h") that is compiled into all + * generated source files.
  • + *
  • An object library of functions that are linked with the C functions + * after compilation with a C complier.
+ * + * In general, programmers will not need to be too concerned with the details + * of these functions. The ASN.1 compiler generates calls to them in the C or + * C++ source files that it creates. However, the functions in the library may + * also be called on their own in applications requiring their specific + * functionality. + */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTPER_H_ +#define _OSRTPER_H_ + +#include "rtsrc/asn1type.h" +#include "rtsrc/asn1CharSet.h" + +/** @defgroup perruntime PER Runtime Library Functions. + * @{ + * The ASN.1 Packed Encoding Rules (PER) runtime library contains the + * low-level constants, types, and functions that are assembled by the + * compiler to encode/decode more complex structures. + * The PER low-level C encode/decode functions are identified by their + * prefixes: pe_ for PER encode, pd_ for PERdecode, and pu_ for PER + * utility functions. + * + */ + + +/* The following constant is stored in an enumerated value if the */ +/* parsed value is not within the defined set of extended enum values */ +/* (note: this is only done in the case of PER because the actual value */ +/* is not known - in BER, the actual value is stored).. */ + +#define ASN_K_EXTENUM 999 + +/* +*Structure to track encoded PER fields +*/ + +typedef struct PERField { + const char* name; + size_t bitOffset; + size_t numbits; +} PERField; + +/* +*Structure to track encoded PER fields +*/ +typedef struct { + unsigned char lb, lbm; + char fmtBitBuffer[40], fmtHexBuffer[10], fmtAscBuffer[10]; + int fmtBitCharIdx, fmtHexCharIdx, fmtAscCharIdx; +} BinDumpBuffer; + +/* Macro to create a character set */ + +#define PU_SETCHARSET(csetvar, canset, abits, ubits) \ +csetvar.charSet.nchars = 0; \ +csetvar.canonicalSet = canset; \ +csetvar.canonicalSetSize = sizeof(canset)-1; \ +csetvar.canonicalSetBits = pu_bitcnt(csetvar.canonicalSetSize); \ +csetvar.charSetUnalignedBits = ubits; \ +csetvar.charSetAlignedBits = abits; + + +/* Macros */ + +#ifdef _TRACE +#define PU_INSLENFLD(pctxt) pu_insLenField(pctxt) +#define PU_NEWFIELD(pctxt,suffix) pu_newField(pctxt,suffix) +#define PU_PUSHNAME(pctxt,name) pu_pushName(pctxt,name) +#define PU_POPNAME(pctxt) pu_popName(pctxt) +#define PU_SETBITOFFSET(pctxt) pu_setFldBitOffset(pctxt) +#define PU_SETBITCOUNT(pctxt) pu_setFldBitCount(pctxt) +#define PU_PUSHELEMNAME(pctxt,idx) pu_pushElemName(pctxt,idx) +#else +#define PU_INSLENFLD(pctxt) +#define PU_NEWFIELD(pctxt,suffix) +#define PU_PUSHNAME(pctxt,name) +#define PU_POPNAME(pctxt) +#define PU_SETBITOFFSET(pctxt) +#define PU_SETBITCOUNT(pctxt) +#define PU_PUSHELEMNAME(pctxt,idx) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __SYMBIAN32__ /* For Symbian */ +#define EXTPERCLASS + +#ifdef BUILDASN1PERDLL +#define EXTERNPER EXPORT_C +#define EXTPERMETHOD EXPORT_C +#elif defined(USEASN1PERDLL) +#define EXTERNPER IMPORT_C +#define EXTPERMETHOD IMPORT_C +#else +#define EXTERNPER +#define EXTPERMETHOD +#endif /* BUILDASN1PERDLL */ + +#else /* Other O/S's */ +#define EXTPERMETHOD + +#ifdef BUILDASN1PERDLL +#define EXTERNPER __declspec(dllexport) +#define EXTPERCLASS __declspec(dllexport) +#elif defined (USEASN1PERDLL) +#define EXTERNPER __declspec(dllimport) +#define EXTPERCLASS __declspec(dllimport) +#else +#define EXTERNPER +#define EXTPERCLASS +#endif /* BUILDASN1PERDLL */ + +#endif + +/* Function prototypes */ + +#define PD_INCRBITIDX(pctxt) \ +((--(pctxt)->buffer.bitOffset < 0) ? \ +((++(pctxt)->buffer.byteIndex >= (pctxt)->buffer.size) ? RTERR_ENDOFBUF : \ +((pctxt)->buffer.bitOffset = 7, 0)) : 0) + +/* This macro is an optimized version of pd_bit function */ + +#define PD_BIT(pctxt,pvalue) \ +((PD_INCRBITIDX (pctxt) != 0) ? RTERR_ENDOFBUF : ((pvalue) ? \ +((*(pvalue) = (OSOCTET)((((pctxt)->buffer.data[(pctxt)->buffer.byteIndex]) & \ +(OSINTCONST(1) << (pctxt)->buffer.bitOffset)) != 0)), 0) : 0 )) + +/* This macro is an optimized version of pu_getSizeConstraint function */ + +#define PU_GETSIZECONSTRAINT(pctxt,extbit,pSize) \ +((((pSize) = ACINFO(pctxt)->pSizeConstraint) != 0) ? \ +((((pSize) = ACINFO(pctxt)->pSizeConstraint)->extended == extbit)?(pSize) : \ +pu_getSizeConstraint (pctxt,extbit)) : NULL) + +/* This macro calculates the relative bit offset to the current buffer position. */ + +#define PU_GETCTXTBITOFFSET(pctxt) \ +(((pctxt)->buffer.byteIndex * 8) + (8 - (pctxt)->buffer.bitOffset)) + +/* This macro sets the bit offset to the given value within the context */ + +#define PU_SETCTXTBITOFFSET(pctxt,_bitOffset) \ +do { \ +(pctxt)->buffer.byteIndex = (_bitOffset / 8); \ +(pctxt)->buffer.bitOffset = (OSUINT16)(8 - (_bitOffset % 8)); \ +} while(0) + +/* These macros are an optimized version of pd_byte_align function */ + +#define PD_BYTE_ALIGN0(pctxt) \ +((!(pctxt)->buffer.aligned) ? 0 : \ +(((pctxt)->buffer.bitOffset != 8) ? ( \ +(pctxt)->buffer.byteIndex++, \ +(pctxt)->buffer.bitOffset = 8, \ +0) : 0 \ +)) + +#ifdef _TRACE +#define PD_BYTE_ALIGN(pctxt) \ +((!(pctxt)->buffer.aligned) ? 0 : \ +(((pctxt)->buffer.bitOffset != 8) ? ( \ +(pctxt)->buffer.byteIndex++, \ +(pctxt)->buffer.bitOffset = 8, \ +pu_setFldBitOffset(pctxt), \ +0) : 0 \ +)) +#else +#define PD_BYTE_ALIGN PD_BYTE_ALIGN0 +#endif + +#define PD_CHECKSEQOFLEN(pctxt,numElements,minElemBits) \ +((pctxt->buffer.size > 0) ? \ +(((numElements * minElemBits) > (pctxt->buffer.size * 8)) ? \ +ASN_E_INVLEN : 0) : 0) + +/** @defgroup perdecruntime PER C Decode Functions. + * @{ + * + * PER runtime library decode functions handle the decoding of the primitive + * ASN.1 data types and length variables. Calls to these functions are + * assembled in the C source code generated by the ASN1C complier to decode + * complex ASN.1 structures. These functions are also directly callable from + * within a user's application program if the need to decode a primitive item + * exists. + * + * The procedure to decode a primitive data item is as follows: + * -# Call the pu_newContext or pu_initContext function to specify the + * address of the buffer containing the encoded ASN.1 data to be decoded and + * whether the data is aligned, or unaligned. + * -# Call the specific decode function to decode the value. + */ + +/** + * This function will decode a single bit a place the result in an ASN.1 + * BOOLEAN type variable. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pvalue A pointer to the BOOLEAN value to receive the decoded + * result. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_bit (OSCTXT* pctxt, OSBOOL* pvalue); + +/** + * This function will decode a series of multiple bits and place the results in + * an unsigned integer variable. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pvalue A pointer to an unsigned integer variable to receive the + * decoded result. + * @param nbits The number of bits to decode. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_bits +(OSCTXT* pctxt, OSUINT32* pvalue, OSUINT32 nbits); + +/** + * This function decodes a variable of the ASN.1 INTEGER type. In this case, + * the integer is assumed to be of a larger size than can fit in a C or C++ + * long type (normally 32 or 64 bits). For example, parameters used to + * calculate security values are typically larger than these sizes. These + * variables are stored in character string constant variables. They are + * represented as hexadecimal strings starting with "0x" prefix. If it is + * necessary to convert a hexadecimal string to another radix, then use the + * ::rtxBigIntSetStr / ::rtxBigIntToString functions. + * + * @param pctxt Pointer to context block structure. + * @param ppvalue Pointer to a character pointer variable to receive the + * decoded unsigned value. Dynamic memory is allocated + * for the variable using the ::rtxMemAlloc function. The + * decoded variable is represented as a decimal string + * starting with no prefix. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_BigInteger (OSCTXT *pctxt, const char** ppvalue); + +/** + * This variant of the pd_BigInteger function allows the user to select + * the radix of the decoded integer string. + * + * @param pctxt Pointer to context block structure. + * @param ppvalue Pointer to a character pointer variable to receive the + * decoded unsigned value. Dynamic memory is allocated + * for the variable using the ::rtxMemAlloc function. The + * decoded variable is represented as a decimal string + * starting with no prefix. + * @param radix Radix to be used for decoded string. Valid values + * are 2, 8, 10, or 16. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_BigIntegerEx (OSCTXT *pctxt, const char** ppvalue, int radix); + +/** + * This function will decode a value of the ASN.1 bit string type whose maximum + * size is is known in advance. The ASN1C complier generates a call to this + * function to decode bit string productions or elements that contain a size + * constraint. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param numbits_p Pointer to an unsigned integer variable to receive + * decoded number of bits. + * @param buffer Pointer to a fixed-size or pre-allocated array of bufsiz + * octets to receive a decoded bit string. + * @param bufsiz Length (in octets) of the buffer to receive the decoded + * bit string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_BitString +(OSCTXT* pctxt, OSUINT32* numbits_p, OSOCTET* buffer, + OSUINT32 bufsiz); + +/** + * This function will decode a variable of the ASN.1 BMP character string. This + * differs from the decode routines for the character strings previously + * described in that the BMP string type is based on 16-bit characters. A + * 16-bit character string is modeled using an array of unsigned short + * integers. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pvalue Pointer to character string structure to receive the + * decoded result. The structure includes a count field + * containing the number of characters and an array of + * unsigned short integers to hold the 16-bit character + * values. + * @param permCharSet A pointer to the constraining character set. This + * contains an array containing all valid characters in + * the set as well as the aligned and unaligned bit + * counts required to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_BMPString +(OSCTXT* pctxt, ASN1BMPString* pvalue, Asn116BitCharSet* permCharSet); + +/** + * This function will decode a variable of the ASN.1 32-bit character string. + * This differs from the decode routines for the character strings previously + * described because the universal string type is based on 32-bit characters. A + * 32-bit character string is modeled using an array of unsigned integers. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pvalue Pointer to character string structure to receive the + * decoded result. The structure includes a count field + * containing the number of characters and an array of + * unsigned short integers to hold the 32-bit character + * values. + * @param permCharSet A pointer to the constraining character set. This + * contains an array containing all valid characters in + * the set as well as the aligned and unaligned bit + * counts required to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_UniversalString +(OSCTXT* pctxt, ASN1UniversalString* pvalue, Asn132BitCharSet* permCharSet); + +/** + * This function will position the decode bit cursor on the next byte boundary. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_byte_align (OSCTXT* pctxt); + +/** + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param object_p2 A pointer to an open type variable to receive the + * decoded data. + * @param pnumocts A pointer to an unsigned buffer of bufsiz octets to + * receive decoded data. + */ +EXTERNPER int pd_ChoiceOpenTypeExt +(OSCTXT* pctxt, const OSOCTET** object_p2, OSUINT32* pnumocts); + +/** + * This function will decode an integer constrained either by a value or value + * range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to integer variable to receive decoded value. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsInteger +(OSCTXT* pctxt, OSINT32* pvalue, OSINT32 lower, OSINT32 upper); + +/** + * This function will decode an 8-bit integer constrained either by a value or + * value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 8-bit integer variable to receive decoded + * value. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsInt8 +(OSCTXT* pctxt, OSINT8* pvalue, OSINT32 lower, OSINT32 upper); + +/** + * This function will decode a 16-bit integer constrained either by a value or + * value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 16-bit integer variable to receive decoded + * value. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsInt16 (OSCTXT* pctxt, + OSINT16* pvalue, OSINT32 lower, OSINT32 upper); + +/** + * This function will decode a 64-bit integer constrained either by a value or + * value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 64-bit integer variable to receive decoded + * value. + * @param lower Lower range value, represented as 64-bit integer. + * @param upper Upper range value, represented as 64-bit integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsInt64 (OSCTXT* pctxt, + OSINT64* pvalue, OSINT64 lower, OSINT64 upper); + +/** + * This function will decode an unsigned integer constrained either by a value + * or value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to unsigned integer variable to receive decoded + * value. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsUnsigned +(OSCTXT* pctxt, OSUINT32* pvalue, OSUINT32 lower, OSUINT32 upper); + +/** + * This function will decode an 8-bit unsigned integer constrained either by a + * value or value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 8-bit unsigned integer variable to receive + * decoded value. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsUInt8 (OSCTXT* pctxt, + OSUINT8* pvalue, OSUINT32 lower, OSUINT32 upper); + +/** + * This function will decode a 16-bit unsigned integer constrained either by a + * value or value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 16-bit unsigned integer variable to receive + * decoded value. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsUInt16 +(OSCTXT* pctxt, OSUINT16* pvalue, OSUINT32 lower, OSUINT32 upper); + +/** + * This function will decode a 64-bit unsigned integer constrained either by a + * value or value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 64-bit unsigned integer variable to receive + * decoded value. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsUInt64 (OSCTXT* pctxt, OSUINT64* pvalue, + OSUINT64 lower, OSUINT64 upper); + +/** + * This function decodes a constrained whole number as specified in Section + * 10.5 of the X.691 standard. + * + * @param pctxt Pointer to context block structure. + * @param padjusted_value Pointer to unsigned adjusted integer value to + * receive decoded result. To get the final value, + * this value is added to the lower boundary of the + * range. + * @param range_value Unsigned integer value specifying the total size + * of the range. This is obtained by subtracting + * the lower range value from the upper range + * value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsWholeNumber +(OSCTXT* pctxt, OSUINT32* padjusted_value, OSUINT32 range_value); + +/** + * This function decodes a constrained whole number as specified in Section + * 10.5 of the X.691 standard, represented as 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param padjusted_value Pointer to 64-bit unsigned adjusted integer value + * to receive decoded result. To get the final + * value, this value is added to the lower boundary + * of the range. + * @param range_value Unsigned 64-bit integer value specifying the total + * size of the range. This is obtained by + * subtracting the lower range value from the upper + * range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConsWholeNumber64 +(OSCTXT* pctxt, OSUINT64* padjusted_value, OSUINT64 range_value); + +/** + * This function decodes a constrained string value. This is a deprecated + * version of the function provided for backward compatibility. + * + * @param pctxt Pointer to context block structure. + * @param string Pointer to const char* to receive decoded string. Memory + * will be allocated for this variable using internal + * memory management functions. + * @param pCharSet Pointer to a character set descriptor structure. This + * contains an array containing all valid characters in + * the set as well as the aligned and unaligned bit + * counts required to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConstrainedString +(OSCTXT* pctxt, const char** string, Asn1CharSet* pCharSet); + +/** + * This function decodes a constrained string value. This version of the + * function allows all of the required permitted alphabet constraint parameters + * to be passed in as arguments. + * + * @param pctxt Pointer to context block structure. + * @param string Pointer to const char* to receive decoded string. Memory + * will be allocated for this variable using internal + * memory management functions. + * @param charSet String containing permitted alphabet character set. Can + * be null if no character set was specified. + * @param abits Number of bits in a character set character (aligned). + * @param ubits Number of bits in a character set character (unaligned). + * @param canSetBits Number of bits in a character from the canonical set + * representing this string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ConstrainedStringEx +(OSCTXT* pctxt, const char** string, const char* charSet, + OSUINT32 abits, OSUINT32 ubits, OSUINT32 canSetBits); + +/** + * This function will encode a constrained ASN.1 character string. This + * function is normally not called directly but rather is called from Useful + * Type Character String encode functions that deal with 16-bit strings. The + * only function that does not release is the pe_BMPString function. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pString Character string to be encoded. The structure includes a + * count field containing the number of characters to + * encode and an array of unsigned short integers to hold + * the 16-bit characters to be encoded. + * @param pCharSet Pointer to the constraining character set. This contains + * an array containing all valid characters in the set as + * well as the aligned and unaligned bit counts required + * to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_16BitConstrainedString +(OSCTXT* pctxt, Asn116BitCharString* pString, Asn116BitCharSet* pCharSet); + +/** + * This function will encode a constrained ASN.1 character string. This + * function is normally not called directly but rather is called from Useful + * Type Character String encode functions that deal with 32-bit strings. The + * only function that does not release is the pe_UniversalString function. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pString Character string to be encoded. The structure includes a + * count field containing the number of characters to + * encode and an array of unsigned short integers to hold + * the 32-bit characters to be encoded. + * @param pCharSet Pointer to the constraining character set. This contains + * an array containing all valid characters in the set as + * well as the aligned and unaligned bit counts required + * to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_32BitConstrainedString +(OSCTXT* pctxt, Asn132BitCharString* pString, Asn132BitCharSet* pCharSet); + +/** + * This function will decode a variable of thr ASN.1 BIT STRING type. This + * function allocates dynamic memory t store the decoded result. The ASN1C + * complier generates a call to this function to decode an unconstrained bit + * string production or element. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pBitStr Pointer to a dynamic bit string structure to receive the + * decoded result. This structure contains a field to + * hold the number of decoded bits and a pointer to an + * octet string to hold the decoded data. Memory is + * allocated by the decoder using the rtxMemAlloc + * function. This memory is tracked within the context + * and released when the pu_freeContext function is + * invoked. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_DynBitString +(OSCTXT* pctxt, ASN1DynBitStr* pBitStr); + +/** + * This function will decode a value of the ASN.1 octet string type whose + * maximum size is known in advance. The ASN1C complier generates a call to + * this function to decode octet string productions or elements that contain a + * size constraint. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pOctStr A pointer to a dynamic octet string to receive the + * decoded result. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_DynOctetString +(OSCTXT* pctxt, ASN1DynOctStr* pOctStr); + +/** + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param itemBits The size of the specific entity. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_GetComponentLength +(OSCTXT* pctxt, OSUINT32 itemBits); + +/** + * This function will decode a length determinant value. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pvalue A pointer to an unsigned integer variable to receive the + * decoded length value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_Length (OSCTXT* pctxt, OSUINT32* pvalue); + +/** + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param bitOffset The bit offset inside the message buffer. + */ +EXTERNPER int pd_moveBitCursor (OSCTXT* pctxt, int bitOffset); + +/** + * This function decodes a value of the ASN.1 object identifier type. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to value to receive decoded result. The + * ASN1OBJID structure contains an integer to hold the + * number of subidentifiers and an array to hold the + * subidentifier values. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_ObjectIdentifier (OSCTXT* pctxt, ASN1OBJID* pvalue); + +/** + * This function decodes a value of the ASN.1 object identifier type using + * 64-bit subidentifiers. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to value to receive decoded result. The + * ASN1OID64 structure contains an integer to hold the + * number of subidentifiers and an array of 64-bit + * unsigned integers to hold the subidentifier values. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_oid64 (OSCTXT* pctxt, ASN1OID64* pvalue); + +/** + * This function decodes a value of the ASN.1 RELATIVE-OID type. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to value to receive decoded result. The + * ASN1OBJID structure contains an integer to hold the + * number of subidentifiers and an array to hold the + * subidentifier values. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_RelativeOID (OSCTXT* pctxt, ASN1OBJID* pvalue); + +/** + * This function will decode a value of the ASN.1 octet string type whose + * maximun size is known in advance. The ASN1C compiler generates a call to + * this function to decode octet string productions or elements that contain a + * size constraint. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pnumocts A pointer to an unsigned buffer of bufsiz octets to + * receive decoded data. + * @param buffer A pointer to a pre-allocated buffer of size octets to + * receive the decoded data. + * @param bufsiz The size of the buffer to receive the decoded result. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_OctetString +(OSCTXT* pctxt, OSUINT32* pnumocts, OSOCTET* buffer, + OSUINT32 bufsiz); + +/** + * This function will decode an ASN.1 open type. This used to be the ASN.1 ANY + * type, but now is used in a variety of applications requiring an encoding that + * can be interpreted by a decoder without prior knowledge of the type of the + * variable. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pnumocts A pointer to an unsigned buffer of bufsiz octets to + * receive decoded data. + * @param object_p2 A pointer to an open type variable to receive the + * decoded data. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_OpenType +(OSCTXT* pctxt, const OSOCTET** object_p2, OSUINT32* pnumocts); + +/** + * This function will decode an ASN.1 open type extension. These are extra + * fields in a version-2 message that may be present after the ... extension + * marker. An open type structure (extElem1) is added to a message structure + * that contains an extension marker but no extension elements. The + * pd_OpenTypeExt function will populate this structure with the complete + * extension information (optional bit or choice index, length and data). A + * subsequent call to pe_OpenTypeExt will cause the saved extension fields to + * be included in a newly encoded message of the given type. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param object_p2 A pointer to an open type variable to receive the + * decoded data. + * @param pnumocts A pointer to an unsigned buffer of bufsiz octets to + * receive decoded data. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_OpenTypeExt +(OSCTXT* pctxt, const OSOCTET** object_p2, OSUINT32* pnumocts); + +/** + * This function will decode a value of the binary encoded ASN.1 real type. + * This function provides support for the plus-infinity special real values. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all workings variables + * that must be maintained between function calls. + * @param pvalue Pointer to an real variable to receive decoded + * value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_Real +(OSCTXT* pctxt, OSREAL* pvalue); + +/** + * This function will decode a small non-negative whole number as specified in + * Section 10.6 of the X.691 standard. This is a number that is expected to be + * small, but whose size is potentially unlimited due to the presence of an + * extension maker. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all workings variables + * that must be maintained between function calls. + * @param pvalue Pointer to an unsigned integer value to receive decoded + * results. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_SmallNonNegWholeNumber +(OSCTXT* pctxt, OSUINT32* pvalue); + +/** + * This function will decode a semi-constrained integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to integer variable to receive decoded value. + * @param lower Lower range value, represented as signed + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_SemiConsInteger + (OSCTXT* pctxt, OSINT32* pvalue, OSINT32 lower); + +/** + * This function will decode a semi-constrained unsigned integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to unsigned integer variable to receive decoded + * value. + * @param lower Lower range value, represented as unsigned + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_SemiConsUnsigned + (OSCTXT* pctxt, OSUINT32* pvalue, OSUINT32 lower); + +/** + * This function will decode a semi-constrained 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 64-bit integer variable to receive decoded + * value. + * @param lower Lower range value, represented as signed 64-bit + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_SemiConsInt64 + (OSCTXT* pctxt, OSINT64* pvalue, OSINT64 lower); + +/** + * This function will decode a semi-constrained unsigned 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to unsigned 64-bit integer variable to receive + * decoded value. + * @param lower Lower range value, represented as unsigned 64-bit + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_SemiConsUInt64 + (OSCTXT* pctxt, OSUINT64* pvalue, OSUINT64 lower); + + +/** + * This function will decode an unconstrained integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to integer variable to receive decoded value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_UnconsInteger (OSCTXT *pctxt, OSINT32* pvalue); + +/** + * This function will decode an unconstrained unsigned integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to unsigned integer variable to receive decoded + * value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +#define pd_UnconsUnsigned(pctxt,pvalue) \ +pd_SemiConsUnsigned(pctxt, pvalue, 0U) + +/** + * This function will decode an unconstrained 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to 64-bit integer variable to receive decoded + * value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_UnconsInt64 (OSCTXT *pctxt, OSINT64* pvalue); + +/** + * This function will decode an unconstrained unsigned 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to unsigned 64-bit integer variable to receive + * decoded value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +#define pd_UnconsUInt64(pctxt,pvalue) \ +pd_SemiConsUInt64(pctxt, pvalue, 0) + +/** + * This function will decode a variable of the ASN.1 character string. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to a character pointer variable to receive the + * decoded result. Dynamic memory is allocated + * for the variable using the ::rtxMemAlloc function. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_VarWidthCharString (OSCTXT* pctxt, const char** pvalue); + +/** + * This function will decode a value of the decimal encoded ASN.1 real type. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all workings variables + * that must be maintained between function calls. + * @param ppvalue Pointer to a character pointer variable to receive the + * decoded result. Dynamic memory is allocated + * for the variable using the ::rtxMemAlloc function. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pd_Real10 (OSCTXT *pctxt, const char** ppvalue); + +/** @} perdecruntime */ + +/* Encode functions */ +/** @defgroup perencruntime PER C Encode Functions. + * @{ + * + * The Per low-level encode functions handle the PER encoding of the primitive + * ASN.1 data types. Calls to these functions are assembled in the C source + * code generated by the ASN1C complier to accomplish the encoding of complex + * ASN.1 structures. These functions are also directly callable from within a + * user's application program if the need to accomplish a low level encoding + * function exists. + * + * The procedure to call a low-level encode function is the same as the + * procedure to call a compiler generated encode function described above. The + * pu_newContext function must first be called to set a pointer to the buffer + * into which the variable is to be encoded. A static encode buffer is + * specified by assigning a pointer to a buffer and a buffer size. Setting the + * buffer address to NULL and buffer size to 0 specifies a dynamic buffer. The + * encode function is then invoked. The result of the encoding will start at + * the beginning of the specified buffer, or, if a dynamic buffer was used, + * only be obtained by calling pe_GetMsgPtr. The length of the encoded compound + * is obtained by calling pe_GetMsgLen. + */ + +/** + * This function will encode a constrained ASN.1 character string. This + * function is normally not called directly but rather is called from Useful + * Type Character String encode functions that deal with 16-bit strings. The + * only function that does that in this release is the pe_BMPString function. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value Character string to be encoded. The structure includes a + * count field containing the number of characters to + * encode and an array of unsigned short integers to hold + * the 16-bit characters to be encoded. + * @param pCharSet Pointer to the constraining character set. The contains + * an array containing all valid characters in the set as + * well as the aligned and unaligned bit counts required + * to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_16BitConstrainedString +(OSCTXT* pctxt, Asn116BitCharString value, Asn116BitCharSet* pCharSet); + +/** + * This function will encode a constrained ASN.1 character string. This + * function is normally not called directly but rather is called from Useful + * Type Character String encode functions that deal with 32-bit strings. The + * only function that does that in this release is the pe_UniversalString + * function. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value Character string to be encoded. The structure includes a + * count field containing the number of characters to + * encode and an array of unsigned short integers to hold + * the 32-bit characters to be encoded. + * @param pCharSet Pointer to the constraining character set. The contains + * an array containing all valid characters in the set as + * well as the aligned and unaligned bit counts required + * to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_32BitConstrainedString +(OSCTXT* pctxt, Asn132BitCharString value, Asn132BitCharSet* pCharSet); + +/** + * This function encodes a two's complement binary integer as specified in + * Section 10.4 of the X.691 standard. + * + * @param pctxt Pointer to context block structure. + * @param value Signed integer value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_2sCompBinInt +(OSCTXT* pctxt, OSINT32 value); + +/** + * This function encodes a two's complement binary 64-bit integer as specified + * in Section 10.4 of the X.691 standard. + * + * @param pctxt Pointer to context block structure. + * @param value Signed 64-bit integer value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_2sCompBinInt64 (OSCTXT* pctxt, OSINT64 value); + +/** + * @param pctxt Pointer to context block structure. + * @param pvalue A pointer to a character string containing the value to + * be encoded. + * @param nocts The number of octets. + */ +EXTERNPER int pe_aligned_octets +(OSCTXT* pctxt, OSOCTET* pvalue, OSUINT32 nocts); + +/** + * The pe_BigInteger function will encode a variable of the ASN.1 INTEGER type. + * In this case, the integer is assumed to be of a larger size than can fit in + * a C or C++ long type (normally 32 or 64 bits). For example, parameters used + * to calculate security values are typically larger than these sizes. Items of + * this type are stored in character string constant variables. They can be + * represented as decimal strings (with no prefixes), as hexadecimal strings + * starting with a "0x" prefix, as octal strings starting with a "0o" prefix or + * as binary strings starting with a "0b" prefix. Other radixes currently are + * not supported. It is highly recommended to use the hexadecimal or binary + * strings for better performance. + * + * @param pctxt Pointer to context block structure. + * @param pvalue A pointer to a character string containing the value to + * be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_BigInteger +(OSCTXT* pctxt, const char* pvalue); + +/** + * This function will encode a varialbe of the ASN.1 BOOLEAN type in single + * bit, + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value The BOOLEAN value to be encoded. + */ +EXTERNPER int pe_bit +(OSCTXT* pctxt, OSBOOL value); + +/** + * This function encodes multiple bits. + * + * @param pctxt Pointer to context block structure. + * @param value Unsigned integer containing the bits to be encoded. + * @param nbits Number of bits in value to encode. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_bits +(OSCTXT* pctxt, OSUINT32 value, OSUINT32 nbits); + +/** + * This function encodes multiple bits, using unsigned 64-bit integer to hold + * bits. + * + * @param pctxt Pointer to context block structure. + * @param value Unsigned 64-bit integer containing the bits to be + * encoded. + * @param nbits Number of bits in value to encode. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_bits64 (OSCTXT* pctxt, OSUINT64 value, OSUINT32 nbits); + +/** + * This function will encode a value of the ASN.1 bit string type. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param numocts The number of bits n the string to be encoded. + * @param data Pointer to the bit string data to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_BitString +(OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data); + +/** + * This function will encode a variable of the ASN.1 BMP character string. This + * differs from the encode routines for the character strings previously + * described in that the BMP string type is based on 16-bit characters. A + * 16-bit character string is modeled using an array of unsigned short + * integers. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param value Character string to be encoded. This structure includes + * a count field containing the number of characters to + * encode and an array of unsigned short integers to hold + * the 16-bit characters to be encoded. + * @param permCharSet Pointer to the constraining character set. This contains + * an array containing all valid characters in the set as + * well as the aligned and unaligned bit counts required + * to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_BMPString +(OSCTXT* pctxt, ASN1BMPString value, Asn116BitCharSet* permCharSet); + +/** + * This function will encode a variable of the ASN.1 Universal character + * string. This differs from the encode routines for the character strings + * previously described in that the Universal string type is based on 32-bit + * characters. A 32-bit character string is modeled using an array of unsigned + * integers. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param value Character string to be encoded. The structure includes a + * count field containing all valid characters in the set + * as well as the aligned and unaligned bit counts + * required to encode the characters. + * @param permCharSet A pointer to the constraining character set. This + * contains an array containing all valid characters in + * the set as well as the aligned and the unaligned bit + * counts required to encode the characters. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_UniversalString +(OSCTXT* pctxt, ASN1UniversalString value, Asn132BitCharSet* permCharSet); + +/** + * This function will position the encode bit cursor on the next byte boundry. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_byte_align (OSCTXT* pctxt); + +/** + * This function will determine if the given number of bytes will fit in the + * encode buffer. If not, either the buffer is expanded (if it is a dynamic + * buffer) or an error is signaled. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param nbytes Number of bytes of space required to hold the variable + * to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_CheckBuffer (OSCTXT* pctxt, size_t nbytes); + +/** + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param numocts Number of octets in the string to be encoded. + * @param data Pointer to octet string data to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ChoiceTypeExt +(OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data); + +/** + * This function encodes an integer constrained either by a value or value + * range constraint. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConsInteger +(OSCTXT* pctxt, OSINT32 value, OSINT32 lower, OSINT32 upper); + +/** + * This function encodes a 64-bit integer constrained either by a value or + * value range constraint. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded, represented as 64-bit integer. + * @param lower Lower range value, represented as 64-bit integer. + * @param upper Upper range value, represented as 64-bit integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConsInt64 (OSCTXT* pctxt, + OSINT64 value, OSINT64 lower, OSINT64 upper); + +/** + * This function encodes a constrained string value. This is a deprecated + * version of the function provided for backward compatibility. + * + * @param pctxt Pointer to context block structure. + * @param string Pointer to string to be encoded. + * @param pCharSet Pointer to a character set descriptor structure. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConstrainedString +(OSCTXT* pctxt, const char* string, Asn1CharSet* pCharSet); + +/** + * This function encodes a constrained string value. This version of the + * function allows all of the required permitted alphabet constraint parameters + * to be passed in as arguments. + * + * @param pctxt Pointer to context block structure. + * @param string Pointer to string to be encoded. + * @param charSet String containing permitted alphabet character set. Can + * be null if no character set was specified. + * @param abits Number of bits in a character set character (aligned). + * @param ubits Number of bits in a character set character (unaligned). + * @param canSetBits Number of bits in a character from the canonical set + * representing this string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConstrainedStringEx +(OSCTXT* pctxt, const char* string, const char* charSet, + OSUINT32 abits, OSUINT32 ubits, OSUINT32 canSetBits); + +/** + * This function encodes an unsigned integer constrained either by a value or + * value range constraint. The constrained unsigned integer option is used if: + * + * 1. The lower value of the range is >= 0, and 2. The upper value of the range + * is >= MAXINT + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded. + * @param lower Lower range value. + * @param upper Upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConsUnsigned +(OSCTXT* pctxt, OSUINT32 value, OSUINT32 lower, OSUINT32 upper); + +/** + * This function encodes an unsigned 64-bit integer constrained either by a + * value or value range constraint. The constrained unsigned integer option is + * used if: + * + * 1. The lower value of the range is >= 0, and 2. The upper value of the range + * is >= MAXINT + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded, represented as unsigned 64-bit + * integer. + * @param lower Lower range value, represented as unsigned 64-bit + * integer. + * @param upper Upper range value, represented as unsigned 64-bit + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConsUInt64 (OSCTXT* pctxt, OSUINT64 value, + OSUINT64 lower, OSUINT64 upper); + +/** + * This function encodes a constrained whole number as specified in Section + * 10.5 of the X.691 standard. + * + * @param pctxt Pointer to context block structure. + * @param adjusted_value Unsigned adjusted integer value to be encoded. The + * adjustment is done by subtracting the lower value + * of the range from the value to be encoded. + * @param range_value Unsigned integer value specifying the total size of + * the range. This is obtained by subtracting the + * lower range value from the upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConsWholeNumber +(OSCTXT* pctxt, OSUINT32 adjusted_value, OSUINT32 range_value); + +/** + * This function encodes a constrained whole number as specified in Section + * 10.5 of the X.691 standard, represented as 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param adjusted_value Unsigned adjusted integer value to be encoded. The + * adjustment is done by subtracting the lower value + * of the range from the value to be encoded. + * @param range_value Unsigned integer value specifying the total size of + * the range. This is obtained by subtracting the + * lower range value from the upper range value. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ConsWholeNumber64 +(OSCTXT* pctxt, OSUINT64 adjusted_value, OSUINT64 range_value); + +/** + * This function will expand the buffer to hold the given number of bytes. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param nbytes The number of bytes the buffer is to be expanded by. + * Note that the buffer will be expanded by + * ASN_K_ENCBIFXIZ or nbytes (whichever is larger. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ExpandBuffer (OSCTXT* pctxt, size_t nbytes); + +/** + * @param value Length value to be encoded. + */ +EXTERNPER OSUINT32 pe_GetIntLen (OSUINT32 value); + +/** + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + */ +EXTERNPER size_t pe_GetMsgBitCnt (OSCTXT* pctxt); + +/** + * This function will return the message pointer and length of an encoded + * message. This function is called after a complier generated encode function + * to get the pointer and length of the message. It is normally used when + * dynamic encoding is specified because the message pointer is not known until + * encoding is complete. If static encoding is used, the message starts at the + * beginning of the specified buffer adn the pe_GetMsgLen function can be used + * to obtain the lenght of the message. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pLength Pointer to variable to receive length of the encoded + * message. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER OSOCTET* pe_GetMsgPtr (OSCTXT* pctxt, OSINT32* pLength); + +/** + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pLength Pointer to variable to receive length of the encoded + * message. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER OSOCTET* pe_GetMsgPtrU (OSCTXT* pctxt, OSUINT32* pLength); + +/** + * This function will encode a length determinant value. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value Length value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_Length (OSCTXT* pctxt, OSUINT32 value); + +/** + * This function encodes a non-negative binary integer as specified in Section + * 10.3 of the X.691 standard. + * + * @param pctxt Pointer to context block structure. + * @param value Unsigned integer value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_NonNegBinInt (OSCTXT* pctxt, OSUINT32 value); + +/** + * This function encodes a non-negative binary 64-bit integer as specified in + * Section 10.3 of the X.691 standard. + * + * @param pctxt Pointer to context block structure. + * @param value Unsigned 64-bit integer value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_NonNegBinInt64 (OSCTXT* pctxt, OSUINT64 value); + +/** + * This function encodes a value of the ASN.1 object identifier type. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to value to be encoded. The ASN1OBJID structure + * contains a numids fields to hold the number of + * subidentifiers and an array to hold the subidentifier + * values. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_ObjectIdentifier (OSCTXT* pctxt, ASN1OBJID* pvalue); + +#ifndef _NO_INT64_SUPPORT +/** + * This function encodes a value of the ASN.1 object identifier type, using + * 64-bit subidentifiers. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to value to be encoded. The ASN1OID64 structure + * contains a numids fields to hold the number of + * subidentifiers and an array of unsigned 64-bit + * integers to hold the subidentifier values. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_oid64 (OSCTXT* pctxt, ASN1OID64* pvalue); +#endif + +/** + * This function encodes a value of the ASN.1 RELATIVE-OID type. + * + * @param pctxt Pointer to context block structure. + * @param pvalue Pointer to value to be encoded. The ASN1OBJID structure + * contains a numids fields to hold the number of + * subidentifiers and an array to hold the subidentifier + * values. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_RelativeOID (OSCTXT* pctxt, ASN1OBJID* pvalue); + +/** + * This fuction will encode an array of octets. The Octets will be encoded + * unaligned starting at the current bit offset within the encode buffer. + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pvalue A pointer to an array of octets to encode + * @param nbits The number of Octets to encode + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_octets +(OSCTXT* pctxt, const OSOCTET* pvalue, OSUINT32 nbits); + +/** + * This function will encode a value of the ASN.1 octet string type. + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param numocts Number of octets in the string to be encoded. + * @param data Pointer to octet string data to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_OctetString +(OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data); + +/** + * This function will encode an ASN.1 open type. This used to be the ANY type, + * but now is used in a variety of applications requiring an encoding that can + * be interpreted by a decoder without a prior knowledge of the type of the + * variable. + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param numocts Number of octets in the string to be encoded. + * @param data Pointer to octet string data to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_OpenType +(OSCTXT* pctxt, OSUINT32 numocts, const OSOCTET* data); + +/** + * This function will encode an ASN.1 open type extension. An open type + * extension field is the data that potentially resides after the ... marker in + * a version-1 message. The open type structure contains a complete encoded bit + * set including option element bits or choice index, length, and data. + * Typically, this data is populated when a version-1 system decodes a + * version-2 message. The extension fields are retained and can then be + * re-encoded if a new message is to be sent out (for example, in a store and + * forward system). + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pElemList A pointer to the open type to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_OpenTypeExt +(OSCTXT* pctxt, OSRTDList* pElemList); + +/** + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pElemList A pointer to the open type to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_OpenTypeExtBits +(OSCTXT* pctxt, OSRTDList* pElemList); + +/** + * This function will encode a value of the ASN.1 real type. This function + * provides support for the plus-infinity and minus-infinity special real + * values. Use the rtxGetPlusInfinity or rtxGetMinusInfinity functions to get + * these special values. + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value Value to be encoded. Special real values plus and minus + * infinity are encoded by using the rtxGetPlusInfinity + * and the rtxGetMinusInfinity functions to se the real + * value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_Real (OSCTXT* pctxt, OSREAL value); + +/** + * This function will endcode a small, non-negative whole number as specified + * in Section 10.6 of teh X.691 standard. This is a number that is expected to + * be small, but whose size is potentially unlimited due to the presence of an + * extension marker. + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value An unsigned integer value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_SmallNonNegWholeNumber (OSCTXT* pctxt, OSUINT32 value); + +/** + * This function encodes an semi-constrained integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded. + * @param lower Lower range value, represented as signed + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_SemiConsInteger + (OSCTXT* pctxt, OSINT32 value, OSINT32 lower); + +#ifndef _NO_INT64_SUPPORT +/** + * This function encodes an semi-constrained 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded, represented as 64-bit integer. + * @param lower Lower range value, represented as signed 64-bit + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_SemiConsInt64 + (OSCTXT* pctxt, OSINT64 value, OSINT64 lower); +#endif + +/** + * This function encodes an semi-constrained unsigned integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded. + * @param lower Lower range value, represented as unsigned + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_SemiConsUnsigned + (OSCTXT* pctxt, OSUINT32 value, OSUINT32 lower); + +#ifndef _NO_INT64_SUPPORT +/** + * This function encodes an semi-constrained unsigned 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded, represented as unsigned 64-bit + * integer. + * @param lower Lower range value, represented as unsigned 64-bit + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_SemiConsUInt64 + (OSCTXT* pctxt, OSUINT64 value, OSUINT64 lower); +#endif + +/** + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value Value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_UnconsLength (OSCTXT* pctxt, OSUINT32 value); + +/** + * This function encodes an unconstrained integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_UnconsInteger (OSCTXT* pctxt, OSINT32 value); + +#ifndef _NO_INT64_SUPPORT +/** + * This function encodes an unconstrained 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded, represented as 64-bit integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_UnconsInt64 (OSCTXT* pctxt, OSINT64 value); +#endif + +/** + * This function encodes an unconstrained unsigned integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_UnconsUnsigned (OSCTXT* pctxt, OSUINT32 value); + +#ifndef _NO_INT64_SUPPORT +/** + * This function encodes an unconstrained unsigned 64-bit integer. + * + * @param pctxt Pointer to context block structure. + * @param value Value to be encoded, represented as unsigned 64-bit + * integer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_UnconsUInt64 (OSCTXT* pctxt, OSUINT64 value); +#endif + +/** + * This function will encode a ASN.1 character string. + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value A pointer to a character string containing the value to + * be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_VarWidthCharString (OSCTXT* pctxt, const char* value); + +/** + * This function will encode a number from character string to ASN.1 real type + * using decimal encoding. Number may be represented in integer, decimal, and + * exponent formats. + * + * @param pctxt A pointer to a context structure. The provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pvalue Value to be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pe_Real10 (OSCTXT* pctxt, const char* pvalue); + +/** @} perencruntime */ + +/* Utility functions */ + + +/** + * @defgroup perutil PER C Utility Functions + * @{ + * + * The PER utility functions are common routines used by both the PER encode + * and decode functions. + */ + +/** + * This function is used to add size to a context variable. + * + * @param pctxt A pointer to a context structure. The referenced size + * constraint is added to this structure for use by a + * subsequent encode or decode function. + * @param pSize A pointer to the size constraint to add the context + * variable. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pu_addSizeConstraint (OSCTXT* pctxt, Asn1SizeCnst* pSize); + +EXTERNPER OSBOOL pu_alignCharStr +(OSCTXT* pctxt, OSUINT32 len, OSUINT32 nbits, Asn1SizeCnst* pSize); + +/** + * @param pctxt A pointer to a context structure. The referenced size + * constraint is added to this structure for use by a + * subsequent encode or decode function. + * @param size The size constraint to add the context variable. + */ +EXTERNPER int pu_checkSizeConstraint(OSCTXT* pctxt, int size); + +/** + * @param value Value to be encoded. + */ +EXTERNPER OSUINT32 pu_bitcnt (OSUINT32 value); + +EXTERNPER Asn1SizeCnst* pu_checkSize +(Asn1SizeCnst* pSizeList, OSUINT32 value, OSBOOL* pExtendable); + +/** + * This function releases all dynamicmemeory associated with a context. This + * function should be called even if the referenced context variable is not + * dynamic. The reason is because it frees memory allocated within the context + * as well as the context structure (it will only try to free the context + * structure if it detects that it was previously allocated using the + * pu_newContext function). + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + */ +EXTERNPER void pu_freeContext (OSCTXT* pctxt); + + +/** + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + */ +EXTERNPER int pu_getBitOffset (OSCTXT* pctxt); + + +EXTERNPER size_t pu_getMaskAndIndex (size_t bitOffset, unsigned char* pMask); + +/** + * This function will return the number of bits in a encoded message. This + * function is called after a complier generated encode function is called to + * get the bit count of the encoded component. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @return Length (in bits) of encoded message content. + */ +EXTERNPER size_t pu_getMsgLen (OSCTXT* pctxt); + +/** + * This function provides a standard hesadecimal dump of the contents of the + * buffer currently specified in the given context. + * + * @param pctxt Pointer to a context structure. The contents of the + * encode or decode buffer that was specified in the call + * to pu_initContext or pu_newContext is dumped. + */ +EXTERNPER void pu_hexdump (OSCTXT* pctxt); + +EXTERNPER int pu_setBuffer +(OSCTXT* pctxt, OSOCTET* bufaddr, size_t bufsiz, OSBOOL aligned); + +EXTERNPER int pe_setp (OSCTXT* pctxt, + OSOCTET* bufaddr, size_t bufsiz, OSBOOL aligned); + + + +#define pd_setp(pctxt, bufaddr, bufsiz, aligned) \ + pu_setBuffer(pctxt, bufaddr, bufsiz, aligned) +#define pe_resetp(pctxt) rtxResetContext(pctxt) +#define pd_resetp(pctxt) rtxResetContext(pctxt) + + + +/** + * This function is used to initialize a pre-allocated OSCTXT structure. This + * can be an OSCTXT variable declared on the stack or a pointer to an + * OSCTXT structure that was previously allocated. This function sets all + * internal variables within the structure to their initial values. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param bufaddr For encoding, this is the address of a buffer to receive + * the encoded PER message (note: this is optional, if + * specified to NULL a dynamic buffer will be allocated). + * For decoding, this is that address of the buffer that + * contains the PER message to be decoded. + * @param bufsiz For encoding, this is the size of the encoded buffer + * (note: this is optional, if the bufaddr arguement is + * specified to NULL, then dynamic encoding is in effect + * and the buffer size is indefinite). For decoding, this + * is the length (in octets) of the PER message to be + * decoded. + * @param aligned A Boolean value specifying whether aligned or unaligned + * encoding should be performed. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pu_initContext +(OSCTXT* pctxt, OSOCTET* bufaddr, OSUINT32 bufsiz, OSBOOL aligned); + +/** + * This function is used to initialize the buffer of an OSCTXT structure with + * buffer data from a second context structure. This function copies the buffer + * information from the source context buffer to the destination structure. The + * non-buffer related fields in the context remain untouched. + * + * @param pTarget A pointer to the target context structure. Buffer + * information within this structure is updated with data + * from the source context. + * @param pSource A pointer to the source context structure. Buffer + * information from the source context structure is + * copied to the target structure. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNPER int pu_initContextBuffer (OSCTXT* pTarget, OSCTXT* pSource); + +EXTERNPER const char* pu_getFullName +(OSCTXT* pctxt, const char* suffix); + +EXTERNPER Asn1SizeCnst* pu_getSizeConstraint +(OSCTXT* pctxt, OSBOOL extbit); + +EXTERNPER void pu_init16BitCharSet +(Asn116BitCharSet* pCharSet, OSUNICHAR first, OSUNICHAR last, + OSUINT32 abits, OSUINT32 ubits); + +/** + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + */ +EXTERNPER void pu_insLenField (OSCTXT* pctxt); + +/** + * @param pSizeList A pointer to the size of the Linked List. + */ +EXTERNPER OSBOOL pu_isExtendableSize (Asn1SizeCnst* pSizeList); + +/** + * @param pSizeList A pointer to the size of the Linked List. + */ +EXTERNPER OSBOOL pu_isFixedSize (Asn1SizeCnst* pSizeList); + +/** + * This function is similar to the pu_initContext function in that it + * initializes a context variable. The difference is that this function + * allocates a new structure and then initializes it. It is equivalent to + * calling malloc to allocate a context structure and then calling + * pu_initContext to initialize it. + * + * @param bufaddr For encoding, this is the address of a buffer to receive + * the encoded PER message (note: this is optional, if + * specified as NULL a dynamic buffer will be allocated). + * For decoding, this is that address of the buffer that + * contains the PER message to be decoded. + * @param bufsiz For encoding, this is the size of the encoded buffer + * (note: this is optional, if the bufaddr argument is + * specified to NULL, then dynamic encoding is in effect + * and the buffer size is indefinite). For decoding, this + * is the length (in octets) of the PER message to be + * decoded. + * @param aligned A Boolean value specifying whether aligned or unaligned + * encoding should be performed. + * @return A pointer to OSCTXT structure to receive the allocated + * structure. NULL is returned if any error occurs in + * allocating or initializing the context. + */ +EXTERNPER OSCTXT* pu_newContext +(OSOCTET* bufaddr, OSUINT32 bufsiz, OSBOOL aligned); + +EXTERNPER PERField* pu_newField +(OSCTXT* pctxt, const char* nameSuffix); + +/** + * @param pctxt A pointer to a context structure. + */ +EXTERNPER void pu_popName (OSCTXT* pctxt); + +/** + * Pushs an element on the stack. + * + * @param pctxt A pointer to a context structure. + * @param index The location to insert the element. + */ +EXTERNPER void pu_pushElemName (OSCTXT* pctxt, int index); + +/** + * @param pctxt A pointer to a context structure. + * @param name A pointer to the element to add to the stack. + */ +EXTERNPER void pu_pushName (OSCTXT* pctxt, const char* name); + + +EXTERNPER void pu_setBitOffset (OSCTXT* pctxt, int bitOffset); + +/** + * This function sets a permitted alphabet character set. This is the resulting + * set of characters when the character associated with a standard character + * string type is merged with a permitted alphabet constraint. + * + * @param pCharSet A pointer to a character set structure describing the + * character set currently associated with the character + * string type. The resulting character set structure + * after being merged with the permSet parameter. + * @param permSet A null-terminated string of permitted characters. + */ +EXTERNPER void pu_setCharSet (Asn1CharSet* pCharSet, const char* permSet); + +/** + * This function sets a permitted alphabet character set for 16-bit character + * strings. This is the resulting set of character when the character + * associated with a 16-bit string type is merged with a permitted alphabet + * constraint. + * + * @param pctxt Pointer to a context structure. + * @param pCharSet Pointer to a character set structure describing the + * character set currently associated with the character + * string type. The resulting character set structure + * after being merged with the permSet parameter. + * @param pAlphabet Pointer to a structure describing the 16-bit permitted + * alphabet. + */ +EXTERNPER void pu_set16BitCharSet +(OSCTXT* pctxt, Asn116BitCharSet* pCharSet, Asn116BitCharSet* pAlphabet); + + +/** + * @param pCharSet Pointer to a character set structure describing the + * character set currently associated with the character + * string type. The resulting character set structure + * after being merged with the permSet parameter. + * @param firstChar The first character in the range. + * @param lastChar The last character in the range. + */ +EXTERNPER void pu_set16BitCharSetFromRange +(Asn116BitCharSet* pCharSet, OSUINT16 firstChar, OSUINT16 lastChar); + +/** + * @param pctxt A pointer to a context structure. + */ +EXTERNPER void pu_setFldBitCount (OSCTXT* pctxt); + + +/** + * @param pctxt A pointer to a context structure. + */ +EXTERNPER void pu_setFldBitOffset (OSCTXT* pctxt); + +/** + * @param pCtxt A pointer to a context structure. + * @param value The BOOLEAN value to be encoded. + */ +EXTERNPER OSBOOL pu_setTrace (OSCTXT* pCtxt, OSBOOL value); + +/** + * This function provides a detailed binary dump of the contents of the buffer + * currently specified in the given context. The list of fields dumped by this + * function was previously built up within the context using calls pu_newField, + * pu_pushName, and pu_popName. These calls are built into both + * compiler-generated and low-level PER encode/decode functions to trace the + * actual bit encoding of a given construct. + * + * @param pctxt A pointer to a context structure. The contents of the + * encode or decode buffer that was specified in the call + * to pu_initContext or pu_newContext is dumped. + * @param varname The name of the top-level variable name of the structure + * being dumped. + */ +EXTERNPER void pu_bindump (OSCTXT* pctxt, const char* varname); +EXTERNPER void pu_dumpField +(OSCTXT* pctxt, PERField* pField, const char* varname, + size_t nextBitOffset, BinDumpBuffer* pbuf); + +EXTERNPER void pu_init32BitCharSet +(Asn132BitCharSet* pCharSet, OS32BITCHAR first, OS32BITCHAR last, + OSUINT32 abits, OSUINT32 ubits); + +/** + * This function sets a permitted alphabet character set for 32-bit character + * strings. This is the resulting set of character when the character + * associated with a 16-bit string type is merged with a permitted alphabet + * constraint. + * + * @param pctxt Pointer to a context structure. + * @param pCharSet Pointer to a character set structure describing the + * character set currently associated with the character + * string type. The resulting character set structure + * after being merged with the permSet parameter. + * @param pAlphabet Pointer to a structure describing the 32-bit permitted + * alphabet. + */ +EXTERNPER void pu_set32BitCharSet +(OSCTXT* pctxt, Asn132BitCharSet* pCharSet, Asn132BitCharSet* pAlphabet); + +/** + * @param pCharSet Pointer to a character set structure describing the + * character set currently associated with the character + * string type. The resulting character set structure + * after being merged with the permSet parameter. + * @param firstChar The first character in the range. + * @param lastChar The last character in the range. + */ +EXTERNPER void pu_set32BitCharSetFromRange +(Asn132BitCharSet* pCharSet, OSUINT32 firstChar, OSUINT32 lastChar); + +/** + * Returns numeric version of run-time library. The format of version is as + * follows: MmP, where: + * M - major version number; + * m - minor version number; + * p - patch release number. + * For example, the value 581 means the version 5.81. + * @return Version of run-time library in numeric format. + */ +EXTERNPER int pu_GetLibVersion (); + +/** + * Returns information string describing the library. The string + * contains name of library, its version and flags used for building + * the library. + * + * @return Information string + */ +EXTERNPER const char* pu_GetLibInfo (); + +/** + * @} perutil + */ + +#ifdef __cplusplus +} +#endif + +/* Macros */ + +#define pe_GeneralString(pctxt,value,permCharSet) \ +pe_VarWidthCharString(pctxt, value) + +#define pe_GraphicString(pctxt,value,permCharSet) \ +pe_VarWidthCharString(pctxt, value) + +#define pe_T61String(pctxt,value,permCharSet) \ +pe_VarWidthCharString(pctxt, value) + +#define pe_TeletexString(pctxt,value,permCharSet) \ +pe_VarWidthCharString(pctxt, value) + +#define pe_VideotexString(pctxt,value,permCharSet) \ +pe_VarWidthCharString(pctxt, value) + +#define pe_ObjectDescriptor(pctxt,value,permCharSet) \ +pe_VarWidthCharString(pctxt, value) + +#define pe_UTF8String(pctxt,value,permCharSet) \ +pe_VarWidthCharString(pctxt, value) + + +#define pe_IA5String(pctxt,value,permCharSet) \ +pe_ConstrainedStringEx (pctxt, value, permCharSet, 8, 7, 7) + +#define pe_NumericString(pctxt,value,permCharSet) \ +pe_ConstrainedStringEx (pctxt, value, \ +(permCharSet == 0)?NUM_CANSET:permCharSet, 4, 4, 4) + +#define pe_PrintableString(pctxt,value,permCharSet) \ +pe_ConstrainedStringEx (pctxt, value, permCharSet, 8, 7, 7) + +#define pe_VisibleString(pctxt,value,permCharSet) \ + +#define pe_ISO646String pe_IA5String +#define pe_GeneralizedTime pe_IA5String +#define pe_UTCTime pe_GeneralizedTime + + +#define pd_GeneralString(pctxt,pvalue,permCharSet) \ +pd_VarWidthCharString (pctxt, pvalue) + +#define pd_GraphicString(pctxt,pvalue,permCharSet) \ +pd_VarWidthCharString (pctxt, pvalue) + +#define pd_VideotexString(pctxt,pvalue,permCharSet) \ +pd_VarWidthCharString (pctxt, pvalue) + +#define pd_TeletexString(pctxt,pvalue,permCharSet) \ +pd_VarWidthCharString (pctxt, pvalue) + +#define pd_T61String(pctxt,pvalue,permCharSet) \ +pd_VarWidthCharString (pctxt, pvalue) + +#define pd_ObjectDescriptor(pctxt,pvalue,permCharSet) \ +pd_VarWidthCharString (pctxt, pvalue) + +#define pd_UTF8String(pctxt,pvalue,permCharSet) \ +pd_VarWidthCharString (pctxt, pvalue) + + +#define pd_IA5String(pctxt,pvalue,permCharSet) \ +pd_ConstrainedStringEx (pctxt, pvalue, permCharSet, 8, 7, 7) + +#define pd_NumericString(pctxt,pvalue,permCharSet) \ +pd_ConstrainedStringEx (pctxt, pvalue, \ +(permCharSet == 0)?NUM_CANSET:permCharSet, 4, 4, 4) + +#define pd_PrintableString(pctxt,pvalue,permCharSet) \ +pd_ConstrainedStringEx (pctxt, pvalue, permCharSet, 8, 7, 7) + +#define pd_VisibleString(pctxt,pvalue,permCharSet) \ +pd_ConstrainedStringEx (pctxt, pvalue, permCharSet, 8, 7, 7) + + +#define pd_ISO646String pd_IA5String +#define pd_GeneralizedTime pd_IA5String +#define pd_UTCTime pd_GeneralizedTime + +#define pe_GetMsgLen pu_getMsgLen + +/** @} perruntime */ + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1tag.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1tag.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1tag.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1type.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1type.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1type.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1version.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/asn1version.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/asn1version.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtBCD.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtBCD.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtBCD.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtCompare.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtCompare.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtCompare.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtContext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtContext.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtContext.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtCopy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtCopy.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtCopy.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtExternDefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtExternDefs.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtExternDefs.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrint.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrint.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtPrint.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrintStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrintStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtPrintStream.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrintToStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrintToStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtPrintToStream.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrintToString.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtPrintToString.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtPrintToString.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtSocketSelect.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtSocketSelect.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtSocketSelect.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtStream.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtTable.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtTable.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtTable.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtToken.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtToken.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtToken.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtbench.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtbench.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtbench.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtconv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtpersrc/rtconv.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,16 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "rtsrc/rtconv.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CBitStr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CBitStr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,832 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1CBITSTR_H_ +#define _ASN1CBITSTR_H_ + +#include "rtsrc/asn1CppTypes.h" +/** + * @file rtsrc/ASN1CBitStr.h + * Bit string control class definitions. + */ +/** + * @addtogroup asn1ctrl + * @{ + */ +// +// +// ASN1CBitStr +// +// Bit string implementation. This class provides all functionalty +// necessary for bit strings. +// +// Author Artem Bolgar. +// version 1.52 21 Feb, 2003 +// +#ifndef _NO_UTILS_CLASSES + +/** + * ASN.1 bit string control class. + * The ASN1CBitStr class is derived from the ASN1CType base class. It is used + * as the base class for generated control classes for the ASN.1 BIT STRING + * type. This class provides utility methods for operating on the bit string + * referenced by the generated class. This class can also be used inline to + * operate on bits within generated BIT STRING elements in a SEQUENCE, SET, or + * CHOICE construct. + */ +class EXTRTCLASS ASN1CBitStr : public ASN1CType { + private: + OSUINT32 _numbits; // placeholder + OSOCTET* _units; // placeholder + protected: + OSOCTET** mpUnits; + OSUINT32 mMaxNumBits; + OSUINT32* mpNumBits; + int mUnitsUsed; + int mUnitsAllocated; + OSBOOL mDynAlloc; + private: + EXTRTMETHOD OSOCTET* allocateMemory(int sz); + + EXTRTMETHOD OSOCTET* reallocateMemory(OSOCTET* old, int oldBufSz, int newBufSz); + + EXTRTMETHOD void freeMemory(OSOCTET* mem); + /* + * Set the field mUnitsUsed with the logical size in units of the bit + * set. WARNING:This function assumes that the number of units actually + * in use is less than or equal to the current value of mUnitsUsed! + */ + EXTRTMETHOD void recalculateUnitsUsed(); + + /* + * Ensures that the bit string can hold enough units. + * param unitsRequired the minimum acceptable number of units. + */ + EXTRTMETHOD int checkCapacity(int unitsRequired); + + + /* + * Returns the unit of this bitset at index j as if this bit string had an + * infinite amount of storage. + */ + EXTRTMETHOD OSOCTET getBits(int j); + + EXTRTMETHOD void privateInit (OSUINT32 nbits); + EXTRTMETHOD void privateInit (OSOCTET* bitStr, OSUINT32 maxNumbits_); + EXTRTMETHOD void privateInit (ASN1TDynBitStr& bitStr); + protected: + /* + * Creates an empty bit string. The string should be additionaly initialized + * by call to 'init' method. + */ + EXTRTMETHOD ASN1CBitStr (OSRTMessageBufferIF& msgBuf); + + /* + * Default protected ctor. mpContext should be set and the string should be + * additionaly initialized by call to 'init' method. + */ + EXTRTMETHOD ASN1CBitStr(); + + /* + * This constructor creates an empty bit string. + * + * @param ctxt - Reference to reference-counted context object. + */ + EXTRTMETHOD ASN1CBitStr (OSRTContext& ctxt); + + /* + * This constructor initializes the internal bit string to the + * given value. + * + * @param pBits - Pointer to binary bit string data. + * @param numbits - Reference to counter to hold number of bits. + * @param maxNumbits - Maximum size (in bits) of this bit string. + */ + EXTRTMETHOD ASN1CBitStr (OSOCTET* pBits, OSUINT32& numbits, OSUINT32 maxNumbits); + + /* + * This constructor initializes the internal bit string to the + * given value. + * + * @param bitstr - Reference to a bit string variable. + */ + EXTRTMETHOD ASN1CBitStr (ASN1TDynBitStr& bitStr); + + EXTRTMETHOD void init (OSOCTET* pBits, OSUINT32& numbits, OSUINT32 maxNumbits); + EXTRTMETHOD void init (ASN1TDynBitStr& bitStr); + + public: + /** + * This constructor creates an empty bit string. If the \c nbits argument is + * zero, the bit string is set to be dynamic; otherwise, the capacity is set + * to \c nbits. + * + * @param msgbuf - ASN.1 message buffer or stream object. + * @param nbits - Number of bits this bit string can contain (zero if + * unbounded. + */ + EXTRTMETHOD ASN1CBitStr (OSRTMessageBufferIF& msgbuf, OSUINT32 nbits); + + /** + * This constructor creates a bit string from an array of bits. The + * constructor does not copy the bit string data, it just references the + * given data variables. All operations on the bit string cause the + * referenced items to be updated directly. + * + * @param msgbuf - ASN.1 message buffer or stream object. + * @param bitStr - Pointer to static byte array + * @param numbits - Reference to length of bit string (in bits) + * @param maxNumbits_ - sets maximum length in bits + */ + EXTRTMETHOD ASN1CBitStr (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr, + OSUINT32& numbits, OSUINT32 maxNumbits_); + + /* + * Creates bits string from ASN1TDynBitStr. Ctor does not copy bytes, + * just assign array (data member of ASN1TDynBitStr) to units. + * This string will be extendable. + */ + EXTRTMETHOD ASN1CBitStr(OSRTMessageBufferIF& msgBuf, ASN1TDynBitStr& bitStr); + + /* + * Creates empty bit string. If nbits == 0 then bit string is dynamic; + * else capacity will be fixed to nbits. + */ + EXTRTMETHOD ASN1CBitStr(OSRTContext& ctxt, OSUINT32 nbits); + + /* + * Creates bits string from array of bits. Ctor does not copy bytes, + * just assign passed array to units. + * Param bitStr - pointer to static byte array + * Param numbits - reference to length of bit string (in bits); + * Param maxNumbits_ - sets maximum length in bits + */ + EXTRTMETHOD ASN1CBitStr(OSRTContext& ctxt, OSOCTET* bitStr, + OSUINT32& octsNumbits, OSUINT32 maxNumbits_); + + /* + * Creates bits string from ASN1TDynBitStr. Ctor does not copy bytes, + * just assign array (data member of ASN1TDynBitStr) to units. + * This string will be extendable. + */ + EXTRTMETHOD ASN1CBitStr(OSRTContext& ctxt, ASN1TDynBitStr& bitStr); + + /* + * Copy constructor. + */ + EXTRTMETHOD ASN1CBitStr(const ASN1CBitStr& bitStr); + + /* + * Copy constructor, but allows to specify 'extendable' parameter + */ + EXTRTMETHOD ASN1CBitStr(const ASN1CBitStr& bitStr, OSBOOL extendable); + + + EXTRTMETHOD ~ASN1CBitStr(); + /** + * This version of the set method sets the given bit in the target string. + * + * @param bitIndex Relative index of the bit to set in the string. The + * bit idex 0 refers to the MS bit (bit 8) in the first + * octet. The index values then progress from the left + * to right (MS to LS). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets the bit at the specified index to 1. + * + * Returns: 0 - if succeed, or + * RTERR_OUTOFBND - if 'bitIndex' is out of bounds, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int set(OSUINT32 bitIndex); + + /** + * This version of teh set method sets the bits from the specified fromIndex + * (inclusive) to the specified toIndex (exclusive) to one. + * + * @param fromIndex Relative start index (inclusive) of bits in the + * string. The bit index 0 refers to the MS bit (bit 8) + * in the first octet. The index values then progress + * from the left to right (MS to LS). + * @param toIndex Relative end index (exclusive) of bits in the string. + * The bit index 0 refers to the MS bit (bit 8) in the + * first octet. The index values then progress from the + * left to right (MS to LS). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets the bits from the specified fromIndex(inclusive) to the + * specified toIndex(exclusive) to 1. + * + * Returns: 0 - if succeed, or + * RTERR_OUTOFBND - if one of indexes is out of bounds, or + * RTERR_RANGERR - if fromIndex > toIndex, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int set(OSUINT32 fromIndex, OSUINT32 toIndex); + + /** + * Changes the bit at the specified index to the specified value. + * + * @param bitIndex Relative index of bit to set in string. Bit index 0 + * refers to the MS bit (bit 8) in the first octet. + * The index values then progress from left to right + * (MS to LS bits). + * @param value Boolean value to which the bit is to be set. + * @return Completion status of operation: 0 - if succeed + * - 0 (0) = success + * - negative return value is error. + */ + /*Returns (details): RTERR_OUTOFBND - if 'bitIndex' is out of bounds, or + * other error codes (see asn1type.h). + */ + inline int change(OSUINT32 bitIndex, OSBOOL value) { + if(value) + return set(bitIndex); + else + return clear(bitIndex); + } + + /** + * This version of the clear method sets the given bit in the target string + * to zero. + * + * @param bitIndex Relative index of bit in string. Bit index 0 refers to + * the MS bit (bit 8) in the first octet. The index + * values then progress from left to right (MS to LS + * bits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets the bit specified by the index to 0. + * + * Returns: 0 - if succeed, or + * RTERR_OUTOFBND - if 'bitIndex' is out of bounds, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int clear(OSUINT32 bitIndex); + + /** + * This version of the clear method sets the bits from the specified + * fromIndex (inclusive) to the specified toIndex (exclusive) to zero. + * + * @param fromIndex Relative start index (inclusive) of bits in string. + * Bit index 0 refers to the MS bit (bit 8) in the + * first octet. The index values then progress from + * left to right (MS to LS bits). + * @param toIndex Relative end index (exclusive) of bits in string. Bit + * index 0 refers to the MS bit (bit 8) in the first + * octet. The index values then progress from left to + * right (MS to LS bits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets the bits from the specified fromIndex(inclusive) to the + * specified toIndex(exclusive) to 0. + * + * Returns: 0 - if succeed, or + * RTERR_OUTOFBND - if one of indexes is out of bounds, or + * RTERR_RANGERR - if fromIndex > toIndex, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int clear(OSUINT32 fromIndex, OSUINT32 toIndex); + + /** + * This version of the clear method sets all bits in the bit string to zero. + * + * @param - none + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets all of the bits in this bit string to 0. + */ + EXTRTMETHOD void clear(); + + /** + * This version of the invert method inverts the given bit in the target + * string. + * + * If the bit in the bit string is a zero, it will be set to 1; if the bit is + * a one, it will be set to 0. + * + * @param bitIndex Relative index of bit in string. Bit index 0 refers to + * the MS bit (bit 8) in the first octet. The index + * values then progress from left to right (MS to LS + * bits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets the bit at the specified index to to the complement of its + * current value. + * + * Returns: 0 - if succeed, or + * RTERR_OUTOFBND - if 'bitIndex' is out of bounds, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int invert(OSUINT32 bitIndex); + + /** + * This version inverts the bits from the specified fromIndex (inclusive) to + * the specified toIndex (exclusive). + * + * If the bit in the bit string is a zero, it will be set to 1; if the bit + * is a one, it will be set to 0. + * + * @param fromIndex Relative start index (inclusive) of bits in string. + * Bit index 0 refers to the MS bit (bit 8) in the + * first octet. The index values then progress from + * left to right (MS to LS bits). + * @param toIndex Relative end index (exclusive) of bits in string. Bit + * index 0 refers to the MS bit (bit 8) in the first + * octet. The index values then progress from left to + * right (MS to LS bits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets each bit from the specified fromIndex(inclusive) to the + * specified toIndex(exclusive) to the complement of its current + * value. + * + * Returns: 0 - if succeed, or + * RTERR_OUTOFBND - if one of indexes is out of bounds, or + * RTERR_RANGERR - if fromIndex > toIndex, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int invert(OSUINT32 fromIndex, OSUINT32 toIndex); + + /** + * This method returns the value of the bit with the specified index. + * + * @param bitIndex Relative index of bit in string. Bit index 0 refers to + * the MS bit (bit 8) in the first octet. The index + * values then progress from left to right (MS to LS + * bits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Returns the value of the bit with the specified index. + */ + EXTRTMETHOD OSBOOL get(OSUINT32 bitIndex); + + /** + * This method is the same as ASN1CBitStr::get. + * + * @see get (OSUINT32 bitIndex) + */ + /* + * Returns TRUE if the value of the bit with the specified index is set to 1. + */ + inline OSBOOL isSet(OSUINT32 bitIndex) { return get(bitIndex); } + + /** + * This method returns TRUE if this bit string contains no bits that are set + * to 1. + * + * @param - none + * @return TRUE, if the bit string contains no bits that are set + * to 1. + */ + /* + * Returns true if this bit string contains no bits that are set + * to 1. + */ + inline OSBOOL isEmpty() { return (mUnitsUsed == 0); } + + /** + * This method returns the number of bytes of space actually in use by this + * bit string to represent bit values. + * + * @param - none + * @return Number of bytes of space actually in use by this bit + * string to represent bit values. + */ + /* + * Returns the number of bytes of space actually in use by this + * bit string to represent bit values. + */ + EXTRTMETHOD int size() const; + + /** + * This method Calculates the "logical size" of the bith string. + * + * The "logical size" is caluculated by noting the index of the highest set + * bit in the bit string plus one. Zero will be returned if the bit string + * contains no set bits. The highest bit in the bit string is the LS bit in + * the last octet set to 1. + * + * @param - none + * @return Returns the "logical size" of this bit string. + */ + /* + * Returns the "logical size" of this bit string: the index of + * the highest set bit in the bit string plus one. Returns zero + * if the bit string contains no set bits. + */ + EXTRTMETHOD OSUINT32 length() const; + + /** + * This method calculates the cardinality of the target bit string. + * + * Cardinality of the bit string is the number of bits set to 1. + * + * @param - none + * @return The number of bytes of space actually in use by this + * bit string to represent the bit values. + */ + /* + * Returns the number of bits set to 1 in this + * bit string. + */ + EXTRTMETHOD int cardinality() const; + + /** + * This method copies the bit string to the given buffer. + * + * @param pBuf Pointer to the destination buffer where bytes will be + * copied. + * @param bufSz Size of the destination buffer. If the size of + * the buffer is not large enough to receive the + * entire bit string, a negative status value + * (RTERR_BUFOVFLOW) will be returned. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Copies bit string to buffer (pBuf). + */ + EXTRTMETHOD int getBytes(OSOCTET* pBuf, int bufSz); + + /** + * This version of the get method copies the bit string composed of bits from + * this bit string from the specified fromIndex (inclusive) to the specified + * toIndex (exclusive) into the given buffer. + * + * @param fromIndex Relative start index (inclusive) of bits in string. + * Bit index 0 refers to the MS bit (bit 8) in the + * first octet. The index values then progress from + * left to right (MS to LS bits). + * @param toIndex Relative end index (exclusive) of bits in string. Bit + * index 0 refers to the MS bit (bit 8) in the first + * octet. The index values then progress from left to + * right (MS to LS bits). + * @param pBuf Pointer to destination buffer where bytes will be + * copied. + * @param bufSz Size of the destination buffer. If the size of + * the buffer is not large enough to receive the + * entire bit string, a negative status value + * (RTERR_BUFOVFLOW) will be returned. + * @return Completion status of operation: + * - 0 (0) = success, + * - RTERR_OUTOFBND index value is out of bounds + * - RTERR_RANGERR fromIndex > toIndex + * - other error codes (see asn1type.h). + */ + EXTRTMETHOD int get(OSUINT32 fromIndex, OSUINT32 toIndex, OSOCTET* pBuf, int bufSz); + + /** + * This method provides the logical AND of the target bit string with the + * argument bit string. + * + * @param pOctstr A pointer to octets of another bit string for + * performing logical operation. + * @param octsNumbits A number of bits in arguent bit string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Performs a logical AND of this target bit set with the + * argument bit set. + * + * Returns: 0 - if succeed, or + * ASN_E_INVLEN - if 'octsNumbits' is negative, or + * RTERR_INVPARAM - if pOctstr is the same bit string as this or null, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int doAnd(const OSOCTET* pOctstr, OSUINT32 octsNumbits); + + /** + * This method performs a logical AND of the target bit string with the + * argument bit string. + * + * @param bitStr A reference t another bit string represented by + * ASN1TDynBitStr type for performing logical + * operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doAnd(const ASN1TDynBitStr& bitStr) { + return doAnd(bitStr.data, bitStr.numbits); + } + + /** + * This method performs a logical AND of the target bit string with the + * argument bit string. + * + * @param bitStr A reference to another bit string represented by + * ASN1CBitStr type for performing logical operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doAnd(const ASN1CBitStr& bitStr) { + return doAnd(*bitStr.mpUnits, bitStr.length()); + } + + + /** + * This method preforms a logical OR of the target bit string with the + * argument bit string. + * + * @param pOctstr A pointer to octets of another bit string for + * performing logical operation. + * @param octsNumbits A number of bits in arguent bit string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Performs a logical OR of this target bit set with the + * argument bit set. + * + * Returns: 0 - if succeed, or + * ASN_E_INVLEN - if 'octsNumbits' is negative, or + * RTERR_INVPARAM - if pOctstr is the same bit string as this or null, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int doOr(const OSOCTET* pOctstr, OSUINT32 octsNumbits); + + /** + * This method performs a logical OR of the target bit string with the + * argument bit string. + * + * @param bitStr A reference t another bit string represented by + * ASN1TDynBitStr type for performing logical + * operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doOr(const ASN1TDynBitStr& bitStr) { + return doOr(bitStr.data, bitStr.numbits); + } + + /** + * This method performs a logical OR of the target bit string with the + * argument bit string. + * + * @param bitStr A reference to another bit string represented by + * ASN1CBitStr type for performing logical operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doOr(const ASN1CBitStr& bitStr) { + return doOr(*bitStr.mpUnits, bitStr.length()); + } + + /** + * This method provides the logical XOR of the target bit string with the + * argument bit string. + * + * @param pOctstr A pointer to octets of another bit string for + * performing logical operation. + * @param octsNumbits A number of bits in arguent bit string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Performs a logical XOR of this target bit set with the + * argument bit set. + * + * Returns: 0 - if succeed, or + * ASN_E_INVLEN - if 'octsNumbits' is negative, or + * RTERR_INVPARAM - if pOctstr is null, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int doXor(const OSOCTET* pOctstr, OSUINT32 octsNumbits); + + /** + * This method performs a logical XOR of the target bit string with the + * argument bit string. + * + * @param bitStr A reference t another bit string represented by + * ASN1TDynBitStr type for performing logical + * operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doXor(const ASN1TDynBitStr& bitStr) { + return doXor(bitStr.data, bitStr.numbits); + } + + /** + * This method performs a logical OR of the target bit string with the + * argument bit string. + * + * @param bitStr A reference to another bit string represented by + * ASN1CBitStr type for performing logical operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doXor(const ASN1CBitStr& bitStr) { + return doXor(*bitStr.mpUnits, bitStr.length()); + } + + /** + * This method performs a logical ANDNOT of the target bit string with the + * argument bit string. + * + * Logical ANDNOT clars all of the bits in this bit string whose + * corresponding bit is set in the specified bit string. + * + * @param pOctstr A pointer to octets of another bit string for + * performing logical operation. + * @param octsNumbits A number of bits in arguent bit string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Clears all of the bits in this bit string whose corresponding + * bit is set in the specified bit string. + * + * Returns: 0 - if succeed, or + * ASN_E_INVLEN - if 'octsNumbits' is negative, or + * RTERR_INVPARAM - if pOctstr is null, or + * other error codes (see asn1type.h). + */ + EXTRTMETHOD int doAndNot(const OSOCTET* pOctstr, OSUINT32 octsNumbits); + + /** + * This method performs a logical ANDNOT of the target bit string with the + * argument bit string. + * + * Logical ANDNOT clears all of the bits in this bit string whose + * corresponding bit is set in the specified bit string. + * + * @param bitStr A reference t another bit string represented by + * ASN1TDynBitStr type for performing logical + * operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doAndNot(const ASN1TDynBitStr& bitStr) { + return doAndNot(bitStr.data, bitStr.numbits); + } + + /** + * This method performs a logical ANDNOT of the target bit string with the + * argument bit string. + * + * Logical ANDNOT clears all of the bits in this bit string whose + * corresponding bit is set in the specified bit string. + * + * @param bitStr A reference to another bit string represented by + * ASN1CBitStr type for performing logical operation. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int doAndNot(const ASN1CBitStr& bitStr) { + return doAndNot(*bitStr.mpUnits, bitStr.length()); + } + + /** + * This method shifts all bits to the left by the number of specified in the + * shift operand. + * + * If the bit string can dynamically grow, then the length of the bit string + * will be decreased by shift bits. Otherwise, bits that are shifted into the + * bitstring are filled with zeros from the right. Most left bits are lost. + * + * @param shift Number of bits to be shifted. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Shifts all bits to the left by 'shift' bits. + */ + EXTRTMETHOD int shiftLeft(OSUINT32 shift); + + /** + * This method shifts all bits to the right by the number of specified in the + * shift operand. + * + * If the bit string can dynamically grow, then the length of the bit string + * will be decreased by shift bits. Otherwise, bits that are shifted into the + * bitstring are filled with zeros from the left. Most right bits are lost. + * + * @param shift Number of bits to be shifted. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Shifts all bits to the right by 'shift' bits. + */ + EXTRTMETHOD int shiftRight(OSUINT32 shift); + + /** + * This method returns the number of unused bits in the last octet. + * + * @param - none + * @return Number of bits in teh last octet. It equals to + * length() % 8. + */ + /* + * Returns number of unused bits in last unit. + */ + EXTRTMETHOD int unusedBitsInLastUnit(); + + /** + * This method returns a filled ANSDITDynBitStr variable. + * + * Memory is not allocated when calling this method; only a pointer is + * assigned. Thus, the ASN1TDynBitStr variable is only valid while this + * ASN1CBitStr is in scope. + * + * @param - none + * @return Filled ASN1TDynBitStr. + */ + /* + * Returns filled ASN1TDynBitStr. Memory for data is not + * reallocated, thus, this ASN1TDynBitStr will be eligible while + * this ASN1CBitStr is in scope. + */ + EXTRTMETHOD operator ASN1TDynBitStr(); + + /** + * This method returns a pointer to the filled ANSDITDynBitStr variable. + * + * Memory for the ASN1DynBitStr variable is alloced using memory memAlloc and + * bits are copied into it. + * + * @param - none + * @return Pointer to a filled ASN1TDynBitStr. + */ + /* + * Returns pointer to filled ASN1TDynBitStr. In this method, + * memory is allocated, and bits are copied to it. + */ + EXTRTMETHOD operator ASN1TDynBitStr*(); +} ; +#else +typedef class _ASN1CBitStr : public ASN1CType { + public: + _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSUINT32 nbits) : + ASN1CType (msgBuf) {} + + _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSOCTET* bitStr, + OSUINT32& octsNumbits, OSUINT32 maxNumbits_) : + ASN1CType (msgBuf) {} + + _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, ASN1TDynBitStr& bitStr) : + ASN1CType (msgBuf) {} +} ASN1CBitStr; +#endif // _NO_UTILS_CLASSES +#endif // _ASN1CBITSTR_H_ +/** + * @}asn1cb + */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CGeneralizedTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CGeneralizedTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,203 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** +@file +@internalTechnology +*/ + +#ifndef __ASN1CGENTIME_H__ +#define __ASN1CGENTIME_H__ + +#include "rtsrc/ASN1CTime.h" + +/** + * @file rtsrc/ASN1CGeneralizedTime.h + * GeneralizedTime control class definition. + */ +/** + * @addtogroup asn1ctrl + * @{ + */ +/** + * @addtogroup asn1ctime + * @{ + */ +// +// +// ASN1CGeneralizedTime +// +// ISO 8601 time and date for ITU-T X.680. +// +// Author Artem Bolgar. +// version 3.00 03 Sep, 2004 (refactored to use ASN1TGeneralizedTime) +// +// version 2.13 11 Jul, 2003 (2038 year problem fixed + some other fixes) +// version 1.11 03 Aug, 2002 +// +#ifndef _NO_UTILS_CLASSES + +/** + * ASN.1 GeneralizedTime control class. + * The ASN1CGeneralizedTime class is derived from the ASN1CTime base class. It + * is used as the base class for generated control classes for the ASN.1 + * Generalized Time ([UNIVERSAL 24] IMPLICIT VisibleString) type. This class + * provides utility methods for operating on the time information referenced by + * the generated class. This class can also be used inline to operate on the + * times within generated time string elements in a SEQUENCE, SET, or CHOICE + * construct. The time string generally is encoded according to ISO 8601 format + * with some exceptions (see X.680). + */ +class EXTRTCLASS ASN1CGeneralizedTime : public ASN1CTime { + protected: + ASN1TGeneralizedTime timeObj; + + virtual ASN1TTime& getTimeObj () { return timeObj; } + virtual const ASN1TTime& getTimeObj () const { return timeObj; } + + EXTRTMETHOD ASN1CGeneralizedTime(char*& buf, int bufSize, OSBOOL useDerRules = FALSE); + + EXTRTMETHOD ASN1CGeneralizedTime(ASN1GeneralizedTime& buf, + OSBOOL useDerRules = FALSE); + public: + +/** + * This constructor creates a time string from a buffer. It does not deep-copy + * the data, it just assigns the passed array to an internal reference + * variable. The object will then directly operate on the given data variable. + * + * @param msgBuf Reference to an OSRTMessage buffer derived object (for + * example, an ASN1BEREncodeBuffer). + * @param buf A reference pointer to the time string buffer. + * @param bufSize The size of the passed buffer, in bytes. + * @param useDerRules An OSBOOL value. + */ + EXTRTMETHOD ASN1CGeneralizedTime(OSRTMessageBufferIF& msgBuf, char*& buf, int bufSize, + OSBOOL useDerRules = FALSE); + +/** + * This constructor creates a time string using the ASN1GeneralizedTime + * argument. The constructor does not deep-copy the variable, it assigns a + * reference to it to an internal variable. The object will then directly + * operate on the given data variable. This form of the constructor is used + * with a complier-generated time string variable. + * + * @param msgBuf Reference to an OSRTMessage buffer derived object (for + * example, an ASN1BEREncodeBuffer). + * @param buf A reference pointer to the time string buffer. + * @param useDerRules An OSBOOL value. + */ + EXTRTMETHOD ASN1CGeneralizedTime(OSRTMessageBufferIF& msgBuf, ASN1GeneralizedTime& buf, + OSBOOL useDerRules = FALSE); + + EXTRTMETHOD ASN1CGeneralizedTime(OSRTContext& ctxt, char*& buf, int bufSize, + OSBOOL useDerRules = FALSE); + + EXTRTMETHOD ASN1CGeneralizedTime(OSRTContext& ctxt, ASN1GeneralizedTime& buf, + OSBOOL useDerRules = FALSE); + + // copy ctor + + ASN1CGeneralizedTime (const ASN1CGeneralizedTime& original) : + ASN1CTime (original) {} + + /** + * This method returns the centry part (first two digits) of the year + * component of the time value. + * + * @param - none + * @return Century part (first two digits) of the year component + * is returned if the operation is sucessful. If the + * operation fails, one of the negative status codes is + * returned. + */ + /* + * Gets century part of the year (first two digits of the year). + * Returns: first 2 digits of the year - if success; + * error code - if parsed value is invalid. + */ + EXTRTMETHOD int getCentury(); + + /** + * This method sets the centry part (first two digits) of the year component + * of the time value. + * + * @param century Century part (first two digits) of the year component. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + /* + * Sets century part of the year (first 2 digits). + * Returns 0, if succeed, or error code, if error. + */ + EXTRTMETHOD int setCentury(int century); + + /** + * This converts the value of the C built-in type time_t to a time string. + * + * The value is the number of seconds from January 1, 1970. Note that the + * action of this method may differ for different inherited ASN1CTime + * Classes. + * + * @param time The time value, expressed as a number of seconds from + * January 1, 1970. + * @param diffTime TRUE means the difference between local time and UTC + * time will be calculated; in other case, only local + * time will be stored. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setTime(time_t time, OSBOOL diffTime); + + const ASN1CGeneralizedTime& operator = (const ASN1CGeneralizedTime& tm) { + return (const ASN1CGeneralizedTime&) ASN1CTime::operator = (tm); + } + protected: + /* + * Compiles new time string accoring X.680 (clause 41) and ISO 8601. + * Returns 0, if succeed, or error code, if error. + */ + EXTRTMETHOD int compileString(); +} ; +#else +typedef class _ASN1CGeneralizedTime : public _ASN1CTime { + protected: + _ASN1CGeneralizedTime(char*& buf, int bufSize, OSBOOL useDerRules) {} + _ASN1CGeneralizedTime(ASN1VisibleString& buf, OSBOOL useDerRules) {} + public: + _ASN1CGeneralizedTime (OSRTMessageBufferIF& msgBuf, char*& buf, int sz, + OSBOOL useDerRules = FALSE) : + _ASN1CTime (msgBuf, buf, sz, useDerRules) {} + _ASN1CGeneralizedTime (OSRTMessageBufferIF& msgBuf, ASN1VisibleString& buf, + OSBOOL useDerRules = FALSE) : + _ASN1CTime (msgBuf, buf, useDerRules) {} + _ASN1CGeneralizedTime(OSRTContext& ctxt, char*& buf, int bufSize, + OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {} + _ASN1CGeneralizedTime(OSRTContext& ctxt, ASN1VisibleString& buf, + OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {} +} ASN1CGeneralizedTime; +#endif // _NO_UTILS_CLASSES + +/** + * @}ASN1CGeneralizedTime + */ +/** + * @} asn1ctrl + */ + +#endif //__ASN1CGENTIME_H__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CSeqOfList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CSeqOfList.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,613 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1CSEQOFLIST_H_ +#define _ASN1CSEQOFLIST_H_ + +#ifndef __SYMBIAN32__ /* OS: Symbian */ +#include +#endif + +#include +#include "rtsrc/asn1CppTypes.h" +/** + * @file rtsrc/ASN1CSeqOfList.h + * ASN1CSeqOfList linked list control class definition. + */ +/** + * @addtogroup asn1ctrl + * @{ + */ + +// +// +// ASN1CSeqOfList +// +// Doubly-linked list implementation. This class provides all functionalty +// necessary for linked list. To iterate list use methods iterator, +// iteratorFrom, iteratorFromLast. +// +// Note: this implementation is not thread-safe. +// +// ASN1CSeqOfListIterator +// +// An iterator for lists that allows the programmer to traverse the +// list in either direction and modify the list during iteration. +// +// Author Artem Bolgar +// version 1.09, 12 Nov, 2003 +// version 1.08, 11 Feb, 2003 +// +#ifndef _NO_UTILS_CLASSES + +class EXTRTCLASS ASN1CSeqOfList; + +// +// +// ASN1CSeqOfListIterator +// +/** + * Linked list iterator class. The ASN1CSeqOfListIterator class is an iterator + * for linked lists (represented by ASN1CSeqOfList) that allows the programmer + * to traverse the list in either direction and modify the list during + * iteration. The iterator is fail-fast. This means the list is structurally + * modified at any time after the ASN1CSeqOfListIterator class is created, in + * any way except through the iterator's own remove or insert methods, the + * iterator's methods next and prev methods will return NULL. The remove, set + * and insert methods will return the RTERR_CONCMODF error code. + */ +class EXTRTCLASS ASN1CSeqOfListIterator { + friend class ASN1CSeqOfList; + protected: + ASN1CSeqOfList* pSeqList; // pointer to the list + OSRTDListNode* nextNode; // next node + OSRTDListNode* lastNode; // last returned node + volatile int expectedModCount; // expect modification counter + int stat; + + EXTRTMETHOD ASN1CSeqOfListIterator(ASN1CSeqOfList* list); + EXTRTMETHOD ASN1CSeqOfListIterator(ASN1CSeqOfList* list, OSRTDListNode* startNode); + + public: + /** + * This method returns TRUE if this iterator has more elements when + * traversing the list in the forward direction. + * + * In other words, the method returns TRUE if the \c next method would return + * an element rather than returning a null value. + * + * @return TRUE if next would return an element rather than + * returning a null value. + */ + inline OSBOOL hasNext() { return OSBOOL(nextNode != 0); } + + /** + * This method returns TRUE if this iterator has more elements when + * traversing the list in the reverse direction. + * + * In other words, this method will return TRUE if prev would return an + * element rather than returning a null value. + * + * @return TRUE if next would return an element rather than + * returning a null value. + */ + inline OSBOOL hasPrev() { return OSBOOL(nextNode != 0); } + + /** + * This method returns the next element in the list. + * + * This method may be called repeatedly to iterate through the list or + * intermixed with calls to prev to go back and forth. + * + * @return The next element in the list. A null value will be + * returned if the iteration is not successful. + */ + EXTRTMETHOD void* next(); + + /** + * This method returns the previous element in the list. + * + * This method may be called repeatedly to iterate through the list or + * intermixed with calls to next to go back and forth. + * + * @param - none + * @return The previous element in the list. A null value will be + * returned if the iteration is not successful. + */ + EXTRTMETHOD void* prev(); + + /** + * This method removes from the list the last element that was returned by + * the next or prev methods. + * + * This call can only be made once per call to the next or prev methods. + * + * @param - none + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int remove(); + + /** + * This method replaces the last element returned by the next or prev methods + * with the specified element. + * + * This call can be made only if neither remove nor insert methods have been + * called after the last call to next or prev methods. + * + * @param data The element that replaces the last element returned by + * the next or prev methods + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int set(void* data); + + /** + * This method inserts the specified element into the list. + * + * The element is inserted immediately before the next element that would be + * returned by the next method, if any, and after the next element would be + * returned by the prev method, if any. If the list contains no elements, the + * new element becomes the sole element in the list. The new element is + * inserted before the implicit cursor: a subsequent call to next would be + * unaffected, and a subsequent call to prev would return the new element. + * + * @param data The element to be inserted + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int insert(void* data); + + /* Returns the state of iterator. 0 if it is OK, RTERR_* value otherwise */ + inline int getState () { return stat; } + + protected: + inline void* operator new(size_t, void* data) { return data; } +#if !defined(__xlC__) + inline void operator delete(void*, void*) {} +#endif +#ifndef __BORLANDC__ + inline void operator delete(void*, size_t) {} +#endif +} ; + + +// +// +// ASN1CSeqOfList +// +/** + * Doubly-linked list implementation. This class provides all functionality + * necessary for linked list operations. It is the base class for ASN1C + * compiler-generated ASN1C_ control classes for SEQUENCE OF and SET OF PDU + * types. + */ +class EXTRTCLASS ASN1CSeqOfList : public ASN1CType { + friend class ASN1CSeqOfListIterator; + protected: + OSRTDList* pList; // list + volatile int modCount; // modification counter + OSBOOL wasAssigned; + + // The following protected ctor could be used to perform lists' operation, + // which do not require the memory allocation. + EXTRTMETHOD ASN1CSeqOfList (OSRTDList& lst); + EXTRTMETHOD ASN1CSeqOfList (ASN1TSeqOfList& lst); + EXTRTMETHOD ASN1CSeqOfList (ASN1TPDUSeqOfList& lst); + + public: + + /** + * This constructor creates a linked list using the OSRTDList argument. The + * constructor does not deep-copy the variable; it assigns a reference to it + * to an external variable. + * + * The object will then directly operate on the given list variable. + * + * @param msgBuf Reference to an ASN1Message buffer derived object + * (for example, an ASN1BEREncodeBuffer). + * @param lst Reference to a linked list structure. + * @param initBeforeUse Set to TRUE if the passed linked list needs to be + * initialized (rtxDListInit to be called). + */ + EXTRTMETHOD ASN1CSeqOfList (OSRTMessageBufferIF& msgBuf, OSRTDList& lst, + OSBOOL initBeforeUse = TRUE); + + /** + * This constructor creates an empty linked list. + * + * @param msgBuf Reference to an ASN1Message buffer derived object (for + * example, an ASN1BEREncodeBuffer). + */ + EXTRTMETHOD ASN1CSeqOfList (OSRTMessageBufferIF& msgBuf); + + /** + * This constructor creates an empty linked list. + * + * @param ccobj Reference to a control class object (for example, + * any generated ASN1C_ class object). + */ + EXTRTMETHOD ASN1CSeqOfList (ASN1CType& ccobj); + + /** + * This constructor creates a linked list using the ASN1TSeqOfList (holder of + * OSRTDList) argument. + * + * The construction does not deep-copy the variable, it assigns a reference + * to it to an internal variable. The object will then directly operate on + * the given list variable. This constructor is used with a + * compiler-generated linked list variable. + * + * @param msgBuf Reference to an ASN1Message buffer derived object (for + * example, an ASN1BEREncodeBuffer). + * @param lst Reference to a linked list holder. + */ + EXTRTMETHOD ASN1CSeqOfList (OSRTMessageBufferIF& msgBuf, ASN1TSeqOfList& lst); + + /** + * This constructor creates a linked list using the ASN1TSeqOfList (holder of + * OSRTDList) argument. + * + * The construction does not deep-copy the variable, it assigns a reference + * to it to an internal variable. The object will then directly operate on + * the given list variable. This constructor is used with a + * compiler-generated linked list variable. + * + * @param ccobj Reference to a control class object (for example, + * any generated ASN1C_ class object). + * @param lst Reference to a linked list holder. + */ + EXTRTMETHOD ASN1CSeqOfList (ASN1CType& ccobj, ASN1TSeqOfList& lst); + + /** + * This constructor creates a linked list using the ASN1TPDUSeqOfList + * argument. + * + * The construction does not deep-copy the variable, it assigns a reference + * to it to an internal variable. The object will then directly operate on + * the given list variable. This constructor is used with a + * compiler-generated linked list variable. + * + * @param msgBuf Reference to an ASN1Message buffer derived object (for + * example, an ASN1BEREncodeBuffer). + * @param lst Reference to a linked list holder. + */ + EXTRTMETHOD ASN1CSeqOfList (OSRTMessageBufferIF& msgBuf, ASN1TPDUSeqOfList& lst); + + EXTRTMETHOD ASN1CSeqOfList (OSRTContext& ctxt, OSRTDList& lst, + OSBOOL initBeforeUse = TRUE); + EXTRTMETHOD ASN1CSeqOfList (OSRTContext& ctxt); + EXTRTMETHOD ASN1CSeqOfList (OSRTContext& ctxt, ASN1TSeqOfList& lst); + EXTRTMETHOD ASN1CSeqOfList (OSRTContext& ctxt, ASN1TPDUSeqOfList& lst); + + EXTRTMETHOD ~ASN1CSeqOfList(); + + // Appends new list node with data + /** + * This method appends an item to the linked list. + * + * This item is represented by a void pointer that can point to an object of + * any type. The rtxMemAlloc function is used to allocate memory for the list + * node structure, therefore, all internal list memory will be released + * whenever rtxMemFree is called. + * + * @param data Pointer to a data item to be appended to the list. + * @return - none + */ + EXTRTMETHOD void append(void* data); + + // Appends array to list data. Data won't be copied, just assigned. + /** + * This method appends array items' pointers to a doubly linked list. + * + * The rtxMemAlloc function is used to allocate memory for the list node + * structure, therefore all internal list memory will be released whenever + * the rtxMemFree is called. The data is not copied; it is just assigned to + * the node. + * + * @param data Pointer to source array to be appended to the list. + * @param numElems The number of elements in the source array. + * @param elemSize The size of one element in the array. Use the + * sizeof() operator to pass this parameter. + * @return - none + */ + EXTRTMETHOD void appendArray(const void* data, int numElems, int elemSize); + + // Appends array to list data. Data will be copied. + /** + * This method appends array items into a doubly linked list. + * + * The rtxMemAlloc function is used to allocate memory for the list node + * structure; therefore all internal list memory will be released whenever + * rtxMemFree is called. The data will be copied; the memory will be + * allocated using rtxMemAlloc. + * + * @param data Pointer to source array to be appended to the list. + * @param numElems The number of elements in the source array. + * @param elemSize The size of one element in the array. Use the sizeof() + * operator to pass this parameter. + * @return - none + */ + EXTRTMETHOD void appendArrayCopy(const void* data, int numElems, int elemSize); + + /** + * This method initializes the linked list structure. + */ + inline void init () { + rtxDListInit (pList); + } + + // Inserts new list node at the specified index + /** + * This method inserts an item into the linked list structure. + * + * The item is represented by a void pointer that can point to an object of + * any type. The rtxMemAlloc function is used to allocate memory for the list + * node structure. All internal list memory will be released when the + * rtxMemFree function is called. + * + * @param index Index at which the specified item is to be inserted. + * @param data Pointer to data item to be appended to the list. + * @return - none + */ + EXTRTMETHOD void insert(int index, void* data); + + // Removes list node at specified index from the list + /** + * This method removed a node at the specified index from the linked list + * structure. + * + * The rtxMemAlloc function was used to allocate the memory for the list node + * structure, therefore, all internal list memory will be released whenever + * the rtxMemFree is called. + * + * @param index Index of the item to be removed. + * @return - none + */ + EXTRTMETHOD void remove(int index); + + // Removes the first occurrence of the specified element in the list. + /** + * This method removes the first occurrence of the node with specified data + * from the linked list structure. + * + * The rtxMemAlloc function was used to allocate the memory for the list node + * structure, therefore, all internal list memory will be released whenever + * the rtxMemFree function is called. + * + * @param data - Pointer to the data item to be appended to the list. + */ + EXTRTMETHOD void remove(void* data); + + // Removes the first element from the list. + /** + * This method removes the first node (head) from the linked list structure. + * + * @param - none + * @return - none + */ + inline void removeFirst() { + remove(pList->head); + } + + // Removes the last element from the list. + /** + * This method removes the last node (tail) from the linked list structure. + * + * @param - none + * @return - none + */ + inline void removeLast() { + remove(pList->tail); + } + + // Returns index of the list node with specified data + /** + * This method returns the index in this list of the first occurrence of the + * specified item, or -1 if the list does not contain the time. + * + * @param data - Pointer to data item to searched. + * @return The index in this list of the first occurrence of the + * specified item, or -1 if the list does not contain + * the item. + */ + EXTRTMETHOD int indexOf(void* data) const; + + // Returns 'TRUE' if this list contains the specified element. + /** + * This method returns TRUE if this list contains the specified pointer. Note + * that a match is not done on the contents of each data item (i.e. + * what is pointed at by the pointer), only the pointer values. + * + * @param data - Pointer to data item. + * @return TRUE if this pointer value found in the list. + */ + inline OSBOOL contains (void* data) const { + return indexOf(data) != -1; + } + + /** + * This method returns the first item from the list or null if there are no + * elements in the list. + * + * @return The first item of the list. + */ + EXTRTMETHOD void* getFirst(); + + /** + * This method returns the last item from the list or null if there are no + * elements in the list. + * + * @return The last item in the list. + */ + EXTRTMETHOD void* getLast(); + + /** + * This method returns the item at the specified position in the list. + * + * @param index Index of the item to be returned. + * @return The item at the specified index in the list. + */ + EXTRTMETHOD void* get (int index) const; + + /** + * This method replaces the item at the specified index in this list with the + * specified item. + * + * @param index The index of the item to be replaced. + * @param data The item to be stored at the specified index. + * @return The item previously at the specified position. + */ + EXTRTMETHOD void* set (int index, void* data); + + /** + * This method removes all items from the list. + */ + EXTRTMETHOD void clear(); + + /** + * This method removes all items from the list and frees the associated + * memory. + */ + EXTRTMETHOD void free(); + + /** + * This method returns TRUE if the list is empty. + * + * @return TRUE if this list is empty. + */ + EXTRTMETHOD OSBOOL isEmpty() const; + + /** + * This method returns the number of nodes in the list. + * + * @return The number of items in this list. + */ + EXTRTMETHOD int size() const; + + /** + * This method returns an iterator over the elements in the linked list in + * the sequence from the fist to the last. + * + * @return The iterator over this linked list. + + */ + EXTRTMETHOD ASN1CSeqOfListIterator* iterator(); + + // Creates iterator from the tail of the list + /** + * This method creates a reverse iterator over the elements in this linked + * list in the sequence from last to first. + * + * @param - none + * @return The reverse iterator over this linked list. + + */ + EXTRTMETHOD ASN1CSeqOfListIterator* iteratorFromLast(); + + // Creates iterator from the node with specified data + /** + * This method runs an iterator over the elements in this linked list + * starting from the specified item in the list. + * + * @param data The item of the list to be iterated first. + * @return The iterator over this linked list. + + */ + EXTRTMETHOD ASN1CSeqOfListIterator* iteratorFrom(void* data); + + /** + * This method converts the linked list into a new array. + * + * The rtxMemAlloc function is used to allocate memory for an array. + * + * @param elemSize The size of one element in the array. Use the + * sizeof() operator to pass this parameter. + * @return The point to converted array. + */ + EXTRTMETHOD void* toArray (int elemSize); + + // Converts to array + /** + * This method converts the linked list into an array. + * + * The rtxMemAlloc function is used to allocate memory for the array if the + * capacity of the specified array is exceeded. + * + * @param pArray Pointer to destination array. + * @param elemSize The size of one element in the array. Use the + * sizeof() operator to pass this parameter. + * @param allocatedElems The number of elements already allocated in the + * array. If this number is less than the number + * of nodes in the list, then a new array is + * allocated and returned. Memory is allocated + * using rtxMemAlloc function. + * @return The pointer to the converted array. + */ + EXTRTMETHOD void* toArray (void* pArray, int elemSize, int allocatedElems); + + // Returns element at specified index + /** + * This method is the overloaded operator[]. + * + * It returns the item at the specified position in the list. + * + * @see get (int index) + */ + inline void* operator[](int index) const { + return get(index); + } + + inline operator OSRTDList* () { + return pList; + } + protected: + // Removes specified node from the list + EXTRTMETHOD void remove(OSRTDListNode* node); + + // Inserts new node ('data') before another node ('node') + EXTRTMETHOD void insertBefore(void* data, OSRTDListNode* node); + + // Inserts new node ('data') after another node ('node') + EXTRTMETHOD void insertAfter(void* data, OSRTDListNode* node); + + +} ; +#else +typedef class _ASN1CSeqOfList : public ASN1CType { + public: + _ASN1CSeqOfList (OSRTMessageBufferIF& msgBuf, OSRTDList& lst, + OSBOOL initBeforeUse = TRUE) : ASN1CType (msgBuf) {} + _ASN1CSeqOfList (OSRTMessageBufferIF& msgBuf, ASN1TSeqOfList& lst) : + ASN1CType (msgBuf) {} + _ASN1CSeqOfList (OSRTMessageBufferIF& msgBuf) : ASN1CType (msgBuf) {} +} ASN1CSeqOfList; + +#endif // _NO_UTILS_CLASSES + +/** + * @} + */ + +#endif // _ASN1CSEQOFLIST_H_ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,673 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef __ASN1CTIME_H__ +#define __ASN1CTIME_H__ + +#ifndef _WIN32_WCE +#include +#endif +#include "rtsrc/asn1CppTypes.h" +#include "rtsrc/ASN1TTime.h" + +/** + * @file rtsrc/ASN1CTime.h + * ASN1CTime abstract class definition. This is used + * as the base class for other ASN.1 time class definitions. + */ +/** + * @addtogroup asn1ctrl + * @{ + */ +/** + * @defgroup asn1ctime Date and Time Runtime Classes + * The date and time classes contain methods for doing date/time calculations + * for the various ASN.1 time types including GeneralizedTime and UTCTime. + * + * @{ + */ + +// +// +// ASN1CTime +// +// ISO 8601 time and date for ITU-T X.680. +// +// Author Artem Bolgar. +// +#ifndef _NO_UTILS_CLASSES + +#define LOG_TMERR(pctxt,stat) ((pctxt != 0) ? LOG_RTERR (pctxt, stat) : stat) + +/** + * ASN.1 Time control base class. + * The ASN1CTime class is derived from the ASN1CType base class. It is used as + * the abstract base class for generated control classes for the ASN.1 + * Generalized Time ([UNIVERSAL 24] IMPLICIT VisibleString) types and Universal + * Time ([UNIVERSAL 23] IMPLICIT VisibleString) types. This class provides + * utility methods for operating on the time information referenced by the + * generated class. This class can also be used inline to operate on the times + * within generated time string elements in a SEQUENCE, SET, or CHOICE + * construct. The time string are generally formatted according to ISO 8601 + * format with some exceptions (X.680). + */ +class EXTRTCLASS ASN1CTime : public ASN1CType { + protected: + OSBOOL parsed; + OSBOOL derRules; + + char*& timeStr; + int strSize; + + EXTRTMETHOD void checkCapacity(); + + /* + * Returns time string pointer. NULL, if error occurred. + */ + EXTRTMETHOD char*& getTimeStringPtr (); + + virtual ASN1TTime& getTimeObj () = 0; + virtual const ASN1TTime& getTimeObj () const = 0; + + EXTRTMETHOD ASN1CTime(char*& buf, int bufSize, OSBOOL useDerRules); + EXTRTMETHOD ASN1CTime(ASN1VisibleString& buf, OSBOOL useDerRules); + private: + char timeStrBuf[MAX_TIMESTR_SIZE]; + char* pTimeStr; // placeholder + + EXTRTMETHOD void privateInit (); + + public: + enum { + January = 1, Jan = 1, + February = 2, Feb = 2, + March = 3, Mar = 3, + April = 4, Apr = 4, + May = 5, + June = 6, Jun = 6, + July = 7, Jul = 7, + August = 8, Aug = 8, + September = 9, Sep = 9, + October = 10, Oct = 10, + November = 11, Nov = 11, + December = 12, Dec = 12 + }; + + /** + * This constructor creates a time string from buffer. + * + * It does not deep-copy the data; it just assigns the passed array to an + * internal reference variable. The object will then directly operate on the + * given data variable. + * + * @param msgBuf Reference to an OSRTMessage buffer derived object (for + * example, \c ASNBEREncodeBuffer). + * @param buf Reference to a pointer to a time string buffer. + * @param bufSize Size of buffer in bytes. + * @param useDerRules Use the Distinguished Encoding Rules (DER) to operate + * on this time value. + */ + EXTRTMETHOD ASN1CTime (OSRTMessageBufferIF& msgBuf, char*& buf, int bufSize, + OSBOOL useDerRules); + + /** + * This constructor creates a time string from an \c ASN1VisibleString + * object. + * + * It does not deep-copy the data; it just assigns the passed object to an + * internal reference variable. The object will then directly operate on the + * given data variable. + * + * @param msgBuf Reference to an OSRTMessage buffer derived object (for + * example, \c ASNBEREncodeBuffer). + * @param buf Reference to a visible string object to hold the time + * data. + * @param useDerRules Use the Distinguished Encoding Rules (DER) to operate + * on this time value. + */ + EXTRTMETHOD ASN1CTime (OSRTMessageBufferIF& msgBuf, ASN1VisibleString& buf, + OSBOOL useDerRules); + + EXTRTMETHOD ASN1CTime (OSRTContext& ctxt, char*& buf, int bufSize, + OSBOOL useDerRules); + + EXTRTMETHOD ASN1CTime (OSRTContext& ctxt, ASN1VisibleString& buf, + OSBOOL useDerRules); + + /** + * The copy constructor. This does not deep-copy the original value. + * Instead, it assigns references to the internal components. + * + * @param original The original time string object value. + */ + EXTRTMETHOD ASN1CTime (const ASN1CTime& original); + + EXTRTMETHOD ~ASN1CTime(); + + /** + * This method returns the year component of the time value. + * + * Note that the return value may differ for different inherited ASN1CTime + * classes. + * + * @param - none + * @return Year component (full 4 digits) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getYear(); + + /** + * This method returns the month number component of the time value. + * + * The number of January is 1, February 2, ... up to December 12. You may + * also use enumerated valued for decoded months: ASN1CTime::January, + * ASN1CTime::February, etc. Also short aliases for months can be used: + * ASN1CTime::Jan, ASN1CTime::Feb, etc. Note that the return value may differ + * for different inherited ASN1CTime classes. + * + * @param - none + * @return Month component (1 - 12) is returned if operation is + * successful. If the operation fails, a negative value + * is returned. + */ + virtual EXTRTMETHOD int getMonth(); + + /** + * This method returns the day of month number component of the time value. + * + * The number of the first day in the month is 1; the number of the last day + * may be in the interval from 28 to 31. Note that the return value may be + * differ for different inherited ASN1CTime classes. + * + * @param - none + * @return Day of month component (1 - 31) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDay(); + + /** + * This method returns the hour component of the time value. + * + * As the ISO 8601 is based on the 24-hour timekeeping system, hours are + * represented by two-digit values from 00 to 23. Note that the return value + * may differ from different inherited ASN1CTime classes. + * + * @param - none + * @return Hour component (0 - 23) is returned if the operation + * is successful. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD int getHour(); + + /** + * This method returns the minute component of the time value. + * + * Minutes are represented by the two digits from 00 to 59. Note that the + * return value may differ from different inherited ASN1CTime classes. + * + * @param - none + * @return Minute component (0 - 59) is returned if the operation + * is successful. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD int getMinute(); + + /** + * This method returns the second component of the time value. + * + * Seconds are represented by two digits from 00 to 59. Note that the return + * value may differ from different inherited ASN1CTime classes. + * + * @param - none + * @return Second component (0 - 59) is returned if the operation + * is successful. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD int getSecond(); + + /** + * This method returns the second's decimal component of the time value. + * + * Second's decimal fraction is represented by one or more digits from 0 to 9. Note + * that the return value may differ for different inherited ASN1CTime + * classes. + * + * @param - none + * @return Second's decimal fraction component (0 - 9) is + * returned if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD int getFraction(); + + /** + * This method returns the second's decimal component of the time value. + * Second's fraction will be represented as double value more than 0 and + * less than 1. + * + * Second's decimal fraction is represented by one or more digits from 0 to 9. + * + * @return Second's decimal fraction component is + * returned if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD double getFractionAsDouble(); + + /** + * This method returns the second's decimal component of the time value. + * Second's fraction will be represented as string w/o integer part + * and decimal point. + * + * @return Length of the fraction string returned in pBuf, + * if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD int getFractionStr(char* const pBuf, size_t bufSize); + + /** + * This method returns the number of digits in second's decimal component + * of the time value. + * + * @return Second's decimal fraction's length is + * returned if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD int getFractionLen(); + + /** + * This method returns the hour component of the difference between the time + * zone of the object and the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive of negative time + * difference. Note that the return value may differ for different inherited + * ASN1CTime classes. + * + * @param - none + * @return The negative or positive hour component of the + * difference between the time zone of the object and + * the UTC time (-12 - +12) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDiffHour(); + + /** + * This method returns the minute component of the difference between the + * time zone of the object and the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive of negative time + * difference. Note that the return value may differ for different inherited + * ASN1CTime classes. + * + * @param - none + * @return The negative or positive minute component of the + * difference between the time zone of the object and + * the UTC time (-59 - +59) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDiffMinute(); + + /** + * This method returns the difference between the time zone of the object and + * the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive of negative time + * difference. Note that the return value may differ for different inherited + * ASN1CTime classes. + * + * @param - none + * @return The negative or positive minute component of the + * difference between the time zone of the object and + * the UTC time (-12*60 - +12*60) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDiff(); + + /** + * This method returns the UTC flag state. + * + * If the UTC flag is TRUE, then the time is a UTC time and symbol Z is added + * at the end of the time string. Otherwise, it is local time. + * + * @param - none + * @return UTC flag state is returned. + */ + virtual EXTRTMETHOD OSBOOL getUTC(); + + /** + * This method converts the time string to a value of the built-in C type + * time_t. + * + * The value is the number of seconds from January 1, 1970. If the time is + * represned as UTC time plus or minus a time difference, then the resulting + * value will be recalculated as local time. For example, if the time string + * is "19991208120000+0930", then this string will be converted to + * "19991208213000" and then converted to a time_t value. Note that the + * return value may differ for different inherited ASN1CTime classes. + * + * @param - none + * @return The time value, expressed as a number of seconds from + * January 1, 1970. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD time_t getTime(); + + /** + * This method sets the 'use DER' flag which enforces the DER rules + * when time strings are constructed or parsed. + */ + void setDER (OSBOOL bvalue) { derRules = bvalue; } + + /** + * This method sets teh UTC flag state. + * + * If the UTC flag is TRUE, then the time is a UTC time and symbol 'Z' is + * added to the end of the string. Otherwise, it is a local time. + * + * @param utc UTC flag state. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setUTC(OSBOOL utc); + + /** + * This method sets the year component of the time value. + * + * Note that the action of this method may differ for different inherited + * ASN1CTime classes. + * + * @param year_ Year component (full 4 digits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setYear(int year_); + + /** + * This method sets the month number component of the time value. + * + * The number of January is 1, February 2, ..., through December 12. You may + * use enumerated values for months encoding: ASN1CTime::January, + * ASN1CTime::February, etc. Also you can use short aliases for months: + * ASN1CTime::Jan, ASN1CTime::Feb, etc. Note that the action of this method + * may differ for different inherited ASN1CTime classes. + * + * @param month_ Month component (1 - 12). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setMonth(int month_); + + /** + * This method sets the day of month number component of the time value. + * + * The number of the first day in the month is 1; the number of the last day + * in the month may be in the interval from 28 to 31. Note that the action of + * this method may differ for different inherited ASN1CTime classes. + * + * @param day_ Day of month component (1 - 31). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDay(int day_); + + /** + * This method sets the hour component of the time value. + * + * As the ISO 8601 is based on the 24-hour timekeeping system, hours are + * represented by two digits from 00 to 23. Note that the action of this + * method may differ for different inherited ASN1CTime classes. + * + * @param hour_ Hour component (0 - 23). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setHour(int hour_); + + /** + * This method sets the minute component of the time value. + * + * Minutes are represented by two digits from 00 to 59. Note that the action + * of this method may differ for different inherited ASN1CTime classes. + * + * @param minute_ Minute component (0 - 59). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setMinute(int minute_); + + /** + * This method sets the second component of the time value. + * + * Seconds are represented by two digits from 00 to 59. Note that the action + * of this method may differ form different inherited ASN1CTime classes. + * + * @param second_ Second component (0 - 59). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setSecond(int second_); + + /** + * This method sets the second's decimal fraction component of the time + * value. + * + * Second's decimal fraction is represented by one or more digits from 0 to 9. Note + * that the action of this method may differ for different inherited + * ASN1CTime classes. + * + * @param fraction Second's decimal fraction component (0 - 9). + * @param fracLen Optional parameter specifies number of digits in + * second's fraction. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setFraction(int fraction, int fracLen = -1); + + /** + * This method sets the second's decimal fraction component of the time + * value. Double value must be greater or equal 0 and less than 1. + * + * @param frac Second's decimal fraction component. + * @param fracLen Specifies number of digits in + * second's fraction. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setFraction (double frac, int fracLen); + + /** + * This method sets the second's decimal fraction component of the time + * value. Double value must be greater or equal 0 and less than 1. + * + * @param frac Second's decimal fraction component. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setFraction (char const* frac); + + /** + * This converts the value of the C built-in type time_t to a time string. + * + * The value is the number of seconds from January 1, 1970. Note that the + * action of this method may differ for different inherited ASN1CTime + * Classes. + * + * @param time The time value, expressed as a number of seconds from + * January 1, 1970. + * @param diffTime TRUE means the difference between local time and UTC + * time will be calculated; in other case, only local + * time will be stored. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int setTime(time_t time, OSBOOL diffTime) = 0; + + /** + * This method sets teh hour component of the difference between the time + * zone of the object and the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive or negative time + * difference. Note that the action of this method may differ from different + * inherited ASN1CTime classes. + * + * @param dhour The negative or positive hour component of the + * difference between the time zone of the object and + * the UTC time (-12 - +12) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDiffHour(int dhour); + + /** + * This method sets the hours and the minute components of the difference + * between the time zone of the object and Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive or negative time + * difference. Note that the action of this method may differ for different + * inherited ASN1CTime classes. + * + * @param dhour The negative or positive hour component of the + * difference between the time zone of the object and + * the UTC time (-12 - +12). + * @param dminute The negative or positive minute component of the + * difference between the time zone of the object and + * the UTC time (-59 - +59). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDiff(int dhour, int dminute); + + /** + * This method sets the difference between the time zone of the object and + * Coordinated Universal Time (UTC), in minutes. + * + * The UTC time is the sum of the local time and a positive or negative time + * difference. Note that the action of this method may differ for different + * inherited ASN1CTime classes. + * + * @param inMinutes The negative or positive difference, in minutes, + * between the time zone of the object and the UTC time + * (-12*60 - +12*60) is returned if the operation is + * successful. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDiff(int inMinutes); + + /** + * This method parses the given time string. + * + * The string is expected to be in the ASN.1 value notation format for the + * given ASN.1 time string type. Note that the action of this method may + * differ for different inherited ASN1CTime classes. + * + * @param string The time string value to be parsed. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int parseString(const char* string); + + /** + * This method clears the time string. + * + * Note the action of this method may differ for different inherited + * ASN1CTime classes. + * + * @param - none + * @return - none + */ + virtual EXTRTMETHOD void clear(); + + /** + * This method compares times. + * + */ + virtual EXTRTMETHOD int equals (ASN1CTime&); + + /* Returns the length of compiled time string */ + EXTRTMETHOD size_t getTimeStringLen (); + + /* Copies the compiled time string into specified buffer */ + EXTRTMETHOD const char* getTimeString (char* pbuf, size_t bufsize); + + EXTRTMETHOD const ASN1CTime& operator = (const ASN1CTime& ); + virtual EXTRTMETHOD OSBOOL operator == (ASN1CTime&); + virtual EXTRTMETHOD OSBOOL operator != (ASN1CTime&); + virtual EXTRTMETHOD OSBOOL operator > (ASN1CTime&); + virtual EXTRTMETHOD OSBOOL operator < (ASN1CTime&); + virtual EXTRTMETHOD OSBOOL operator >= (ASN1CTime&); + virtual EXTRTMETHOD OSBOOL operator <= (ASN1CTime&); + + protected: + /* + * Compiles new time string accoring X.680 and ISO 8601. + * Returns 0, if succeed, or error code, if error. + */ + virtual int compileString() = 0; + +} ; + +#else +typedef class _ASN1CTime : public ASN1CType { + protected: + _ASN1CTime(char*& buf, int bufSize, OSBOOL useDerRules) {} + _ASN1CTime(ASN1VisibleString& buf, OSBOOL useDerRules) {} + public: + _ASN1CTime (OSRTMessageBufferIF& msgBuf, char*& , int, OSBOOL) : + ASN1CType (msgBuf) {} + _ASN1CTime (OSRTMessageBufferIF& msgBuf, ASN1VisibleString&, OSBOOL) : + ASN1CType (msgBuf) {} + _ASN1CTime(OSRTContext& ctxt, char*& buf, int bufSize, + OSBOOL useDerRules) : ASN1CType (ctxt) {} + _ASN1CTime(OSRTContext& ctxt, ASN1VisibleString& buf, + OSBOOL useDerRules) : ASN1CType (ctxt) {} +} ASN1CTime; + +#endif // _NO_UTILS_CLASSES + +/** + * @} asn1ctime + */ +/** + * @} asn1ctrl + */ + +#endif //__ASN1CTIME_H__ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CUTCTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1CUTCTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,182 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** +@file +@internalTechnology +*/ + +#ifndef __ASN1CUTCTIME_H__ +#define __ASN1CUTCTIME_H__ + +#include "rtsrc/ASN1CTime.h" + +// +// +// ASN1CUTCTime +// +// ISO 8601 time and date for ITU-T X.680. +// +// Author Artem Bolgar. +// version 3.00 03 Sep, 2004 (refactored to use ASN1TUTCTime) +// +// version 2.13 11 Jul, 2003 (2038 year problem fixed + some other fixes) +// version 1.11 3 Aug, 2002 +// + +/** + * @file rtsrc/ASN1CUTCTime.h + * ASN1CUTCTime control class definition. + */ +/** + * @addtogroup asn1ctrl + * @{ + */ +/** + * @addtogroup asn1ctime + * @{ + */ + +#ifndef _NO_UTILS_CLASSES +/** + * ASN.1 UTCTime control class. + * The ASN1CUTTime class is derived from the ASN1CTime base class. It used as + * the bass class for generated control classes for the ASN.1 Universal Time + * ([UNIVERSAL 23] IMPLICIT VisibleString) type. This class provides utility + * methods for operating on the time information referenced by the generated + * class. This class can also be used inline to operate on the time within + * generated time string elements in a SEQUENCE, SET, or CHOICE construct. The + * string generally is encoded according to ISO 8601 format with some + * exceptions (see X.680). + */ +class EXTRTCLASS ASN1CUTCTime : public ASN1CTime { + protected: + ASN1TUTCTime timeObj; + + virtual ASN1TTime& getTimeObj () { return timeObj; } + virtual const ASN1TTime& getTimeObj () const { return timeObj; } + + EXTRTMETHOD ASN1CUTCTime(char*& buf, int bufSize, OSBOOL useDerRules = FALSE); + EXTRTMETHOD ASN1CUTCTime(ASN1UTCTime& buf, OSBOOL useDerRules = FALSE); + + public: + /** + * This constructor creates a time string from a buffer. + * + * It does not deep-copy the data, it just assigns the passed array to an + * internal reference variable. The object will then directly operate on the + * given data variable. + * + * @param msgBuf Reference to an ASN1MEssage buffer derived object (for + * example, an ASN1BEREncodeBuffer). + * @param buf Reference to a pointer to a time string buffer. + * @param bufSize Size of passed buffer, in bytes. + * @param useDerRules Use the Distinguished Encoding Rules to encode or + * decode the value, + */ + EXTRTMETHOD ASN1CUTCTime(OSRTMessageBufferIF& msgBuf, char*& buf, int bufSize, + OSBOOL useDerRules = FALSE); + + /** + * This constructor creates a time string suing the ASN1UTCTime argument. c + * The constructor does not deep-copy the variable, it assigns a referene to + * it to an internal variable. The object will then directly operate on the + * given data variable. This form of the constructor is used with a + * compiler-generated time string variable. + * + * @param msgBuf Reference to an ASN1MEssage buffer derived object (for + * example, an ASN1BEREncodeBuffer). + * @param buf Reference to a time string structure. + * @param useDerRules Use the Distinguished Encoding Rules to encode or + * decode the value, + */ + EXTRTMETHOD ASN1CUTCTime(OSRTMessageBufferIF& msgBuf, ASN1UTCTime& buf, + OSBOOL useDerRules = FALSE); + + EXTRTMETHOD ASN1CUTCTime(OSRTContext& ctxt, char*& buf, int bufSize, + OSBOOL useDerRules = FALSE); + + EXTRTMETHOD ASN1CUTCTime(OSRTContext& ctxt, ASN1UTCTime& buf, + OSBOOL useDerRules = FALSE); + + // copy ctor + + ASN1CUTCTime (const ASN1CUTCTime& original) : + ASN1CTime (original) {} + + /** + * Converts time_t to time string. + * + * @param time time to convert, + * @param diffTime TRUE means the difference between local time and UTC + * will be calculated; in other case only local time + * will be stored. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setTime(time_t time, OSBOOL diffTime); + + const ASN1CUTCTime& operator = (const ASN1CUTCTime& tm) { + return (ASN1CUTCTime&) ASN1CTime::operator = (tm); + } + + protected: + /* + * Compiles new time string accoring X.680 (clause 42) and ISO 8601. + * Returns 0, if successful, or error code, if error. + */ + EXTRTMETHOD int compileString(); + + /* + * Gets fraction of second, 0..9. + * Returns: Zero. + */ + EXTRTMETHOD int getFraction(); + + /* + * This method is not applicable for ASN1CUTCTime. + * Returns RTERR_NOTSUPP. + */ + EXTRTMETHOD int setFraction(int fraction); + +} ; +#else +typedef class _ASN1CUTCTime : public _ASN1CTime { + protected: + _ASN1CUTCTime(char*& buf, int bufSize, OSBOOL useDerRules) {} + _ASN1CUTCTime(ASN1VisibleString& buf, OSBOOL useDerRules) {} + public: + _ASN1CUTCTime (OSRTMessageBufferIF& msgBuf, char*& buf, int sz, + OSBOOL useDerRules = FALSE) : + _ASN1CTime (msgBuf, buf, sz, useDerRules) {} + _ASN1CUTCTime (OSRTMessageBufferIF& msgBuf, ASN1VisibleString& buf, + OSBOOL useDerRules = FALSE) : + _ASN1CTime (msgBuf, buf, useDerRules) {} + _ASN1CUTCTime(OSRTContext& ctxt, char*& buf, int bufSize, + OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {} + _ASN1CUTCTime(OSRTContext& ctxt, ASN1VisibleString& buf, + OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {} +} ASN1CUTCTime; +#endif // _NO_UTILS_CLASSES +#endif //__ASN1CUTCTIME_H__ + +/** + * @} + */ +/** + * @} + */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1Context.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1Context.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,72 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtsrc/ASN1Context.h + * Common C++ type and class definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1CONTEXT_H_ +#define _ASN1CONTEXT_H_ + +#include "rtxsrc/rtxDiag.h" +#include "rtxsrc/rtxError.h" +#include "rtxsrc/OSRTContext.h" + +/** + * @defgroup asn1context Context Management Classes + * This group of classes manages an OSCTXT structure. This is the C structure + * use to keep track of all of the working variables required to encode or + * decode an ASN.1 message. @{ + */ +/** + * Reference counted ASN.1 context class. This keeps track of all encode/decode + * function variables between function invocations. It is reference counted to + * allow a message buffer and type class to share access to it. + */ +class EXTRTCLASS ASN1Context : public OSRTContext { + public: + /** + * The default constructor initializes the mCtxt member variable for + * ASN.1 encoding/decoding. + */ + EXTRTMETHOD ASN1Context (); + + /** + * This method sets run-time key to the context. This method does nothing + * for unlimited redistribution libraries. + * + * @param key - array of octets with the key + * @param keylen - number of octets in key array. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setRunTimeKey (const OSOCTET* key, size_t keylen); + + // deprecated methods: all have been changed to begin with lowercase + // character (AB, 7/14/04).. + inline OSCTXT* GetPtr () { return &mCtxt; } + inline void PrintErrorInfo () { printErrorInfo (); } +}; + +/** @} */ + +#endif /* ASN1CONTEXT */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1TObjId.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1TObjId.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,466 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +// +// CHANGE LOG +// Date Init Description +// +// +/** + * @file rtsrc/ASN1TObjId.h + * ASN.1 object identifier class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1TOBJID_H_ +#define _ASN1TOBJID_H_ + +#include "rtsrc/asn1type.h" + +/** + * @ingroup cppruntime + */ +/** + * @addtogroup asn1data + * @{ + */ +/** + * Object identifier. This is the base class for generated C++ data type + * classes for object identifier values. + */ +struct EXTRTCLASS ASN1TObjId : public ASN1OBJID { + /** + * The default constructor creates an empty object identifier value. + */ + ASN1TObjId () { numids = 0; } + + /** + * The Virtual Destructor + */ + virtual EXTRTMETHOD ~ASN1TObjId (); + + /** + * This constructor initializes the object identifer to contain the given + * data values. + * + * @param _numids - Number of subidentifiers in the OID. + * @param _subids - Array of subidentifier values. + */ + EXTRTMETHOD ASN1TObjId (OSOCTET _numids, const OSUINT32* _subids); + + /** + * This constructor initializes the object identifier to contain the given + * data values. This can be used to set the value to a compiler-generated + * OID value. + * + * @param oid - C object identifier value. + */ + EXTRTMETHOD ASN1TObjId (const ASN1OBJID& oid); + + /** + * The copy constructor. + * + * @param oid - C++ object identifier value. + */ + EXTRTMETHOD ASN1TObjId (const ASN1TObjId& oid); + + /** + * Construct an OID from a dotted string. + * + * @param dotted_oid_string - for example "1.3.1.6.1.10" + */ + EXTRTMETHOD ASN1TObjId (const char *dotted_oid_string); + + /** + * Assignment from a string. + * + * @param dotted_oid_string - New value (for example "1.3.6.1.6.0"); + */ + EXTRTMETHOD ASN1TObjId& operator=(const char *dotted_oid_string); + + /** + * This assignment operator sets the object identifier to contain the OID in + * the given C structure. This can be used to set the value to a + * compiler-generated OID value. + * + * @param rhs - C object identifier value. + */ + EXTRTMETHOD void operator= (const ASN1OBJID& rhs); + + /** + * This assignment operator sets the object identifier to contain the OID in + * the given C++ structure. + * + * @param rhs - C++ object identifier value. + */ + EXTRTMETHOD void operator= (const ASN1TObjId& rhs); + + /** + * Overloaded += operator. + * This operator allows subidentifiers in the form of a dotted OID + * string ("n.n.n") to be appended to an existing OID object. + * + * @param dotted_oid_string - C++ object identifier value. + * @return - True if values are equal. + */ + EXTRTMETHOD ASN1TObjId& operator+=(const char *dotted_oid_string); + + /** + * Overloaded += operator. + * This operator allows a single subidentifier in the form of an + * integer value to be appended to an existing OID object. + * + * @param i - Subidentifier to append. + * @return - True if values are equal. + */ + EXTRTMETHOD ASN1TObjId& operator+=(const OSUINT32 i); + + /** + * Overloaded += operator. + * This operator allows one object identifier to be appended to + * another object identifier. + * + * @param o - C++ object identifier value. + * @return - True if values are equal. + */ + EXTRTMETHOD ASN1TObjId& operator+=(const ASN1TObjId &o); + + /** + * Get a printable ASCII string of a part of the value. + * + * @param pctxt - Pointer to a context structure. + * @return - Dotted OID string (for example "3.6.1.6") + */ + EXTRTMETHOD const char *toString (OSCTXT* pctxt) const; + + /** + * Sets the data of an object identifier using a pointer and a length. + * + * @param raw_oid - Pointer to an array of subidentifier values. + * @param oid_len - Number of subids in the array, + */ + EXTRTMETHOD void set_data (const OSUINT32 *raw_oid, OSUINT32 oid_len); + + /** + * Compare the first n sub-ids(left to right) of two object identifiers. + * + * @param n - Number of subid values to compare. + * @param o - OID to compare this OID with. + * @return - 0 if OID's are equal, -1 if this OID less than + * given OID, +1 if this OID > given OID. + */ + EXTRTMETHOD int nCompare(const OSUINT32 n, const ASN1TObjId &o) const; + + /** + * Compare the last n sub-ids(right to left) of two object identifiers. + * + * @param n - Number of subid values to compare. + * @param o - OID to compare this OID with. + * @return - 0 if OID's are equal, -1 if this OID less than + * given OID, +1 if this OID > given OID. + */ + EXTRTMETHOD int RnCompare(const OSUINT32 n, const ASN1TObjId &o) const; + + /** + * Trim the given number of rightmost sub elements from this OID. + * + * @param n - number of subids to trim from OID + */ + EXTRTMETHOD void trim(const OSUINT32 n); + +}; + +/** + * This comparison operator allows for comparison of equality of two C-based + * object identifier structures. + * + * @param lhs - C object identifier value. + * @param rhs - C object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator== (const ASN1OBJID& lhs, const ASN1OBJID& rhs); + +/** + * This comparison operator allows for comparison of equality of two C++-based + * object identifier structures. + * + * @param lhs - C++ object identifier value. + * @param rhs - C++ object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator==(const ASN1TObjId &lhs, const ASN1TObjId &rhs); + +/** + * This comparison operator allows for comparison of equality of a C-based + * object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator==(const ASN1OBJID &lhs, const char *dotted_oid_string); + +/** + * This comparison operator allows for comparison of equality of C++ based + * object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator==(const ASN1TObjId &lhs, const char *dotted_oid_string); + +/** + * Overloaded not equal operator. + * This comparison operator allows for comparison of not equality of C++ based + * object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param rhs - C++ object identifier value + * @return - True if values are equal. + */ +EXTERNRT int operator!=(const ASN1TObjId &lhs, const ASN1TObjId &rhs); + +/** + * Overloaded not equal operator. + * This comparison operator allows for comparison of not equality of C based + * object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param rhs - C object identifier value + * @return - True if values are equal. + */ +EXTERNRT int operator!=(const ASN1OBJID &lhs, const ASN1OBJID &rhs); + +/** + * Overloaded not equal operator. + * This comparison operator allows for comparison of not equality of C based + * object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator!=(const ASN1OBJID &lhs, const char *dotted_oid_string); + +/** + * Overloaded not equal operator. + * This comparison operator allows for comparison of not equality of C++ based + * object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator!=(const ASN1TObjId &lhs, const char *dotted_oid_string); + +/** + * Overloaded less than < operator. + * This comparison operator allows for comparison of less than of C++ based + * object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param rhs - C++ object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator<(const ASN1TObjId &lhs, const ASN1TObjId &rhs); + +/** + * Overloaded less than < operator. + * This comparison operator allows for comparison of less than of C based + * object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param rhs - C object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator<(const ASN1OBJID &lhs, const ASN1OBJID &rhs); + +/** + * Overloaded less than < operator. + * This comparison operator allows for comparison of less than of C based + * object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator<(const ASN1OBJID &lhs, const char *dotted_oid_string); + +/** + * Overloaded less than < operator. + * This comparison operator allows for comparison of less than of C++ based + * object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator<(const ASN1TObjId &lhs, const char *dotted_oid_string); + +/** + * Overloaded less than <= operator. + * This comparison operator allows for comparison of less than of C++ based + * object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param rhs - C++ object identifier value + * @return - True if values are equal. + */ +EXTERNRT int operator<=(const ASN1TObjId &lhs, const ASN1TObjId &rhs); + +/** + * Overloaded less than <= operator. + * This comparison operator allows for comparison of less than of C based + * object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param rhs - C object identifier value + * @return - True if values are equal. + */ +EXTERNRT int operator<=(const ASN1OBJID &lhs, const ASN1OBJID &rhs); + +/** + * Overloaded less than <= operator. + * This comparison operator allows for comparison of less than of a C++ based + * object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ + +EXTERNRT int operator<=(const ASN1TObjId &lhs, const char *dotted_oid_string); + +/** + * Overloaded less than <= operator. + * This comparison operator allows for comparison of less than or equal of + * a C based object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator<=(const ASN1OBJID &lhs, const char *dotted_oid_string); + + +/** + * Overloaded greater than > operator. + * This comparison operator allows for comparison of greater than of C++ based + * object identifier structures + * + * @param lhs - C++ object identifier value. + * @param rhs - C++ object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator>(const ASN1TObjId &lhs, const ASN1TObjId &rhs); + +/** + * Overloaded greater than > operator. + * This comparison operator allows for comparison of greater than of a C++ + * based object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator>(const ASN1TObjId &lhs, const char *dotted_oid_string); + +/** + * Overloaded greater than > operator. + * This comparison operator allows for comparison of greater than of C based + * object identifier structures. + * + * @param lhs - C object identifier value. + * @param rhs - C object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator>(const ASN1OBJID &lhs, const ASN1OBJID &rhs); + +/** + * Overloaded greater than > operator. + * This comparison operator allows for comparison of greater than of a C based + * object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator>(const ASN1OBJID &lhs, const char *dotted_oid_string); + +/** + * Overloaded greater than equal >= operator. + * This comparison operator allows for comparison of greater than or equal + * of C++ based object identifier structures. + * + * @param lhs - C++ object identifier value. + * @param rhs - C++ object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator>=(const ASN1TObjId &lhs, const ASN1TObjId &rhs); + +/** + * Overloaded greater than equal >= operator. + * This comparison operator allows for comparison of greater than or equal + * of a C++ based object identifier structure and a dotted string. + * + * @param lhs - C++ object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator>=(const ASN1TObjId &lhs, const char *dotted_oid_string); + +/** + * Overloaded greater than equal >= operator. + * This comparison operator allows for comparison of greater than or equal + * of C based object identifier structures. + * + * @param lhs - C object identifier value. + * @param rhs - C object identifier value. + * @return - True if values are equal. + */ +EXTERNRT int operator>=(const ASN1OBJID &lhs, const ASN1OBJID &rhs); + + +/** + * Overloaded greater than equal >= operator. + * This comparison operator allows for comparison of greater than or equal + * of a C based object identifier structure and a dotted string. + * + * @param lhs - C object identifier value. + * @param dotted_oid_string - String containing OID value to compare. + * @return - True if values are equal. + */ +EXTERNRT int operator>=(const ASN1OBJID &lhs, const char *dotted_oid_string); + +/** + * Overloaded append + operator. + * This operator allows two Object Identifier values to be concatanated. + * + * @param lhs - C++ object identifier value. + * @param rhs - C++ object identifier value. + * + */ +EXTERNRT ASN1TObjId operator +(const ASN1TObjId &lhs, const ASN1TObjId &rhs); + +#endif + +/** + * @} + */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1TOctStr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1TOctStr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,193 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +// +// CHANGE LOG +// Date Init Description +// +// +/** + * @file rtsrc/ASN1TOctStr.h + * ASN.1 OCTET string class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1TOCTSTR_H_ +#define _ASN1TOCTSTR_H_ + +#include "rtsrc/asn1type.h" +/** + * @ingroup cppruntime + */ +/** + * @addtogroup asn1data + * @{ + */ +/** + * Dynamic octet string. This is the base class for generated C++ data type + * classes for unsized OCTET string's. + */ +struct EXTRTCLASS ASN1TDynOctStr : public ASN1DynOctStr { + /** + * The default constructor creates an empty octet string. + */ + ASN1TDynOctStr () { numocts = 0; } + + /** + * This constructor initializes the octet string to contain the given data + * values. + * + * @param _numocts - Number of octet in the octet string. + * @param _data - The binary octet data values. + */ + ASN1TDynOctStr (OSUINT32 _numocts, const OSOCTET* _data) { + numocts = _numocts; + data = _data; + } + + /** + * This constructor initializes the octet string to contain the given data + * values. + * + * @param _os - C octet string structure. + */ + ASN1TDynOctStr (ASN1DynOctStr& _os) { + numocts = _os.numocts; + data = _os.data; + } + + /** + * This constructor initializes the octet string to contain the given data + * values. In this case, it is initializes the string to contain the + * characters in a null-terminated C character string. + * + * @param cstring - C null-terminated string. + */ + ASN1TDynOctStr (const char* cstring) { + if (strlen(cstring) > 0) { + numocts = (OSUINT32)strlen(cstring) + 1; + data = (const OSOCTET*) cstring; + } + else numocts = 0; + } + + /** + * This assignment operator sets the octet string to contain the characters + * in a null-terminated C character string. For example, myOctStr = "a + * char string"; + * + * @param cstring - C null-terminated string. + */ + ASN1TDynOctStr& operator= (const char* cstring) { + if (strlen(cstring) > 0) { + numocts = (OSUINT32)strlen(cstring) + 1; + data = (const OSOCTET*) cstring; + } + else numocts = 0; + return *this; + } + + /** + * This assignment operator sets the octet string to contain the characters + * from the given C++ octet string object. + * + * @param octet - Octet string object reference + */ + EXTRTMETHOD ASN1TDynOctStr& operator=(const ASN1TDynOctStr& octet); + + /** + * This method converts the binary octet string to a human-readable + * representation. The string is first checked to see if it contains + * all printable characters. If this is the case, the characters in + * the string are returned; otherwise, the string contents are converted + * into a hexadecimal character string. + * + * @param pctxt - Pointer to a context structure. + */ + EXTRTMETHOD const char* toString (OSCTXT* pctxt) const; + + /** + * This method converts the binary octet string to a hexadecimal + * string representation. + * + * @param pctxt - Pointer to a context structure. + */ + EXTRTMETHOD const char* toHexString (OSCTXT* pctxt) const; + + /** + * This method compares the first n octets of this octet string with + * the given octet string. + * + * @param n - Number of octets to compare + * @param o - Octet string for comparison + * @return - 0 if strings are equal, -1 if this octet string is + * less than the given string, +1 if this string > + * given string. + */ + EXTRTMETHOD int nCompare (OSUINT32 n, const ASN1TDynOctStr &o) const; + +} ; + +//operator== + +EXTERNRT int operator==(const ASN1TDynOctStr &lhs,const ASN1TDynOctStr &rhs); +EXTERNRT int operator==(const ASN1TDynOctStr &lhs,const char *string); +EXTERNRT int operator==(const ASN1DynOctStr &lhs,const ASN1DynOctStr &rhs); +EXTERNRT int operator==(const ASN1DynOctStr &lhs,const char *string); + +//operator != + +EXTERNRT int operator!=(const ASN1TDynOctStr &lhs,const ASN1TDynOctStr &rhs); +EXTERNRT int operator!=(const ASN1TDynOctStr &lhs,const char *string); +EXTERNRT int operator!=(const ASN1DynOctStr &lhs,const ASN1DynOctStr &rhs); +EXTERNRT int operator!=(const ASN1DynOctStr &lhs,const char *string); + +//operator < + +EXTERNRT int operator<(const ASN1TDynOctStr &lhs,const ASN1TDynOctStr &rhs); +EXTERNRT int operator<(const ASN1TDynOctStr &lhs,const char *string); +EXTERNRT int operator<(const ASN1DynOctStr &lhs,const ASN1DynOctStr &rhs); +EXTERNRT int operator<(const ASN1DynOctStr &lhs,const char *string); + +//operator <= + +EXTERNRT int operator<=(const ASN1TDynOctStr &lhs,const ASN1TDynOctStr &rhs); +EXTERNRT int operator<=(const ASN1TDynOctStr &lhs,const char *string); +EXTERNRT int operator<=(const ASN1DynOctStr &lhs,const ASN1DynOctStr &rhs); +EXTERNRT int operator<=(const ASN1DynOctStr &lhs,const char *string); + + //operator > + +EXTERNRT int operator>(const ASN1TDynOctStr &lhs,const ASN1TDynOctStr &rhs); +EXTERNRT int operator>(const ASN1TDynOctStr &lhs,const char *string); +EXTERNRT int operator>(const ASN1DynOctStr &lhs,const ASN1DynOctStr &rhs); +EXTERNRT int operator>(const ASN1DynOctStr &lhs,const char *string); + +//operator >= + +EXTERNRT int operator>=(const ASN1TDynOctStr &lhs,const ASN1TDynOctStr &rhs); +EXTERNRT int operator>=(const ASN1TDynOctStr &lhs,const char *string); +EXTERNRT int operator>=(const ASN1DynOctStr &lhs,const ASN1DynOctStr &rhs); +EXTERNRT int operator>=(const ASN1DynOctStr &lhs,const char *string); + +#endif + +/** + * @} + */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1TTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/ASN1TTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,850 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef __ASN1TTIME_H__ +#define __ASN1TTIME_H__ + +#ifndef _WIN32_WCE +#include +#endif +#include "rtsrc/asn1CppTypes.h" + +#define MAX_TIMESTR_SIZE 64 + +#define LOG_TTMERR(stat) (mStatus = stat, stat) + + +// +// +// ASN1TTime +// +// ISO 8601 time and date for ITU-T X.680. +// +// Author Artem Bolgar. +// + +/** + * @file rtsrc/ASN1TTime.h + */ +/** + * @ingroup cppruntime + */ +/** + * @addtogroup asn1data + * @{ + */ +/** + * @addtogroup asn1ctime + * @{ + */ +/** + * ASN.1 Time utility base class. + */ +class EXTRTCLASS ASN1TTime { + public: + short mYear; + short mMonth; + short mDay; + short mHour; + short mMinute; + short mSecond; + short mDiffHour; + short mDiffMin; + int mSecFraction; + int mSecFracLen; + int mStatus; + OSBOOL mbUtcFlag; + OSBOOL mbDerRules; + + enum { + January = 1, Jan = 1, + February = 2, Feb = 2, + March = 3, Mar = 3, + April = 4, Apr = 4, + May = 5, + June = 6, Jun = 6, + July = 7, Jul = 7, + August = 8, Aug = 8, + September = 9, Sep = 9, + October = 10, Oct = 10, + November = 11, Nov = 11, + December = 12, Dec = 12 + }; + + EXTRTMETHOD ASN1TTime (); + + /** + * This constructor creates an empty time class. + * + * @param useDerRules Use the Distinguished Encoding Rules (DER) to operate + * on this time value. + */ + EXTRTMETHOD ASN1TTime (OSBOOL useDerRules); + + + /** + * The copy constructor. + * + * @param original The original time string object value. + */ + EXTRTMETHOD ASN1TTime (const ASN1TTime& original); + + /** + * The destructor. + */ + virtual EXTRTMETHOD ~ASN1TTime(); + + /** + * This method returns the year component of the time value. + * + * Note that the return value may differ for different inherited ASN1TTime + * classes. + * + * @return Year component (full 4 digits) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getYear() const; + + /** + * This method returns the month number component of the time value. + * + * The number of January is 1, February 2, ... up to December 12. You may + * also use enumerated valued for decoded months: ASN1TTime::January, + * ASN1TTime::February, etc. Also short aliases for months can be used: + * ASN1TTime::Jan, ASN1TTime::Feb, etc. Note that the return value may differ + * for different inherited ASN1TTime classes. + * + * @return Month component (1 - 12) is returned if operation is + * successful. If the operation fails, a negative value + * is returned. + */ + virtual EXTRTMETHOD int getMonth() const; + + /** + * This method returns the day of month number component of the time value. + * + * The number of the first day in the month is 1; the number of the last day + * may be in the interval from 28 to 31. Note that the return value may be + * differ for different inherited ASN1TTime classes. + * + * @return Day of month component (1 - 31) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDay() const; + + /** + * This method returns the hour component of the time value. + * + * As the ISO 8601 is based on the 24-hour timekeeping system, hours are + * represented by two-digit values from 00 to 23. Note that the return value + * may differ from different inherited ASN1TTime classes. + * + * @return Hour component (0 - 23) is returned if the operation + * is successful. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD int getHour() const; + + /** + * This method returns the minute component of the time value. + * + * Minutes are represented by the two digits from 00 to 59. Note that the + * return value may differ from different inherited ASN1TTime classes. + * + * @return Minute component (0 - 59) is returned if the operation + * is successful. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD int getMinute() const; + + /** + * This method returns the second component of the time value. + * + * Seconds are represented by two digits from 00 to 59. Note that the return + * value may differ from different inherited ASN1TTime classes. + * + * @return Second component (0 - 59) is returned if the operation + * is successful. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD int getSecond() const; + + /** + * This method returns the second's decimal component of the time value. + * + * Second's decimal fraction is represented by one or more digits from 0 to 9. + * + * @return Second's decimal fraction component is + * returned if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD int getFraction() const; + + /** + * This method returns the second's decimal component of the time value. + * Second's fraction will be represented as double value more than 0 and + * less than 1. + * + * Second's decimal fraction is represented by one or more digits from 0 to 9. + * + * @return Second's decimal fraction component is + * returned if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD double getFractionAsDouble() const; + + /** + * This method returns the second's decimal component of the time value. + * Second's fraction will be represented as string w/o integer part + * and decimal point. + * + * @return Length of the fraction string returned in pBuf, + * if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD int getFractionStr(char* const pBuf, size_t bufSize) const; + + /** + * This method returns the number of digits in second's decimal component + * of the time value. + * + * @return Second's decimal fraction's length is + * returned if operation is successful. If the + * operation fails, a negative value is returned. + */ + virtual EXTRTMETHOD int getFractionLen() const; + + /** + * This method returns the hour component of the difference between the time + * zone of the object and the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive of negative time + * difference. Note that the return value may differ for different inherited + * ASN1TTime classes. + * + * @return The negative or positive hour component of the + * difference between the time zone of the object and + * the UTC time (-12 - +12) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDiffHour() const; + + /** + * This method returns the minute component of the difference between the + * time zone of the object and the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive of negative time + * difference. Note that the return value may differ for different inherited + * ASN1TTime classes. + * + * @return The negative or positive minute component of the + * difference between the time zone of the object and + * the UTC time (-59 - +59) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDiffMinute() const; + + /** + * This method returns the difference between the time zone of the object and + * the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive of negative time + * difference. Note that the return value may differ for different inherited + * ASN1TTime classes. + * + * @return The negative or positive minute component of the + * difference between the time zone of the object and + * the UTC time (-12*60 - +12*60) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + */ + virtual EXTRTMETHOD int getDiff() const; + + /** + * This method returns the UTC flag state. + * + * If the UTC flag is TRUE, then the time is a UTC time and symbol Z is added + * at the end of the time string. Otherwise, it is local time. + * + * @return UTC flag state is returned. + */ + virtual EXTRTMETHOD OSBOOL getUTC() const; + + /** + * This method converts the time string to a value of the built-in C type + * time_t. + * + * The value is the number of seconds from January 1, 1970. If the time is + * represned as UTC time plus or minus a time difference, then the resulting + * value will be recalculated as local time. For example, if the time string + * is "19991208120000+0930", then this string will be converted to + * "19991208213000" and then converted to a time_t value. Note that the + * return value may differ for different inherited ASN1TTime classes. + * + * @return The time value, expressed as a number of seconds from + * January 1, 1970. If the operation fails, a negative + * value is returned. + */ + virtual EXTRTMETHOD time_t getTime() const; + + /** + * This method sets the 'use DER' flag which enforces the DER rules + * when time strings are constructed or parsed. + */ + void setDER (OSBOOL bvalue) { mbDerRules = bvalue; } + + /** + * This method sets teh UTC flag state. + * + * If the UTC flag is TRUE, then the time is a UTC time and symbol 'Z' is + * added to the end of the string. Otherwise, it is a local time. + * + * @param utc UTC flag state. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setUTC(OSBOOL utc); + + /** + * This method sets the year component of the time value. + * + * Note that the action of this method may differ for different inherited + * ASN1TTime classes. + * + * @param year_ Year component (full 4 digits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setYear(int year_); + + /** + * This method sets the month number component of the time value. + * + * The number of January is 1, February 2, ..., through December 12. You may + * use enumerated values for months encoding: ASN1TTime::January, + * ASN1TTime::February, etc. Also you can use short aliases for months: + * ASN1TTime::Jan, ASN1TTime::Feb, etc. Note that the action of this method + * may differ for different inherited ASN1TTime classes. + * + * @param month_ Month component (1 - 12). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setMonth(int month_); + + /** + * This method sets the day of month number component of the time value. + * + * The number of the first day in the month is 1; the number of the last day + * in the month may be in the interval from 28 to 31. Note that the action of + * this method may differ for different inherited ASN1TTime classes. + * + * @param day_ Day of month component (1 - 31). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDay(int day_); + + /** + * This method sets the hour component of the time value. + * + * As the ISO 8601 is based on the 24-hour timekeeping system, hours are + * represented by two digits from 00 to 23. Note that the action of this + * method may differ for different inherited ASN1TTime classes. + * + * @param hour_ Hour component (0 - 23). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setHour(int hour_); + + /** + * This method sets the minute component of the time value. + * + * Minutes are represented by two digits from 00 to 59. Note that the action + * of this method may differ for different inherited ASN1TTime classes. + * + * @param minute_ Minute component (0 - 59). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setMinute(int minute_); + + /** + * This method sets the second component of the time value. + * + * Seconds are represented by two digits from 00 to 59. Note that the action + * of this method may differ form different inherited ASN1TTime classes. + * + * @param second_ Second component (0 - 59). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setSecond(int second_); + + /** + * This method sets the second's decimal fraction component of the time + * value. + * + * Second's decimal fraction is represented by one or more digits from 0 to 9. Note + * that the action of this method may differ for different inherited + * ASN1TTime classes. + * + * @param fraction Second's decimal fraction component (0 - 9). + * @param fracLen Optional parameter specifies number of digits in + * second's fraction. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setFraction(int fraction, int fracLen = -1); + + /** + * This method sets the second's decimal fraction component of the time + * value. Double value must be greater or equal 0 and less than 1. + * + * @param frac Second's decimal fraction component. + * @param fracLen Specifies number of digits in + * second's fraction. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setFraction (double frac, int fracLen); + + /** + * This method sets the second's decimal fraction component of the time + * value. Double value must be greater or equal 0 and less than 1. + * + * @param frac Second's decimal fraction component. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setFraction (char const* frac); + + /** + * This converts the value of the C built-in type time_t to a time string. + * + * The value is the number of seconds from January 1, 1970. Note that the + * action of this method may differ for different inherited ASN1TTime + * Classes. + * + * @param time The time value, expressed as a number of seconds from + * January 1, 1970. + * @param diffTime TRUE means the difference between local time and UTC + * time will be calculated; in other case, only local + * time will be stored. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int setTime(time_t time, OSBOOL diffTime) = 0; + + /** + * This method sets teh hour component of the difference between the time + * zone of the object and the Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive or negative time + * difference. Note that the action of this method may differ from different + * inherited ASN1TTime classes. + * + * @param dhour The negative or positive hour component of the + * difference between the time zone of the object and + * the UTC time (-12 - +12) is returned if the + * operation is successful. If the operation fails, a + * negative value is returned. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDiffHour(int dhour); + + /** + * This method sets the hours and the minute components of the difference + * between the time zone of the object and Coordinated Universal Time (UTC). + * + * The UTC time is the sum of the local time and a positive or negative time + * difference. Note that the action of this method may differ for different + * inherited ASN1TTime classes. + * + * @param dhour The negative or positive hour component of the + * difference between the time zone of the object and + * the UTC time (-12 - +12). + * @param dminute The negative or positive minute component of the + * difference between the time zone of the object and + * the UTC time (-59 - +59). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDiff(int dhour, int dminute); + + /** + * This method sets the difference between the time zone of the object and + * Coordinated Universal Time (UTC), in minutes. + * + * The UTC time is the sum of the local time and a positive or negative time + * difference. Note that the action of this method may differ for different + * inherited ASN1TTime classes. + * + * @param inMinutes The negative or positive difference, in minutes, + * between the time zone of the object and the UTC time + * (-12*60 - +12*60) is returned if the operation is + * successful. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setDiff(int inMinutes); + + /** + * This method parses the given time string. + * + * The string is expected to be in the ASN.1 value notation format for the + * given ASN.1 time string type. Note that the action of this method may + * differ for different inherited ASN1TTime classes. + * + * @param string The time string value to be parsed. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int parseString (const char* string) = 0; + + /** + * This method clears the time object. + * + * Note the action of this method may differ for different inherited + * ASN1TTime classes. + */ + virtual EXTRTMETHOD void clear(); + + /** + * Compiles new time string accoring X.680 and ISO 8601. + * Returns 0, if succeed, or error code, if error. + * + * @param pbuf A pointer to destination buffer. + * @param bufsize A size of destination buffer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int compileString (char* pbuf, size_t bufsize) const = 0; + + /** + * This method compares times. + * + */ + virtual EXTRTMETHOD int equals (const ASN1TTime&) const; + + /** + * Get a printable ASCII string of the time value into the specified buffer. + * + * @param pbuf Pointer to a destination buffer. + * @param bufsize Size of destination buffer. + * @return Compiled time string. NULL, if error occurs. + */ + EXTRTMETHOD const char* toString (char* pbuf, size_t bufsize) const; + + /** + * Get a printable ASCII string of the time value. + * + * @param pctxt Pointer to a context structure. + * @return Compiled time string. NULL, if error occurs. + */ + EXTRTMETHOD const char* toString (OSCTXT* pctxt) const; + + /** + * Get a printable ASCII string of the time value. Memory will be + * allocated using new[] operator. User is responsible to free it + * using delete[]. + * + * @return Compiled time string. NULL, if error occurs. + */ + EXTRTMETHOD const char* toString () const; + + EXTRTMETHOD const ASN1TTime& operator = (const ASN1TTime& ); + virtual EXTRTMETHOD OSBOOL operator == (const ASN1TTime&) const; + virtual EXTRTMETHOD OSBOOL operator != (const ASN1TTime&) const; + virtual EXTRTMETHOD OSBOOL operator > (const ASN1TTime&) const; + virtual EXTRTMETHOD OSBOOL operator < (const ASN1TTime&) const; + virtual EXTRTMETHOD OSBOOL operator >= (const ASN1TTime&) const; + virtual EXTRTMETHOD OSBOOL operator <= (const ASN1TTime&) const; + + protected: + EXTRTMETHOD static int checkDate (int day, int month, int year); + EXTRTMETHOD void privateInit (); + + EXTRTMETHOD static void addMilliseconds (int deltaMs, + short& year, short& month, short& day, + short& hour, short& minute, + short& second, int& secFraction, + int secFracLen); + EXTRTMETHOD static void addDays (int deltaDays, short& year, short& month, short& day); + + EXTRTMETHOD int getDaysNum () const; + EXTRTMETHOD long getMillisNum () const; + + EXTRTMETHOD static short daysInMonth(int i); + EXTRTMETHOD static int daysAfterMonth(int i); + +} ; + +/** + * ASN.1 GeneralizedTime utility class. + * The ASN1TGeneralizedTime class is derived from the ASN1TTime base class. + */ +class EXTRTCLASS ASN1TGeneralizedTime : public ASN1TTime { + public: + + /** + * A default constructor. + */ + inline ASN1TGeneralizedTime () {} + + /** + * This constructor creates a time object using the specified time string. + * + * @param buf A pointer to the time string to be parsed. + * @param useDerRules An OSBOOL value. + */ + EXTRTMETHOD ASN1TGeneralizedTime(const char* buf, OSBOOL useDerRules = FALSE); + + /** + * This constructor creates an empty time object. + * + * @param useDerRules An OSBOOL value. + */ + inline ASN1TGeneralizedTime(OSBOOL useDerRules) : + ASN1TTime (useDerRules) {} + + /** + * A copy constructor. + */ + inline ASN1TGeneralizedTime (const ASN1TGeneralizedTime& original) : + ASN1TTime (original) {} + + /** + * This method returns the centry part (first two digits) of the year + * component of the time value. + * + * @return Century part (first two digits) of the year component + * is returned if the operation is sucessful. If the + * operation fails, one of the negative status codes is + * returned. + */ + EXTRTMETHOD int getCentury() const; + + /** + * This method sets the centry part (first two digits) of the year component + * of the time value. + * + * @param century Century part (first two digits) of the year component. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setCentury(int century); + + /** + * This converts the value of the C built-in type time_t to a time string. + * + * The value is the number of seconds from January 1, 1970. + * + * @param time The time value, expressed as a number of seconds from + * January 1, 1970. + * @param diffTime TRUE means the difference between local time and UTC + * time will be calculated; in other case, only local + * time will be stored. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setTime(time_t time, OSBOOL diffTime); + + /** + * Parses sting. + * + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int parseString (const char* string); + + inline const ASN1TGeneralizedTime& operator = + (const ASN1TGeneralizedTime& tm) + { + return (const ASN1TGeneralizedTime&) ASN1TTime::operator = (tm); + } + + /** + * Compiles new time string accoring X.680 and ISO 8601. + * Returns 0, if succeed, or error code, if error. + * + * @param pbuf A pointer to destination buffer. + * @param bufsize A size of destination buffer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int compileString (char* pbuf, size_t bufsize) const; +} ; + +/** + * ASN.1 UTCTime utility class. + * The ASN1TUTTime class is derived from the ASN1TTime base class. + */ +class EXTRTCLASS ASN1TUTCTime : public ASN1TTime { + public: + + /** + * A default constructor. + */ + EXTRTMETHOD ASN1TUTCTime (); + + /** + * This constructor creates a time object using the specified time string. + * + * @param timeStr A pointer to the time string to be parsed. + * @param useDerRules Create object using DER rules. + */ + EXTRTMETHOD ASN1TUTCTime(const char* timeStr, OSBOOL useDerRules = FALSE); + + /** + * This constructor creates an empty time object. + * + * @param useDerRules An OSBOOL value. + */ + EXTRTMETHOD ASN1TUTCTime(OSBOOL useDerRules); + + /** + * A copy constructor. + */ + ASN1TUTCTime (const ASN1TUTCTime& original) : + ASN1TTime (original) {} + + /** + * This method sets the year component of the time value. + * + * The year parameter can be either the two last digits of the year + * (00 - 99) or the full four digits (0 - 9999). Note: the getYear method + * returns the year in the full four digits, independent of the format of the + * year parameter used in this method. + * + * @param year_ Year component (full four digits or only last two + * digits). + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setYear(int year_); + + /** + * Converts time_t to time string. + * + * @param time time to convert, + * @param diffTime TRUE means the difference between local time and UTC + * will be calculated; in other case only local time + * will be stored. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setTime(time_t time, OSBOOL diffTime); + + /** + * This method sets the UTC flag state. + * + * If the UTC flag is TRUE, then the time is a UTC time and symbol 'Z' is + * added to the end of the string. Otherwise, it is a local time. + * + * @param utc UTC flag state. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setUTC (OSBOOL utc); + + /** + * Clears out the time object. + */ + EXTRTMETHOD void clear(); + + /** + * Compiles new time string accoring X.680 and ISO 8601. + * Returns 0, if succeed, or error code, if error. + * + * @param pbuf A pointer to destination buffer. + * @param bufsize A size of destination buffer. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int compileString (char* pbuf, size_t bufsize) const; + + /** + * Parses the given time string. The string is assumed to be in standard + * UTC time format. + * + * @param string UTC time string to be parsed. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + EXTRTMETHOD int parseString(const char* string); + + const ASN1TUTCTime& operator = (const ASN1TUTCTime& tm) { + return (ASN1TUTCTime&) ASN1TTime::operator = (tm); + } + + protected: + /* + * Gets fraction of second, 0..9. + * Returns: Zero. + */ + EXTRTMETHOD int getFraction() const; + + /* + * This method is not applicable for ASN1TUTCTime. + * Returns RTERR_NOTSUPP. + */ + EXTRTMETHOD int setFraction (int fraction, int fracLen = -1); + +} ; +#endif //__ASN1TTIME_H__ + +/** + * @} + */ +/** + * @} + */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CEvtHndlr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CEvtHndlr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,345 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file asn1CEvtHndlr.h + * C event handler structure. The ASN1CEventHandler type is a structured type + * that can be used to define event handlers by the user. + */ +/** + * @defgroup Asn1CEventHandler Asn1CEventHandler + * Asn1CEventHandler is a structure typed used for user-defined event handlers. + * @ingroup cppruntime + * @{ + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1CEVTHNDLR_H_ +#define _ASN1CEVTHNDLR_H_ + +#include +#include "rtsrc/asn1type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This is a function pointer for a callback function which is invoked + * from within a decode function when an element of a SEQUENCE, SET, + * SEQUENCE OF, SET OF, or CHOICE construct is parsed. + * + * @param name For SEQUENCE, SET, or CHOICE, this is the name of the + * element as defined in the ASN.1 defination. For + * SEQUENCE OF or SET OF, this is set to the name + * "element". + * @param index For SEQUENCE, SET, or CHOICE, this is not used and is + * set to the value + * -1. For SEQUENCE OF or SET OF, this contains the + * zero-based index of the element in the conceptual + * array associated with the construct. + * @return - none + */ +typedef void (*rtxStartElement) (const char* name, int index) ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when parsing is complete on an element of a + * SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE construct. + * + * @param name For SEQUENCE, SET, or CHOICE, this is the name of the + * element as defined in the ASN.1 defination. For + * SEQUENCE OF or SET OF, this is set to the name + * "element". + * @param index For SEQUENCE, SET, or CHOICE, this is not used and is + * set to the value + * -1. For SEQUENCE OF or SET OF, this contains the + * zero-based index of the element in the conceptual + * array associated with the construct. + * @return - none + */ +typedef void (*rtxEndElement) (const char* name, int index) ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of the BOOLEAN ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ +typedef void (*rtxBoolValue) (OSBOOL value); + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of the INTERGER ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ +typedef void (*rtxIntValue) (OSINT32 value); + +/** + * This is a function pointer for a callback function which is invoked + * from within a decode function when a value of the INTEGER ASN.1 type + * is parsed. In this case, constraints on the integer value forced the + * use of unsigned integer C type to represent the value. + * + * @param value Parsed value. + * @return - none + */ +typedef void (*rtxUIntValue) (OSUINT32 value); + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of the 64-bit INTERGER ASN.1 type + * is parsed. + * + * @param value Parsed value. + * @return - none + */ +typedef void (*rtxInt64Value) (OSINT64 value); + +/** + * This is a function pointer for a callback function which is invoked + * from within a decode function when a value of the 64-bit INTEGER ASN.1 type + * is parsed. + * + * @param value Parsed value. + * @return - none + */ +typedef void (*rtxUInt64Value) (OSUINT64 value); + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of the BIT STRING ASN.1 type is + * parsed. + * + * @param numbits - Number of bits in the parsed value. + * @param data - Pointer to a byte array that contains the bit + * string data. + * @return - none + */ +typedef void (*rtxBitStrValue) (OSUINT32 numbits, const OSOCTET* data); + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of one of the OCTET STRING ASN.1 type + * is parsed. + * + * @param numocts Number of octets in the parsed value. + * @param data Pointer to byte array containing the octet string + * data. + * @return - none + */ +typedef void (*rtxOctStrValue) (OSUINT32 numocts, const OSOCTET* data) ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of one of the 8-bit ASN.1 character + * string types is parsed. + * + * @param value Null terminated character string value. + * @return - none + */ +typedef void (*rtxCharStrValue) (const char* value) ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of one of the 16-bit ASN.1 character + * string types is parsed. + * + * This is used for the ASN.1 BmpString type. + * + * @param nchars Number of characters in the parsed value. + * @param data Pointer to an array containing 16-bit values. + * These are represented using unsigned short integer + * values. + * @return - none + */ +typedef void (*rtxCharStrValue16Bit) (OSUINT32 nchars, OSUNICHAR* data) ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of one of the 32-bit ASN.1 characer + * string types is parsed. + * + * This is used for the ASN.1 UniversalString type. + * + * @param nchars Number of characters in the parsed value. + * @param data Pointer to an array containing 32-bit values. + * Each 32-bit integer value is a universal character. + * @return - none + */ +typedef void (*rtxCharStrValue32Bit) (OSUINT32 nchars, OS32BITCHAR* data) ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of the NULL ASN.1 type is parsed. + * + * @param - none + * @return - none + */ +typedef void (*rtxNullValue) () ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function whn a value the OBJECT IDENTIFIER ASN.1 type is + * parsed. + * + * @param numSubIds Number of subidentifiers in the object identifier. + * @param pSubIds Pointer to array containing the subidentifier values. + * @return -none + */ +typedef void (*rtxOidValue) (OSUINT32 numSubIds, OSUINT32* pSubIds) ; + + /** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value the REAL ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ +typedef void (*rtxRealValue) (double value) ; + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when a value of the ENUMERATED ASN.1 type is + * parsed. + * + * @param value - Parsed enumerated value + * @param text - Textual value of the enumerated identifier + * @return - none + */ +typedef void (*rtxEnumValue) (OSUINT32 value, const OSUTF8CHAR* text); + +/** + * This is a function pointer for a callback function which is invoked from + * within a decode function when an ASN.1 open type is parsed. + * + * @param numocts Number of octets in the parsed value. + * @param data Pointer to byet array contain in tencoded ASN.1 + * value. + * @return - none + */ +typedef void (*rtxOpenTypeValue) (OSUINT32 numocts, const OSOCTET* data) ; + +/** + * This is a basic C based event handler structure, which can be used + * to define user-defined event handlers. + */ +typedef struct Asn1NamedCEventHandler { + rtxStartElement startElement; + rtxEndElement endElement; + rtxBoolValue boolValue; + rtxIntValue intValue; + rtxUIntValue uIntValue; + rtxInt64Value int64Value; + rtxUInt64Value uInt64Value; + rtxBitStrValue bitStrValue; + rtxOctStrValue octStrValue; + rtxCharStrValue charStrValue; + rtxCharStrValue16Bit charStrValue16Bit; + rtxCharStrValue32Bit charStrValue32Bit; + rtxNullValue nullValue; + rtxOidValue oidValue; + rtxRealValue realValue; + rtxEnumValue enumValue; + rtxOpenTypeValue openTypeValue; +} Asn1NamedCEventHandler; + +/** + * This function is called to add a new event handler to the context event + * handler list. + * + * @param pCtxt Context to which event handler has to be added. + * @param pHandler Pointer to the event handler structure. + * @return none + */ + +EXTERNRT void rtAddEventHandler +(OSCTXT* pCtxt, Asn1NamedCEventHandler* pHandler); + +/** + * This function is called to remove an event handler from the context event + * handler list. Note that it does not delete the event handler object. + * + * @param pCtxt Context from which event handler has to be removed. + * @param pHandler Pointer to event handler structure. + * @return none + */ +EXTERNRT void rtRemoveEventHandler +(OSCTXT* pCtxt, Asn1NamedCEventHandler* pHandler); + +/** + * The following functions are invoked from within the generated + * code to call the various user-defined event handler methods .. + */ +EXTERNRT void rtInvokeStartElement +(OSCTXT* pCtxt, const char* name, int index); + +EXTERNRT void rtInvokeEndElement +(OSCTXT* pCtxt, const char* name, int index); + +EXTERNRT void rtInvokeBoolValue (OSCTXT* pCtxt, OSBOOL value); + +EXTERNRT void rtInvokeIntValue (OSCTXT* pCtxt, OSINT32 value); + +EXTERNRT void rtInvokeUIntValue (OSCTXT* pCtxt, OSUINT32 value); + +EXTERNRT void rtInvokeInt64Value (OSCTXT* pCtxt, OSINT64 value); + +EXTERNRT void rtInvokeUInt64Value (OSCTXT* pCtxt, OSUINT64 value); + +EXTERNRT void rtInvokeBitStrValue +(OSCTXT* pCtxt, OSUINT32 numbits, const OSOCTET* data); + +EXTERNRT void rtInvokeOctStrValue +(OSCTXT* pCtxt, OSUINT32 numocts, const OSOCTET* data); + +EXTERNRT void rtInvokeCharStrValue (OSCTXT* pCtxt, const char* value); + +EXTERNRT void rtInvokeCharStr16BitValue +(OSCTXT* pCtxt, OSUINT32 nchars, OSUNICHAR* data); + +EXTERNRT void rtInvokeCharStr32BitValue +(OSCTXT* pCtxt, OSUINT32 nchars, OS32BITCHAR* data); + +EXTERNRT void rtInvokeNullValue (OSCTXT* pCtxt); + +EXTERNRT void rtInvokeOidValue +(OSCTXT* pCtxt, OSUINT32 numSubIds, OSUINT32* pSubIds); + +EXTERNRT void rtInvokeRealValue (OSCTXT* pCtxt, double value); + +EXTERNRT void rtInvokeEnumValue +(OSCTXT* pCtxt, OSUINT32 value, const OSUTF8CHAR* text); + +EXTERNRT void rtInvokeOpenTypeValue +(OSCTXT* pCtxt, OSUINT32 numocts, const OSOCTET* data); + + +#ifdef __cplusplus +} +#endif + +#endif + +/** + * @} + */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CharSet.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CharSet.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,96 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file asn1CharSet.h + */ +/* +// CHANGE LOG +// Date Init Description +// +// +*/ +/* asn1CharSet.h - ASN.1 character set definitions */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1CHARSET_H_ +#define _ASN1CHARSET_H_ + +/* Canonical character set definitions */ + +#define NUM_ABITS 4 +#define NUM_UBITS 4 +#define NUM_CANSET \ +" 0123456789" + +#define PRN_ABITS 8 +#define PRN_UBITS 7 +#define PRN_CANSET \ +" '()+,-./0123456789:=?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + +#define VIS_ABITS 8 +#define VIS_UBITS 7 +#define VIS_CANSET \ +" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]"\ +"^_`abcdefghijklmnopqrstuvwxyz{|}~" + +#define T61_ABITS 8 +#define T61_UBITS 7 +#define T61_CANSET \ +" !\"%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]"\ +"_abcdefghijklmnopqrstuvwxyz" + +#define IA5_ABITS 8 +#define IA5_UBITS 7 +#define IA5_CANSET \ +"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017"\ +"\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"\ +" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]"\ +"^_`abcdefghijklmnopqrstuvwxyz{|}~" + +#define IA5_RANGE1_LOWER 0 +#define IA5_RANGE2_LOWER 0x5f + +#define GEN_ABITS 8 +#define GEN_UBITS 7 +#define GEN_CANSET \ +"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017"\ +"\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"\ +" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"\ +"`abcdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207"\ +"\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237"\ +"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257"\ +"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277"\ +"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317"\ +"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337"\ +"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357"\ +"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" + +#define BMP_ABITS 16 +#define BMP_UBITS 16 +#define BMP_FIRST 0 +#define BMP_LAST 0xffff + +#define UCS_ABITS 32 +#define UCS_UBITS 32 +#define UCS_FIRST 0 +#define UCS_LAST 0xfffffffful + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CppEvtHndlr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CppEvtHndlr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,363 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +// rtsrc/asn1CppEvtHndlr.h - this .h file defines the object that is registered +// for the C++ version of the event handler feature. + +/** + * @file rtsrc/asn1CppEvtHndlr.h + * Named event handler base class. The Asn1Named Event Handler class is + * an abstract base class from which user-defined event handlers are derived. + * This class contains pure virtual function definitions for all of the + * methods that must be implemented to create a customized event handler + * class. + */ +/** + * @defgroup Asn1NamedEventHandler Named Event Handlers + * Named Event Handler Classes include base classes from which user-defined + * error handler and event handler classes are derived. + * @ingroup cppruntime + * @{ + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1CPPEVTHNDLR_H_ +#define _ASN1CPPEVTHNDLR_H_ + +#include "rtsrc/asn1type.h" + +// The following pure abstract class defines the event handler interface +// callback functions that are invoked as a message is parsed.. +/** + * Named event handler base class. This is the base class from which + * user-defined event handler classes are derived. These classes can be + * used to handle events during the parsing of an ASN.1 message. The + * event callback methods that can be implemented are startElement, + * endElement, and contents methods. + */ +class EXTRTCLASS Asn1NamedEventHandler { + public: + Asn1NamedEventHandler() {} + virtual ~Asn1NamedEventHandler() {} + + // Start element callback function. This is invoked upon entry into + // an element in a constructed type (SEQUENCE, SET, SEQUENCE OF, + // SET OF, or CHOICE). A single char* argument (name) is passed. + /** + * This method is invoked from within a decode function when an element of a + * SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE construct is parsed. + * + * @param name For SEQUENCE, SET, or CHOICE, this is the name of the + * element as defined in the ASN.1 defination. For + * SEQUENCE OF or SET OF, this is set to the name + * "element". + * @param index For SEQUENCE, SET, or CHOICE, this is not used and is + * set to the value + * -1. For SEQUENCE OF or SET OF, this contains the + * zero-based index of the element in the conceptual + * array associated with the construct. + * @return - none + */ + virtual void startElement (const char* name, int index) = 0; + + // End element callback function. This is invoked upon exit from + // a constructed type. A single char* argument (name) is passed. + /** + * This method is invoked from within a decode function when parsing is + * complete on an element of a SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE + * construct. + * + * @param name For SEQUENCE, SET, or CHOICE, this is the name of the + * element as defined in the ASN.1 defination. For + * SEQUENCE OF or SET OF, this is set to the name + * "element". + * @param index For SEQUENCE, SET, or CHOICE, this is not used and is + * set to the value + * -1. For SEQUENCE OF or SET OF, this contains the + * zero-based index of the element in the conceptual + * array associated with the construct. + * @return - none + */ + virtual void endElement (const char* name, int index) = 0; + + // Data callback functions. These are invoked when data contents + // are parsed from a field. A separate callback is invoked for + // each of the ASN.1 primitive data types.. + + /** + * This method is invoked from within a decode function when a value of the + * BOOLEAN ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ + virtual void boolValue (OSBOOL value) = 0; + + /** + * This method is invoked from within a decode function when a value of the + * INTEGER ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ + virtual void intValue (OSINT32 value) = 0; + + /** + * This method is invoked from within a decode function when a value of the + * INTEGER ASN.1 type is parsed. + * + * In this case, constraints on the integer value forced the use of unsigned + * integer C type to represent the value. + * + * @param value Parsed value. + * @return - none + */ + virtual void uIntValue (OSUINT32 value) = 0; + + /** + * This method is invoked from within a decode function when a value of the + * 64-bit INTEGER ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ + virtual void int64Value (OSINT64 value) { + intValue ((OSINT32)value); + } + + /** + * This method is invoked from within a decode function when a value of the + * 64-bit INTEGER ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ + virtual void uInt64Value (OSUINT64 value) { + uIntValue ((OSUINT32)value); + } + + /** + * This method is invoked from within a decode function when a value of the + * BIT STRING ASN.1 type is parsed. + * + * @param numbits - Number of bits in the parsed value. + * @param data - Pointer to a byte array that contains the bit + * string data. + * @return - none + */ + virtual void bitStrValue (OSUINT32 numbits, const OSOCTET* data) = 0; + + /** + * This method is invoked from within a decode function when a value of one + * of the OCTET STRING ASN.1 type is parsed. + * + * @param numocts Number of octets in the parsed value. + * @param data Pointer to byte array containing the octet string + * data. + * @return - none + */ + virtual void octStrValue (OSUINT32 numocts, const OSOCTET* data) = 0; + + /** + * This method is invoked from within a decode function when a value of one + * of the 8-bit ASN.1 character string types is parsed. + * + * @param value Null terminated character string value. + * @return - none + */ + virtual void charStrValue (const char* value) = 0; + + /** + * This method is invoked from within a decode function when a value of one + * of the 16-bit ASN.1 character string types is parsed. + * + * This is used for the ASN.1 BmpString type. + * + * @param nchars Number of characters in the parsed value. + * @param data Pointer to an array containing 16-bit values. + * These are represented using unsigned short integer + * values. + * @return - none + */ + virtual void charStrValue (OSUINT32 nchars, OSUNICHAR* data) = 0; + + /** + * This method is invoked from within a decode function when a value of one + * of the 32-bit ASN.1 characer string types is parsed. + * + * This is used for the ASN.1 UniversalString type. + * + * @param nchars Number of characters in the parsed value. + * @param data Pointer to an array containing 32-bit values. + * Each 32-bit integer value is a universal character. + * @return - none + */ + virtual void charStrValue (OSUINT32 nchars, OS32BITCHAR* data) = 0; + + /** + * This method is invoked from within a decode function when a value of the + * NULL ASN.1 type is parsed. + * + * @param - none + * @return - none + */ + virtual void nullValue () = 0; + + /** + * This method is invoked from within a decode function whn a value the + * OBJECT IDENTIFIER ASN.1 type is parsed. + * + * @param numSubIds Number of subidentifiers in the object identifier. + * @param pSubIds Pointer to array containing the subidentifier values. + * @return -none + */ + virtual void oidValue (OSUINT32 numSubIds, OSUINT32* pSubIds) = 0; + + /** + * This method is invoked from within a decode function when a value the + * REAL ASN.1 type is parsed. + * + * @param value Parsed value. + * @return - none + */ + virtual void realValue (double value) = 0; + + /** + * This method is invoked from within a decode function when a value of the + * ENUMERATED ASN.1 type is parsed. + * + * @param value - Parsed enumerated value + * @param text - Textual value of enumerated identifier + * @return - none + */ + virtual void enumValue (OSUINT32 value, const OSUTF8CHAR* text) = 0; + + /** + * This value is invoked from within a decode function when an ASN.1 open + * type is parsed. + * + * @param numocts Number of octets in the parsed value. + * @param data Pointer to byet array contain in tencoded ASN.1 + * value. + * @return - none + */ + virtual void openTypeValue (OSUINT32 numocts, const OSOCTET* data) = 0; + + // The following static function is called to add a new event handler + // to the context event handler list.. + + EXTRTMETHOD static void addEventHandler (OSCTXT* pCtxt, + Asn1NamedEventHandler* pHandler); + + // The following static function is called to remove an event handler + // from the context event handler list. Note that it does not delete + // the event handler object. + + EXTRTMETHOD static void removeEventHandler (OSCTXT* pCtxt, + Asn1NamedEventHandler* pHandler); + + // The following static methods are invoked from within the generated + // code to call the various user-defined event handler methods .. + + EXTRTMETHOD static void invokeStartElement (OSCTXT* pCtxt, const char* name, int index); + EXTRTMETHOD static void invokeEndElement (OSCTXT* pCtxt, const char* name, int index); + EXTRTMETHOD static void invokeBoolValue (OSCTXT* pCtxt, OSBOOL value); + EXTRTMETHOD static void invokeIntValue (OSCTXT* pCtxt, OSINT32 value); + EXTRTMETHOD static void invokeUIntValue (OSCTXT* pCtxt, OSUINT32 value); + EXTRTMETHOD static void invokeInt64Value (OSCTXT* pCtxt, OSINT64 value); + EXTRTMETHOD static void invokeUInt64Value (OSCTXT* pCtxt, OSUINT64 value); + EXTRTMETHOD static void invokeBitStrValue (OSCTXT* pCtxt, OSUINT32 numbits, + const OSOCTET* data); + EXTRTMETHOD static void invokeOctStrValue (OSCTXT* pCtxt, OSUINT32 numocts, + const OSOCTET* data); + EXTRTMETHOD static void invokeCharStrValue (OSCTXT* pCtxt, const char* value); + EXTRTMETHOD static void invokeCharStrValue (OSCTXT* pCtxt, OSUINT32 nchars, + OSUNICHAR* data); + EXTRTMETHOD static void invokeCharStrValue (OSCTXT* pCtxt, OSUINT32 nchars, + OS32BITCHAR* data); + EXTRTMETHOD static void invokeNullValue (OSCTXT* pCtxt); + EXTRTMETHOD static void invokeOidValue (OSCTXT* pCtxt, OSUINT32 numSubIds, + OSUINT32* pSubIds); + EXTRTMETHOD static void invokeRealValue (OSCTXT* pCtxt, double value); + EXTRTMETHOD static void invokeEnumValue (OSCTXT* pCtxt, OSUINT32 value, + const OSUTF8CHAR* text); + EXTRTMETHOD static void invokeOpenTypeValue (OSCTXT* pCtxt, OSUINT32 numocts, + const OSOCTET* data); + +} ; + +// The following pure abstract class defines the error handler interface +// callback functions that are invoked when a parsing error occurs.. + +class EXTRTCLASS ASN1MessageBuffer ; + +/** + * Error handler base class. This is the base class from which + * user-defined error classes are derived. These classes can be + * used to provide fault-tolerance when parsing a message. The normal + * decoder behavior is to stop decoding when it encounters an error. + * An error handler can be used to ignore or take corrective action + * that will allow the decoding process to continue. + */ +class EXTRTCLASS Asn1ErrorHandler { + public: + Asn1ErrorHandler() {} + virtual ~Asn1ErrorHandler() {} + + /** + * The error handler callback method. This is the method that the user + * must override to provide customized error handling. + * + * @param pCtxt - Pointer to a context block structure. + * @param pCCB - Pointer to a context control block structure. + * @param stat - The error status that caused the handler to be invoked. + * @return - Corrected status. Set to 0 to cause decoding to + * continue or to a negative status code (most likely \c stat) to + * cause decoding to terminate. + */ + virtual int error (OSCTXT* pCtxt, ASN1CCB* pCCB, int stat) = 0; + + // The following static method is called from within the generated + // code to call the virtual error callback method.. + + EXTRTMETHOD static int invoke (OSCTXT* pCtxt, ASN1CCB* pCCB, int stat); + + // The following static method is called from within the generated + // code to call the virtual error callback method.. + + EXTRTMETHOD static int invoke (OSCTXT* pCtxt, OSOCTET* ptr, int len, int stat); + + /** + * This static method is called to set the error handler + * within the context structure. Note that unlike event handlers, only + * a single error handling object can be specified. This must be + * called by the user to specify the error handling object prior to + * execution of the main decode function.. + * + * @param pCtxt - Pointer to a context block structure. + * @param pHandler - Pointer to error handler object to register. + */ + EXTRTMETHOD static void setErrorHandler (OSCTXT* pCtxt, + Asn1ErrorHandler* pHandler); + +} ; +/** + * @}Asn1NamedEventHandler + */ +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CppTypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1CppTypes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,743 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +// +// CHANGE LOG +// Date Init Description +// 07/14/04 AB Exceptions have been removed +// 04/19/02 ED Added XEREncode, XERDecode message buffer types +// 04/19/02 ED Removed StringOverflow and added RTLError excp +// 07/14/02 ED Changed all methods to being with lowercase +// char for consistency. Added deprecated inline +// methods for those that did not to maintain +// backward compatibility. +// 07/16/02 AB added 'const' to RTLError::getStatus +// 10/29/02 CZ Added/modified doxygen code for groups. +// +// + +/** + * @file rtsrc/asn1CppTypes.h + * Common C++ type and class definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1CPPTYPES_H_ +#define _ASN1CPPTYPES_H_ + +#include "rtxsrc/rtxMemory.h" +#include "rtxsrc/rtxDiag.h" +#include "rtxsrc/rtxError.h" +#include "rtxsrc/rtxMemBuf.h" +#include "rtsrc/asn1CppEvtHndlr.h" +#include "rtsrc/ASN1Context.h" +#include "rtxsrc/OSRTMsgBuf.h" + +// for compatibilty only +#define ASN1TRY try +#define ASN1RTLTHROW(stat) exit (-1) +#define ASN1THROW(ex) exit (-1) +#define ASN1CATCH(exType,ex,body) if (0) { body; } + +/** + * @defgroup cppruntime C++ Run-Time Classes + * The OSRT C++ run-time classes are wrapper classes that provide an + * object-oriented interface to the common C run-time library functions. The + * categories of classes provided are as follows: + *
    + *
  • Context management classes manage the context structure (OSCTXT) + * used to keep track of the working variables required to encode or + * decode XML messages.
  • + *
  • Message buffer classes are used to manage message buffers for + * encoding or decoding XML messages.
  • + *
  • XSD type base classes are used as the base for compiler- + * generated C++ data structures.
  • + *
  • Stream classes are used to read and write messages to and from + * files, sockets, and memory buffers.
  • + *
+ * @{ + */ +/** + * @defgroup osrtmsgbuf OSRT Message Buffer Classes + * @{ + */ +/** + * Abstract ASN.1 message buffer base class. This class is used to manage a + * message buffer containing an ASN.1 message. For encoding, this is the buffer + * the message is being built in. For decoding, it is a message that was read + * into memory to be decoded. Further classes are derived from this to handle + * encoding and decoding of messages for different encoding rules types. + */ +class EXTRTCLASS ASN1MessageBuffer : public OSRTMessageBuffer +{ + protected: + + /** + * The protected constructor creates a new context and sets the buffer class + * type. + * + * @param bufferType Type of message buffer that is being created (for + * example, BEREncode). + */ + EXTRTMETHOD ASN1MessageBuffer (Type bufferType); + + /** + * This constructor sets the buffer class type and also a pointer to a + * context created by the user. + * + * @param bufferType Type of message buffer that is being created (for + * example, BEREncode). + * @param pContext A pointer to an OSRTContext structure previously + * created by the user. */ + EXTRTMETHOD ASN1MessageBuffer (Type bufferType, OSRTContext* pContext); + + /** + * This method sets error status to the context. + * + * @return Error status value being set. + */ + virtual int setStatus (int stat) { + mpContext->setStatus (stat); + return stat; + } + + public: + /** + * The virtual destructor does nothing. It is overridden by derived versions + * of this class. + */ + virtual ~ASN1MessageBuffer () {} + + /** + * The addEventHandler method is used to register a used-defined named event + * handler. Methods from within this handler will be invoked when this + * message buffer is used in the decoding of a message. + * + * @param pEventHandler - Pointer to named event handler object to + * register. + */ + virtual void addEventHandler (Asn1NamedEventHandler* pEventHandler) { + Asn1NamedEventHandler::addEventHandler + (getCtxtPtr(), pEventHandler); + } + +#ifndef __SYMBIAN32__ + /** + * The CStringToBMPString method is a utility function for converting a + * null-terminated Ascii string into a BMP string. A BMP string contains + * 16-bit Unicode characters. + * + * @param cstring - Null-terminated character string to convert + * @param pBMPString - Pointer to BMP string target variable + * @param pCharSet - Pointer to permitted alphabet character set. If + * provided, index to character within this set is + * returned. + */ + virtual ASN1BMPString* CStringToBMPString + (const char* cstring, ASN1BMPString* pBMPString, + Asn116BitCharSet* pCharSet = 0); +#endif + + /** + * Returns a pointer to application-specific information block + */ + virtual void* getAppInfo () { return 0; } + + /** + * This version of the overloaded initBuffer method initializes the message + * buffer to point at the memory contained within the referenced OSRTMEMBUF + * object. + * + * @param membuf OSRTMEMBUF memory buffer class object reference. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int initBuffer (OSRTMEMBUF& membuf); + + /** + * This version of the overloaded initBuffer method initializes the message + * buffer to point at the given Unicode string. This is used mainly for XER + * (XML) message decoding. + * + * @param unistr Pointer to a Unicode character string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int initBuffer (OSUNICHAR* unistr); + + /** + * This version of the overloaded initBuffer method initializes the message + * buffer to point at the given null-terminated UTF-8 character string. + * + * @param str Pointer to a null-terminated ASCII character + * string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int initBuffer (const OSUTF8CHAR* /*str*/) { return RTERR_NOTSUPP; } + + /** + * This method checks the type of the message buffer. + * + * @param bufferType Enumerated identifier specifying a derived class. + * Possible values + * are: BEREncode, BERDecode, PEREncode, PERDecode, + * XEREncode, XERDecode, XMLEncode, XMLDecode, + * Stream. + * @return Boolean result of the match operation. True if this + * is the class corresponding to the identifier + * argument. + */ + virtual OSBOOL isA (Type /*bufferType*/) { return FALSE; } + + /** + * The removeEventHandler method is used to de-register a used-defined named + * event handler. + * + * @param pEventHandler - Pointer to named event handler object to + * de-register. + */ + virtual void removeEventHandler (Asn1NamedEventHandler* pEventHandler) { + Asn1NamedEventHandler::removeEventHandler + (getCtxtPtr(), pEventHandler); + } + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + virtual void resetErrorInfo () { + OSRTMessageBuffer::resetErrorInfo (); + } + + /** + * Sets the application-specific information block. + */ + virtual void setAppInfo (void* /*pAppInfo*/) { } + + /** + * The setErrorHandler method is used to register a used-defined error + * handler. Methods from within this handler will be invoked when an error + * occurs in decoding a message using this message buffer object. + * + * @param pErrorHandler - Pointer to error handler object to register. + */ + virtual void setErrorHandler (Asn1ErrorHandler* pErrorHandler) { + Asn1ErrorHandler::setErrorHandler + (getCtxtPtr(), pErrorHandler); + } + + /** + * This method sets run-time key to the context. This method does nothing + * for unlimited redistribution libraries. + * + * @param key - array of octets with the key + * @param keylen - number of octets in key array. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setRunTimeKey (const OSOCTET* key, size_t keylen); + + // The following are deprecated method definitions maintained for + // backward compatibility only.. + + inline OSOCTET* GetMsgCopy () { return getMsgCopy(); } + inline const OSOCTET* GetMsgPtr() { return getMsgPtr(); } + inline void PrintErrorInfo() { printErrorInfo(); } + +} ; +/** @} */ + +/** + * @defgroup asn1ctrl Control (ASN1C_) Base Classes + * The ASN1C Control Base Classes are used as the base for compiler-generated + * ASN1C_ classes. These are wrapper classes that can be used to encode/decode + * PDU types and as helper classes for performing operations on complex data + * types. @{ + */ +/** + * ASN1C control class base class. This is the main base class for all + * generated ASN1C_\ control classes. It holds a variable of a generated + * data type as well as the associated message buffer or stream class to which + * a message will be encoded or from which a message will be decoded. + */ +class EXTRTCLASS ASN1CType { + protected: + /** + * The mpContext member variable holds a reference-counted C runtime + * variable. This context is used in calls to all C run-time functions. The + * context pointed at by this smart-pointer object is shared with the + * message buffer object contained within this class. + */ + OSRTCtxtPtr mpContext; + + /** + * The mpMsgBuf member variable is a pointer to a derived message buffer or + * stream class that will manage the ASN.1 message being encoded or decoded. + */ + OSRTMessageBufferIF* mpMsgBuf; + + /** + * The default constructor sets the message pointer member variable to NULL + * and creates a new context object. + */ + EXTRTMETHOD ASN1CType (); + + /** + * This constructor sets the message pointer member variable to NULL and + * initializes the context object to point at the given context value. + * + * @param ctxt - Reference to a context object. + */ + EXTRTMETHOD ASN1CType (OSRTContext& ctxt); + + EXTRTMETHOD int setMsgBuf (OSRTMessageBufferIF& msgBuf, OSBOOL initBuf=FALSE); + + /** + * This method sets run-time key to the context. This method does nothing + * for unlimited redistribution libraries. + * + * @param key - array of octets with the key + * @param keylen - number of octets in key array. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ + EXTRTMETHOD int setRunTimeKey (const OSOCTET* key, size_t keylen); + + public: + /** + * This constructor sets the internal message buffer pointer to point at the + * given message buffer or stream object. The context is set to point at the + * context contained within the message buffer object. Thus, the message + * buffer and control class object share the context. It will not be + * released until both objects are destroyed. + * + * @param msgBuf - Reference to a message buffer or stream object. + */ + EXTRTMETHOD ASN1CType (OSRTMessageBufferIF& msgBuf); + + /** + * The copy constructor sets the internal message buffer pointer and context + * to point at the message buffer and context from the original ASN1CType + * object. + * + * @param orig - Reference to a message buffer or stream object. + */ + EXTRTMETHOD ASN1CType (const ASN1CType& orig); + + /** + * The virtual destructor does nothing. It is overridden by derived versions + * of this class. + */ + virtual ~ASN1CType () {} + + /** + * The append method can be used to append an element to any + * linked list structure contained within the generated type. + * + * @param llist Linked list structure. + * @param pdata Data record to be appended. Note that the pointer + * value is appended. The data is not copied. + */ + inline void append (OSRTDList& llist, void* pdata) { + rtxDListAppend (getCtxtPtr(), &llist, pdata); + } + + /** + * The getContext method returns the underlying context smart-pointer + * object. + * + * @return Context smart pointer object. + */ + inline OSRTCtxtPtr getContext () { + return mpContext; + } + + /** + * The getCtxtPtr method returns the underlying C runtime context. This + * context can be used in calls to C runtime functions. + */ + inline OSCTXT* getCtxtPtr () { + return (!mpContext.isNull ()) ? mpContext->getPtr() : 0; + } + + /** + * This method returns the completion status of previous operation. + * It can be used to check completion status of constructors or methods, + * which do not return completion status. If error occurs, use + * printErrorInfo method to print out the error's description and + * stack trace. + * Method resetError can be used to reset error to continue operations + * after recovering from the error. + * + * @return Runtime status code: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int getStatus () const { + return (!mpContext.isNull()) ? mpContext->getStatus() : 0; + } + + /** + * The memAlloc method allocates memory using the C runtime memory + * management functions. The memory is tracked in the underlying context + * structure. When both this ASN1CType derived control class object and the + * message buffer object are destroyed, this memory will be freed. + * + * @param numocts Number of bytes of memory to allocate + * @return Void pointer to allocated memory or NULL if + * insufficient memory was available to fulfill the request. + */ + inline void* memAlloc (size_t numocts) { + if (mpContext.isNull ()) return 0; + return mpContext->memAlloc (numocts); + } + + /** + * The \c memFreeAll method will free all memory currently tracked within + * the context. This includes all memory allocated with the memAlloc method + * as well as any memory allocated using the C \c rtxMemAlloc function with + * the context returned by the \c getCtxtPtr method. + */ + inline void memFreeAll () { + if (!mpContext.isNull ()) + mpContext->memFreeAll (); + } + + /** + * The memRealloc method reallocates memory using the C runtime memory + * management functions. + * + * @param ptr Original pointer containing dynamic memory to be + * resized. + * @param numocts Number of bytes of memory to allocate + * @return Reallocated memory pointer + */ + inline void* memRealloc (void* ptr, size_t numocts) { + if (mpContext.isNull ()) return 0; + return mpContext->memRealloc (ptr, numocts); + } + + /** + * The memReset method resets dynamic memory using the C runtime memory + * management functions. + * + */ + inline void memReset () { + if (!mpContext.isNull ()) + mpContext->memReset (); + } + + /** + * The memFreePtr method frees the memory at a specific location. This + * memory must have been allocated using the memAlloc method described + * earlier. + * + * @param ptr - Pointer to a block of memory allocated with \c + * memAlloc + */ + inline void memFreePtr (void* ptr) { + if (!mpContext.isNull ()) + mpContext->memFreePtr (ptr); + } + + /** + * The PrintErrorInfo method prints information on errors contained within + * the context. + */ + inline void printErrorInfo () { + if (!mpContext.isNull ()) + mpContext->printErrorInfo (); + } + + /** + * This method resets error status and stack trace. This method should be + * used to continue operations after recovering from the error. + */ + inline void resetError () { + if (!mpContext.isNull ()) + mpContext->resetErrorInfo (); + } + + /** + * This method turns diagnostic tracing on or off. + * + * @param value Boolean value; TRUE = turn tracing on. + * @return Previous state. + */ + inline OSBOOL setDiag (OSBOOL value) { + return getContext()->setDiag (value); + } + + /** + * The \c Encode method encodes an ASN.1 message using the encoding rules + * specified by the derived message buffer object. + * + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int Encode (); + + /** + * The \c Decode method decodes the ASN.1 message described by the + * encapsulated message buffer object. + * + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int Decode (); + + /** + * The \c EncodeTo method encodes an ASN.1 message into the given message + * buffer or stream argument. + * + * @param msgBuf Message buffer or stream to which the message is to + * be encoded. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int EncodeTo (OSRTMessageBufferIF& /*msgBuf*/) + { return ASN_E_NOTPDU; } + + /** + * The \c DecodeFrom method decodes an ASN.1 message from the given message + * buffer or stream argument. + * + * @param msgBuf Message buffer or stream containing message to + * decode. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int DecodeFrom (OSRTMessageBufferIF& /*msgBuf*/) + { return ASN_E_NOTPDU; } +} ; +/** @} */ + +/** + * @defgroup asn1data ASN.1 Type (ASN1T_) Base Classes + * These classes are used as the base for compiler-generated ASN1T_ C++ data + * structures. These are enhanced versions of the C structures used for mapping + * ASN.1 types. The main difference is that constructors and operators have + * been added to the derived classes. @{ + */ +/** + * Dynamic bit string. This is the base class for generated C++ data type + * classes for unsized BIT STRING's. + */ +struct EXTRTCLASS ASN1TDynBitStr : public ASN1DynBitStr { + /** + * The default constructor creates an empty bit string. + */ + ASN1TDynBitStr () { numbits = 0; } + + /** + * This constructor initializes the bit string to contain the given data + * values. + * + * @param _numbits - Number of bits in the bit string. + * @param _data - The binary bit data values. + */ + ASN1TDynBitStr (OSUINT32 _numbits, const OSOCTET* _data) { + numbits = _numbits; + data = _data; + } + + /** + * This constructor initializes the bit string to contain the given data + * values. + * + * @param _bs - C bit string structure. + */ + ASN1TDynBitStr (ASN1DynBitStr& _bs) { + numbits = _bs.numbits; + data = _bs.data; + } +} ; + +/* Dynamic octet string */ +#include "rtsrc/ASN1TOctStr.h" + +/** + * BMPString. This is the base class for generated C++ data type classes for + * BMPString values. + */ +struct EXTRTCLASS ASN1TBMPString : public ASN1BMPString { + /** + * The default constructor creates an empty BMPString value. + */ + inline ASN1TBMPString () { + nchars = 0; + data = 0; + } +} ; + +/** + * UniversalString. This is the base class for generated C++ data type classes for + * UniversalString values. + */ +struct EXTRTCLASS ASN1TUniversalString : public ASN1UniversalString { + /** + * The default constructor creates an empty UniversalString value. + */ + inline ASN1TUniversalString () { + nchars = 0; + data = 0; + } +} ; + +/** + * Open type. This is the base class for generated C++ data type classes for + * open type values. + */ +struct EXTRTCLASS ASN1TOpenType : public ASN1OpenType { + /** + * The default constructor creates an empty open type value. + */ + inline ASN1TOpenType () { + numocts = 0; + data = 0; + } +} ; + +/** + * Open type with table constraint. This is the base class for generated C++ + * data type classes for open type values with table constraints. It is only + * used when the -tables compiler command line option is specified. + */ +struct EXTRTCLASS Asn1TObject : public Asn1Object { + /** + * The default constructor creates an empty object value. + */ + inline Asn1TObject () { + encoded.numocts = 0; + encoded.data = 0; + decoded = 0; + index =0; + } +} ; + +typedef Asn1TObject ASN1TObject; + +/* Object identifier */ +#include "rtsrc/ASN1TObjId.h" + +/** + * Object identifier with 64-bit arcs. This class is identical to the + * ASN1TObjId class except it allows 64-bit integers to be used for the arc + * (i.e. subidentifier) values. + */ +struct EXTRTCLASS ASN1TObjId64 : public ASN1OID64 { + inline ASN1TObjId64 () { numids = 0; } + EXTRTMETHOD ASN1TObjId64 (OSOCTET _numids, const OSINT64* _subids); + EXTRTMETHOD ASN1TObjId64 (const ASN1OID64& oid); + EXTRTMETHOD ASN1TObjId64 (const ASN1TObjId64& oid); + EXTRTMETHOD void operator= (const ASN1OID64& rhs); + EXTRTMETHOD void operator= (const ASN1TObjId64& rhs); +} ; + +/** + * SEQUENCE or SET extension element holder. This is used for the /c extElem1 + * open extension element in extensible SEQUENCE or SET constructs. + */ +struct EXTRTCLASS ASN1TSeqExt : public OSRTDList { + /** + * The default constructor creates an empty open extension element. + */ + inline ASN1TSeqExt () { + rtxDListInit (this); + } +} ; + +/** + * Base class for PDU types. This class is used as the base class for all + * compiler-generated PDU types. + */ +struct EXTRTCLASS ASN1TPDU { + protected: + /** + * The mpContext member variable holds a smart-pointer to the current + * context variable. This ensures an instance of this PDU type will persist + * if the control class and message buffer classes used to decode or copy + * the message are destroyed. + */ + OSRTCtxtPtr mpContext; + + public: + /** + * The setContext method allows the context member variable to be set. It is + * invoked in compiler-generated control class decode and copy methods. + * This method is invoked to prevent memory freeing of decoded or copied + * data after a control class or message buffer object goes out of scope. + * Also, if context is set to ASN1TPDU then generated destuctor of + * inherited ASN1T_ class will invoke generated free routines. + * Note, it is not obligatory to call generated free routines unless a + * series of messages is being decoded or control class and message buffer + * objects go out of scope somewhere. The destructor of the control class + * or message buffer class will free all dynamicly allocated memory. + * Thus, if performance is a main issue, "setContext (NULL)" may be called + * after Decode method call. In this case destructor of ASN1T_ will + * do nothing. + * + * @param ctxt A pointer to reference counted ASN.1 context class instance. + */ + inline void setContext (OSRTContext* ctxt) { + if (mpContext.isNull()) mpContext = ctxt; + else if (ctxt == 0) mpContext = 0; + } +} ; + +/** + * SEQUENCE OF element holder. This class is used as the base class for + * compiler-generated SEQUENCE OF linked-list types. + */ +struct EXTRTCLASS ASN1TSeqOfList : public OSRTDList { + /** + * The default constructor creates an empty list. + */ + inline ASN1TSeqOfList () { + rtxDListInit (this); + } +} ; + +/** + * SEQUENCE OF element holder (PDU). This class is used as the base class for + * compiler-generated SEQUENCE OF linked-list types. In this case, the type has + * also been determined to be a PDU. + */ +struct EXTRTCLASS ASN1TPDUSeqOfList : public ASN1TSeqOfList, public ASN1TPDU { + /** + * The default constructor creates an empty list. + */ + ASN1TPDUSeqOfList () {} +} ; + +/** @} */ + +/** @} */ + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1ErrCodes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1ErrCodes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,133 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file asn1ErrCodes.h + * List of numeric status codes that can be returned by ASN1C run-time + * functions and generated code. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1ERRCODES_H_ +#define _ASN1ERRCODES_H_ + +/** + * @defgroup asn1ErrCodes Run-time error status codes. + * This is a list of status codes that can be returned by the ASN1C + * run-time functions and generated code. In many cases, additional + * information and parameters for the different errors are stored in + * the context structure at the time the error in raised. This + * additional information can be output using the \c rtxErrPrint or + * \c rtxErrLogUsingCB run-time functions. + * @{ + */ + +/** + * Fragment decode success status. This is returned when decoding is + * successful but only a fragment of the item was decoded. User should + * repeat the decode operation in order to fully decode message. + */ +#define ASN_OK_FRAG 2 + +/** + * Error base. ASN.1 specific errors start at this base number to + * distinguish them from common and other error types. + */ +#define ASN_E_BASE -100 + +/** + * Invalid object identifier. This error code is returned when an + * object identifier is encountered that is not valid. Possible reasons + * for being invalid include invalid first and second arc identifiers + * (first must be 0, 1, or 2; second must be less than 40), not enough + * subidentifier values (must be 2 or more), or too many arc values + * (maximum number is 128). + */ +#define ASN_E_INVOBJID (ASN_E_BASE) + +/** + * Invalid length. This error code is returned when a length value is + * parsed that is not consistent with other lengths in a BER/DER message. + * This typically happens when an inner length within a constructed type + * is larger than the outer length value. + */ +#define ASN_E_INVLEN (ASN_E_BASE-1) + +/** + * Bad tag value. This error code is returned when a tag value is + * parsed with an identifier code that is too large to fit in a 32-bit + * integer variable. + */ +#define ASN_E_BADTAG (ASN_E_BASE-2) + +/** + * Invalid binary string. This error code is returned when decoding XER + * data and a bit string value is received that contains something other + * than '1' or '0' characters. + */ +#define ASN_E_INVBINS (ASN_E_BASE-3) + +/** + * Invalid table constraint index. This error code is returned when a + * value is provided to index into a table and the value does not match + * any of the defined indexes. + */ +#define ASN_E_INVINDEX (ASN_E_BASE-4) + +/** + * Invalid table constraint value. This error code is returned when a + * the value for an element in a table-constrained message instance does + * not match the value for the element defined in the table. + */ +#define ASN_E_INVTCVAL (ASN_E_BASE-5) + +/** + * Concurrent list modification error. This error is returned from + * within a list iterator when it is detected that the list was + * modified outside the control of the iterator. + */ +#define ASN_E_CONCMODF (ASN_E_BASE-6) + +/** + * Illegal state for operation. This error is returned in places where + * an operation is attempted but the object is not in a state that would + * allow the operation to be completed. One example is in a list iterator + * class when an attempt is made to remove a node but the node does + * not exist. + */ +#define ASN_E_ILLSTATE (ASN_E_BASE-7) + +/** + * Encode/Decode method called for non-PDU. This error is returned when + * an Encode or Decode method is called on a non-PDU. Only PDUs have + * implementations of these methods. + */ +#define ASN_E_NOTPDU (ASN_E_BASE-8) + +/** + * Element type could not be resolved at run-time. This error is returned + * when the run-time parser modules is used (Asn1RTProd) to decode a type + * at run-time and the type of the element could not be resolved. + */ +#define ASN_E_UNDEFTYP (ASN_E_BASE-9) + +/** + * @} asn1ErrCodes + */ +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1compat.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1compat.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,95 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file asn1compat.h + * This header file contains deprecated definitions of ASN.1 runtime + * constants, data structures, and other defintions. It is included + * with generated code when the '-compat' command-line switch is used. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1COMPAT_H_ +#define _ASN1COMPAT_H_ + +#include "rtxsrc/osSysTypes.h" + +#define ASN_OK 0 + +/* ASN.1 Primitive Type Definitions */ + +typedef char ASN1CHAR; +typedef OSUINT8 ASN1OCTET; +typedef OSBOOL ASN1BOOL; +typedef OSINT8 ASN1INT8; +typedef OSUINT8 ASN1UINT8; +typedef OSINT16 ASN1SINT; +typedef OSUINT16 ASN1USINT; +typedef OSINT32 ASN1INT; +typedef OSUINT32 ASN1UINT; +typedef OSINT32 ASN1ENUM; +typedef OSREAL ASN1REAL; + +typedef OSUNICHAR ASN116BITCHAR; +typedef OS32BITCHAR ASN132BITCHAR; + +#define ASN1UINT_MAX OSUINT32_MAX +#define ASN1INT_MAX ((OSINT32)OSINT32_MAX) +#define ASN1INT_MIN ((OSINT32)OSINT32_MIN) + +/* 64-bit long integer type */ + +#ifndef ASN1INT64 +#define ASN1INT64 OSINT64 +#define ASN1UINT64 OSUINT64 +#define ASN1INT64FMT OSINT64FMT +#define ASN1UINT64FMT OSUINT64FMT +#define ASN1INT64FMTX OSINT64FMTX +#define ASN1INT64MAX OSINT64MAX +#define ASN1UINT64MAX OSUINT64MAX +#define ASN1INT64MIN OSINT64MIN +#define ASN1I64CONST(val) OSI64CONST(val) +#define ASN1UI64CONST(val) OSUI64CONST(val) +#endif + +typedef const char* ASN1ConstCharPtr; +typedef const ASN1OCTET* ASN1ConstOctetPtr; +typedef const void* ASN1ConstVoidPtr; +typedef const ASN116BITCHAR* ASN1Const16BitCharPtr; +#define ASN1Const const + +#define ASN1CTXT OSCTXT + +#define rtInitContext rtAsn1InitContext +#define rtFreeContext rtAsn1FreeContext + +#define xu_error rtxErrSetData +#define xu_addErrParm rtxErrAddStrParm +#define xu_addIntErrParm rtxErrAddIntParm +#define xu_addUnsignedErrParm rtxErrAddUIntParm +#define xu_log_error rtxErrLogUsingCB +#define xu_fmtErrMsg rtxErrGetText +#define xu_freeErrParms rtxErrFreeParms +#define xu_perror rtxErrPrint + +#define xu_malloc rtxMemAlloc +#define xu_freeall rtxMemFree +#define ALLOC_ASN1ELEM rtxMemAllocType + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1intl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1intl.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,79 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/* + * asn1intl.h - ASN.1 runtime internal definitions + */ +/** + * @file asn1intl.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1INTL_H_ +#define _ASN1INTL_H_ + +/* ASN1C run-time version number: this should match the ASN1C compiler */ +/* version in no-dot format (ex. 5.70 would be 570).. */ + +#define ASN1RT_VERSION 600 + +#ifndef _COMPACT + +/* For ARM compilers. */ +#ifndef __MODULE__ +#define LOG_ASN1ERR(ctxt,stat) \ + rtErrSetData(&ctxt->errInfo,stat,__FILE__,__LINE__) +#else +#define LOG_ASN1ERR(ctxt,stat) \ + rtErrSetData(&ctxt->errInfo,stat,__MODULE__,__LINE__) +#endif /* ifndef __MODULE__ */ + +#define ASN1_PRINT_OCTSTR(os) \ +printf ("%-*.*s", os.numocts, os.numocts, os.data) + +#else /* if defined _COMPACT */ +#undef _TRACE +#define ASN1_PRINT_OCTSTR(os) +#endif + +#define LOG_RTERR_AND_FREE(ctxt_p,stat,lctxt) \ +rtFreeContext ((lctxt)), LOG_RTERR(ctxt_p, stat) + +#define LOG_RTERR_AND_FREE_MEM(ctxt_p,stat,mem_p) \ +rtxMemFreePtr ((ctxt_p),(mem_p)), LOG_RTERR(ctxt_p, stat) +/* + * Memory allocations macros. These are for use in generated ASN1C code only. + */ +#define ALLOC_ASN1ELEMDNODE_MEM(pctxt,type) \ +(type*) (((char*)rtxMemHeapAlloc (&(pctxt)->pMemHeap, sizeof(type) + \ +sizeof(OSRTDListNode))) + sizeof(OSRTDListNode)) + +#define ALLOC_ASN1ELEMDNODE(pctxt,type) \ +(type*) (((char*)rtxMemHeapAllocZ (&(pctxt)->pMemHeap, sizeof(type) + \ +sizeof(OSRTDListNode))) + sizeof(OSRTDListNode)) + +#define ALLOC_ASN1ELEMSNODE_MEM(pctxt,type) \ +(type*) (((char*)rtxMemHeapAlloc (&(pctxt)->pMemHeap, sizeof(type) + \ +sizeof(OSRTSListNode))) + sizeof(OSRTSListNode)) + +#define ALLOC_ASN1ELEMSNODE(pctxt,type) \ +(type*) (((char*)rtxMemHeapAllocZ (&(pctxt)->pMemHeap, sizeof(type) + \ +sizeof(OSRTSListNode))) + sizeof(OSRTSListNode)) + +#endif /* _ASN1INTL_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1tag.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1tag.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,138 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file asn1tag.h + * Constants and structures used to define ASN.1 tag values. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1TAG_H_ +#define _ASN1TAG_H_ + +#include "rtxsrc/osSysTypes.h" + +/* Set this #define to use an internal tag type of 32 bits instead */ +/* of 16 bits. This will allow ID codes up to 2 ^ 29 (536870912) */ +/* instead of the default representation of 2 ^ 13 (8192). */ +#ifndef _16BIT +#define ASN1C_EXPANDED_TAGS +#endif + +/* Tagging Value and Mask Constants */ + +/* tag class value constants */ + +#define TV_UNIV 0 /* universal */ +#define TV_APPL 1 /* application-wide */ +#define TV_CTXT 2 /* context-specific */ +#define TV_PRIV 3 /* private-use */ + +/* tag form value constants */ + +#define TV_PRIM 0 /* primitive */ +#define TV_CONS 1 /* constructor */ + +/* tag mask values - these can be logically or'd together to */ +/* form tags compatible with the ASNTAG structure.. */ + +#ifdef ASN1C_EXPANDED_TAGS + +#define TM_UNIV 0x00000000 /* universal class */ +#define TM_APPL 0x40000000 /* application-wide class */ +#define TM_CTXT 0x80000000 /* context-specific class */ +#define TM_PRIV 0xC0000000 /* private-use class */ + +#define TM_PRIM 0x00000000 /* primitive form */ +#define TM_CONS 0x20000000 /* constructor form */ +#define TM_IDCODE 0x1FFFFFFF /* ID code mask */ + +#define ASN_K_BADTAG 0xFFFFFFFF /* invalid tag code */ +#define ASN_K_NOTAG 0xFFFFFFFF /* no tag input parameter */ + +#else + +#define TM_UNIV 0x0000 /* universal class */ +#define TM_APPL 0x4000 /* application-wide class */ +#define TM_CTXT 0x8000 /* context-specific class */ +#define TM_PRIV 0xC000 /* private-use class */ + +#define TM_PRIM 0x0000 /* primitive form */ +#define TM_CONS 0x2000 /* constructor form */ +#define TM_IDCODE 0x1FFF /* ID code mask */ + +#define ASN_K_BADTAG 0xFFFF /* invalid tag code */ +#define ASN_K_NOTAG 0xFFFF /* no tag input parameter */ + +#endif + +#define TM_CLASS 0xC0 /* class mask */ +#define TM_FORM 0x20 /* form mask */ +#define TM_CLASS_FORM 0xE0 /* class/form mask */ +#define TM_B_IDCODE 0x1F /* id code mask (byte) */ + +/* universal built-in type ID code value constants */ + +#define ASN_ID_EOC 0 /* end of contents */ +#define ASN_ID_BOOL 1 /* boolean */ +#define ASN_ID_INT 2 /* integer */ +#define ASN_ID_BITSTR 3 /* bit string */ +#define ASN_ID_OCTSTR 4 /* byte (octet) string */ +#define ASN_ID_NULL 5 /* null */ +#define ASN_ID_OBJID 6 /* object ID */ +#define ASN_ID_OBJDSC 7 /* object descriptor */ +#define ASN_ID_EXTERN 8 /* external type */ +#define ASN_ID_REAL 9 /* real */ +#define ASN_ID_ENUM 10 /* enumerated value */ +#define ASN_ID_EPDV 11 /* EmbeddedPDV type */ +#define ASN_ID_RELOID 13 /* relative object ID */ +#define ASN_ID_SEQ 16 /* sequence, sequence of */ +#define ASN_ID_SET 17 /* set, set of */ + +#define ASN_SEQ_TAG 0x30 /* SEQUENCE universal tag byte */ +#define ASN_SET_TAG 0x31 /* SET universal tag byte */ + +/* Restricted character string type ID's */ + +#define ASN_ID_UTF8String 12 +#define ASN_ID_NumericString 18 +#define ASN_ID_PrintableString 19 +#define ASN_ID_TeletexString 20 +#define ASN_ID_T61String ASN_ID_TeletexString +#define ASN_ID_VideotexString 21 +#define ASN_ID_IA5String 22 +#define ASN_ID_UTCTime 23 +#define ASN_ID_GeneralTime 24 +#define ASN_ID_GraphicString 25 +#define ASN_ID_VisibleString 26 +#define ASN_ID_GeneralString 27 +#define ASN_ID_UniversalString 28 +#define ASN_ID_BMPString 30 + +#ifdef ASN1C_EXPANDED_TAGS +typedef OSUINT32 ASN1TAG; +#define ASN1TAG_LSHIFT 24 +#else +typedef OSUINT16 ASN1TAG; +#define ASN1TAG_LSHIFT 8 +#endif + +typedef enum { ASN1IMPL, ASN1EXPL } ASN1TagType; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1type.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1type.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,898 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + /*The following is the text for the main C/C++ Runtime index page.*/ + /*! \mainpage C/C++ Common Runtime Classes and Library Functions + * + * The ASN.1 C++ run-time classes are wrapper classes that provide an + * object-oriented interface to the ASN.1 C run-time library functions. The + * categories of classes provided are as follows: + *
    + *
  • Context Management classes manage the OSCTXT structure used to keep + * track of the working variables required to encode or decode ASN.1 + * messages.
  • + *
  • Message Buffer classes are used to manage message buffers.
  • + *
  • ASN1C Control Base classes are wrapper classes that are used as the + * base for compiler-generated ASN1C_ classes, including Date and Time + * Run-time classes.
  • + *
  • ASN.1 Type (ASN1T_) Base classes are used as the base for compiler- + * generated ASN1T_ C++ data structures.
  • + *
  • ASN.1 Stream classes are used to read and write ASN.1 messages from + * and to files, sockets, memory buffer, etc.
  • + *
  • TCP/IP or UDP Socket classes provide utility methods for doing socket + * I/O.
  • %Asn1NamedEventHandler classes include the base classes for + * user-defined error handler and event handler classes.
+ * + * The C run-time common library contains common C functions used by + * the encoding rules (BER/DER, PER, and XER) low-level encode/decode + * functions. These functions are identified by their rt prefixes. + * The categories of functions provided are as follows:
    + *
  • Memory Allocation macros and functions handle memory + * management for the ASN1C run-time.
  • + *
  • Context Management functions handle the allocation, + * initialization, and destruction of context variables + * (variables of type OSCTXT) that handle the working data used + * during encoding or decoding a message.
  • + *
  • Diagnostic Trace functions allow the output of trace messages + * to standard output that trace the execution of complier generated + * functions.
  • + *
  • Error Formatting and Print functions allow information about + * the encode/decode errors to be added to a context block structure + * and printed out.
  • + *
  • Memory Buffer Management functions handle the allocation, + * expansion, and de-allocation of dynamic memory buffers used by some + * encode/decode functions.
  • + *
  • Object Identifier Helper functions provide assistance in working + * with the object identifier ASN.1 type.
  • + *
  • Linked List and Stack Utility functions are used to maintain + * linked lists and stacks used within the ASN.1 run-time library + * functions.
  • + *
  • REAL Helper functions - REAL helper functions provide assistance + * in working with the REAL ASN.1 type. Two functions are provided to + * obtain the plus and minus infinity special values.
  • + *
  • Formatted Printing functions allow raw ASN.1 data fields to be + * formatted and printed to standard output and other output devices.
  • + *
  • Binary Coded Decimal (BCD) helper functions provide assistance in + * working with BCD numbers.
  • + *
  • Character String Conversion functions convert between standard + * null-terminated C strings and different ASN.1 string types.
  • + *
  • Big Integer Helper functions are arbitrary-precision integer + * manipulating functions used to maintain big integers used within the + * ASN.1 run-time functions.
  • + *
  • Comparison functions allow comparison of the values of primitive + * ASN.1 types. They make it possible to compare complex structures and + * determine what elements within those structures are different.
  • + *
  • Comparison to Standard Output functions do the same actions as the + * other comparison functions, but print the comparison results to standard + * output instead of to the buffer.
  • + *
  • Copy functions - This group of functions allows copying values of + * primitive ASN.1 types.
  • + *
  • Print Values to Standard Output functions print the output in a + * "name=value" format, where the value format is obtained by calling + * one of the ToString functions with the given value.
  • + *
+ */ +/** + * @file asn1type.h + * Common ASN.1 runtime constants, data structure definitions, and run-time + * functions to support the BER/DER/PER/XER as defined in the ITU-T standards. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _ASN1TYPE_H_ +#define _ASN1TYPE_H_ + +#include +#include +#include +#include +#include +#include /*so that borland compilers don't choke on extern linkage*/ +#ifndef _WIN32_WCE +#include +#endif + +#ifdef _NUCLEUS +#ifndef NUCLEUS +#include +#endif /* NUCLEUS */ +#else + +#if !defined(_MSC_VER) && !defined(__GNUC__) && !defined(_16BIT) && !defined(__SYMBIAN32__) +#include +#endif + +#endif /* _NUCLEUS */ + +#include "rtxsrc/rtxExternDefs.h" +#include "rtxsrc/rtxSList.h" +#include "rtxsrc/rtxStack.h" +#include "rtxsrc/rtxUTF8.h" + + +/** + * @defgroup cruntime C Runtime Common Functions + * The C run-time common library contains common C functions used by + * the low-level encode/decode functions. These functions are identified + * by their rt and rtx prefixes. + * + * The categories of functions provided are as follows:
    + *
  • Context management functions handle the allocation, + * initialization, and destruction of context variables + * (variables of type OSCTXT) that handle the working data used + * during the encoding or decoding of a message.
  • + *
  • Memory allocation macros and functions provide an optimized memory + * management interface.
  • + *
  • Doubly linked list (DList) functions are used to manipulate linked + * list structures that are used to model repeating XSD types and + * elements.
  • + *
  • UTF-8 and Unicode character string functions provide support + * for conversions to and from these formats in C or C++.
  • + *
  • Date/time conversion functions provide utilities for converting + * system and structured numeric date/time values to XML schema standard + * string format.
  • + *
  • Pattern matching function compare strings against patterns specified + * using regular expressions (regexp's).
  • + *
  • Diagnostic trace functions allow the output of trace messages + * to standard output.
  • + *
  • Error formatting and print functions allow information about + * encode/decode errors to be added to a context block structure + * and printed out.
  • + *
  • Memory buffer management functions handle the allocation, + * expansion, and de-allocation of dynamic memory buffers used by some + * encode/decode functions.
  • + *
  • Formatted print functions allow binary data to be + * formatted and printed to standard output and other output devices.
  • + *
  • Big Integer helper functions are arbitrary-precision integer + * manipulating functions used to maintain big integers.
  • + *
+ * @{ + */ +#include "rtsrc/asn1tag.h" +#include "rtsrc/asn1ErrCodes.h" +#include "rtsrc/asn1version.h" +#include "rtsrc/rtExternDefs.h" + +/* + * Flags used to determine or change the behavior of encoding and + * decoding. + */ +#define XM_SEEK 0x01 /* seek match until found or end-of-buf */ +#define XM_ADVANCE 0x02 /* advance pointer to contents on match */ +#define XM_DYNAMIC 0x04 /* alloc dyn mem for decoded variable */ +#define XM_SKIP 0x08 /* skip to next field after parsing tag */ +#define XM_OPTIONAL 0x10 /* tag test is for optional element */ + +/* Sizing Constants */ + +#define ASN_K_MAXDEPTH 32 /* maximum nesting depth for messages */ +#define ASN_K_MAXENUM 100 /* maximum enum values in an enum type */ +#define ASN_K_MAXERRP 5 /* maximum error parameters */ +#define ASN_K_MAXERRSTK 8 /* maximum levels on error ctxt stack */ + +#ifndef ASN_K_ENCBUFSIZ +#define ASN_K_ENCBUFSIZ 16*1024 /* dynamic encode buffer extent size */ +#endif + +#ifndef ASN_K_MEMBUFSEG +#define ASN_K_MEMBUFSEG 1024 /* memory buffer extent size */ +#endif + +#define OSRTINDENTSPACES 3 /* number of spaces for indent */ + +/* Constants for encoding/decoding real values */ + +#define ASN1_K_PLUS_INFINITY 0x40 +#define ASN1_K_MINUS_INFINITY 0x41 + +#define REAL_BINARY 0x80 +#define REAL_SIGN 0x40 +#define REAL_EXPLEN_MASK 0x03 +#define REAL_EXPLEN_1 0x00 +#define REAL_EXPLEN_2 0x01 +#define REAL_EXPLEN_3 0x02 +#define REAL_EXPLEN_LONG 0x03 +#define REAL_FACTOR_MASK 0x0c +#define REAL_BASE_MASK 0x30 +#define REAL_BASE_2 0x00 +#define REAL_BASE_8 0x10 +#define REAL_BASE_16 0x20 +#define REAL_ISO6093_MASK 0x3F + +#ifndef __SYMBIAN32__ +#include +#define ASN1REALMAX (OSREAL)DBL_MAX +#define ASN1REALMIN (OSREAL)-DBL_MAX +#endif + +typedef void* ASN1ANY; + +/** + * An enumerated list of the various string types: hexadecimal, binary, and + * character strings. + */ +typedef enum { ASN1HEX, ASN1BIN, ASN1CHR } ASN1StrType; + +/** + * An enumerated list of ASN.1 actions: encode or decode. + */ +typedef enum { ASN1ENCODE, ASN1DECODE } ASN1ActionType; + +/* + * OBJECT IDENTIFIER + */ +/** + * @defgroup objidhelpers Object Identifier Helper Functions + * @{ + * + * Object identifier helper functions provide assistance in working with the + * object identifier ASN.1 type. + */ + +#define ASN_K_MAXSUBIDS 128 /* maximum sub-id's in an object ID */ + +/** + * This structure describes an object identifier with 32-bit arcs. + */ +typedef struct { /* object identifier */ + /** The number of sub-identifiers in the OID. */ + OSUINT32 numids; + /** An array of sub-identifiers. */ + OSUINT32 subid[ASN_K_MAXSUBIDS]; +} ASN1OBJID; + +/** + * This structure describes an object identifier with 64-bit arcs. + */ +typedef struct { /* object identifier with 64-bit arcs */ + /** The number of sub-identifiers in the OID. */ + OSUINT32 numids; + /** An array of sub-identifiers. */ + OSUINT64 subid[ASN_K_MAXSUBIDS]; +} ASN1OID64; + +/** @cond false */ +#ifdef __cplusplus +#define EXTERN_C extern "C" +extern "C" { +#else +#define EXTERN_C extern +#endif +/** @endcond */ + +/** + * This function populates an object identifier variable with data. It copies + * data from a source variable to a target variable. Typically, the source + * variable is a compiler-generated object identifier constant that resulted + * from a object identifier value specification within an ASN.1 specification. + * + * @param ptarget A pointer to a target object identifier variable to + * receive object * identifier data. Typically, this is a + * variable within a compiler-generated C structure. + * @param psource A pointer to a source object identifier variable to copy + * to a target. Typically, this is a compiler-generated + * variable corresponding to an ASN.1 value specification + * in the ASN.1 source file. + */ +EXTERNRT void rtSetOID (ASN1OBJID* ptarget, ASN1OBJID* psource); + +/** + * This function appends one object identifier to another one. It copies the + * data from a source variable to the end of a target variable. Typically, the + * source variable is a compiler-generated object identifier constant that + * resulted from an object identifier value specification within an ASN.1 + * specification. + * + * @param ptarget A pointer to a target object identifier variable to + * receive object identifier data. Typically, this is a + * variable within a compiler-generated C structure. + * @param psource A pointer to a source object identifier variable to copy + * to a target. Typically, this is a compiler-generated + * variable corresponding to an ASN.1 value specification + * in the ASN.1 source file. + */ +EXTERNRT void rtAddOID (ASN1OBJID* ptarget, ASN1OBJID* psource); + +/** + * @} + */ + +/* + * OCTET STRING + */ +typedef struct { /* generic octet string structure */ + OSUINT32 numocts; + OSOCTET data[1]; +} ASN1OctStr; + +#define ASN1DynOctStr OSDynOctStr + +/* + * BIT STRING + */ +typedef struct { /* generic bit string structure (dynamic) */ + OSUINT32 numbits; + const OSOCTET* data; +} ASN1DynBitStr; + +#include "rtxsrc/rtxBitString.h" + +#define OSSETBIT(bitStr,bitIndex) \ +rtxSetBit (bitStr.data, bitStr.numbits, bitIndex) + +#define OSSETBITP(pBitStr,bitIndex) \ +rtxSetBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex) + +#define OSCLEARBIT(bitStr,bitIndex) \ +rtxClearBit (bitStr.data, bitStr.numbits, bitIndex) + +#define OSCLEARBITP(pBitStr,bitIndex) \ +rtxClearBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex) + +#define OSTESTBIT(bitStr,bitIndex) \ +rtxTestBit (bitStr.data, bitStr.numbits, bitIndex) + +#define OSTESTBITP(pBitStr,bitIndex) \ +rtxTestBit ((pBitStr)->data, (pBitStr)->numbits, bitIndex) + +/** + * @defgroup timeutilf Time Helper Functions + * @{ + * Utility functions for working with time strings in different + * formats. rtMake* functions create time strings, rtParse* functions + * parse time strings into the C OSNumDateTime structure defined in + * osSysTypes.h. Implementations of these functions exist for the + * ASN.1 GeneralizedTime and UTCTime formats. + */ +/** + * This function creates a time string in ASN.1 GeneralizedTime format as + * specified in the X.680 ITU-T standard. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param dateTime A pointer to a date/time structure that contains + * components of the date and time. + * @param outdata A pointer to a pointer to a destination string. If + * outdataSize is non-zero, it should be a pointer to a + * pointer to an actual array. Otherwise, the memory will + * be allocated and the pointer will be stored in the \c + * outdata. + * @param outdataSize A size of outdata (in octets). If zero, the memory for + * the \c outdata will be allocated. If not, the \c + * outdata 's size should be big enough to receive the + * generated time string. Otherwise, error code will be + * returned. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtMakeGeneralizedTime (OSCTXT* pctxt, + const OSNumDateTime* dateTime, + char** outdata, + size_t outdataSize); + +/** + * This function creates a time string in ASN.1 UTCTime format as specified in + * the X.680 ITU-T standard. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param dateTime A pointer to a date/time structure that contains + * components of the date and time. + * @param outdata A pointer to a pointer to a destination string. If + * outdataSize is non-zero, it should be a pointer to a + * pointer to an actual array. Otherwise, the memory will + * be allocated and the pointer will be stored in the \c + * outdata. + * @param outdataSize A size of outdata (in octets). If zero, the memory for + * the \c outdata will be allocated. If not, the \c + * outdata 's size should be big enough to receive the + * generated time string. Otherwise, error code will be + * returned. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtMakeUTCTime (OSCTXT* pctxt, + const OSNumDateTime* dateTime, + char** outdata, + size_t outdataSize); +/** + * This function parses a time string that is represented in ASN.1 + * GeneralizedTime format as specified in the X.680 ITU-T standard. It stores + * the parsed result in a numeric date/time C structure. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param value A pointer to the time string to be parsed. + * @param dateTime A pointer to the destination structure. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtParseGeneralizedTime (OSCTXT *pctxt, + const char* value, + OSNumDateTime* dateTime); + +/** + * This function parses a time string that is represented in ASN.1 UTCTime + * format as specified in the X.680 ITU-T standard. It stores the parsed + * result in a numeric date/time C structure. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param value A pointer to the time string to be parsed. + * @param dateTime A pointer to the destination date/time structure. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtParseUTCTime (OSCTXT *pctxt, + const char* value, + OSNumDateTime* dateTime); + +/** + * @} + */ + +/* + * SEQUENCE OF + */ +typedef struct { /* generic sequence of structure */ + OSUINT32 n; + void* elem; +} ASN1SeqOf; + +typedef struct { /* sequence of OCTET STRING */ + OSUINT32 n; + OSDynOctStr* elem; +} ASN1SeqOfOctStr; + +/* + * Open Type + */ +typedef struct { /* generic open type data structure */ + OSUINT32 numocts; + const OSOCTET* data; +} ASN1OpenType; + +typedef struct { /* generic table constraint value holder */ + ASN1OpenType encoded; + void* decoded; + OSINT32 index; /* table index */ +} Asn1Object; + +typedef Asn1Object ASN1Object; + +/* ASN.1 useful type definitions */ + +typedef struct { + OSUINT32 nchars; + OSUNICHAR* data; +} Asn116BitCharString; + +typedef struct { + OSUINT32 nchars; + OS32BITCHAR* data; +} Asn132BitCharString; + +typedef const char* ASN1GeneralizedTime; +typedef const char* ASN1GeneralString; +typedef const char* ASN1GraphicString; +typedef const char* ASN1IA5String; +typedef const char* ASN1ISO646String; +typedef const char* ASN1NumericString; +typedef const char* ASN1ObjectDescriptor; +typedef const char* ASN1PrintableString; +typedef const char* ASN1TeletexString; +typedef const char* ASN1T61String; +typedef const char* ASN1UTCTime; +typedef const char* ASN1VideotexString; +typedef const char* ASN1VisibleString; + +typedef const OSUTF8CHAR* ASN1UTF8String; +typedef Asn116BitCharString ASN1BMPString; +typedef Asn132BitCharString ASN1UniversalString; + +/* ASN.1 constrained string structures */ + +typedef struct { + int nchars; + char data[255]; +} Asn1CharArray; + +typedef struct { + Asn1CharArray charSet; + const char* canonicalSet; + int canonicalSetSize; + unsigned canonicalSetBits; + unsigned charSetUnalignedBits; + unsigned charSetAlignedBits; +} Asn1CharSet; + +typedef struct { + Asn116BitCharString charSet; + OSUINT16 firstChar, lastChar; + unsigned unalignedBits; + unsigned alignedBits; +} Asn116BitCharSet; + +typedef struct { + Asn132BitCharString charSet; + OSUINT32 firstChar, lastChar; + unsigned unalignedBits; + unsigned alignedBits; +} Asn132BitCharSet; + +/** + * @defgroup charstrcon Character String Conversion Functions + * @{ + * + * Common utility functions are provided to convert between standard + * null-terminated C strings and different ASN.1 string types. + */ + +/* Helper functions. */ + +/** + * This function ensures that a given string does not contain invalid + * characters. + * + * @param tag The ASN.1 Tag that identifies the string. + * @param object_p A pointer to the character string to be examined. + * + * @return This function returns 0 if the string validates + * or the tag is not associated with a string; it + * otherwise returns the integer value of the character + * that invalidates the string. + */ +EXTERNRT int rtValidateStr (ASN1TAG tag, const char *object_p); + + +/* 16-bit character functions */ + +/** + * This function converts a BMP string into a null-terminated C string. Any + * characters that are not 8-bit characters are discarded. + * + * @param pBMPString A pointer to a BMP string structure to be converted. + * @param cstring A pointer to a buffer to receive the converted string. + * @param cstrsize The size of the buffer to receive the converted string. + * @return A pointer to the returned string structure. This is the + * cstring argument parameter value. + */ +EXTERNRT const char* rtBMPToCString (ASN1BMPString* pBMPString, + char* cstring, OSUINT32 cstrsize); + +/** + * This function converts a BMP string into a null-terminated C string. Any + * characters that are not 8-bit characters are discarded. This function + * allocates dynamic memory to hold the converted string using the standard C + * run-time malloc function. The user is responsible for freeing this memory. + * + * @param pBMPString A pointer to a BMP string structure to be converted. + * @return A pointer to the returned string structure. This is the + * cstring argument parameter value. + */ +EXTERNRT const char* rtBMPToNewCString (ASN1BMPString* pBMPString); + +/** + * This function converts a BMP string into a null-terminated C string. Any + * characters that are not 8-bit characters are discarded. In contrast to + * rtBMPToNewCString, this function allocates dynamic memory to hold the + * converted string using the rtMemAlloc function. The rtMemFreePtr should be + * called to release the allocated memory or the rtmemFree function should be + * called to release all memory allocated using the specified context block. + * + * @param pctxt A pointer to a context structure. + * @param pBMPString A pointer to a BMP string structure to be converted. + * @return A pointer to the returned string structure. This is the + * cstring argument parameter value. + */ +EXTERNRT const char* rtBMPToNewCStringEx + (OSCTXT *pctxt, ASN1BMPString* pBMPString); + +/** + * This function converts a null-terminated C string into a 16-bit BMP string + * structure. + * + * @param pctxt A pointer to a context string. + * @param cstring A pointer to a null-terminated C string to be converted + * into a BMP string. + * @param pBMPString A pointer to a BMP string structure to receive the + * converted string. + * @param pCharSet A pointer to a character set structure describing the + * character set currently associated with the BMP + * character string type. + * @return A pointer to BMP string structure. This is the + * pBMPString argument parameter value. + */ +EXTERNRT ASN1BMPString* rtCToBMPString (OSCTXT* pctxt, + const char* cstring, + ASN1BMPString* pBMPString, + Asn116BitCharSet* pCharSet); + +EXTERNRT OSBOOL rtIsIn16BitCharSet (OSUNICHAR ch, + Asn116BitCharSet* pCharSet); + +/* 32-bit character (UCS-4) functions */ + + +/** + * This function converts a Universal 32-bit string into a null-terminated C + * string. Any characters that are not 8-bit characters are discarded. + * + * @param pUCSString A pointer to a Universal string structure to be + * converted. + * @param cstring A pointer to a buffer to receive a converted string. + * @param cstrsize The size of the buffer to receive the converted string. + * @return The pointer to the returned string. This is the cstring + * argument parameter value. + */ +EXTERNRT const char* rtUCSToCString (ASN1UniversalString* pUCSString, + char* cstring, OSUINT32 cstrsize); + +/** + * This function converts a Universal 32-bit string into a null-terminated C + * string. Any characters that are not 8-bit characters are discarded. This + * function allocates dynamic memory to hold the converted string using the + * standard C run-time malloc function. The user is responsible for freeing + * this memory. + * + * @param pUCSString A pointer to a Universal 32-bit string structure to be + * converted. + * @return A pointer to allocated null-terminated string. The user + * is responsible for freeing this memory. + */ +EXTERNRT const char* rtUCSToNewCString (ASN1UniversalString* pUCSString); + +/** + * This function converts a Universal 32-bit string into a null-terminated C + * string. Any characters that are not 8-bit characters are discarded. In + * contrast to rtUSCToNewCString this function allocates dynamic memory to hold + * the converted string using the rtMemAlloc function. The rtMemFreePtr should + * be called to release the allocated memory or the rtMemFree function should + * be called to release all memory allocated using the specified context block. + * + * @param pctxt A pointer to a context block. + * @param pUCSString A pointer to a Universal 32-bit string structure to be + * converted. + * @return A pointer to allocated null-terminated string. The user + * is responsible for freeing this memory. + */ +EXTERNRT const char* rtUCSToNewCStringEx +(OSCTXT* pctxt, ASN1UniversalString* pUCSString); + +/** + * This function converts a null-terminated C string into a 32-bit UCS-4 + * (Universal Character Set, 4 byes) string structure. + * + * @param pctxt A pointer to a context structure. + * @param cstring A pointer to a null-terminated C string to be converted + * into a Universal string. + * @param pUCSString A pointer to a Universal string structure to receive the + * converted string + * @param pCharSet A pointer to a character structure describing the + * character set currently associated with the Universal + * character string type. + * @return A pointer to a Universal string structure. This is the + * pUCSString argument parameter value. + */ +EXTERNRT ASN1UniversalString* rtCToUCSString +(OSCTXT* pctxt, const char* cstring, ASN1UniversalString* pUCSString, + Asn132BitCharSet* pCharSet); + + +EXTERNRT OSBOOL rtIsIn32BitCharSet (OS32BITCHAR ch, + Asn132BitCharSet* pCharSet); + +/** + * This function converts a 32-bits encoded string to a wide character string. + * + * @param pUCSString A pointer to a Universal string structure. + * @param wcstring The pointer to the buffer to receive the converted + * string. + * @param wcstrsize The number of wide characters (wchar_t) the outbuffer + * can hold. + * @return A character count or error status. This will be negative + * if the conversion fails. If the result is positive, + * the number of characters was written to scstrsize. + */ +EXTERNRT wchar_t* rtUCSToWCSString (ASN1UniversalString* pUCSString, + wchar_t* wcstring, OSUINT32 wcstrsize); + + +/** + * This function converts a wide-character string to a Universal 32-bits + * encoded string. + * + * @param pctxt A pointer to a context structure. + * @param wcstring The pointer to the wide-character (Unicode) string to + * convert + * @param pUCSString The pointer to the Universal String structure to receive + * the converted string. + * @param pCharSet The pointer to the character set structure describing + * the character set currently associated with the + * Universal character string type. + * @return If the conversion of the WCS to the UTF-8 was + * successful, the number of bytes in the converted + * string is returned. If the encoding fails, a negative + * status value is returned. + */ +EXTERNRT ASN1UniversalString* rtWCSToUCSString +(OSCTXT* pctxt, wchar_t* wcstring, + ASN1UniversalString* pUCSString, Asn132BitCharSet* pCharSet); + +/** + * This function converts an ASN.1 Universal String type (32-bit + * characters) to UTF-8. + * + * @param pctxt A pointer to a context structure. + * @param pUnivStr Pointer to universal string to be converted. + * @param outbuf Output buffer to receive UTF-8 characters. + * @param outbufsiz Output buffer size in bytes. + * @return Zero if conversion was successful, a negative + * status code if failed. + */ +EXTERNRT int rtUnivStrToUTF8 +(OSCTXT* pctxt, const ASN1UniversalString* pUnivStr, OSOCTET* outbuf, + size_t outbufsiz); + +/** + * This function converts the given null-terminated UTF-8 string to + * a bit string value. The string consists of a series of '1' and '0' + * characters. This is the dynamic version in which memory is allocated for + * the returned binary string variable. Bits are stored from MSB to LSB order. + * + * @param pctxt Pointer to context block structure. + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to a variable to receive the decoded boolean + * value. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtUTF8StrToASN1DynBitStr + (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, ASN1DynBitStr* pvalue); + +/** + * This function converts the given part of UTF-8 string to + * a bit string value. The string consists of a series of '1' and '0' + * characters. This is the dynamic version in which memory is allocated for + * the returned binary string variable. Bits are stored from MSB to LSB order. + * + * @param pctxt Pointer to context block structure. + * @param utf8str UTF-8 string to convert. Not necessary to be + * null-terminated. + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to a variable to receive the decoded boolean + * value. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtUTF8StrnToASN1DynBitStr + (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, size_t nbytes, + ASN1DynBitStr* pvalue); + +/** + * @} + */ + +/* Big Integer */ + +typedef struct ASN1BigInt { + size_t numocts; /* number of used octets in mag */ + OSOCTET* mag; /* magnitude */ + int sign; /* sign, can be -1, 0, 1 */ + size_t allocated; /* number of allocated octets for mag */ + OSBOOL dynamic; /* is buffer dynamic? */ +} ASN1BigInt; + +/* ASN.1 context control block - this structure is used to keep track */ +/* of pointer and length context values when decoding sets or sequence */ +/* of constructs. */ + +#define ASN1_K_CCBMaskSize 32 +#define ASN1_K_NumBitsPerMask 16 +#define ASN1_K_MaxSetElements (ASN1_K_CCBMaskSize*ASN1_K_NumBitsPerMask) + +typedef struct { /* context control block */ + OSOCTET* ptr; /* constructor pointer */ + long len; /* constructor length */ + int seqx; /* sequence element index */ + OSUINT16 mask[ASN1_K_CCBMaskSize]; /* set mask value */ + size_t bytes; /* bytes processed before block (for stream) */ + int stat; /* status, returned by BS_CHKEND */ +} ASN1CCB; + +/* ASN.1 dump utility callback function definition */ + +typedef int (*ASN1DumpCbFunc) (const char* text_p, void* cbArg_p); + +/** + * @ingroup cruntime + * + * Memory allocation functions and macros handle memory management for the + * ASN1C run-time. Special algorithms are used for allocation and deallocation + * of memory to improve the run-time performance. @{ + */ +/** + * Allocate a dynamic array. This macro allocates a dynamic array of records of + * the given type. This version of the macro will return the RTERR_NOMEM error + * status if the memory request cannot be fulfilled. + * + * @param pctxt - Pointer to a context block + * @param pseqof - Pointer to a generated SEQUENCE OF array structure. + * The n member variable must be set to the number + * of records to allocate. + * @param type - Data type of an array record + */ +#define ALLOC_ASN1ARRAY(pctxt,pseqof,type) do {\ +if (sizeof(type)*(pseqof)->n < (pseqof)->n) return RTERR_NOMEM; \ +if (((pseqof)->elem = (type*) rtxMemHeapAlloc \ +(&(pctxt)->pMemHeap, sizeof(type)*(pseqof)->n)) == 0) return RTERR_NOMEM; \ +} while (0) + +/** + * Allocate a dynamic array. This macro allocates a dynamic array of records of + * the given type. This version of the macro will set the internal parameters + * of the SEQUENCE OF structure to NULL if the memory request cannot be + * fulfilled. + * + * @param pctxt - Pointer to a context block + * @param pseqof - Pointer to a generated SEQUENCE OF array structure. + * The n member variable must be set to the number + * of records to allocate. + * @param type - Data type of an array record + */ +#define ALLOC_ASN1ARRAY1(pctxt,pseqof,type) do {\ +if (sizeof(type)*(pseqof)->n < (pseqof)->n) (pseqof)->elem = 0; \ +else (pseqof)->elem = (type*) rtxMemHeapAlloc \ +(&(pctxt)->pMemHeap, sizeof(type)*(pseqof)->n); \ +} while (0) + +/** + * @} + */ + +#define ASN1NUMOCTS(nbits) ((nbits>0)?(((nbits-1)/8)+1):0) + +#ifdef __cplusplus +} +#endif + +#include "rtsrc/rtContext.h" +#include "rtxsrc/rtxCommonDefs.h" +#include "rtxsrc/rtxError.h" +#include "rtxsrc/rtxMemory.h" + +/** + * @} + */ + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1version.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/asn1version.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,37 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef __ASN1VERSION_H +#define __ASN1VERSION_H + +#define OS_ASN1RT_VERSION 611 +#define OS_ASN1RT_VERSION_STR "6.11" + + +#define ACVERSION OS_ASN1RT_VERSION +#define OS_ASN1RT_MAJOR_VERSION (OS_ASN1RT_VERSION/100) +#define OS_ASN1RT_MINOR_VERSION (OS_ASN1RT_VERSION%100/10) +#define OS_ASN1RT_PATCH_VERSION (OS_ASN1RT_VERSION%10) + +#define OS_ASN1RT_MAJOR_VERSION_STR (OS_ASN1RT_VERSION_STR[0]) +#define OS_ASN1RT_MINOR_VERSION_STR (OS_ASN1RT_VERSION_STR[2]) +#define OS_ASN1RT_PATCH_VERSION_STR (OS_ASN1RT_VERSION_STR[3]) + +#endif /* __ASN1VERSION_H */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtBCD.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtBCD.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,151 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtBCD.h + * Binary-decimal conversion functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTBCD_H_ +#define _RTBCD_H_ + +#include "rtsrc/asn1type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup bcdHelper Binary Coded Decimal (BCD) Helper Functions + * @{ + * + * Binary Coded Decimal (BCD) helper functions provide assistance in working + * with BCD numbers. Functions are provided to convert to a BCD values to + * and from string form. + */ +/** + * This function converts a packed BCD value to a standard null-terminated + * string. Octet values may contain filler digits if the number of BCD digits is + * odd. + * + * BCD digits can be 0(0000) to 9(1001). + * Filler digits can be A(1010), B(1011), C(1100), D(1101), E(1110) or F(1111) + * + * @param numocts The number of octets in the BCD value. + * @param data The pointer to the BCD value. + * @param buffer The destination buffer. Should not be less than buffsiz + * argument is. + * @param bufsiz The size of the destination buffer (in octets). The + * buffer size should be atleast ((numocts * 2) + 1) to + * hold the BCD to String conversion. + * @param isTBCD Whether the input data is formatted as a TBCD string + * or not. + * @return The converted null-terminated string. NULL, if error has + * occurred or destination buffer is not enough. + * @see rtTBCDToString + */ +EXTERNRT const char* rtBCDToString + (OSUINT32 numocts, const OSOCTET* data, char* buffer, size_t bufsiz, + OSBOOL isTBCD); + +/** + * This function converts a standard null-terminated string into a BCD value. + * The source string should contain only characters '0' - '9', 'A' - 'F', or + * 'a' - 'f'. Otherwise, an error will occur. + * + * @param str The source standard null-terminated string. + * @param bcdStr The destination buffer. Should not be less than bufsiz + * is. + * @param bufsiz The size of the destination buffer (in octets). + * @param isTBCD Whether the string is a TBCD string or not. + * @return The number of octets in the resulting BCD value or + * a negative value if an error occurs. + * @see rtStringToTBCD + */ +EXTERNRT int rtStringToBCD + (const char* str, OSOCTET* bcdStr, size_t bufsiz, OSBOOL isTBCD); + +/** + * This function converts a standard null-terminated string into a BCD value. + * The source string should contain only characters '0' - '9', 'A' - 'F', or + * 'a' - 'f'. Otherwise, an error will occur. + * + * @param str The source standard null-terminated string. + * @param pctxt Pointer to a context structure block. + * @param poctstr Pointer to a dynamic octet string variable. Memory + * will be allocated for the data member of this + * structure with rtMemAlloc. + * @return The number of octets in the resulting BCD value or + * a negative value if an error occurs. + */ +EXTERNRT int rtStringToDynBCD + (OSCTXT* pctxt, const char* str, ASN1DynOctStr* poctstr); + +/** + * This function converts a packed TBCD value to a standard null-terminated + * string. Octet value can contain the filler digit to represent the odd + * number of BCD digits. A TBCD string differs from a normal BCD string + * in that the byte values of the octets are flipped. The BCD string + * 0x12345f would be represented 0x2143f5 as a TBCD string. + * + * TBCD digits can be 0(0000) to 9(1001). + * Filler digits can be A(1010), B(1011), C(1100), D(1101), E(1110) or F(1111) + * + * @param numocts The number of octets in the BCD value. + * @param data The pointer to the BCD value. + * @param buffer The destination buffer. Should not be less than buffsiz + * argument is. + * @param bufsiz The size of the destination buffer (in octets). The + * buffer size should be atleast ((numocts * 2) + 1) to + * hold the BCD to String conversion. + * @return The converted null-terminated string. NULL, if error has + * occurred or destination buffer is not enough. + * @since 6.06 + */ +EXTERNRT const char* rtTBCDToString + (OSUINT32 numocts, const OSOCTET* data, char* buffer, size_t bufsiz); + +/** + * This function converts a standard null-terminated string into a TBCD value. + * The source string should contain only characters '0' - '9', 'A' - 'F', or + * 'a' - 'f'. Otherwise, an error will occur. A TBCD string differs from a + * normal BCD string in that its bytes are flipped. The BCD string + * 0x12345f would be represented 0x2143f5 as a TBCD string. + * + * @param str The source standard null-terminated string. + * @param bcdStr The destination buffer. Should not be less than bufsiz + * is. + * @param bufsiz The size of the destination buffer (in octets). + * @return The number of octets in the resulting BCD value or + * a negative value if an error occurs. + * @since 6.06 + */ +EXTERNRT int rtStringToTBCD + (const char* str, OSOCTET* bcdStr, size_t bufsiz); + +/** + * @} bcdHelper + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtCompare.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtCompare.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,592 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** + * @file rtCompare.h Functions for comparing the + * values of primitive ASN.1 types. + */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _RTCOMPARE_H_ +#define _RTCOMPARE_H_ +#include "asn1type.h" +#include "rtconv.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup cmp Comparison Functions + * @ingroup cruntime + * @{ + * + * The group of functions allows comparing the values of primitive ASN.1 types. + * These functions are used in the comparison routines that are generated by + * the ASN1C complier when the -gencompare option is used. + * + * Information on elements that do not match is written to the given error + * buffer for each function. This makes it possible to compare complex + * structures and get back specific information as to what elements within + * those structures are different. + */ +/* Compare function to Buffer */ + +/** + * The rtCmpBoolean function compares two ASN.1 Boolean values. The return + * value is TRUE (matched) or FALSE (unmatched). + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param value First value to compare. + * @param compValue Second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpBoolean (const char* name, OSBOOL value, + OSBOOL compValue, char* errBuff, + int errBuffSize); + +EXTERNRT OSBOOL rtCmpInt8 (const char* name, OSINT8 value, + OSINT8 compValue, char* errBuff, + int errBuffSize); + +EXTERNRT OSBOOL rtCmpSInt (const char* name, OSINT16 value, + OSINT16 compValue, char* errBuff, + int errBuffSize); + +EXTERNRT OSBOOL rtCmpUInt8 (const char* name, OSUINT8 value, + OSUINT8 compValue, char* errBuff, + int errBuffSize); + +EXTERNRT OSBOOL rtCmpUSInt (const char* name, OSUINT16 value, + OSUINT16 compValue, char* errBuff, + int errBuffSize); + +/** + * The rtCmpInteger function compars two ASN.1 INTEGER values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param value First value to compare. + * @param compValue Second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpInteger (const char* name, OSINT32 value, + OSINT32 compValue, char* errBuff, + int errBuffSize); + +/** + * The rtCmpUnsigned function compares two ASN.1 unsigned INTEGER values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param value First value to compare. + * @param compValue Second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpUnsigned (const char* name, OSUINT32 value, + OSUINT32 compValue, char* errBuff, + int errBuffSize); + +/** + * The rtCompInt64 function compares two 64-bit ASN.1 INTEGER values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param value First value to compare. + * @param compValue Second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpInt64 (const char* name, OSINT64 value, + OSINT64 compValue, char* errBuff, + int errBuffSize); + +/** + * The rtCmpUInt64 function compares two 64-bit ASN.1 unsigned INTEGER values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param value First value to compare. + * @param compValue Second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpUInt64 (const char* name, OSUINT64 value, + OSUINT64 compValue, char* errBuff, + int errBuffSize); + +/** + * The rtCmpBitStr function compares two ASN.1 BIT STRING values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param numbits The number of bits in the first value to compare. + * @param data The pointer to the data of the first value to compare. + * @param compNumbits The number of bits in the second value to compare. + * @param compData The pointer to the data of the second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpBitStr (const char* name, OSUINT32 numbits, + const OSOCTET* data, OSUINT32 compNumbits, + const OSOCTET* compData, char* errBuff, + int errBuffSize); + +/** + * The rtCmpOctStr function compares two ASN.1 OCTET STRING values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param numocts The number of the octets in the first value to compare. + * @param data The pointer to the data of the first value to compare. + * @param compNumocts The number of the octets in the second value to compare. + * @param compData The pointer to the data of the second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpOctStr (const char* name, OSUINT32 numocts, + const OSOCTET* data, OSUINT32 compNumocts, + const OSOCTET* compData, char* errBuff, + int errBuffSize); + +/** + * The rtCmpCharStr function compares two ASN.1 8-bit character sting values + * (including IA5String, VisibleString, PrintableString, NumericString, etc.) + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param cstring The first standard null-terminated string to compare. + * @param compCstring The second standard null-terminated string to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpCharStr (const char* name, const char* cstring, + const char* compCstring, char* errBuff, + int errBuffSize); + +/** + * The rtCmp16BitCharStr function compares two ASN.1 16-bit character string + * values (including BMPString). + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param bstring The pointer to the first 16-bit character string + * structure to compare. + * @param compBstring The pointer to the second 16-bit character string + * structure to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmp16BitCharStr (const char* name, + Asn116BitCharString* bstring, + Asn116BitCharString* compBstring, + char* errBuff, int errBuffSize); + +/** + * The rtCmp32BitCharStr function compares two 32-bit character string values + * (including UniversalString). + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param bstring The pointer to the first 32-bit character string + * structure to compare. + * @param compBstring The pointer to the second 32-bit character string + * structure to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmp32BitCharStr (const char* name, + Asn132BitCharString* bstring, + Asn132BitCharString* compBstring, + char* errBuff, int errBuffSize); + +/** + * The rtCmpReal function compares two ASN.1 REAL values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param value First value to compare. + * @param compValue Second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpReal (const char* name, OSREAL value, + OSREAL compValue, char* errBuff, + int errBuffSize); + +/** + * The rtCmpOID function compares two ASN.1 OBJECT IDENTIFIER or REALTIVE-OID + * values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param pOID The pointer to the first value to compare. + * @param pcompOID The pointer to the second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpOID (const char* name, ASN1OBJID* pOID, + ASN1OBJID* pcompOID, char* errBuff, + int errBuffSize); +EXTERNRT OSBOOL rtCmpOIDValue (const char* name, ASN1OBJID* pOID, + ASN1OBJID* pcompOID, char* errBuff, + int errBuffSize); + +/** + * The rtCmpOID64 function compares two 64-bit ASN.1 OBJECT IDENTIFIER or + * RELATIVE-OID values. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param pOID The pointer to the first value to compare. + * @param pcompOID The pointer to the second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpOID64 (const char* name, ASN1OID64* pOID, + ASN1OID64* pcompOID, char* errBuff, + int errBuffSize); +EXTERNRT OSBOOL rtCmpOID64Value (const char* name, ASN1OID64* pOID, + ASN1OID64* pcompOID, char* errBuff, + int errBuffSize); + +/** + * The rtCmpOpenType function compares two ASN.1 values of the old (pre- 1994) + * ASN.1 ANY type or other elements defined in the later standards to be Open + * Types (for example, a variable type declaration in a CLASS construct defined + * in X.681). + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param numocts The number of octets in the first value to compare. + * @param data The pointer to the data of the first value to compare. + * @param compNumocts The number of octets in the second value to compare. + * @param compData The pointer to the data of the second value to compare. + * @param errBuff The pointer to the buffer to receive the null-terminated + * string if the comparison fails. If the comparison + * failed, this buffer will contain the null-terminated + * string that explains the reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpOpenType (const char* name, + OSUINT32 numocts, const OSOCTET* data, + OSUINT32 compNumocts, const OSOCTET* compData, + char* errBuff, int errBuffSize); + +/** + * The rtCmpOpenTypeExt function compares two ASN.1 open type extension values. + * + * An open type extension is defined as an extensibility marker on a + * constructed type without any extension elements defined (for example, + * SEQUENCE {a INTEGER, ...}). The difference is that this is an implicit field + * that can span one or more elements whereas the standard Open Type is assumed + * to be a single tagged field. + * + * @param name The name of value. Used for constructing errBuff if + * values are not matching. + * @param pElemList The first pointer to a linked list structure. The + * list should consist of ASN1OpenType elements. + * @param pCompElemList The second pointer to a linked list structure. The + * list should consist of ASN1OpenType elements. + * @param errBuff The pointer to the buffer to receive the + * null-terminated string if the comparison fails. If + * the comparison failed, this buffer will contain + * the null-terminated string that explains the + * reason of comparison failure. + * @param errBuffSize The size of the errBuff buffer. + * @return The comparison result. TRUE, if values matched, + * otherwise FALSE. + */ +EXTERNRT OSBOOL rtCmpOpenTypeExt (const char* name, + OSRTDList* pElemList, + OSRTDList* pCompElemList, + char* errBuff, int errBuffSize); +EXTERNRT OSBOOL rtCmpTag (const char* name, int tag, int compTag, + char* errBuff, int errBuffSize); +EXTERNRT OSBOOL rtCmpSeqOfElements (const char* name, int noOfElems, + int compNoOfElems, char* errBuff, + int errBuffSize); +EXTERNRT OSBOOL rtCmpOptional (const char* name, unsigned presentBit, + unsigned compPresentBit, char* errBuff, + int errBuffSize); +/** + * @} cmp + */ + +/* Compare function To StdOut */ + +/**@defgroup cmpStdout Comparison to Standard Output Functions + * @ingroup cruntime + * @{ + * The rtCmpToStdout functions do the same actions as the rtCmp + * ones, but they print the comparison results to stdout instead of putting it + * into the buffer. The prototypes of these functions are almost the same as + * for the rtCmp except the last two parameters - they re absent in the + * rtCmpToStdout functions. + * + + */ +/** + * @param name The name of value. + * @param value The first value to compare. + * @param compValue The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutBoolean (const char* name, OSBOOL value, + OSBOOL compValue); + +/** + * @param name The name of value. + * @param value The first value to compare. + * @param compValue The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutInteger (const char* name, OSINT32 value, + OSINT32 compValue); + +/** + * @param name The name of value. + * @param value The first value to compare. + * @param compValue The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutInt64 (const char* name, OSINT64 value, + OSINT64 compValue); + +/** + * @param name The name of value. + * @param value The first value to compare. + * @param compValue The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutUnsigned (const char* name, OSUINT32 value, + OSUINT32 compValue); + +/** + * @param name The name of value. + * @param value The first value to compare. + * @param compValue The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutUInt64 (const char* name, OSUINT64 value, + OSUINT64 compValue); + +/** + * @param name The name of value. + * @param numbits The first value to compare. + * @param data The pointer to the first value. + * @param compNumbits The second value to compare. + * @param compData The pointer to the second value. + */ +EXTERNRT OSBOOL rtCmpToStdoutBitStr (const char* name, OSUINT32 numbits, + const OSOCTET* data, + OSUINT32 compNumbits, + const OSOCTET* compData); +/** + * @param name The name of value. + * @param numocts The first value to compare. + * @param data The pointer to the data of the first value. + * @param compNumocts The second value to compare. + * @param compData The pointer to the data of the second value. + */ +EXTERNRT OSBOOL rtCmpToStdoutOctStr (const char* name, OSUINT32 numocts, + const OSOCTET* data, + OSUINT32 compNumocts, + const OSOCTET* compData); +/** + * @param name The name of value. + * @param cstring The first value to compare. + * @param compCstring The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutCharStr (const char* name, + const char* cstring, + const char* compCstring); +/** + * @param name The name of value. + * @param bstring The first value to compare. + * @param compBstring The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdout16BitCharStr (const char* name, + Asn116BitCharString* bstring, + Asn116BitCharString* compBstring); +/** + * @param name The name of value. + * @param bstring The first value to compare. + * @param compBstring The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdout32BitCharStr (const char* name, + Asn132BitCharString* bstring, + Asn132BitCharString* compBstring); +/** + * @param name The name of value. + * @param value The first value to compare. + * @param compValue The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutReal (const char* name, + OSREAL value, OSREAL compValue); +/** + * @param name The name of value. + * @param pOID The first value to compare. + * @param pcompOID The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutOID (const char* name, + ASN1OBJID* pOID, ASN1OBJID* pcompOID); +/** + * @param name The name of value. + * @param pOID The first value to compare. + * @param pcompOID The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutOIDValue (const char* name, + ASN1OBJID* pOID, ASN1OBJID* pcompOID); +/** + * @param name The name of value. + * @param pOID The first value to compare. + * @param pcompOID The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutOID64 (const char* name, + ASN1OID64* pOID, ASN1OID64* pcompOID); +/** + * @param name The name of value. + * @param pOID The first value to compare. + * @param pcompOID The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutOID64Value (const char* name, + ASN1OID64* pOID, + ASN1OID64* pcompOID); +/** + * @param name The name of value. + * @param numocts The number of octets in the first value to compare. + * @param data The pointer to the data in the frist value to compare. + * @param compNumocts The number of octets in the second value to compare. + * @param compData The pointer to the data in the second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutOpenType (const char* name, + OSUINT32 numocts, + const OSOCTET* data, + OSUINT32 compNumocts, + const OSOCTET* compData); +/** + * @param name The name of value. + * @param pElemList The first value to compare. + * @param pCompElemList The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutOpenTypeExt (const char* name, + OSRTDList* pElemList, + OSRTDList* pCompElemList); +/** + * @param name The name of value. + * @param tag The first value to compare. + * @param compTag The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutTag (const char* name, int tag, + int compTag); +/** + * @param name The name of value. + * @param noOfElems The first value to compare. + * @param compNoOfElems The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutSeqOfElements (const char* name, + int noOfElems, + int compNoOfElems); +/** + * @param name The name of value. + * @param presentBit The first value to compare. + * @param compPresentBit The second value to compare. + */ +EXTERNRT OSBOOL rtCmpToStdoutOptional (const char* name, + unsigned presentBit, + unsigned compPresentBit); +/** + * @} cmpStdout + */ + + +#ifdef __cplusplus +} +#endif +#endif + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtContext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtContext.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,211 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtContext.h + * ASN.1 run-time context definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTCONTEXT_H_ +#define _RTCONTEXT_H_ + +#include "rtxsrc/rtxContext.h" +#include "rtxsrc/rtxSList.h" +#include "rtxsrc/rtxStack.h" +#include "rtsrc/rtExternDefs.h" + +/** + * @addtogroup rtxCtxt + * @{ + */ +/* ASN.1 size constraint structure */ + +typedef struct _Asn1SizeCnst { + OSBOOL extended; + OSUINT32 lower; + OSUINT32 upper; + struct _Asn1SizeCnst* next; +} Asn1SizeCnst; + +/* Flag mask constant values */ + +#define ASN1DYNCTXT 0x8000 /* set if context is dynamic */ +#define ASN1INDEFLEN 0x4000 /* set if message is indefinite length */ +#define ASN1TRACE 0x2000 /* enable PER bit tracing */ +#define ASN1LASTEOC 0x1000 /* indicates last parsed item was EOC */ +#define ASN1FASTCOPY 0x0800 /* turns on the "fast copy" mode */ +#define ASN1CONSTAG 0x0400 /* form of last parsed tag */ +#define ASN1CANXER 0x0200 /* canonical XER */ +#define ASN1OPENTYPE 0x0080 /* item is an open type field */ +#define ASN1BOOLTRUE1 0x0040 /* boolean true in BER is 01, not FF */ + +/* ASN.1 encode/decode context block structure */ + +typedef struct { + OSFreeCtxtAppInfoPtr pFreeFunc; /* Free function pointer */ + OSResetCtxtAppInfoPtr pResetFunc;/* Reset function pointer */ + OSRTSList fieldList; /* PER field list */ + Asn1SizeCnst* pSizeConstraint; /* Size constraint list */ + const char* pCharSet; /* String of permitted characters */ + OSRTStack nameStack; /* Element name stack */ + OSRTSList evtHndlrList; /* Event handler object list */ + void* errHndlrCB; /* Error handler callback function */ +} OSASN1CtxtInfo; + +#define ACINFO(pctxt) ((OSASN1CtxtInfo*)(pctxt)->pASN1Info) +#define ASN1BUFCUR(cp) (cp)->buffer.data[(cp)->buffer.byteIndex] +#define ASN1BUFPTR(cp) &(cp)->buffer.data[(cp)->buffer.byteIndex] +#define ASN1BUF_INDEFLEN(cp) (((cp)->flags&ASN1INDEFLEN)!=0) +#define ASN1BUF_PTR(cp) ASN1BUFPTR(cp) + +#ifdef __cplusplus +extern "C" { +#endif +/** + * This function initializes a context using a run-time key. This form + * is required for evaluation and limited distribution software. The + * compiler will generate a macro for rtInitContext in the rtkey.h + * file that will invoke this function with the generated run-time key. + * + * @param pctxt The pointer to the context structure variable to be + * initialized. + * @param key Key data generated by ASN1C compiler. + * @param keylen Key data field length. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtInitContextUsingKey +(OSCTXT* pctxt, const OSOCTET* key, size_t keylen); + +/** + * This function initializes an OSCTXT block. It makes sure that if the block + * was not previously initialized, that all key working parameters are set to + * their correct initial state values (i.e. declared within a function as a + * normal working variable). A user must call this function or + * rtNewContext before making any other run-time library calls. + * + * @param pctxt Pointer to context structure variable to be initialized. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ +#ifndef rtInitContext +EXTERNRT int rtInitContext (OSCTXT* pctxt); +#endif + +/** + * This function initializes an OSCTXT block using an existing context + * as a basis. This provides improved performance over initializing a + * context from scratch because the overhead of creating a memory heap + * and doing license checking is eliminated. The new context shares + * the memory heap of the existing context. + * + * @param pctxt Pointer to context structure variable to be initialized. + * @param psrc Source context to use fo initialization. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtInitSubContext (OSCTXT* pctxt, OSCTXT* psrc); + +/** + * This function allocates a new OSCTXT block and initializes it. Although + * the block is allocated from the standard heap, it should not be freed using + * free. The rtFreeContext function should be used because this frees items + * allocated within the block before freeing the block itself. + * + * This is the preferred way of setting up a new encode or decode context + * because it ensures the block is properly initialized before using it. If a + * context variable is declared on the stack, the user must first remember to + * invoke the rtInitContext function on it. This can be a source of errors. + * This function can be called directly when setting up BER context or it will + * be invoked from within the pu_newContext call for PER. + * + * @return Newly allocated context if successful, + * NULL if failure. + */ +#ifndef rtNewContext +EXTERNRT OSCTXT* rtNewContext (void); +#endif + +/** + * This function allocates a new OSCTXT block and initializes it. Although + * the block is allocated from the standard heap, it should not be freed using + * free. The rtFreeContext function should be used because this frees items + * allocated within the block before freeing the block itself. + * + * This is the preferred way of setting up a new encode or decode context + * because it ensures the block is properly initialized before using it. If a + * context variable is declared on the stack, the user must first remember to + * invoke the rtInitContext function on it. This can be a source of errors. + * This function can be called directly when setting up BER context or it will + * be invoked from within the pu_newContext call for PER. + * + * @param key Key data generated by ASN1C compiler. + * @param keylen Key data field length. + * @return Newly allocated context if successful, + * NULL if failure. + */ +EXTERNRT OSCTXT* rtNewContextUsingKey (const OSOCTET* key, size_t keylen); + +/** + * This function frees all dynamic memory associated with a context. This + * includes all memory inside the block (in particular, the list of memory + * blocks used by the rtMem functions) as well as the block itself if allocated + * with the rtNewContext function + * + * @param pctxt A pointer to a context structure. + */ +EXTERNRT void rtFreeContext (OSCTXT* pctxt); + +/** + * This function is deprecated, use ::rtSetFastCopy. + */ +EXTERNRT void rtSetCopyValues (OSCTXT* pctxt, OSBOOL value); + +/** + * This function sets the ASN1FASTCOPY flag in the specified context. This flag + * has effect only if decoding is being performed. If this flag is set then + * some decoded data (BIT STRINGs, OCTET STRINGs or OPEN TYPEs) will not + * be copied. Instead, a pointer to the location of the data in the decode + * buffer will be stored in the generated structure. This may improve + * decoding performance, but should be used carefully. If the decode + * buffer is destroyed, all uncopied data will be lost. Use only if you + * are sure the decode buffer will be available when data in the decoded + * structure is processed. By default this flag is not set. + * + * @param pctxt Pointer to context block structure. + * @param value Boolean value of the flag to set. + */ +EXTERNRT void rtSetFastCopy (OSCTXT* pctxt, OSBOOL value); + +/** + * @} rtxCtxt + */ + +/* Internal function defs */ +void rtErrASN1Init (); +EXTERNRT int rtCtxtInitASN1Info (OSCTXT* pctxt); +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtCopy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtCopy.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,278 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtsrc/rtCopy.h Functions for copying values of primitive + * ASN.1 types. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTCOPY_H_ +#define _RTCOPY_H_ +#include "rtsrc/asn1type.h" + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @defgroup copy Copy Functions + * @ingroup cruntime + * @{ + * This group of functions allows copying values of primitive ASN.1 types. + * + * These functions are used in copy routines that are generated by the ASN.1 + * complier when -gencopy option is used. Some primitive types that are + * mapped onto C standard primitive types (such as BOOLEAN, INTEGER REAL) do + * not need copy functions. The standard assingment operator can be used to + * copy these types. + */ + +/** + * The rtCopyBitStr function copies one ASN.1 BIT STRING value to another. + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param srcNumbits The number of bits in the source value to copy. + * @param pSrcData The pointer to data of the source value to copy. + * @param pDstNumbits The pointer to destination number of bits. The + * srcNumbits argument will be copied into it. + * @param pDstData The pointer to the destination buffer to receive the + * copied data. The buffer is assumed to be already + * allocated or static and should be enough to receive + * the copying data. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyBitStr (OSUINT32 srcNumbits, + const OSOCTET* pSrcData, + OSUINT32* pDstNumbits, OSOCTET* pDstData); + +/** + * The rtCopyDynBitStr function is similar to the rtCopyBitStr, but it copies a + * dynamic ASN.1 BIT STRING value. + * + * The return vale is one of the TRUE (copied successfully) or FALSE (error has + * occurred). + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pSrcData The pointer to data of the source value to copy. + * @param pDstData The pointer to the destination dynamic bit string + * structure to receive the copied data. The memory will + * be allocated dynamically via call to rtxMemAlloc + * function. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyDynBitStr + (OSCTXT* pctxt, ASN1DynBitStr* pSrcData, ASN1DynBitStr* pDstData); + +/** + * The rtCopyOctStr function copies one ASN.1 OCTET STRING value to another. + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param srcNumocts The number of octets in the source value to copy. + * @param pSrcData The pointer to data of the source value to copy. + * @param pDstNumocts The pointer to the destination number of octets. The + * srcNumocts argument will be copied into it. + * @param pDstData The pointer to the destination buffer to receive the + * copied data. The buffer is assumed to be already + * allocated or static and should be enough to receive + * the copying data. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyOctStr + (OSUINT32 srcNumocts, const OSOCTET* pSrcData, + OSUINT32* pDstNumocts, OSOCTET* pDstData); + +/** + * The rtCopyDynOctStr funtion is similar to rtCopyOctStr, but it copies a + * dynamic ASN.1 OCTET STRING value. + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pSrcData The pointer to the source dynamic octet string structure + * to copy. + * @param pDstData The point to destination dynamic octet string structure + * to receive the copied data. The memory will be + * allocated dynamically via a call to rtxMemAlloc + * function. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyDynOctStr + (OSCTXT* pctxt, ASN1DynOctStr* pSrcData, ASN1DynOctStr* pDstData); + +/** + * The rtCopyCharStr function copies one ASN.1 8-bit character string value to + * another (including IA5String, VisibleString, PrintableString, NumericString, + * etc). + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param srcStr The pointer to the source standard null-terminated + * string to copy. + * @param dstStr The pointer to pointer destination string to receive the + * copied string. The memory will be allocated + * dynamically via a call to rtxMemAlloc function. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyCharStr + (OSCTXT* pctxt, const char* srcStr, char** dstStr); + +/** + * The rtCopy16BitCharStr function copies one ASN.1 16-bit character string + * value to another (generally BMPString). + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param srcStr The pointer to the source 16-bit character string + * structure to copy. + * @param dstStr The pointer to destination 16-bit character string + * structure to receive the copied string. The memory + * will be allocated dynamically via call to rtxMemAlloc + * function. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopy16BitCharStr + (OSCTXT* pctxt, Asn116BitCharString* srcStr, Asn116BitCharString* dstStr); + +/** + * The rtCopy32BitCharStr function copies one ASN.1 32-bit character string + * value to another (generally UniversalString). + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param srcStr The pointer to the source 32-bit character string + * structure to copy. + * @param dstStr The pointer to destination 32-bit character string + * structure to receive the copied string. The memory + * will be allocated dynamically via call to rtxMemAlloc + * function. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopy32BitCharStr + (OSCTXT* pctxt, Asn132BitCharString* srcStr, Asn132BitCharString* dstStr); + +/** + * The rtCopyIOD function copies one ASN.1 OBJECT IDENTIFIER or RELATED-IOD + * value to another. + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param srcOID The pointer to the source object identifier structure to + * copy. + * @param dstOID The pointer to destination structure t receive the + * copied string. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyOID + (ASN1OBJID* srcOID, ASN1OBJID* dstOID); + +/** + * The rtCopyOID64 function copies one 64-bit ASN.1 OBJECT IDENTIFIER or + * RELATIVE-OID value to another. + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param srcOID The pointer to the source object identifier structure to + * copy. + * @param dstOID The pointer to destination structure t receive the + * copied string. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyOID64 + (ASN1OID64* srcOID, ASN1OID64* dstOID); + +/** + * The rtCopyOpenType copies ASN.1 value of the old (pre- 1994) ASN.1 ANY type + * or other elements defined in the later standards to be Open Types (for + * example, a variable type declaration in a CLASS construct as defined in + * X.681). + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param srcOT The pointer to the source Open Type structure to copy. + * @param dstOT The pointer to the destination Open Type structure to + * receive the copied data. The memory will be allocated + * dynamically via call to the rtxMemAlloc function. + * @return The copying result. TRUE, if success, otherwise FALSE. + */ +EXTERNRT OSBOOL rtCopyOpenType + (OSCTXT* pctxt, ASN1OpenType* srcOT, ASN1OpenType* dstOT); + +/** + * The rtCopyOpenTypeExt function copies an ASN.1 open type extension value. + * + * The return value is one of the TRUE (copied successfully) or FALSE (error + * has occurred). An open type extension is defined as extensibility marker on + * a constructed type without any extension elements defined (for example, + * SEQUENCE { a INTEGER, ... }). The difference is that this is an implicit + * field that can span more elements whereas the standard Open Type is assumed + * to be a single tagged field. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param srcList The pointer to the source linked list structure to copy. + * The list should consist of ASN1OpenType elements. + * @param dstList The pointer to destination linked list structure to + * receive the copied data. The memory for list nodes and + * data will be allocated dynamically via call to the + * rtxMemAlloc function. The list nodes will contain the + * data of ASN1OpenType type. + */ +EXTERNRT OSBOOL rtCopyOpenTypeExt + (OSCTXT* pctxt, OSRTDList* srcList, OSRTDList* dstList); +/** + * @} + */ + +/* Macros */ +#define RTCOPYCHARSTR(pctxt,src,dst) \ +do { char* ptr; rtCopyCharStr (pctxt, src, &ptr); *dst = ptr; } while(0) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTCOPY_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtExternDefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtExternDefs.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,74 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef _RTEXTERNDEFS_H_ +#define _RTEXTERNDEFS_H_ + +/** + * @file rtExternDefs.h + * Common definitions of external function modifiers used to define the + * scope of functions used in DLL's (Windows only). + */ + +#if defined(__SYMBIAN32__) /* OS: Symbian */ +#define EXTRTCLASS + +#ifndef EXTERN +#ifdef BUILDASN1RTDLL +#define EXTERN EXPORT_C +#elif defined (USEASN1RTDLL) +#define EXTERN IMPORT_C +#else +#define EXTERN +#endif /* BUILDASN1RTDLL */ +#endif /* EXTERN */ + +#ifndef EXTERNRT +#ifdef BUILDASN1RTDLL +#define EXTERNRT EXPORT_C +#define EXTRTMETHOD EXPORT_C +#elif defined (USEASN1RTDLL) +#define EXTERNRT IMPORT_C +#define EXTRTMETHOD IMPORT_C +#else +#define EXTERNRT +#define EXTRTMETHOD +#endif /* BUILDASN1RTDLL */ +#endif /* EXTERNRT */ + +#else /* OS: Win, Unix, Linux, ... */ +#define EXTRTMETHOD + +#ifndef EXTERNRT +#if defined(BUILDASN1RTDLL) || defined(BUILDRTXDLL) +#define EXTERNRT __declspec(dllexport) +#define EXTRTCLASS __declspec(dllexport) +#elif defined (USEASN1RTDLL) +#define EXTERNRT __declspec(dllimport) +#define EXTRTCLASS __declspec(dllimport) +#else +#define EXTERNRT +#define EXTRTCLASS +#endif /* BUILDRTDLL */ +#endif + +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrint.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrint.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,198 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtPrint.h Functions to print ASN.1 data in various formats. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTPRINT_H_ +#define _RTPRINT_H_ +#include +#include "rtsrc/asn1type.h" +#include "rtxsrc/rtxPrint.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup valsToStdout Print Values to Standard Output + * @ingroup cruntime + * @{ + * These functions print the output in a "name=value" format. The + * value format is obtained by calling one of the ToString functions with the + * given value. + */ +#define rtPrintBoolean rtxPrintBoolean +#define rtPrintInteger rtxPrintInteger +#define rtPrintInt64 rtxPrintInt64 +#define rtPrintUnsigned rtxPrintUnsigned +#define rtPrintUInt64 rtxPrintUInt64 +#define rtPrintReal rtxPrintReal +#define rtPrintCharStr rtxPrintCharStr +#define rtPrintHexStr rtxPrintHexStr + +/** + * This function prints the value of a bit string to stdout. + * + * @param name The name of the variable to print. + * @param numbits The number of bitsto be printed. + * @param data A pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + */ +EXTERNRT void rtPrintBitStr (const char* name, OSUINT32 numbits, + const OSOCTET* data, const char* conn); + +/** + * This function prints the value of a bit string to stdout in brace text + * format. + * + * @param name The name of the variable to print. + * @param numbits The number of bits to be printed. + * @param data A pointer to the data to be printed. + */ +EXTERNRT void rtPrintBitStrBraceText +(const char* name, OSUINT32 numbits, const OSOCTET* data); + +/** + * This function prints the value of an octet string to stdout. + * + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + */ +EXTERNRT void rtPrintOctStr (const char* name, OSUINT32 numocts, + const OSOCTET* data, const char* conn); + +/** + * This function prints the value of a 16-bit character string to stdout. + * + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + */ +EXTERNRT void rtPrint16BitCharStr (const char* name, + Asn116BitCharString* bstring); + + +/** + * This function prints the value of a 32-bit character string to stdout. + * + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + */ +EXTERNRT void rtPrint32BitCharStr (const char* name, + Asn132BitCharString* bstring, + const char* conn); + +/** + * This function prints a Universal string to standard output. Characters + * in the string that are within the normal Ascii range are printed as + * single characters. Characters outside the Ascii range are printed + * as 8-byte hex codes (0xnnnnnnnn). + * + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + */ +EXTERNRT void rtPrintUnivCharStr (const char* name, + Asn132BitCharString* bstring); + +/** + * This function prints the value of an object identifier to stdout. + * + * @param name The name of the variable to print. + * @param pOID A pointer to the OID to be printed. + */ +EXTERNRT void rtPrintOID (const char* name, ASN1OBJID* pOID); + +/** + * This function prints the value of an object identifier + * to stdout. Only the value is printed, not the name. + * + * @param pOID A pointer to the OID to be printed. + */ +EXTERNRT void rtPrintOIDValue (ASN1OBJID* pOID); + +/** + * This function prints the value of an object identifier with 64-bit arc + * values to stdout. + * + * @param name The name of the variable to print. + * @param pOID A pointer to the OID to be printed. + */ +EXTERNRT void rtPrintOID64 (const char* name, ASN1OID64* pOID); + +/** + * This function prints the value of an object identifier with 64-bit arc + * values to stdout. Only the value is printed, not the name. + * + * @param pOID A pointer to the OID to be printed. + */ +EXTERNRT void rtPrintOID64Value (ASN1OID64* pOID); + +/** + * This function prints the value of an open type to stdout. + * + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data The pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + */ +EXTERNRT void rtPrintOpenType (const char* name, OSUINT32 numocts, + const OSOCTET* data, const char* conn); + +/** + * This function prints the value of an open type extension to stdout. + * + * @param name The name of the variable to print. + * @param pElemList A pointer to an element of a list. + */ +EXTERNRT void rtPrintOpenTypeExt (const char* name, OSRTDList* pElemList); + +/** + * This function prints the value of an open type extension in brace + * text format to stdout. + * + * @param name The name of the variable to print. + * @param pElemList A pointer to an element of a list. + */ +EXTERNRT void rtPrintOpenTypeExtBraceText +(const char* name, OSRTDList* pElemList); + +#define rtPrintIndent rtxPrintIndent +#define rtPrintIncrIndent rtxPrintIncrIndent +#define rtPrintDecrIndent rtxPrintDecrIndent +#define rtPrintCloseBrace rtxPrintCloseBrace +#define rtPrintOpenBrace rtxPrintOpenBrace + +/** + * @} valsToStdout + */ +#ifdef __cplusplus +} +#endif +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrintStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrintStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,21 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#include "rtxsrc/rtxPrintStream.h" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrintToStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrintToStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,244 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** + * @file rtPrintToStream.h + * Functions to print the output in a "name=value" format. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTPRINTTOSTREAM_H_ +#define _RTPRINTTOSTREAM_H_ +#include +#include "rtsrc/asn1type.h" +#include "rtxsrc/rtxPrintStream.h" +#include "rtxsrc/rtxPrintToStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup valsToStream Print Values to user specified Stream + * @ingroup cruntime + * @{ + * These functions print the output in a "name=value" format. + */ +#define rtPrintToStreamBoolean rtxPrintToStreamBoolean +#define rtPrintToStreamInteger rtxPrintToStreamInteger +#define rtPrintToStreamInt64 rtxPrintToStreamInt64 +#define rtPrintToStreamUnsigned rtxPrintToStreamUnsigned +#define rtPrintToStreamUInt64 rtxPrintToStreamUInt64 +#define rtPrintToStreamCharStr rtxPrintToStreamCharStr +#define rtPrintToStreamReal rtxPrintToStreamReal +#define rtPrintToStreamHexStr rtxPrintToStreamHexStr +#define rtPrintToStreamIndent rtxPrintToStreamIndent +#define rtPrintToStreamIncrIndent rtxPrintToStreamIncrIndent +#define rtPrintToStreamDecrIndent rtxPrintToStreamDecrIndent +#define rtPrintToStreamCloseBrace rtxPrintToStreamCloseBrace +#define rtPrintToStreamOpenBrace rtxPrintToStreamOpenBrace + +/** + * Prints an ASN.1 bit string value to a print stream. + * + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param numbits The number of bitsto be printed. + * @param data A pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamBitStr +(OSCTXT *pctxt, const char* name, OSUINT32 numbits, const OSOCTET* data, + const char* conn); + +/** + * This function prints the value of a bit string to a stream in brace text + * format. + * + * @param pctxt Pointer to a context initialized for printing. + * @param name The name of the variable to print. + * @param numbits The number of bitsto be printed. + * @param data A pointer to the data to be printed. + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamBitStrBraceText +(OSCTXT *pctxt, const char* name, OSUINT32 numbits, const OSOCTET* data); + +/** + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamOctStr +(OSCTXT *pctxt, const char* name, OSUINT32 numocts, const OSOCTET* data, + const char* conn); + +/** + * Prints a 16-bit (Unicode) character string value to a print stream. + * + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStream16BitCharStr +(OSCTXT *pctxt, const char* name, Asn116BitCharString* bstring, + const char* conn); + +/** + * Prints a 32-bit (Universal) character string value to a print stream. + * + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStream32BitCharStr +(OSCTXT *pctxt, const char* name, Asn132BitCharString* bstring, + const char* conn); + +/** + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param pOID A pointer to the OID to be printed. + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamOID +(OSCTXT *pctxt, const char* name, ASN1OBJID* pOID); + +/** + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param pOID A pointer to the OID to be printed. + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamOIDValue (OSCTXT *pctxt, ASN1OBJID* pOID); + +/** + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param pOID A pointer to the OID to be printed. + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamOID64 +(OSCTXT *pctxt, const char* name, ASN1OID64* pOID); + +/** + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param pOID A pointer to the OID to be printed. + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamOID64Value (OSCTXT *pctxt, ASN1OID64* pOID); + +/** + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data The pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamOpenType +(OSCTXT *pctxt, const char* name, OSUINT32 numocts, const OSOCTET* data, + const char* conn); + +/** + * @param pctxt Pointer to an ASN1 context initialized for printing. + * @param name The name of the variable to print. + * @param pElemList A pointer to an element of a list. + * + * @return Completion status, 0 on success and -ve on failure + */ +EXTERNRT int rtPrintToStreamOpenTypeExt +(OSCTXT *pctxt, const char* name, OSRTDList* pElemList); + +/** + * This function prints a Universal string to stream output. Characters + * in the string that are within the normal Ascii range are printed as + * single characters. Characters outside the Ascii range are printed + * as 8-byte hex codes (0xnnnnnnnn). + * @param pctxt Pointer to an ASN1 context initialized for stream + * printing. + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + */ +EXTERNRT int rtPrintToStreamUnivCharStr + (OSCTXT *pctxt, const char* name, Asn132BitCharString* bstring); + +/** + * This function prints a Unicode string to stream output. Characters + * in the string that are within the normal Ascii range are printed as + * single characters. Characters outside the Ascii range are printed + * as 4-byte hex codes (0xnnnn). + * @param pctxt Pointer to an ASN1 context initialized for stream + * printing. + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + */ +EXTERNRT int rtPrintToStreamUnicodeCharStr + (OSCTXT *pctxt, const char* name, Asn116BitCharString* bstring); + +/** + * This function prints the value of an open type extension in brace + * text format to stream. + * @param pctxt Pointer to an ASN1 context initialized for stream + * printing. + * @param name The name of the variable to print. + * @param pElemList A pointer to an element of a list. + */ +EXTERNRT int rtPrintToStreamOpenTypeExtBraceText + (OSCTXT *pctxt, const char* name, OSRTDList* pElemList); + +/** + * These macro definitions provide backward compatible definitions for + * ASN1C v5.xx applications. + */ +#define rtPrintCallback rtxPrintCallback +#define rtSetPrintStream rtxSetPrintStream +#define rtSetGlobalPrintStream rtxSetGlobalPrintStream +#define rtPrintToStream rtxPrintToStream +#define rtDiagToStream rtxDiagToStream +#define rtPrintStreamRelease rtxPrintStreamRelease + +/** + * @} valsToStream + */ +#ifdef __cplusplus +} +#endif +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrintToString.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtPrintToString.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,369 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** + * @file rtsrc/rtPrintToString.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTPRINTTOSTRING_H_ +#define _RTPRINTTOSTRING_H_ +#include +#include "rtsrc/asn1type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtPrintToString Print values to text buffer functions. + * @ingroup cruntime + * Format the output value to string in a "name = value" format. The value + * format is obtained by calling one of the "ToString" functions with the given + * value. + * + * @{ + */ +/** + * @param name The name of the variable to print. + * @param value ASN.1 value to print (Note: multiple arguments may be + * used to represent the value- for example a bit string + * would be represented by a numbits and data argument. + * See the function prototype forthe exact calling + * sequence). + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringBoolean (const char* name, OSBOOL value, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param value ASN.1 value to print (Note: multiple arguments may be + * used to represent the value- for example a bit string + * would be represented by a numbits and data argument. + * See the function prototype forthe exact calling + * sequence). + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringInteger (const char* name, OSINT32 value, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param value ASN.1 value to print (Note: multiple arguments may be + * used to represent the value- for example a bit string + * would be represented by a numbits and data argument. + * See the function prototype forthe exact calling + * sequence). + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringInt64 (const char* name, OSINT64 value, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param value ASN.1 value to print (Note: multiple arguments may be + * used to represent the value- for example a bit string + * would be represented by a numbits and data argument. + * See the function prototype for the exact calling + * sequence). + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringUnsigned (const char* name, OSUINT32 value, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param value ASN.1 value to print (Note: multiple arguments may be + * used to represent the value- for example a bit string + * would be represented by a numbits and data argument. + * See the function prototype for the exact calling + * sequence). + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringUInt64 (const char* name, OSUINT64 value, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param numbits The number of bits to be printed. + * @param data A pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringBitStr (const char* name, + OSUINT32 numbits, const OSOCTET* data, const char* conn, + char* buffer, int bufferSize); + +/** + * This function prints the value of a bit string to a text buffer in + * brace text format. + * + * @param name The name of the variable to print. + * @param numbits The number of bits to be printed. + * @param data A pointer to the data to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringBitStrBraceText +(const char* name, OSUINT32 numbits, const OSOCTET* data, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOctStr (const char* name, + OSUINT32 numocts, const OSOCTET* data, const char* conn, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param cstring A pointer to the character string to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringCharStr (const char* name, + const char* cstring, char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param ustring A pointer to the UTF-8 string to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer A pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringUTF8Str (const char *name, + const OSUTF8CHAR *ustring, char *buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param bstring A pointer to a 16-bit string to print. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToString16BitCharStr (const char* name, + Asn116BitCharString* bstring, const char* conn, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param bstring A pointer to a 32-bit string to print. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToString32BitCharStr (const char* name, + Asn132BitCharString* bstring, const char* conn, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param value ASN.1 value to print (Note: multiple arguments may be + * used to represent the value- for example a bit string + * would be represented by a numbits and data argument. + * See the function prototype forthe exact calling + * sequence). + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringReal (const char* name, OSREAL value, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param pOID A pointer to a OID to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOID (const char* name, ASN1OBJID* pOID, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param pOID A pointer to a OID to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOID64 (const char* name, ASN1OID64* pOID, + char* buffer, int bufferSize); + +/** + * @param bufferIndex The index to the buffer. + * @param pOID A pointer to a OID to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOIDValue (ASN1OBJID* pOID, + char* buffer, int bufferSize); + +/** + * @param bufferIndex The index to the buffer. + * @param pOID A pointer to a OID to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOID64Value (ASN1OID64* pOID, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + * @param conn A pointer to the connector between the name and the + * value. This points to either -> or . + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOpenType (const char* name, + OSUINT32 numocts, const OSOCTET* data, const char* conn, + char* buffer, int bufferSize); + +/** + * @param name The name of the variable to print. + * @param pElemList A pointer to the element to be printed. + * @param bufferSize The size of the buffer to receive the printed value. + * @param buffer Pointer to a buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOpenTypeExt (const char* name, + OSRTDList* pElemList, char* buffer, int bufferSize); + +/** + * @param namebuf A pointer to the buffer name. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToString (const char* namebuf, + char* buffer, int bufSize); + +/** + * This function prints the value of a binary string in hex format + * to string buffer. If the string is 32 bytes or less, it is printed + * on a single line with a '0x' prefix. If longer, a formatted hex dump + * showing both hex and ascii codes is done. + * + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringHexStr + (const char* name, OSUINT32 numocts, const OSOCTET* data, char* buffer, + int bufSize); + +/** + * This function prints a Unicode string to string buffer. Characters + * in the string that are within the normal Ascii range are printed as + * single characters. Characters outside the Ascii range are printed + * as 4-byte hex codes (0xnnnn). + * + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringUnicodeCharStr + (const char* name, Asn116BitCharString* bstring, char* buffer, int bufSize); + +/** + * This function prints a Universal string to string buffer. Characters + * in the string that are within the normal Ascii range are printed as + * single characters. Characters outside the Ascii range are printed + * as 8-byte hex codes (0xnnnnnnnn). + * + * @param name The name of the variable to print. + * @param bstring A pointer to the bit string to be printed. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringUnivCharStr (const char* name, + Asn132BitCharString* bstring, char* buffer, int bufSize); + +#ifndef __SYMBIAN32__ +/** + * This function prints the value of an open type extension in brace + * text format to buffer. + * + * @param name The name of the variable to print. + * @param pElemList A pointer to an element of a list. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOpenTypeExtBraceText + (const char* name, OSRTDList* pElemList, char* buffer, int bufSize); + +/** + * This function prints indentation spaces to buffer. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringIndent (char* buffer, int bufSize); + +/** + * This function increments the current indentation level. + */ +EXTERNRT void rtPrintToStringIncrIndent(); + +/** + * This function decrements the current indentation level. + */ +EXTERNRT void rtPrintToStringDecrIndent (); + +/** + * This function closes a braced region by decreasing the indent level, + * printing indent spaces, and printing the closing brace. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringCloseBrace (char* buffer, int bufSize); + +/** + * This function opens a braced region by printing indent spaces, + * printing the name and opening brace, and increasing the indent level. + * @param buffer Pointer to a buffer to receive the printed value. + * @param bufSize The size of the buffer to receive the printed value. + */ +EXTERNRT int rtPrintToStringOpenBrace + (const char*, char* buffer, int bufSize); + +#endif + +/** + * @} + */ +#ifdef __cplusplus +} +#endif +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtSocketSelect.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtSocketSelect.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,92 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtSocketSelect.h + * Support for socket select operation. + */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _RTSOCKETSELECT_H_ +#define _RTSOCKETSELECT_H_ + +#ifdef _WIN32_WCE +#include +#elif (defined(_WIN32) || defined(_WIN64)) && !defined(__SYMBIAN32__) +#include +#ifdef INCL_WINSOCK_API_TYPEDEFS +#undef INCL_WINSOCK_API_TYPEDEFS +#endif +#ifdef INCL_WINSOCK_API_PROTOTYPES +#undef INCL_WINSOCK_API_PROTOTYPES +#endif +#define INCL_WINSOCK_API_TYPEDEFS 1 +#define INCL_WINSOCK_API_PROTOTYPES 0 +#include +#else +#include +#include +#include +#include +#include +#include +#endif + +#include "asn1type.h" +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @addtogroup sockets + * @ingroup cruntime + * @{ + */ + +#if !defined(_AIX) && !defined (__SYMBIAN32__) /* AIX 4.3 & Symbian doesn't support select */ +/** + * This function is used for synchronous monitoring of multiple sockets. + * For more information refer to documnetation of "select" system call. + * + * @param nfds The highest numbered descriptor to be monitored + * plus one. + * @param readfds The descriptors listed in readfds will be watched for + * whether read would block on them. + * @param writefds The descriptors listed in writefds will be watched for + * whether write would block on them. + * @param exceptfds The descriptors listed in exceptfds will be watched for + * exceptions. + * @param timeout Upper bound on amount of time elapsed before select + * returns. + * + * @return Completion status of operation: 0 (ASN_OK) = success, + * negative return value is error. + */ +EXTERNRT int rtSocketSelect(int nfds, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval * timeout); +#endif /* !defined(_AIX or SYMBIAN) */ + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* _RTSOCKETSELECT_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,88 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/* + * This file is deprecated and maintained for backward compatibility only. + * Definitions in rtxsrc/rtxStream.h should be used for any new + * development. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTSTREAM_H_ +#define _RTSTREAM_H_ + +#include "rtxsrc/rtxStreamFile.h" +#include "rtxsrc/rtxStreamMemory.h" +#include "rtxsrc/rtxStreamSocket.h" +#include "rtsrc/rtExternDefs.h" +#include "rtsrc/asn1compat.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define rtStreamRelease rtxStreamRelease +#define rtStreamClose rtxStreamClose +#define rtStreamFlush rtxStreamFlush +#define rtStreamInit rtxStreamInit +#define rtStreamRead rxtStreamRead +#define rtStreamBlockingRead rxtStreamBlockingRead +#define rtStreamSkip rtxStreamSkip +#define rtStreamWrite rxtStreamWrite +#define rtStreamGetIOBytes rtxStreamGetIOBytes +#define rtStreamMark rtxStreamMark +#define rtStreamReset rtxStreamReset +#define rtStreamMarkSupported rtxStreamMarkSupported +#define rtStreamIsOpened rtxStreamIsOpened +#define rtStreamIsReadable rtxStreamIsReadable +#define rtStreamIsWritable rtxStreamIsWritable + +#define rtStreamBufClose rtxStreamClose +#define rtStreamBufFlush rtxStreamFlush +#define rtStreamBufInit rtxStreamInit +#define rtStreamBufMark rtxStreamMark +#define rtStreamBufSkip rtxStreamSkip +#define rtStreamBufReset rtxStreamReset +#define rtStreamBufWrite rtxStreamWrite + +/* special case: return code was changed in rtx to return number of + bytes read whereas rt version returned 0 if success */ +EXTERNRT int rtStreamBufRead (ASN1CTXT* pctxt, ASN1OCTET* pdata, size_t size); + +#define rtStreamFileAttach rtxStreamFileAttach +#define rtStreamFileOpen rtxStreamFileOpen +#define rtStreamFileCreateReader rtxStreamFileCreateReader +#define rtStreamFileCreateWriter rtxStreamFileCreateWriter + +#define rtStreamSocketAttach rtxStreamSocketAttach +#define rtStreamSocketCreateReader rtxStreamSocketCreateReader +#define rtStreamSocketCreateWriter rtxStreamSocketCreateWriter + +#define rtStreamMemoryCreate rtxStreamMemoryCreate +#define rtStreamMemoryAttach rtxStreamMemoryAttach +#define rtStreamMemoryGetBuffer rxtStreamMemoryGetBuffer +#define rtStreamMemoryCreateReader rtxStreamMemoryCreateReader +#define rtStreamMemoryCreateWriter rtxStreamMemoryCreateWriter + +#ifdef __cplusplus +} +#endif + +#endif /* _RTSTREAM_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtTable.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtTable.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,98 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxsrc/rtxTable.h + */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _RTTABLE_H_ +#define _RTTABLE_H_ + +#include "rtsrc/asn1type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************************************/ +/* */ +/* Common RunTime Library Functions */ +/* */ +/**************************************************************/ + +EXTERNRT int rtCmpTCINT8 (OSINT8* value, OSINT8* compValue); +EXTERNRT int rtCmpTCUINT8 (OSUINT8* value, OSUINT8* compValue); +#define rtCmpTCCHAR rtCmpTCINT8 +#define rtCmpTCOCTET rtCmpTCUINT8 +EXTERNRT int rtCmpTCSINT (OSINT16* value, OSINT16* compValue); +EXTERNRT int rtCmpTCUSINT (OSUINT16* value, OSUINT16* compValue); +EXTERNRT int rtCmpTCINT (OSINT32* value, OSINT32* compValue); +EXTERNRT int rtCmpTCUINT (OSUINT32* value, OSUINT32* compValue); +EXTERNRT int rtCmpTCINT64 (OSINT64* value, OSINT64* compValue); +EXTERNRT int rtCmpTCUINT64 (OSUINT64* value, OSUINT64* compValue); +EXTERNRT int rtCmpTCOID (ASN1OBJID* pOID, ASN1OBJID* pcompOID); +EXTERNRT int rtCmpTCReal (OSREAL* value, OSREAL* compValue); +EXTERNRT int rtCmpTCBoolean (OSBOOL* key, OSBOOL* pCompValue); +EXTERNRT int rtCmpTCBitStr (OSUINT32 numbits, const OSOCTET* data, + OSUINT32 cmpnumbits, const OSOCTET* cmpData); +EXTERNRT int rtCmpTCOctet (const OSOCTET* pValue, const OSOCTET* pCompValue); +EXTERNRT int rtCmpTCOctStr (OSUINT32 numocts, const OSOCTET* data, + OSUINT32 cmpnumocts, const OSOCTET* cmpdata); +EXTERNRT int rtCmpTCCharStr (const char* cstring, const char* compCstring); +EXTERNRT int rtCmpTC16BitCharStr + (Asn116BitCharString* key, Asn116BitCharString* pCompValue); +EXTERNRT int rtCmpTC32BitCharStr + (Asn132BitCharString* key, Asn132BitCharString* pCompValue); + +EXTERNRT long rtBSearch (void *key, void *base, + size_t nmemb, size_t size, + int (*compar) (void *, void *)); + +EXTERNRT int rtLSearch (void *key, void *base, + int nmemb, size_t size, + int (*compar) (void *, void *)); + +#define RTARRAYTOLIST(arraysize, array, list) \ +{\ + static OSRTDListNode ListNodes[arraysize]; \ + OSUINT32 i; \ + for (i = 0; i < arraysize; i ++) { \ + ListNodes[i].data = (void*)&array[i]; \ + ListNodes[i].next = (OSRTDListNode*) 0; \ + if (0 != list.tail) { \ + list.tail->next = &ListNodes[i]; \ + ListNodes[i].prev = list.tail; \ + } \ + if (0 == list.head) { \ + list.head = &ListNodes[i]; \ + ListNodes[i].prev = (OSRTDListNode*) 0; \ + } \ + list.tail = &ListNodes[i]; \ + list.count++; \ + } \ +} + +EXTERNRT void rtMemFreeNullPtr (OSCTXT* pctxt, void* pobject); + +#ifdef __cplusplus +} +#endif +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtToken.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtToken.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtToken.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTTOKEN_H_ +#define _RTTOKEN_H_ + +#include "rtxsrc/rtxToken.h" + +#endif /*_RTTOKEN_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtbench.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtbench.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,53 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/* Benchmark utility functions */ + +/** + * @file rtbench.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _BENCH_H_ +#define _BENCH_H_ + +#include +#include +#ifndef _WIN32_WCE +#include +#ifndef _NUCLEUS +#include +#endif +#else +#include "rtxsrc/wceAddon.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define ITERCNT 100000 + +double rtBenchAverageMS (clock_t start, clock_t finish, double icnt); + +#ifdef __cplusplus +} +#endif +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtconv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtsrc/rtconv.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,201 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtconv.h + * ASN.1 type to string conversion functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTCONV_H_ +#define _RTCONV_H_ + +#include "rtsrc/asn1type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup convfunc ASN.1 type to string conversion functions. + * @{ + * This group of functions allows raw ASN.1 data fields to be converted + * to a stringified representation. + */ +/** + * This function converts an ASN.1 bit string to a string. The output is an + * ASN.1 value notation for a binary string (for example, '10010'B). + * + * @param numbits The number of bits in the data argument to format. + * @param data The buffer containing the bit string to be formatted + * (note : in the case of BER/DER, this refers to the + * actual point in the string where the data starts, not + * where the contents field starts. The contents field + * contains an extra byte at the beginning that specifies + * the number of unused bits in the last byte). + * @param buffer A pointer to a buffer to receive the stringified value. + * @param bufsiz The size of the buffer to receive the stringified value. + */ +EXTERNRT const char* rtBitStrToString (OSUINT32 numbits, + const OSOCTET* data, + char* buffer, size_t bufsiz); + +/** + * This function converts an ASN.1 Boolean value to a string. The string value + * is one of the keywords TRUE or FALSE. + * + * @param value The value to convert. + * @return The converted value. This will be a string literal set + * to either "TRUE" or "FALSE". + */ +EXTERNRT const char* rtBoolToString (OSBOOL value); + +/** + * This function converts an ASN.1 integer value to a string. + * + * @param value The value to convert. + * @param bufsiz The size of the buffer to receive the stringified value. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtIntToString + (OSINT32 value, char* buffer, size_t bufsiz); + +/** + * This function converts a 64-bit ASN.1 integer value to a string. + * + * @param value The value to convert. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @param bufsiz The size f the buffer to receive the stringified value. + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtInt64ToString + (OSINT64 value, char* buffer, size_t bufsiz); + +/** + * This function converts an ASN.1 integer value to a string. In this case, the + * ASN.1 value was represented in the C/C++ code as an unsigned integer based + * on a constraint. + * + * @param value The value to convert. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @param bufsiz The size f the buffer to receive the stringified value. + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtUIntToString + (OSUINT32 value, char* buffer, size_t bufsiz); + +/** + * This function converts a 64-bit ASN.1 value to a string. + * + * @param value The value to convert. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @param bufsiz The size f the buffer to receive the stringified value. + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtUInt64ToString + (OSUINT64 value, char* buffer, size_t bufsiz); + +/** + * This function converts an ASN.1 OBJECT INDENTIFIER or RELATED-OID value to a + * string. The output format is the ASN.1 value notation for an object + * identifier (ex. { 0 1 222 333 }). All subidentifiers are shown as unsigned + * integer numbers - no attempt is made to map the identifiers to symbolic + * names. + * + * @param numids The number of subidentifiers in the OID value. + * @param data The buffer containing the OID subidentifiers to be + * formatted. + * @param bufsiz The size of the buffer to receive the stringified value. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtOIDToString + (OSUINT32 numids, OSUINT32* data, char* buffer, size_t bufsiz); + +/** + * This function converts a 64-bit ASN.1 OBJECT INDENTIFIER or RELATED-OID + * value to a string. The output format is the ASN.1 value notation for an + * object indentifier (ex. { 0 1 222 333 }). All subidentifiers are shown as + * unsigned integer numbers - no attempt is made to map the identifiers to + * symbolic names. + * + * @param numids The number of subidentifiers in the OID value. + * @param data The buffer containing the 64-bit OID subidentifiers to + * be formatted. + * @param bufsiz The size of the buffer to receive the stringified value. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtOID64ToString + (OSUINT32 numids, OSUINT64* data, char* buffer, size_t bufsiz); + +/** + * This function converts an ASN.1 octet string value to a string. The output + * format is ASN.1 value notation for a hexadecimal string (for example, + * '1F8A'H). + * + * @param numocts The number of octets (bytes) in the data argument to + * format. + * @param data The buffer containing the octet string to be formatted. + * @param bufsiz The size of the buffer to receive the stringified value. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtOctStrToString + (OSUINT32 numocts, const OSOCTET* data, char* buffer, size_t bufsiz); + +/** + * This function converts an ANS.1 tag to a string. The tag is represented + * using the ASN1C internal ASN1CTAG structure. The output is standard ASN.1 + * notation for a tag (for example, [0] = context 0 tag). + * + * @param tag The tag value to be converted. + * @param buffer The pointer to a buffer to receive the stringified + * value. + * @param bufsiz The size of buffer to receive the stringified value + * @return The converted value. This pointer will be equal to the + * buffer argument that was passed in. + */ +EXTERNRT const char* rtTagToString + (ASN1TAG tag, char* buffer, size_t bufsiz); + +/** + * @} pfun + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTBaseType.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTBaseType.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,42 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTBaseType.h + * C++ run-time base class for structured type definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTBASETYPE_H_ +#define _OSRTBASETYPE_H_ + +#include "rtxsrc/OSRTContext.h" + +/** + * C++ structured type base class. This is the base class for all + * generated structured types. + */ +class EXTRTCLASS OSRTBaseType { + public: + OSRTBaseType() { } + virtual ~OSRTBaseType() {} + virtual OSRTBaseType* clone () const { return 0; } +} ; + +#endif //_OSRTBASETYPE_H_ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTContext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTContext.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,404 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/*The following is the text for the main C++ Runtime index page.*/ +/*! \mainpage + *

C++ Common Runtime Library Classes

+ * + * The OSRT C++ run-time classes are wrapper classes that provide an + * object-oriented interface to the common C run-time library functions. The + * categories of classes provided are as follows: + *
    + *
  • Context management classes manage the context structure (OSCTXT) + * used to keep track of the working variables required to encode or + * decode XML messages.
  • + *
  • Message buffer classes are used to manage message buffers for + * encoding or decoding XML messages.
  • + *
  • XSD type base classes are used as the base for compiler- + * generated C++ data structures.
  • + *
  • Stream classes are used to read and write messages to and from + * files, sockets, and memory buffers.
  • + *
+ */ +/** + * @file OSRTContext.h + * C++ run-time context class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTCONTEXT_H_ +#define _OSRTCONTEXT_H_ + +#include "rtxsrc/rtxContext.h" +#include "rtxsrc/rtxDiag.h" +#include "rtxsrc/rtxError.h" +#include "rtxsrc/rtxMemory.h" + +#if defined(_MSC_VER) +// this disables 'unreferenced inline function has been removed' warning +#pragma warning(disable: 4514) +#endif + +/** + * Reference counted context class. This keeps track of all encode/decode + * function variables between function invocations. It is reference counted to + * allow a message buffer and type class to share access to it. + */ +class EXTRTCLASS OSRTContext { + private: + EXTRTMETHOD OSRTContext (OSCTXT*); + + protected: + /** + * The mCtxt member variable is a standard C runtime context variable used + * in most C runtime function calls. + */ + OSCTXT mCtxt; + + /** + * The mCount member variable holds the reference count of this context. + */ + OSUINT32 mCount; + + /** + * TRUE, if initialized correctly, FALSE otherwise + */ + OSBOOL mbInitialized; + + /** + * The mStatus variable holds the return status from C run-time function + * calls. The getStatus method will either return this status or the + * last status on the context error list. + */ + int mStatus; + + public: + /** + * The default constructor initializes the mCtxt member variable and sets + * the reference count variable (mCount) to zero. + */ + EXTRTMETHOD OSRTContext (); + + /** + * The destructor frees all memory held by the context. + */ + virtual EXTRTMETHOD ~OSRTContext (); + + /** + * The getPtr method returns a pointer to the mCtxt member variable. A user + * can use this function to get the the context pointer variable for use in + * a C runtime function call. + */ + inline OSCTXT* getPtr () { return &mCtxt; } + + inline const OSCTXT* getPtr () const { return &mCtxt; } + + /** + * The getRefCount method returns the current reference count. + */ + EXTRTMETHOD OSUINT32 getRefCount(); + + /** + * The getStatus method returns the runtime status code value. + * @return Runtime status code: + * - 0 (0) = success, + * - negative return value is error. + */ + inline int getStatus () const { + return (0 == mStatus) ? rtxErrGetLastError (&mCtxt) : mStatus; + } + + /** + * Returns TRUE, if initialized correctly, FALSE otherwise. + * @return TRUE, if initialized correctly, FALSE otherwise. + */ + inline OSBOOL isInitialized () { return mbInitialized; } + + /** + * The _ref method increases the reference count by one. + */ + EXTRTMETHOD void _ref(); + + /** + * The _unref method decreases the reference count by one. + */ + EXTRTMETHOD void _unref(); + + /** + * Returns error text in a dynamic memory buffer. Buffer will be allocated + * using 'operator new []'. The calling routine is responsible for freeing + * the memory by using 'operator delete []'. + * + * @return A pointer to a newly allocated buffer with error text, or NULL + if an error occurred. + */ + EXTRTMETHOD char* getErrorInfo (); + + /** + * Returns error text in a dynamic memory buffer. Buffer will be allocated + * using 'operator new []'. The calling routine is responsible for freeing + * the memory by using 'operator delete []'. + * + * @param pBufSize A pointer to buffer size. It will + * receive the size of allocated dynamic buffer, or + * (size_t)-1 if an error occurred. + * + * @return A pointer to a newly allocated buffer with error text, or NULL + * if an error occurred. + */ + EXTRTMETHOD char* getErrorInfo (size_t* pBufSize); + + /** + * Returns error text in a memory buffer. If buffer pointer is specified in + * parameters (not NULL) then error text will be copied in the passed + * buffer. Otherwise, this method allocates memory using the + * 'operator new []' function. The calling routine is responsible to free + * the memory by using 'operator delete []'. + * + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param bufSize A reference to buffer size. If pBuf is NULL it will + * receive the size of allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with + * error text. NULL, if error occurred. + */ + EXTRTMETHOD char* getErrorInfo (char* pBuf, size_t& bufSize); + + /** + * The memAlloc method allocates memory using the C runtime memory + * management functions. The memory is tracked in the underlying context + * structure. When both this OSXSDGlobalElement derived control class + * object and the message buffer object are destroyed, this memory will + * be freed. + * + * @param numocts - Number of bytes of memory to allocate + */ + inline void* memAlloc (size_t numocts) { + return rtxMemAlloc (&mCtxt, numocts); + } + + /** + * The \c memFreeAll method will free all memory currently tracked within + * the context. This includes all memory allocated with the memAlloc method + * as well as any memory allocated using the C \c rtxMemAlloc function with + * the context returned by the \c getCtxtPtr method. + */ + inline void memFreeAll () { + //rtxMemFree (&mCtxt); + } + + /** + * The memFreePtr method frees the memory at a specific location. This + * memory must have been allocated using the memAlloc method described + * earlier. + * + * @param ptr - Pointer to a block of memory allocated with \c + * memAlloc + */ + inline void memFreePtr (void* ptr) { + rtxMemFreePtr (&mCtxt, ptr); + } + + /** + * The memRealloc method reallocates memory using the C runtime memory + * management functions. + * + * @param ptr - Original pointer containing dynamic memory to be + * resized. + * @param numocts - Number of bytes of memory to allocate + * @return Reallocated memory pointer + */ + inline void* memRealloc (void* ptr, size_t numocts) { + return rtxMemRealloc (&mCtxt, ptr, numocts); + } + + /** + * The memReset method resets dynamic memory using the C runtime memory + * management functions. + */ + inline void memReset () { + //rtxMemReset (&mCtxt); + } + + /** + * The printErrorInfo method prints information on errors contained within + * the context. + */ + inline void printErrorInfo () { + rtxErrPrint (&mCtxt); + } + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + inline void resetErrorInfo () { + rtxErrReset (&mCtxt); + } + + /** + * The setDiag method will turn diagnostic tracing on or off. + * + * @param value - Boolean value (default = TRUE = on) + * @return - Previous state of the diagnostics enabled boolean + */ + inline OSBOOL setDiag (OSBOOL value=TRUE) { + return rtxSetDiag (&mCtxt, value); + } + + /** + * This method sets run-time key to the context. This method does nothing + * for unlimited redistribution libraries. + * + * @param key - array of octets with the key + * @param keylen - number of octets in key array. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int setRunTimeKey (const OSOCTET* key, size_t keylen); + + /** + * This method sets error status in the context. + * + * @param stat Status value. + * @return Error status value being set. + */ + inline int setStatus (int stat) { + mStatus = stat; + return stat; + } + +}; + +/** + * Context reference counted pointer class. This class allows a + * context object to automatically be released when its reference count + * goes to zero. It is very similar to the standard C++ library auto_ptr + * smart pointer class but only works with an OSRTContext object. + */ +class EXTRTCLASS OSRTCtxtPtr { + protected: + /** + * The mPointer member variable is a pointer to a reference-counted ASN.1 + * context wrapper class object. + */ + OSRTContext* mPointer; + + public: + /** + * This constructor set the internal context pointer to the given value and, + * if it is non-zero, increases the reference count by one. + * + * @param rf - Pointer to OSRTContext object + */ + OSRTCtxtPtr (OSRTContext* rf = 0) : mPointer(rf) { + if (mPointer != 0) mPointer->_ref(); + } + + /** + * The copy constructor copies the pointer from the source pointer object + * and, if it is non-zero, increases the reference count by one. + * + * @param o - Reference to OSRTCtxtPtr object to be copied + */ + OSRTCtxtPtr (const OSRTCtxtPtr& o) : mPointer(o.mPointer) { + if (mPointer != 0) mPointer->_ref(); + } + + /** + * The destructor decrements the reference counter to the internal context + * pointer object. The context object will delete itself if its reference + * count goes to zero. + */ + virtual ~OSRTCtxtPtr() { if (mPointer != 0) mPointer->_unref(); } + + /** + * This assignment operator assigns this OSRTCtxtPtr to another. The + * reference count of the context object managed by this object is first + * decremented. Then the new pointer is assigned and that object's reference + * count is incremented. + * + * @param rf - Pointer to OSRTCtxtPtr smart-pointer object + */ + OSRTCtxtPtr& operator= (const OSRTCtxtPtr& rf) { + if (mPointer != 0) mPointer->_unref(); + mPointer = rf.mPointer; + if (mPointer != 0) mPointer->_ref(); + return *this; + } + + /** + * This assignment operator assigns does a direct assignment of an + * OSRTContext object to this OSRTCtxtPtr object. + */ + OSRTCtxtPtr& operator= (OSRTContext* rf) { + if (mPointer != 0) mPointer->_unref(); + mPointer = rf; + if (mPointer != 0) mPointer->_ref(); + return *this; + } + + /** + * The 'OSRTContext*' operator returns the context object pointer. + */ + operator OSRTContext* () { return mPointer; } + operator const OSRTContext* () const { return mPointer; } + + /** + * The '->' operator returns the context object pointer. + */ + OSRTContext* operator -> () { return mPointer; } + const OSRTContext* operator -> () const { return mPointer; } + + /** + * The '==' operator compares two OSRTContext pointer values. + */ + OSBOOL operator == (const OSRTContext* o) const { + return (mPointer == o); + } + + /** + * The isNull method returns TRUE if the underlying context pointer is NULL. + */ + inline OSBOOL isNull() const { return (mPointer == 0); } + + /** + * This method returns the standard context pointer used in C function + * calls. + */ + inline OSCTXT* getCtxtPtr() { return isNull() ? 0 : mPointer->getPtr(); } + +}; + +/** + * Custom placement new function to allocate memory using context + * memory-management functions. + */ +EXTERNRT void* operator new (size_t nbytes, OSCTXT* pctxt); + +/** + * Custom placement delete function to free memory using context + * memory-management functions. + */ +EXTERNRT void operator delete (void* pmem, OSCTXT* pctxt); + +#endif // _OSRTCONTEXT_H_ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTCtxtHolder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTCtxtHolder.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,131 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTCtxtHolder.h + * C++ run-time message buffer interface class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTCTXTHOLDER_H_ +#define _OSRTCTXTHOLDER_H_ + +#include "rtxsrc/OSRTCtxtHolderIF.h" + +/** + * Abstract message buffer or stream interface class. This is the base class + * for both the in-memory message buffer classes and the run-time stream + * classes. + */ +class EXTRTCLASS OSRTCtxtHolder : public OSRTCtxtHolderIF { + protected: + /** + * The mpContext member variable holds a reference-counted C runtime + * variable. This context is used in calls to all C run-time functions. + */ + OSRTCtxtPtr mpContext; + + /** + * The protected constructor creates a new context and sets the buffer class + * type. + * + * @param pContext Pointer to a context to use. If NULL, new context + * will be allocated. + */ + EXTRTMETHOD OSRTCtxtHolder (OSRTContext* pContext = 0); + + virtual ~OSRTCtxtHolder () {} + + public: + + // Virtual methods + /** + * The getContext method returns the underlying context smart-pointer + * object. + * + * @return Context smart pointer object. + */ + + virtual EXTRTMETHOD OSRTCtxtPtr getContext (); + + /** + * The getCtxtPtr method returns the underlying C runtime context. This + * context can be used in calls to C runtime functions. + * + * @return The pointer to C runtime context. + */ + virtual EXTRTMETHOD OSCTXT* getCtxtPtr (); + + /** + * Returns error text in a dynamic memory buffer. Buffer will be allocated by + * 'operator new []'. The calling routine is responsible to free the memory + * by using 'operator delete []'. + * + * @return A pointer to a newly allocated buffer with error text. + */ + virtual EXTRTMETHOD char* getErrorInfo (); + + /** + * Returns error text in a memory buffer. If buffer pointer is specified in + * parameters (not NULL) then error text will be copied in the passed + * buffer. Otherwise, this method allocates memory using the + * 'operator new []' function. The calling routine is responsible to free + * the memory by using 'operator delete []'. + * + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param bufSize A reference to buffer size. If pBuf is NULL it will + * receive the size of allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with error + * text. NULL, if error occurred. + */ + virtual EXTRTMETHOD char* getErrorInfo (char* pBuf, size_t& bufSize); + + /** + * This method returns the completion status of previous operation. + * It can be used to check completion status of constructors or methods, + * which do not return completion status. If error occurs, use + * printErrorInfo method to print out the error's description and + * stack trace. + * Method resetError can be used to reset error to continue operations + * after recovering from the error. + * + * @return Runtime status code: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int getStatus () const; + + /** + * The printErrorInfo method prints information on errors contained within + * the context. + */ + virtual EXTRTMETHOD void printErrorInfo (); + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + virtual EXTRTMETHOD void resetErrorInfo (); + +}; + +#endif // _OSRTCTXTHOLDERIF_H_ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTCtxtHolderIF.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTCtxtHolderIF.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,119 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTCtxtHolderIF.h + * C++ run-time message buffer interface class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTCTXTHOLDERIF_H_ +#define _OSRTCTXTHOLDERIF_H_ + +#include "rtxsrc/OSRTContext.h" + +/** + * Abstract message buffer or stream interface class. This is the base class + * for both the in-memory message buffer classes and the run-time stream + * classes. + */ +class EXTRTCLASS OSRTCtxtHolderIF { + protected: + /** + * The virtual destructor does nothing. It is overridden by derived versions + * of this class. + */ + virtual ~OSRTCtxtHolderIF () {} + + public: + // Virtual methods + /** + * The getContext method returns the underlying context smart-pointer + * object. + * + * @return Context smart pointer object. + */ + + virtual OSRTCtxtPtr getContext () = 0; + + /** + * The getCtxtPtr method returns the underlying C runtime context. This + * context can be used in calls to C runtime functions. + * + * @return The pointer to C runtime context. + */ + virtual OSCTXT* getCtxtPtr () = 0; + + /** + * Returns error text in a dynamic memory buffer. Buffer will be allocated by + * 'operator new []'. The calling routine is responsible to free the memory + * by using 'operator delete []'. + * + * @return A pointer to a newly allocated buffer with error text. + */ + virtual char* getErrorInfo () = 0; + + /** + * Returns error text in a memory buffer. If buffer pointer is specified in + * parameters (not NULL) then error text will be copied in the passed + * buffer. Otherwise, this method allocates memory using the + * 'operator new []' function. The calling routine is responsible to free + * the memory by using 'operator delete []'. + * + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param bufSize A reference to buffer size. If pBuf is NULL it will + * receive the size of allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with error + * text. NULL, if error occurred. + */ + virtual char* getErrorInfo (char* pBuf, size_t& bufSize) = 0; + + /** + * This method returns the completion status of previous operation. + * It can be used to check completion status of constructors or methods, + * which do not return completion status. If error occurs, use + * printErrorInfo method to print out the error's description and + * stack trace. + * Method resetError can be used to reset error to continue operations + * after recovering from the error. + * + * @return Runtime status code: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int getStatus () const = 0; + + /** + * The printErrorInfo method prints information on errors contained within + * the context. + */ + virtual void printErrorInfo () = 0; + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + virtual void resetErrorInfo () = 0; + +}; + +#endif // _OSRTCTXTHOLDERIF_H_ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTFastString.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTFastString.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,129 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTFastString.h + * C++ fast string class definition. This can be used to hold standard ASCII + * or UTF-8 strings. This string class implementations directly assigns + * any assigned pointers to internal member variables. It does no memory + * management. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTFASTSTRING_H_ +#define _OSRTFASTSTRING_H_ + +#include "rtxsrc/rtxCommon.h" +#include "rtxsrc/rtxPrint.h" + +/** + * C++ fast string class definition. This can be used to hold standard ASCII + * or UTF-8 strings. This string class implementations directly assigns + * any assigned pointers to internal member variables. It does no memory + * management. + */ +class EXTERNRT OSRTFastString : public OSRTStringIF { + protected: + const OSUTF8CHAR* mValue; + + public: + /** + * The default constructor sets the internal string member variable + * pointer to null. + */ + OSRTFastString(); + + /** + * This constructor initializes the string to contain the given + * standard ASCII string value. + * + * @param strval - Null-terminated C string value + */ + OSRTFastString (const char* strval); + + /** + * This constructor initializes the string to contain the given + * UTF-8 string value. + * + * @param strval - Null-terminated C string value + */ + OSRTFastString (const OSUTF8CHAR* strval); + + /** + * Copy constructor. String data is not copied; the pointer is + * simply assigned to the target class member variable. + * + * @param str - C++ string object to be copied. + */ + OSRTFastString (const OSRTFastString& str); + + /** + * The destructor does nothing. + */ + virtual ~OSRTFastString(); + + /** + * This method creates a copy of the given string object. + */ + virtual OSRTStringIF* clone () { return new OSRTFastString (*this); } + + /** + * This method returns the pointer to UTF-8 null terminated string + * as a standard ASCII string. + */ + virtual const char* getValue () const { + return (const char*) mValue; + } + + /** + * This method returns the pointer to UTF-8 null terminated string + * as a UTF-8 string. + */ + virtual const OSUTF8CHAR* getUTF8Value () const { + return mValue; + } + + /** + * This method prints the string value to standard output. + * + * @param name - Name of generated string variable. + */ + virtual void print (const char* name) { rtxPrintCharStr (name, mValue); } + + /** + * This method sets the string value to the given string. + * + * @param str - C null-terminated string. + */ + virtual void setValue (const char* str); + + /** + * This method sets the string value to the given UTF-8 string value. + * + * @param str - C null-terminated UTF-8 string. + */ + virtual void setValue (const OSUTF8CHAR* str); + + /** + * Assignment operator. + */ + OSRTFastString& operator= (const OSRTFastString& original); +} ; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTFileInputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTFileInputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,75 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTFileInputStream.h + * C++ base class definitions for operations with input file streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTFILEINPUTSTREAM_H_ +#define _OSRTFILEINPUTSTREAM_H_ + +#include "rtxsrc/OSRTInputStream.h" + +/** + * Generic file input stream. This class opens an existing file for input in + * binary mode and reads data from it. + */ +class EXTRTCLASS OSRTFileInputStream : public OSRTInputStream { + public: + /** + * Creates and initializes a file input stream using the name of file. + * + * @param pFilename Name of file. + * @see ::rtxStreamFileOpen + */ + EXTRTMETHOD OSRTFileInputStream (const char* pFilename); + + /** + * Creates and initializes a file input stream using the name of file. + * + * @param pContext Pointer to a context to use. + * @param pFilename Name of file. + * @see ::rtxStreamFileOpen + */ + EXTRTMETHOD OSRTFileInputStream (OSRTContext* pContext, const char* pFilename); + + /** + * Initializes the file input stream using the opened FILE structure + * descriptor. + * + * @param file Pointer to FILE structure. + * @see ::rtxStreamFileAttach + */ + EXTRTMETHOD OSRTFileInputStream (FILE* file); + + /** + * Initializes the file input stream using the opened FILE structure + * descriptor. + * + * @param pContext Pointer to a context to use. + * @param file Pointer to FILE structure. + * @see ::rtxStreamFileAttach + */ + EXTRTMETHOD OSRTFileInputStream (OSRTContext* pContext, FILE* file); + +} ; + +#endif /* _OSRTFILEINPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTFileOutputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTFileOutputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,79 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTFileOutputStream.h + * C++ base class definitions for operations with output file streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTFILEOUTPUTSTREAM_H_ +#define _OSRTFILEOUTPUTSTREAM_H_ + +#include "rtxsrc/OSRTOutputStream.h" + +/** + * Generic file output stream. This class opens an existing file for output in + * binary mode and reads data from it. + */ +class EXTRTCLASS OSRTFileOutputStream : public OSRTOutputStream { + public: + /** + * Creates and initializes a file output stream using the name of file. + * + * @param pFilename Name of file. + * @exception OSStreamException Stream create or initialize failed. + * @see ::rtxStreamFileOpen + */ + EXTRTMETHOD OSRTFileOutputStream (const char* pFilename); + + /** + * Creates and initializes a file output stream using the name of file. + * + * @param pContext Pointer to a context to use. + * @param pFilename Name of file. + * @exception OSStreamException Stream create or initialize failed. + * @see ::rtxStreamFileOpen + */ + EXTRTMETHOD OSRTFileOutputStream (OSRTContext* pContext, const char* pFilename); + + /** + * Initializes the file output stream using the opened FILE structure + * descriptor. + * + * @param file Pointer to FILE structure. + * @exception OSStreamException Stream create or initialize failed. + * @see ::rtxStreamFileAttach + */ + EXTRTMETHOD OSRTFileOutputStream (FILE* file); + + /** + * Initializes the file output stream using the opened FILE structure + * descriptor. + * + * @param pContext Pointer to a context to use. + * @param file Pointer to FILE structure. + * @exception OSStreamException Stream create or initialize failed. + * @see ::rtxStreamFileAttach + */ + EXTRTMETHOD OSRTFileOutputStream (OSRTContext* pContext, FILE* file); + +} ; + +#endif /* _OSRTFILEOUTPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTInputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTInputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,249 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTInputStream.h + * C++ base class definitions for operations with input streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTINPUTSTREAM_H_ +#define _OSRTINPUTSTREAM_H_ + +#include "rtxsrc/OSRTInputStreamIF.h" +#include "rtxsrc/OSRTStream.h" + +/** + * @ingroup istrmclas + * + * This is the base class for input streams. These streams are buffered + * (I/O is stored in memory prior to being written) to provide higher + * performance. + */ +class EXTRTCLASS OSRTInputStream : public OSRTStream, public OSRTInputStreamIF { + public: + /** + * The default constructor. It initializes a buffered stream. A + * buffered stream maintains data in memory before reading or writing + * to the device. This generally provides better performance than + * an unbuffered stream. + * + * @exception OSRTStreamException Stream create or initialize failed. + */ + EXTRTMETHOD OSRTInputStream (); + + EXTRTMETHOD OSRTInputStream (OSRTContext* mpContext, OSBOOL attachStream = FALSE); + + /** + * Virtual destructor. Closes the stream if it was opened. + */ + virtual EXTRTMETHOD ~OSRTInputStream (); + + /** + * Closes the input or output stream and releases any system resources + * associated with the stream. For output streams this function also flushes + * all internal buffers to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamClose, ::rtxStreamBufClose + */ + virtual EXTRTMETHOD int close (); + + /** + * This method returns the current position in the stream (in octets). + * + * @return The number of octets already read from the stream. + */ + virtual EXTRTMETHOD size_t currentPos (); + + /** + * Flushes the buffered data to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamFlush, ::rtxStreamBufFlush + */ + virtual EXTRTMETHOD int flush (); + + /** + * This method returns a pointer to the underlying OSRTContext object. + * + * @return A reference-counted pointer to an OSRTContext object. + * The OSRTContext object will not be released until + * all referenced-counted pointer variables go out of + * scope. This allows safe sharing of the context + * between different run-time classes. + */ + virtual OSRTCtxtPtr getContext () { + return OSRTStream::getContext (); + } + + /** + * This method returns a pointer to the underlying OSCTXT object. This is + * the structure used in calls to low-level C encode/decode functions. + * + * @return Pointer to a context (OSCTXT) structure. + */ + virtual OSCTXT* getCtxtPtr () { + return OSRTStream::getCtxtPtr (); + } + + /** + * Returns error text in a dynamic memory buffer. Buffer will be allocated by + * 'operator new []'. The calling routine is responsible to free the memory + * by using 'operator delete []'. + * + * @return A pointer to a newly allocated buffer with error text. + */ + virtual char* getErrorInfo () { + return OSRTStream::getErrorInfo (); + } + + /** + * Returns error text in a memory buffer. If buffer pointer is specified in + * parameters (not NULL) then error text will be copied in the passed + * buffer. Otherwise, this method allocates memory using the + * 'operator new []' function. The calling routine is responsible to free + * the memory by using 'operator delete []'. + * + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param bufSize A reference to buffer size. If pBuf is NULL it will + * receive the size of allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with error + * text. NULL, if error occurred. + */ + virtual char* getErrorInfo (char* pBuf, size_t& bufSize) { + return OSRTStream::getErrorInfo (pBuf, bufSize); + } + + /** + * This method returns the completion status of previous operation. + * It can be used to check completion status of constructors or methods, + * which do not return completion status. + * + * @return Runtime status code: + * - 0 = success, + * - negative return value is error. + */ + virtual int getStatus () const { + return OSRTStream::getStatus (); + } + + /** + * Checks, is the stream opened or not. + * + * @return s TRUE, if the stream is opened, FALSE otherwise. + * @see ::rtxStreamIsOpened + */ + virtual EXTRTMETHOD OSBOOL isOpened (); + + /** + * Tests if this input stream supports the mark and reset methods. Whether + * or not mark and reset are supported is an invariant property of a + * particular input stream instance. By default, it returns FALSE. + * + * @return TRUE if this stream instance supports the mark and + * reset methods; FALSE otherwise. + * @see ::rtxStreamIsMarkSupported + */ + virtual EXTRTMETHOD OSBOOL markSupported (); + + /** + * This method marks the current position in this input stream. A subsequent + * call to the reset method repositions this stream at the last marked + * position so that subsequent reads re-read the same bytes. The + * readAheadLimit argument tells this input stream to allow that many bytes + * to be read before the mark position gets invalidated. + * + * @param readAheadLimit the maximum limit of bytes that can be + * read before the mark position becomes + * invalid. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamMark, ::rtxStreamReset + */ + virtual EXTRTMETHOD int mark (size_t readAheadLimit); + + /** + * The printErrorInfo method prints information on errors contained within + * the context. + */ + inline void printErrorInfo () { OSRTStream::printErrorInfo (); } + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + inline void resetErrorInfo () { OSRTStream::resetErrorInfo (); } + + /** + * Read data from the stream. This method reads up to \c maxToRead + * bytes from the stream. It may return a value less then this if + * the mamimum number of bytes is not available. + * + * @param pDestBuf Pointer to a buffer to receive a data. + * @param maxToRead Size of the buffer. + * @see ::rtxStreamRead + */ + virtual EXTRTMETHOD long read (OSOCTET* pDestBuf, size_t maxToRead); + + /** + * Read data from the stream. This method reads up to \c maxToRead bytes + * from the stream. It may return a value less then this if the mamimum + * number of bytes is not available. + * + * @param pDestBuf Pointer to a buffer to receive a data. + * @param toReadBytes Number of bytes to be read. + * @see ::rtxStreamRead + */ + virtual EXTRTMETHOD long readBlocking (OSOCTET* pDestBuf, size_t toReadBytes); + + /** + * Repositions this stream to the position at the time the mark method was + * last called on this input stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamMark, ::rtxStreamReset + */ + virtual EXTRTMETHOD int reset (); + + /** + * Skips over and discards the specified amount of data octets from this + * input stream. + * + * @param n The number of octets to be skipped. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamSkip + */ + virtual EXTRTMETHOD int skip (size_t n); + +} ; + +#endif /* _OSRTINPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTInputStreamIF.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTInputStreamIF.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,148 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTInputStreamIF.h + * C++ interface class definitions for operations with input streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTINPUTSTREAMIF_H_ +#define _OSRTINPUTSTREAMIF_H_ + +#include "rtxsrc/OSRTStreamIF.h" + +/** + * @defgroup istrmclas Generic Input Stream Classes + * @ingroup cppruntime + * + * The C++ interface class definitions for operations with input streams. + * Classes that implement this interface are used to input data from the + * various stream types, not to decode ASN.1 messages. + * + * @{ + */ +class EXTRTCLASS OSRTInputStreamIF : public OSRTStreamIF { + public: + /** + * Virtual destructor. Closes the stream if it was opened. + */ + virtual EXTRTMETHOD ~OSRTInputStreamIF (); + + /** + * This method returns the current position in the stream (in octets). + * + * @return The number of octets already read from the stream. + */ + virtual size_t currentPos () = 0; + + /** + * Tests if this input stream supports the mark and reset methods. Whether + * or not mark and reset are supported is an invariant property of a + * particular input stream instance. By default, it returns FALSE. + * + * @return TRUE if this stream instance supports the mark and + * reset methods; FALSE otherwise. + * @see ::rtxStreamIsMarkSupported + */ + virtual OSBOOL markSupported () = 0; + + /** + * This method marks the current position in this input stream. A subsequent + * call to the reset method repositions this stream at the last marked + * position so that subsequent reads re-read the same bytes. The + * readAheadLimit argument tells this input stream to allow that many bytes + * to be read before the mark position gets invalidated. + * + * @param readAheadLimit the maximum limit of bytes that can be + * read before the mark position becomes + * invalid. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamMark, ::rtxStreamReset + */ + virtual int mark (size_t readAheadLimit) = 0; + + /** + * Read data from the stream. This method reads up to \c maxToRead bytes + * from the stream. It may return a value less then this if the mamimum + * number of bytes is not available. + * + * @param pDestBuf Pointer to a buffer to receive a data. + * @param maxToRead Size of the buffer. + * @return The total number of octets read into the buffer, or + * negative value with error code if any error is + * occurred. + * @see ::rtxStreamRead + */ + virtual long read (OSOCTET* pDestBuf, size_t maxToRead) = 0; + + /** + * Read data from the stream. This method reads up to \c maxToRead bytes + * from the stream. It may return a value less then this if the mamimum + * number of bytes is not available. + * + * @param pDestBuf Pointer to a buffer to receive a data. + * @param toReadBytes Number of bytes to be read. + * @return The total number of octets read into the buffer, or + * negative value with error code if any error is + * occurred. + * @see ::rtxStreamRead + */ + virtual long readBlocking (OSOCTET* pDestBuf, size_t toReadBytes) = 0; + + /** + * Repositions this stream to the position at the time the mark method was + * last called on this input stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamMark, ::rtxStreamReset + */ + virtual int reset () = 0; + + /** + * Skips over and discards the specified amount of data octets from this + * input stream. + * + * @param n The number of octets to be skipped. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamSkip + */ + virtual int skip (size_t n) = 0; + +} ; + +class EXTRTCLASS OSRTInputStreamPtr { + OSRTInputStreamIF* mPtr; + public: + inline OSRTInputStreamPtr (OSRTInputStreamIF* ptr) : mPtr (ptr) {} + inline ~OSRTInputStreamPtr () { delete mPtr; } + + inline operator OSRTInputStreamIF* () { return mPtr; } + inline OSRTInputStreamIF* operator-> () { return mPtr; } +} ; + +/** @} */ + +#endif /* _OSRTINPUTSTREAMIF_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMemBuf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMemBuf.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,50 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** + * @file OSRTMemBuf.h + */ +/* memory buffer */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTMEMBUF_H_ +#define _OSRTMEMBUF_H_ + +/* Disable MS VC++ Level 4 warning about unreferenced inline functions */ +#ifdef _MSC_VER +#pragma warning(disable: 4514) +#endif /* _MSC_VER */ + +#include "rtxsrc/rtxMemBuf.h" + +/** + * Memory Buffer class. This is the base class for generated C++ data type + * classes for XSD string types (string, token, NMTOKEN, etc.). + */ +class EXTRTCLASS OSRTMemBuf : public OSRTMEMBUF { + public: + EXTRTMETHOD OSRTMemBuf (); + EXTRTMETHOD ~OSRTMemBuf (); + inline const OSOCTET* getData() { return buffer + startidx; } + inline size_t getDataLen() { return usedcnt - startidx; } +} ; + +#endif // _OSRTMEMBUF_H_ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMemoryInputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMemoryInputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,59 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTMemoryInputStream.h + * C++ base class definitions for operations with input memory streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTMEMORYINPUTSTREAM_H_ +#define _OSRTMEMORYINPUTSTREAM_H_ + +#include "rtxsrc/OSRTInputStream.h" + +/** + * Generic memory input stream. This class opens an existing file for input in + * binary mode and reads data from it. + */ +class EXTRTCLASS OSRTMemoryInputStream : public OSRTInputStream { + public: + /** + * Initializes the memory input stream using the specified memory buffer. + * + * @param pMemBuf The pointer to the buffer. + * @param bufSize The size of the buffer. + * @see ::rtxStreamMemoryAttach + */ + EXTRTMETHOD OSRTMemoryInputStream (const OSOCTET* pMemBuf, size_t bufSize); + + /** + * Initializes the memory input stream using the specified memory buffer. + * + * @param pContext Pointer to a context to use. + * @param pMemBuf The pointer to the buffer. + * @param bufSize The size of the buffer. + * @see ::rtxStreamMemoryAttach + */ + OSRTMemoryInputStream + (OSRTContext* pContext, const OSOCTET* pMemBuf, size_t bufSize); + +} ; + +#endif /* _OSRTMEMORYINPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMemoryOutputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMemoryOutputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,60 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTMemoryOutputStream.h + * C++ base class definitions for operations with output memory streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTMEMORYOUTPUTSTREAM_H_ +#define _OSRTMEMORYOUTPUTSTREAM_H_ + +#include "rtxsrc/OSRTOutputStream.h" + +/** + * Generic memory output stream. This class opens an existing file for output in + * binary mode and reads data from it. + */ +class EXTRTCLASS OSRTMemoryOutputStream : public OSRTOutputStream { + public: + /** + * Initializes the memory output stream using the specified memory buffer. + * + * @param pMemBuf The pointer to the buffer. + * @param bufSize The size of the buffer. + * @exception OSCStreamException stream can't be created or initialized. + * @see ::rtxStreamMemoryAttach + */ + EXTRTMETHOD OSRTMemoryOutputStream (OSOCTET* pMemBuf, size_t bufSize); + + /** + * Initializes the memory output stream using the specified memory buffer. + * + * @param pContext Pointer to a context to use. + * @param pMemBuf The pointer to the buffer. + * @param bufSize The size of the buffer. + * @exception OSCStreamException stream can't be created or initialized. + * @see ::rtxStreamMemoryAttach + */ + EXTRTMETHOD OSRTMemoryOutputStream (OSRTContext* pContext, OSOCTET* pMemBuf, size_t bufSize); + +} ; + +#endif /* _OSRTMEMORYOUTPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMsgBuf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMsgBuf.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,218 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTMsgBuf.h + * C++ run-time message buffer class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTMSGBUF_H_ +#define _OSRTMSGBUF_H_ + +#include "rtxsrc/OSRTCtxtHolder.h" +#include "rtxsrc/OSRTMsgBufIF.h" + +/** + * @addtogroup osrtmsgbuf + * @{ + */ +/** + * Abstract message buffer base class. This class is used to manage an + * encode or decode message buffer. For encoding, this is the buffer + * into which the message is being built. For decoding, it describes a + * message that was read into memory to be decoded. Further classes are + * derived from this to handle encoding and decoding of messages for + * different encoding rules types. + */ +class EXTRTCLASS OSRTMessageBuffer : +public OSRTCtxtHolder, public OSRTMessageBufferIF +{ + protected: + + /** + * The mBufferType member variable holds information on the derived + * message buffer class type (for example, XMLEncode). + */ + Type mBufferType; + + /** + * The protected constructor creates a new context and sets the buffer class + * type. + * + * @param bufferType Type of message buffer that is being created (for + * example, XMLEncode). + * @param pContext Pointer to a context to use. If NULL, new context + * will be allocated. + */ + EXTRTMETHOD OSRTMessageBuffer (Type bufferType, OSRTContext* pContext = 0); + + public: + /** + * The virtual destructor does nothing. It is overridden by derived versions + * of this class. + */ + virtual ~OSRTMessageBuffer () {} + + /** + * Returns a pointer to application-specific information block + */ + virtual void* getAppInfo () { return 0; } + + /** + * The getByteIndex method is used to fetch the current byte offset within + * the current working buffer. For encoding, this is the next location that + * will be written to. For decoding, this is the next byte the parser will + * read. + */ + virtual size_t getByteIndex () { + return getCtxtPtr()->buffer.byteIndex; + } + + /** + * The getContext method returns the underlying context smart-pointer + * object. + */ + virtual OSRTCtxtPtr getContext () { + return OSRTCtxtHolder::getContext (); + } + + /** + * The getCtxtPtr method returns the underlying C runtime context. This + * context can be used in calls to C runtime functions. + */ + virtual OSCTXT* getCtxtPtr () { + return OSRTCtxtHolder::getCtxtPtr (); + } + + /** + * Returns error text in a dynamic memory buffer. The buffer is allocated + * using 'operator new []'. The calling routine is responsible to free the + * memory by using 'operator delete []'. + * + * @return A pointer to a newly allocated buffer with error text. + */ + virtual char* getErrorInfo () { + return OSRTCtxtHolder::getErrorInfo (); + } + + /** + * Returns error text in a memory buffer. If buffer pointer is specified in + * parameters (not NULL) then error text will be copied in the passed + * buffer. Otherwise, this method allocates memory using the + * 'operator new []' function. The calling routine is responsible to free + * the memory by using 'operator delete []'. + * + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param bufSize A reference to buffer size. If pBuf is NULL it will + * receive the size of allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with + * error text. NULL, if error occurred. + */ + virtual char* getErrorInfo (char* pBuf, size_t& bufSize) { + return OSRTCtxtHolder::getErrorInfo (pBuf, bufSize); + } + + /** + * The getMsgCopy method will return a copy of the encoded message + * managed by the object. + */ + virtual OSOCTET* getMsgCopy () { + return 0; + } + + /** + * The getMsgPtr method will return a const pointer to the encoded + * message managed by the object. + */ + virtual const OSOCTET* getMsgPtr () { + return getCtxtPtr()->buffer.data; + } + + /** + * This method returns the completion status of previous operation. + * It can be used to check completion status of constructors or methods, + * which do not return completion status. + * + * @return Runtime status code: + * - 0 = success, + * - negative return value is error. + */ + inline int getStatus () const { + return OSRTCtxtHolder::getStatus(); + } + + /** + * Initializes message buffer. + * + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int init () { return 0; } + + /** + * This version of the overloaded initBuffer method initializes the message + * buffer to point at the given null-terminated character string. + * + * @param pMsgBuf Pointer to message buffer. + * @param msgBufLen Length of message buffer in bytes. + * + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual EXTRTMETHOD int initBuffer (OSOCTET* pMsgBuf, size_t msgBufLen); + + /** + * The printErrorInfo method prints information on errors contained within + * the context. + */ + virtual void printErrorInfo () { + OSRTCtxtHolder::printErrorInfo (); + } + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + virtual void resetErrorInfo () { + OSRTCtxtHolder::resetErrorInfo (); + } + + /** + * Sets the application-specific information block. + */ + virtual void setAppInfo (void*) {} + + /** + * The setDiag method will turn diagnostic tracing on or off. + * + * @param value - Boolean value (default = TRUE = on) + */ + virtual EXTRTMETHOD void setDiag (OSBOOL value=TRUE); + +} ; + +/** @} */ + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMsgBufIF.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTMsgBufIF.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,150 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTMsgBufIF.h + * C++ run-time message buffer interface class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTMSGBUFIF_H_ +#define _OSRTMSGBUFIF_H_ + +#include "rtxsrc/OSRTContext.h" +#include "rtxsrc/OSRTCtxtHolderIF.h" + +class OSXMLReaderClass; + +/** + * @defgroup osrtmsgbuf Message Buffer Classes + * These classes are used to manage message buffers. During encoding, messages + * are constructed within these buffers. During decoding, the messages to be + * decoded are held in these buffers. @{ + */ +/** + * Abstract message buffer or stream interface class. This is the base class + * for both the in-memory message buffer classes and the run-time stream + * classes. + */ +class EXTRTCLASS OSRTMessageBufferIF : public OSRTCtxtHolderIF { + public: + enum Type { + BEREncode, BERDecode, PEREncode, PERDecode, XEREncode, XERDecode, + XMLEncode, XMLDecode, Stream + } ; + protected: + /** + * The virtual destructor does nothing. It is overridden by derived versions + * of this class. + */ + virtual ~OSRTMessageBufferIF () {} + + public: + // Virtual methods + /** + * Returns a pointer to application-specific information block + */ + virtual void* getAppInfo () = 0; + + /** + * The getByteIndex method is used to fetch the current byte offset within + * the current working buffer. For encoding, this is the next location that + * will be written to. For decoding, this is the next byte the parser will + * read. + */ + virtual size_t getByteIndex () = 0; + + /** + * The getMsgCopy method will return a copy of the encoded ASN.1 message + * managed by the object. The memory for the copy is allocated by new [] + * operator, user is responsible to free it by delete [] operator. + * + * @return The pointer to copied encoded ASN.1 message. NULL, if error + * occurred. + */ + virtual OSOCTET* getMsgCopy () = 0; + + /** + * The getMsgPtr method will return a const pointer to the encoded ASN.1 + * message managed by the object. + * + * @return The pointer to the encoded ASN.1 message. + */ + virtual const OSOCTET* getMsgPtr () = 0; + + /** + * Initializes message buffer. + * + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int init () = 0; + + /** + * This version of the overloaded initBuffer method initializes the message + * buffer to point at the given null-terminated character string. + * + * @param pMsgBuf Pointer to message buffer. + * @param msgBufLen Length of message buffer in bytes. + * string. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ + virtual int initBuffer (OSOCTET* pMsgBuf, size_t msgBufLen) = 0; + + /** + * This method checks the type of the message buffer. + * + * @param bufferType Enumerated identifier specifying a derived class. + * Possible values + * are: BEREncode, BERDecode, PEREncode, PERDecode, + * XEREncode, XERDecode, XMLEncode, XMLDecode, + * Stream. + * @return Boolean result of the match operation. True if this + * is the class corresponding to the identifier + * argument. + */ + virtual OSBOOL isA (int bufferType) = 0; + + /** + * Sets the application-specific information block. + */ + virtual void setAppInfo (void* pAppInfo) = 0; + + /** + * Sets the namespace information. + */ + virtual void setNamespace + (const OSUTF8CHAR* /*prefix*/, const OSUTF8CHAR* /*uri*/, + OSRTDList* /*pNSAttrs*/ = 0) {} + + /** + * The setDiag method will turn diagnostic tracing on or off. + * + * @param value - Boolean value (default = TRUE = on) + */ + virtual void setDiag (OSBOOL value=TRUE) = 0; + +}; + +/** @} */ + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTOutputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTOutputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,184 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTOutputStream.h + * C++ base class definitions for operations with output streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTOUTPUTSTREAM_H_ +#define _OSRTOUTPUTSTREAM_H_ + +#include "rtxsrc/OSRTOutputStreamIF.h" +#include "rtxsrc/OSRTStream.h" + +/** + * @ingroup ostrmclas + * + * The base class definition for operations with output streams. As with + * the input stream, this implementation is backed by memory buffers to + * improve I/O performance. + * + * @{ + */ +class EXTRTCLASS OSRTOutputStream : public OSRTStream, public OSRTOutputStreamIF { + public: + /** + * The default constructor. It initializes a buffered stream. A + * buffered stream maintains data in memory before reading or writing + * to the device. This generally provides better performance than + * an unbuffered stream. + */ + EXTRTMETHOD OSRTOutputStream (); + + EXTRTMETHOD OSRTOutputStream (OSRTContext* mpContext, OSBOOL attachStream = FALSE); + + /** + * Virtual destructor. Closes the stream if it was opened. + */ + virtual EXTRTMETHOD ~OSRTOutputStream (); + + /** + * Closes the output or output stream and releases any system resources + * associated with the stream. For output streams this function also flushes + * all internal buffers to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamClose, ::rtxStreamBufClose + */ + virtual EXTRTMETHOD int close (); + + /** + * Flushes the buffered data to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamFlush, ::rtxStreamBufFlush + */ + virtual EXTRTMETHOD int flush (); + + /** + * This method returns a pointer to the underlying OSRTContext object. + * + * @return A reference-counted pointer to an OSRTContext object. + * The OSRTContext object will not be released until + * all referenced-counted pointer variables go out of + * scope. This allows safe sharing of the context + * between different run-time classes. + */ + virtual OSRTCtxtPtr getContext () { + return OSRTStream::getContext (); + } + + /** + * This method returns a pointer to the underlying OSCTXT object. This is + * the structure used in calls to low-level C encode/decode functions. + * + * @return Pointer to a context (OSCTXT) structure. + */ + virtual OSCTXT* getCtxtPtr () { + return OSRTStream::getCtxtPtr (); + } + + /** + * Returns error text in a dynamic memory buffer. Buffer will be allocated by + * 'operator new []'. The calling routine is responsible to free the memory + * by using 'operator delete []'. + * + * @return A pointer to a newly allocated buffer with error text. + */ + virtual char* getErrorInfo () { + return OSRTStream::getErrorInfo (); + } + + /** + * Returns error text in a memory buffer. If buffer pointer is specified in + * parameters (not NULL) then error text will be copied in the passed + * buffer. Otherwise, this method allocates memory using the + * 'operator new []' function. The calling routine is responsible to free + * the memory by using 'operator delete []'. + * + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param bufSize A reference to buffer size. If pBuf is NULL it will + * receive the size of allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with error + * text. NULL, if error occurred. + */ + virtual char* getErrorInfo (char* pBuf, size_t& bufSize) { + return OSRTStream::getErrorInfo (pBuf, bufSize); + } + + /** + * This method returns the completion status of previous operation. + * It can be used to check completion status of constructors or methods, + * which do not return completion status. + * + * @return Runtime status code: + * - 0 = success, + * - negative return value is error. + */ + virtual int getStatus () const { + return OSRTStream::getStatus (); + } + + /** + * Checks, is the stream opened or not. + * + * @return s TRUE, if the stream is opened, FALSE otherwise. + * @see ::rtxStreamIsOpened + */ + virtual EXTRTMETHOD OSBOOL isOpened (); + + /** + * The printErrorInfo method prints information on errors contained within + * the context. + */ + inline void printErrorInfo () { OSRTStream::printErrorInfo (); } + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + inline void resetErrorInfo () { OSRTStream::resetErrorInfo (); } + + /** + * Write data to the stream. This method writes the given number of + * octets from the given array to the output stream. + * + * @param pdata The pointer to the data to be written. + * @param size The number of octets to write. + * @return The total number of octets written into the stream, or + * negative value with error code if any error is + * occurred. + * @see ::rtxStreamWrite + */ + virtual EXTRTMETHOD long write (const OSOCTET* pdata, size_t size); + +} ; + +/** @} */ + +#endif /* _OSRTOUTPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTOutputStreamIF.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTOutputStreamIF.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,75 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTOutputStreamIF.h + * C++ interface class definitions for operations with output streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTOUTPUTSTREAMIF_H_ +#define _OSRTOUTPUTSTREAMIF_H_ + +#include "rtxsrc/OSRTStreamIF.h" + +/** + * @defgroup ostrmclas Generic Output Stream Classes + * @ingroup cppruntime + * + * The interface class definition for operations with output streams. Classes + * that implement this interface are used for writing data to the various + * stream types, not to encode ASN.1 messages. + * + * @{ + */ +class EXTRTCLASS OSRTOutputStreamIF : public OSRTStreamIF { + public: + /** + * Virtual destructor. Closes the stream if it was opened. + */ + virtual EXTRTMETHOD ~OSRTOutputStreamIF (); + + /** + * Write data to the stream. This method writes the given number of + * octets from the given array to the output stream. + * + * @param pdata Pointer to the data to be written. + * @param size The number of octets to write. + * @return The total number of octets written into the stream, or + * negative value with error code if any error is + * occurred. + * @see ::rtxStreamWrite + */ + virtual long write (const OSOCTET* pdata, size_t size) = 0; + +} ; + +class EXTRTCLASS OSRTOutputStreamPtr { + OSRTOutputStreamIF* mPtr; + public: + inline OSRTOutputStreamPtr (OSRTOutputStreamIF* ptr) : mPtr (ptr) {} + inline ~OSRTOutputStreamPtr () { delete mPtr; } + + inline operator OSRTOutputStreamIF* () { return mPtr; } + inline OSRTOutputStreamIF* operator-> () { return mPtr; } +} ; + +/** @} */ + +#endif /* _OSRTOUTPUTSTREAMIF_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTSocket.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTSocket.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,302 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTSocket.h + * TCP/IP or UDP socket class definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTSOCKET_H_ +#define _OSRTSOCKET_H_ + +/* Disable MS VC++ Level 4 warning about unreferenced inline functions */ +#ifdef _MSC_VER +#pragma warning(disable: 4514) +#endif /* _MSC_VER */ + +#include "rtxsrc/rtxSocket.h" + +/** @defgroup socketCpp TCP/IP or UDP Socket Classes + * These classes provide utility methods for doing socket I/O. + * @ingroup cppruntime + * @{ + */ + +/** + * Wrapper class for TCP/IP or UDP sockets. + */ +class EXTRTCLASS OSRTSocket { + protected: + OSRTSOCKET mSocket; //< handle of the socket + int mInitStatus; + int mStatus; + OSBOOL mOwner; //< indicates this class owns the socket + + inline OSBOOL isInitialized () { return mInitStatus == 0; } + + public: + /** + * This is the default constructor. It initializes all internal members + * with default values and creates a new socket structure. + * Use getStatus() method to determine + * has error occurred during the initialization or not. + * + */ + EXTRTMETHOD OSRTSocket (); + + /** + * This constructor initializes an instance by using an existing socket. + * + * @param socket An existing socket handle. + * @param ownership Boolean flag that specifies who is the owner of + * the socket. If it is TRUE then the socket will be + * destroyed in the destructor. Otherwise, the user is + * responsible to close and destroy the socket. + */ + EXTRTMETHOD OSRTSocket (OSRTSOCKET socket, OSBOOL ownership = FALSE); + + /** + * The copy constructor. The copied instance will have the same socket + * handle as the original one, but will not be the owner of the handle. + */ + EXTRTMETHOD OSRTSocket (const OSRTSocket& socket); + + /** + * The destructor. This closes socket if the instance is the owner of the + * socket. + */ + EXTRTMETHOD ~OSRTSocket (); + + /** + * This method permits an incoming connection attempt on a socket. It + * extracts the first connection on the queue of pending connections on + * the socket. It then creates a new socket and returns an instance of + * the new socket. The newly created socket will handle the + * actual connection and has the same properties as the original socket. + * + * @param destIP Optional pointer to a buffer that receives the IP + * address of the connecting entity. It may be NULL. + * @param port Optional pointer to a buffer that receives the port + * of the connecting entity. It may be NULL. + * @return An instance of the new socket class. NULL, if error + * occur. Use ::getStatus method to obtain error code. + * @see ::rtSocketAccept + */ + EXTRTMETHOD OSRTSocket* accept (OSIPADDR* destIP = 0, int *port = 0); + + /** + * This method converts an IP address to its string representation. + * + * @param ipAddr The IP address to be converted. + * @param pAddrStr Pointer to the buffer to receive a + * string with the IP address. + * @param bufsize Size of the buffer. + * @return Pointer to a string with IP-address. NULL, if error + * occur. + */ + EXTRTMETHOD static const char* addrToString (OSIPADDR ipAddr, + char* pAddrStr, + int bufsize); + + /** + * This method associates a local address with a socket. It is used on an + * unconnected socket before subsequent calls to the ::connect or ::listen + * methods. + * + * @param addr The local IP address to assign to the + * socket. + * @param port The local port number to assign to the + * socket. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtSocketBind + */ + EXTRTMETHOD int bind (OSIPADDR addr, int port); + + /** + * This method associates a local address with a socket. It is used on an + * unconnected socket before subsequent calls to the ::connect or ::listen + * methods. + * + * @param pAddrStr Null-terminated character string + * representing a number expressed in the + * Internet standard "." (dotted) + * notation. + * @param port The local port number to assign to the + * socket. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtSocketBind + */ + EXTRTMETHOD int bind (const char* pAddrStr, int port); + + /** + * This method associates only a local port with a socket. It is used on an + * unconnected socket before subsequent calls to the OSRTSocket::connect or + * OSRTSocket::listen methods. + * + * @param port The local port number to assign to the + * socket. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtSocketBind + * @see bind () + */ + inline int bind (int port) { + return bind (OSIPADDR_ANY, port); + } + + /** + * This method receives data from the connected socket. In this case, + * the connection is blocked until either the requested number of bytes + * is received or the socket is closed or an error occurs. + * + * @param pbuf Pointer to the buffer for the incoming data. + * @param readBytes Number of bytes to receive. + * @return If no error occurs, returns the number of bytes + * received. Otherwise, the negative value is + * error code. + */ + EXTRTMETHOD int blockingRead (OSOCTET* pbuf, size_t readBytes); + + /** + * This method closes this socket. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtSocketClose + */ + EXTRTMETHOD int close (); + + /** + * This method establishes a connection to this socket. It is used to create + * a connection to the specified destination. When the socket call completes + * successfully, the socket is ready to send and receive data. + * + * @param host Null-terminated character string + * representing a number expressed in the + * Internet standard "." (dotted) + * notation. + * @param port The destination port to connect. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtSocketConnect + */ + EXTRTMETHOD int connect (const char* host, int port); + + /** + * Returns the ownership of underlying O/S socket. + * + * @returns TRUE, if the socket object has the ownership of + * underlying O/S socket. + */ + OSBOOL getOwnership () { return mOwner; } + + /** + * This method returns the handle of the socket. + * + * @return The handle of the socket. + */ + OSRTSOCKET getSocket () const { return mSocket; } + + /** + * Returns a completion status of last operation. + * + * @return Completion status of last operation: + * - 0 = success, + * - negative return value is error. + */ + inline int getStatus () { return mStatus; } + + /** + * This method places a socket into a state where it is listening for + * an incoming connection. + * + * @param maxConnections Maximum length of the queue of pending + * connections. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtSocketListen + */ + EXTRTMETHOD int listen (int maxConnections); + + /** + * This method receives data from a connected socket. It is used to read + * incoming data on sockets. The socket must be connected before calling + * this function. + * + * @param pbuf Pointer to the buffer for the incoming + * data. + * @param bufsize Length of the buffer. + * @return If no error occurs, returns the number + * of bytes received. Negative error code if + * error occurred. + * @see ::rtSocketRecv + */ + EXTRTMETHOD int recv (OSOCTET* pbuf, OSUINT32 bufsize); + + /** + * Transfers an ownership of the underlying O/S socket to or from the + * socket object. If the socket object has the ownership of the underlying + * O/S socket it will close the O/S socket when the socket object is being + * closed or destroyed. + * + * @param ownership TRUE, if socket object should have ownership of the + * underlying O/S socket; FALSE, otherwise. + */ + inline void setOwnership (OSBOOL ownership) { mOwner = ownership; } + + /** + * This method sends data on a connected socket. It is used to write + * outgoing data on a connected socket. + * + * @param pdata Buffer containing the data to be + * transmitted. + * @param size Length of the data in pdata. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtSocketSend + */ + EXTRTMETHOD int send (const OSOCTET* pdata, OSUINT32 size); + + /** + * This method converts a string containing an Internet Protocol dotted + * address into a proper OSIPADDR address. + * + * @param pAddrStr Null-terminated character string + * representing a number expressed in the + * Internet standard "." (dotted) + * notation. + * @return If no error occurs, returns OSIPADDR. + * OSIPADDR_INVALID, if error occurred. + */ + EXTRTMETHOD static OSIPADDR stringToAddr (const char* pAddrStr); +} ; + +/** @} */ + +#endif //_OSRTSOCKET_H_ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTSocketInputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTSocketInputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,94 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTSocketInputStream.h + * C++ base class definitions for operations with input socket streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTSOCKETINPUTSTREAM_H_ +#define _OSRTSOCKETINPUTSTREAM_H_ + +#include "rtxsrc/OSRTSocket.h" +#include "rtxsrc/OSRTInputStream.h" + +/** + * Generic socket input stream. This class opens an existing socket for input in + * binary mode and reads data from it. + */ +class EXTRTCLASS OSRTSocketInputStream : public OSRTInputStream { + protected: + OSRTSocket mSocket; //< a socket + public: + /** + * Creates and initializes a socket input stream using the OSRTSocket + * instance of socket. + * + * @param socket Reference to OSRTSocket instance. + * @see ::rtxStreamSocketOpen + */ + EXTRTMETHOD OSRTSocketInputStream (OSRTSocket& socket); + + /** + * Creates and initializes a socket input stream using the OSRTSocket + * instance of socket. + * + * @param pContext Pointer to a context to use. + * @param socket Reference to OSRTSocket instance. + * @see ::rtxStreamSocketOpen + */ + EXTRTMETHOD OSRTSocketInputStream (OSRTContext* pContext, OSRTSocket& socket); + + /** + * Creates and initializes the socket input stream using the socket + * handle. + * + * @param socket Handle of the socket. + * @param ownership Indicates ownership of the socket. + * Set to TRUE to pass ownership to + * this object instance. The socket + * will be closed when this object + * instance is deleted or goes out + * of scope. + * @see ::rtxStreamSocketAttach + */ + EXTRTMETHOD OSRTSocketInputStream (OSRTSOCKET socket, OSBOOL ownership = FALSE); + + /** + * Creates and initializes the socket input stream using the socket + * handle. + * + * @param pContext Pointer to a context to use. + * @param socket Handle of the socket. + * @param ownership Indicates ownership of the socket. + * Set to TRUE to pass ownership to + * this object instance. The socket + * will be closed when this object + * instance is deleted or goes out + * of scope. + * @see ::rtxStreamSocketAttach + */ + OSRTSocketInputStream (OSRTContext* pContext, + OSRTSOCKET socket, + OSBOOL ownership = FALSE); + +} ; + +#endif /* _OSRTSOCKETINPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTSocketOutputStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTSocketOutputStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,92 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTSocketOutputStream.h + * C++ base class definitions for operations with output socket streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTSOCKETOUTPUTSTREAM_H_ +#define _OSRTSOCKETOUTPUTSTREAM_H_ + +#include "rtxsrc/OSRTSocket.h" +#include "rtxsrc/OSRTOutputStream.h" + +/** + * Generic socket output stream. This class opens an existing socket for output in + * binary mode and reads data from it. + */ +class EXTRTCLASS OSRTSocketOutputStream : public OSRTOutputStream { + protected: + OSRTSocket mSocket; //< a socket + public: + /** + * Creates and initializes a socket output stream using the OSRTSocket + * instance of socket. + * + * @param socket Reference to OSRTSocket instance. + * @see ::rtxStreamSocketOpen + */ + EXTRTMETHOD OSRTSocketOutputStream (OSRTSocket& socket); + + /** + * Creates and initializes a socket output stream using the OSRTSocket + * instance of socket. + * + * @param pContext Pointer to a context to use. + * @param socket Reference to OSRTSocket instance. + * @see ::rtxStreamSocketOpen + */ + EXTRTMETHOD OSRTSocketOutputStream (OSRTContext* pContext, OSRTSocket& socket); + + /** + * Initializes the socket output stream using the socket handle. + * + * @param socket Handle of the socket. + * @param ownership Indicates ownership of the socket. + * Set to TRUE to pass ownership to + * this object instance. The socket + * will be closed when this object + * instance is deleted or goes out + * of scope. + * @see ::rtxStreamSocketAttach + */ + EXTRTMETHOD OSRTSocketOutputStream (OSRTSOCKET socket, OSBOOL ownership = FALSE); + + /** + * Initializes the socket output stream using the socket handle. + * + * @param pContext Pointer to a context to use. + * @param socket Handle of the socket. + * @param ownership Indicates ownership of the socket. + * Set to TRUE to pass ownership to + * this object instance. The socket + * will be closed when this object + * instance is deleted or goes out + * of scope. + * @see ::rtxStreamSocketAttach + */ + OSRTSocketOutputStream (OSRTContext* pContext, + OSRTSOCKET socket, + OSBOOL ownership = FALSE); + +} ; + +#endif /* _OSRTSOCKETOUTPUTSTREAM_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,184 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTStream.h + * C++ base class definitions for operations with I/O streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTSTREAM_H_ +#define _OSRTSTREAM_H_ + +#include "rtxsrc/OSRTCtxtHolder.h" +#include "rtxsrc/OSRTStreamIF.h" + +/** + * @ingroup osrtstream + * + * The default base class for using I/O streams. This class may be + * subclassed, as in the case of OSRTInputStream and OSRTOutputStream or other + * custom implementations. + * + * @{ + * + */ +class EXTRTCLASS OSRTStream : public OSRTCtxtHolder, public OSRTStreamIF { + protected: + OSBOOL mbAttached; //< Flag, TRUE for "attached" streams + int mStatus; //< Last stream operation status + int mInitStatus; //< Initialization status. 0 if initialized successfully + + EXTRTMETHOD OSRTStream (OSRTContext* pContext, OSBOOL attachStream = FALSE); + EXTRTMETHOD OSRTStream (OSRTStream& original); + + /** + * The default constructor. It initializes a buffered stream. A + * buffered stream maintains data in memory before reading or writing + * to the device. This generally provides better performance than + * an unbuffered stream. + */ + EXTRTMETHOD OSRTStream (); + + EXTRTMETHOD char* getErrorInfo (size_t* pBufSize); + public: + /** + * Virtual destructor. Closes the stream if it was opened. + */ + virtual EXTRTMETHOD ~OSRTStream (); + + /** + * Closes the input or output stream and releases any system resources + * associated with the stream. For output streams this function also flushes + * all internal buffers to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamClose + */ + virtual EXTRTMETHOD int close (); + + /** + * Flushes the buffered data to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamFlush + */ + virtual EXTRTMETHOD int flush (); + + /** + * This method returns a pointer to the underlying OSRTContext object. + * + * @return A reference-counted pointer to an OSRTContext object. + * The OSRTContext object will not be released until + * all referenced-counted pointer variables go out of + * scope. This allows safe sharing of the context + * between different run-time classes. + */ + virtual OSRTCtxtPtr getContext () { + return OSRTCtxtHolder::getContext (); + } + + /** + * This method returns a pointer to the underlying OSCTXT object. This is + * the structure used in calls to low-level C encode/decode functions. + * + * @return Pointer to a context (OSCTXT) structure. + */ + virtual OSCTXT* getCtxtPtr () { + return OSRTCtxtHolder::getCtxtPtr (); + } + + /** + * Returns error text in a dynamic memory buffer. Buffer will be allocated by + * 'operator new []'. The calling routine is responsible to free the memory + * by using 'operator delete []'. + * + * @return A pointer to a newly allocated buffer with error text. + */ + virtual char* getErrorInfo () { + return OSRTCtxtHolder::getErrorInfo (); + } + + /** + * Returns error text in a memory buffer. If buffer pointer is specified in + * parameters (not NULL) then error text will be copied in the passed + * buffer. Otherwise, this method allocates memory using the + * 'operator new []' function. The calling routine is responsible to free + * the memory by using 'operator delete []'. + * + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param bufSize A reference to buffer size. If pBuf is NULL it will + * receive the size of allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with error + * text. NULL, if error occurred. + */ + virtual char* getErrorInfo (char* pBuf, size_t& bufSize) { + return OSRTCtxtHolder::getErrorInfo (pBuf, bufSize); + } + + /** + * This method returns the completion status of previous operation. + * It can be used to check completion status of constructors or methods, + * which do not return completion status. + * + * @return Runtime status code: + * - 0 = success, + * - negative return value is error. + */ + inline int getStatus () const { + return mStatus; + } + + inline OSBOOL isInitialized () { return (OSBOOL)(mInitStatus == 0); } + + /** + * Checks, is the stream opened or not. + * @returns TRUE, if the stream is opened, FALSE otherwise. + * @see ::rtxStreamIsOpened + */ + virtual EXTRTMETHOD OSBOOL isOpened (); + + /** + * The printErrorInfo method prints information on errors contained within + * the context. + */ + inline void printErrorInfo () { + OSRTCtxtHolder::printErrorInfo (); + } + + /** + * The resetErrorInfo method resets information on errors contained within + * the context. + */ + inline void resetErrorInfo () { + OSRTCtxtHolder::resetErrorInfo (); + } + +} ; + +/** @} */ + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTStreamIF.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTStreamIF.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,75 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTStreamIF.h + * C++ interface class definitions for operations with I/O streams. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTSTREAMIF_H_ +#define _OSRTSTREAMIF_H_ + +#include "rtxsrc/rtxCommon.h" +#include "rtxsrc/OSRTCtxtHolderIF.h" + +/** @defgroup osrtstream ASN.1 Stream Classes + * + * Classes that read or write ASN.1 messages to files, sockets, memory buffers, + * et c., are derived from this class. + * + * @{ + */ +class EXTRTCLASS OSRTStreamIF : public OSRTCtxtHolderIF { + public: + + /** + * Closes the input or output stream and releases any system resources + * associated with the stream. For output streams this function also flushes + * all internal buffers to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamClose + */ + virtual int close () = 0; + + /** + * Flushes the buffered data to the stream. + * + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + * @see ::rtxStreamFlush + */ + virtual int flush () = 0; + + /** + * Checks, is the stream opened or not. + * @returns TRUE, if the stream is opened, FALSE otherwise. + * @see ::rtxStreamIsOpened + */ + virtual OSBOOL isOpened () = 0; + +} ; + +/** @} */ + +#endif /* _OSRTSTREAMIF_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTString.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTString.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,136 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTString.h + * C++ string class definition. This can be used to hold standard ASCII + * or UTF-8 strings. The standard C++ 'new' and 'delete' operators are + * used to allocate/free memory for the strings. All strings are + * deep-copied. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTSTRING_H_ +#define _OSRTSTRING_H_ + +/* Disable MS VC++ Level 4 warning about unreferenced inline functions */ +#ifdef _MSC_VER +#pragma warning(disable: 4514) +#endif /* _MSC_VER */ + +#include "rtxsrc/rtxCommon.h" +#include "rtxsrc/rtxPrint.h" +#include "rtxsrc/OSRTStringIF.h" + +/** + * C++ string class definition. This can be used to hold standard ASCII + * or UTF-8 strings. The standard C++ 'new' and 'delete' operators are + * used to allocate/free memory for the strings. All strings are + * deep-copied. + */ +class EXTRTCLASS OSRTString : public OSRTStringIF { + protected: + OSUTF8CHAR* mValue; + + public: + /** + * The default constructor creates an empty string. + */ + EXTRTMETHOD OSRTString(); + + /** + * This constructor initializes the string to contain the given + * standard ASCII string value. + * + * @param strval - Null-terminated C string value + */ + EXTRTMETHOD OSRTString (const char* strval); + + /** + * This constructor initializes the string to contain the given + * UTF-8 string value. + * + * @param strval - Null-terminated C string value + */ + EXTRTMETHOD OSRTString (const OSUTF8CHAR* strval); + + /** + * Copy constructor. + * + * @param str - C++ string object to be copied. + */ + EXTRTMETHOD OSRTString (const OSRTString& str); + + /** + * The destructor frees string memory using the standard 'delete' + * operator. + */ + virtual EXTRTMETHOD ~OSRTString(); + + /** + * This method creates a copy of the given string object. + */ + virtual OSRTStringIF* clone () { return new OSRTString (*this); } + + /** + * This method returns the pointer to UTF-8 null terminated string + * as a standard ASCII string. + */ + virtual const char* getValue () const { + return (const char*) mValue; + } + + /** + * This method returns the pointer to UTF-8 null terminated string + * as a UTF-8 string. + */ + virtual const OSUTF8CHAR* getUTF8Value () const { + return mValue; + } + + /** + * This method prints the string value to standard output. + * + * @param name - Name of generated string variable. + */ + virtual void print (const char* name) { + rtxPrintCharStr (name, (const char*)mValue); + } + + /** + * This method sets the string value to the given string. + * + * @param str - C null-terminated string. + */ + virtual EXTRTMETHOD void setValue (const char* str); + + /** + * This method sets the string value to the given UTF-8 string value. + * + * @param str - C null-terminated UTF-8 string. + */ + virtual EXTRTMETHOD void setValue (const OSUTF8CHAR* str); + + /** + * Assignment operator. + */ + EXTRTMETHOD OSRTString& operator= (const OSRTString& original); +} ; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTStringIF.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTStringIF.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,117 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTStringIF.h + * C++ string class interface. This defines an interface to allow + * different types of string derived classes to be implemented. Currently, + * implementations include a standard string class (OSRTString) which + * deep-copies all values using new/delete, and a fast string class + * (OSRTFastString) that just copies pointers (i.e does no memory + * management). + * + * These classes can be used to hold standard ASCII or UTF-8 strings. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTSTRINGIF_H_ +#define _OSRTSTRINGIF_H_ + +#include "rtxsrc/rtxCommon.h" +#include "rtxsrc/rtxPrint.h" + +/** + * C++ string class interface. This defines an interface to allow + * different types of string derived classes to be implemented. Currently, + * implementations include a standard string class (OSRTString) which + * deep-copies all values using new/delete, and a fast string class + * (OSRTFastString) that just copies pointers (i.e does no memory + * management). + */ +class EXTRTCLASS OSRTStringIF { + protected: + /** + * The default constructor creates an empty string. + */ + OSRTStringIF () {} + + /** + * This constructor initializes the string to contain the given + * standard ASCII string value. + * + * @param - Null-terminated C string value + */ + OSRTStringIF (const char*) {} + + /** + * This constructor initializes the string to contain the given + * UTF-8 string value. + * + * @param - Null-terminated C string value + */ + OSRTStringIF (const OSUTF8CHAR*) {} + + public: + /** + * The destructor frees string memory using the standard 'delete' + * operator. + */ + virtual ~OSRTStringIF() {} + + /** + * This method creates a copy of the given string object. + */ + virtual OSRTStringIF* clone () = 0; + + /** + * This method returns the pointer to UTF-8 null terminated string + * as a standard ASCII string. + */ + virtual const char* getValue () const = 0; + + /** + * This method returns the pointer to UTF-8 null terminated string + * as a UTF-8 string. + */ + virtual const OSUTF8CHAR* getUTF8Value () const = 0; + + /** + * This method prints the string value to standard output. + * + * @param name - Name of generated string variable. + */ + virtual void print (const char* name) = 0; + + /** + * This method sets the string value to the given string. + * + * @param str - C null-terminated string. + */ + virtual void setValue (const char* str) = 0; + + /** + * This method sets the string value to the given UTF-8 string value. + * + * @param utf8str - C null-terminated UTF-8 string. + */ + virtual void setValue (const OSUTF8CHAR* utf8str) = 0; + +} ; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTUTF8String.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/OSRTUTF8String.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,126 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file OSRTUTF8String.h + * C++ UTF-8 string class definition. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _OSRTUTF8STRING_H_ +#define _OSRTUTF8STRING_H_ + +#include "rtxsrc/OSRTBaseType.h" +#include "rtxsrc/rtxPrint.h" +#include "rtxsrc/rtxUTF8.h" + +/** + * UTF-8 string. This is the base class for generated C++ data type + * classes for XSD string types (string, token, NMTOKEN, etc.). + */ +class EXTERNRT OSRTUTF8String : public OSRTBaseType { + const OSUTF8CHAR* mValue; + + public: + /** + * The default constructor creates an empty string. + */ + OSRTUTF8String(); + + /** + * This constructor initializes the string to contain the given + * character string value. + * + * @param strval - String value + */ + OSRTUTF8String (const char* strval); + + /** + * This constructor initializes the string to contain the given + * UTF-8 character string value. + * + * @param strval - String value + */ + OSRTUTF8String (const OSUTF8CHAR* strval); + + /** + * Copy constructor. + * + * @param str - C++ XML string class. + */ + OSRTUTF8String (const OSRTUTF8String& str); + + /** + * The destructor frees string memory if the memory ownership flag + * is set. + */ + virtual ~OSRTUTF8String(); + + /** + * Clone method. Creates a copied instance and returns pointer to + * OSRTBaseType. + */ + OSRTBaseType* clone () const { return new OSRTUTF8String (*this); } + + /** + * This method copies the given string value to the internal + * string storage variable. A deep-copy of the given value is done; + * the class will delete this memory when the object is deleted. + * + * @param str - C null-terminated string. + */ + void copyValue (const char* str); + + /** + * This method returns the pointer to C null terminated string. + */ + inline const char* c_str () const { + return mValue; + } + + /** + * This method returns the pointer to UTF-8 null terminated string. + */ + inline const char* getValue () const { + return mValue; + } + + /** + * This method prints the string value to standard output. + * + * @param name - Name of generated string variable. + */ + inline void print (const char* name) { rtxPrintCharStr (name, mValue); } + + /** + * This method sets the string value to the given string. + * A deep-copy of the given value is not done; the pointer is + * stored directly in the class member variable. + * + * @param str - C null-terminated string. + */ + void setValue (const char* str); + + /** + * Assignment operator. + */ + OSRTUTF8String& operator= (const OSRTUTF8String& original); +} ; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/osMacros.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/osMacros.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,117 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef _OSMACROS_H_ +#define _OSMACROS_H_ + +#if defined(_MSC_VER) +// this disables 'conditional expression is constant' warnings +// caused by using do { ... } while(0) in defines. +#pragma warning(disable: 4127) +#endif + +/* Min/max tests */ +#define OS_MAX(a,b) (((a)>(b))?(a):(b)) +#define OS_MIN(a,b) (((a)<(b))?(a):(b)) + +/* Test if character is a hex character */ +#define OS_ISHEXCHAR(c) \ +((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) + +/* Test if string variable (const char*) is empty */ +#define OS_ISEMPTY(s) (s == 0 || *s == '\0') + +/* Nibble-to-hex char conversion macros */ +#define OS_HEXCHARTONIBBLE(ch,b) do { \ +if (ch >= '0' && ch <= '9') b = (unsigned char)(ch - '0'); \ +else if (ch >= 'a' && ch <= 'f') b = (unsigned char)((ch - 'a') + 10); \ +else if (ch >= 'A' && ch <= 'F') b = (unsigned char)((ch - 'A') + 10); \ +else b = 0xFF; } while(0) + +#define OS_NIBBLETOHEXCHAR(b,ch) do { \ +if (b >= 0 && b <= 9) ch = (char)(b + '0'); \ +else if (b >= 0x0a && b <= 0x0f) ch = (char)((b - 10)+ 'a'); \ +else ch = '?'; } while(0) + +/** + * This macro returns the number of elements in an array. + * + * @param x - Array varaible + */ +#define OSRTARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) + +/** + * This macro casts a string literal as a UTF-8 character string value. + */ +#define OSUTF8(str) ((const OSUTF8CHAR*)str) + +/** + * This macro determines the length of a UTF-8 character string value. + */ +#define OSUTF8LEN(str) strlen((const char*)str) + +/* Generic list iteration macros */ + +#define ForAllIter(p,listIter,type) \ +for(listIter.setFirst(),p=(type)listIter.getCurrentItem();!listIter.isDone();\ +listIter.setNext(),p=(type)listIter.getCurrentItem()) + +#define ForAllIterRev(p,listIter,type) \ +for(listIter.setLast(),p=(type)listIter.getCurrentItem();!listIter.isDone();\ +listIter.setPrev(),p=(type)listIter.getCurrentItem()) + +/* UTF-8 character size for -static option */ + +#define UTF8CHAR_SIZE 1 + +/* snprintf macros */ + +#include +#include + +#if defined(_MSC_VER) +# if _MSC_VER >= 1400 +# define os_snprintf(str, size, ...) \ + _snprintf_s(str, size, _TRUNCATE, __VA_ARGS__) +# define os_vsnprintf(str, size, fmt, ...) \ + _vsnprintf_s(str, size, _TRUNCATE, fmt, __VA_ARGS__) +# else +# define os_snprintf _snprintf +# define os_vsnprintf _vsnprintf +# endif +#elif defined(__HP_aCC) +/* at least aCC on HP-UX 11 expects format as non-const! */ +# define os_snprintf(str, size, ...) sprintf(str, __VA_ARGS__) +# define os_vsnprintf(str, size, fmt, ...) \ + vsnprintf(str, size, (char *)fmt, __VA_ARGS__) +#elif defined(_NO_SNPRINTF_) && !defined(__vxworks) && !defined (__SYMBIAN32__) +#define os_snprintf(str, size, ...) sprintf(str, __VA_ARGS__) +#define os_vsnprintf(str, size, fmt, ...) vsprintf(str, fmt, __VA_ARGS__) +/* We use gcc 2.95, which requires ##ARGS */ +#elif defined(__vxworks) || defined(__SYMBIAN32__) +#define os_snprintf(str,size,ARGS...) sprintf(str,##ARGS) +#define os_vsnprintf(str,size,fmt,ARGS...) vsprintf(str,fmt,##ARGS) +#else +#define os_snprintf snprintf +#define os_vsnprintf vsnprintf +#endif + +#endif + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/osSysTypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/osSysTypes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,263 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** +@file +@internalTechnology +*/ + +#ifndef _OSSYSTYPES_H_ +#define _OSSYSTYPES_H_ + +/* Ensure that the appropriate limits are active. */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +#define __STDC_CONSTANT_MACROS +#endif + +#if (!defined(BREW_MODULE) && !defined(FLAT_BREW)) +#include +#else +/* Special include for Qualcomm BREW environment */ +/* #include "AEEStdLib.h" */ +#endif + +#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__) \ + && !defined(__vxworks) && !defined(__SYMBIAN32__) +#include /* does not exist in windows; use builtins instead */ +#endif /* not windows */ + +#include + +#include + +#ifndef FALSE +#define FALSE 0 +#define TRUE 1 +#endif + +#define NumberOf(x) (sizeof(x)/sizeof(x[0])) + +typedef void OSVoid; +typedef void* OSVoidPtr; +typedef unsigned char OSBOOL; +typedef signed char OSINT8; +typedef unsigned char OSUINT8; +typedef short OSINT16; +typedef unsigned short OSUINT16; +typedef OSUINT8 OSOCTET; +typedef OSUINT8 OSUTF8CHAR; +typedef OSUINT16 OSUNICHAR; +typedef double OSREAL; +typedef double OSDOUBLE; +typedef float OSFLOAT; +#ifdef _16BIT +typedef long OSINT32; +typedef unsigned long OSUINT32; +#define OSINTCONST(val) val##L +#define OSUINTCONST(val) val##UL +#else +typedef int OSINT32; +typedef unsigned int OSUINT32; +#define OSINTCONST(val) val +#define OSUINTCONST(val) val##u +#endif /* _16BIT */ +typedef OSUINT32 OS32BITCHAR; + +#define OSUINT32_MAX ((OSUINT32)4294967295UL) +#define OSINT32_MAX ((OSINT32)2147483647L) +#define OSINT32_MIN ((OSINT32)(-OSINT32_MAX-1)) + +#define OSUINT16_MAX ((OSUINT16)65535UL) +#define OSINT16_MAX ((OSINT16)32767L) +#define OSINT16_MIN ((OSINT16)(-OSINT16_MAX-1)) + +#define OSUINT8_MAX ((OSUINT8)255U) +#define OSINT8_MAX ((OSINT8)127L) +#define OSINT8_MIN ((OSINT8)(-OSINT8_MAX-1)) + +#define OSREALMAX ((OSREAL)DBL_MAX) +#define OSREALMIN ((OSREAL)-DBL_MAX) + +/** + * @struct OSNumDateTime + * Numeric date/time structure + */ +typedef struct OSNumDateTime { + OSINT32 year; + OSUINT8 mon; /* 1 <= mon <= 12 */ + OSUINT8 day; /* 1 <= day <= 31 */ + OSUINT8 hour; /* 0 <= hour <= 23 */ + OSUINT8 min; /* 0 <= min <= 59 */ + OSREAL sec; + OSBOOL tz_flag; /* is tzo explicitely set? */ + OSINT32 tzo; /* -1440 <= tzo <= 1440 */ +} OSNumDateTime; + +/* 64-bit long integer type */ + +#ifndef OSINT64_ +#if !defined(_NO_INT64_SUPPORT) +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) +#define OSINT64_ +typedef __int64 OSINT64; +typedef unsigned __int64 OSUINT64; +#define OSINT64FMT "%I64d" +#define OSUINT64FMT "%I64u" +#define OSINT64FMTX "%I64x" +#define OSINT64MAX _I64_MAX +#define OSUINT64MAX _UI64_MAX +#define OSINT64MIN _I64_MIN +#define OSI64CONST(val) val##i64 +#define OSUI64CONST(val) val##ui64 + +#elif defined(INT64_MAX) /* assume have ISO C99 standard types */ +#define OSINT64_ +typedef int64_t OSINT64; +typedef uint64_t OSUINT64; +#ifdef PRId64 /* have C99 format macros */ +#define OSINT64FMT "%"PRId64 +#define OSUINT64FMT "%"PRIu64 +#define OSINT64FMTX "%"PRIx64 +#else /* have C99 types but not format macros, assume long long format */ +#define OSINT64FMT "%lld" +#define OSUINT64FMT "%llu" +#define OSINT64FMTX "%llx" +#endif /* PRId64 */ +#define OSINT64MAX INT64_MAX +#define OSUINT64MAX UINT64_MAX +#define OSINT64MIN INT64_MIN +#define OSI64CONST(val) INT64_C(val) +#define OSUI64CONST(val) UINT64_C(val) + +#else /* ?? __WORDSIZE != 64 */ +#warning "Using long long for 64-bit integers." +#define OSINT64_ +typedef long long OSINT64; +typedef unsigned long long OSUINT64; +#define OSINT64FMT "%lld" +#define OSUINT64FMT "%llu" +#define OSINT64FMTX "%llx" +#define OSI64CONST(val) val##LL +#define OSUI64CONST(val) val##ULL + +/* May throw an error if __STDC_LIMIT_MACROS is not defined */ +#ifdef LLONG_MAX +#define OSINT64MAX LLONG_MAX +#define OSUINT64MAX ULLONG_MAX +#define OSINT64MIN LLONG_MIN +#else +#warning "Using LONG_MAX for 64-bit maximum." +#define OSINT64MAX LONG_MAX +#define OSUINT64MAX ULONG_MAX +#define OSINT64MIN LONG_MIN +#endif + +#endif /* _MSC_VER ... */ +#endif /* !defined(_NO_INT64_SUPPORT) */ + +#ifndef OSINT64_ +/* if OSINT64 is still not defined - define it as long/unsigned long */ +#define OSINT64_ +typedef long OSINT64; +typedef unsigned long OSUINT64; +#define OSINT64FMT "%ld" +#define OSUINT64FMT "%lu" +#define OSINT64FMTX "%lx" +#define OSINT64MAX LONG_MAX +#define OSUINT64MAX ULONG_MAX +#define OSINT64MIN LONG_MIN +#define OSI64CONST(val) val##L +#define OSUI64CONST(val) val##UL +#endif /* OSINT64 ... */ + +#endif /* OSINT64 */ + +/** + * @struct OSDynOctStr osSysTypes.h + * Dynamic binary string structure + * + * This structure is used in generated code for XSD hexBinary and + * base64Binary types. + */ +typedef struct OSDynOctStr { + OSUINT32 numocts; + const OSOCTET* data; +} OSDynOctStr; + +typedef OSDynOctStr OSOpenType; + +/** + * @struct OSXSDAny + * Structure to hold xsd:any data in binary and XML text form. + */ +typedef enum { OSXSDAny_binary, OSXSDAny_xmlText } OSXSDAnyAlt; +typedef struct OSXSDAny { + OSXSDAnyAlt t; + union { + OSOpenType* binary; + const OSUTF8CHAR* xmlText; + } u; +} OSXSDAny; + +/* UTF-8 name/value pair */ + +typedef struct OSUTF8NVP { + const OSUTF8CHAR* name; + const OSUTF8CHAR* value; +} OSUTF8NVP; + +typedef OSUTF8NVP OSAnyAttr; +typedef OSUTF8NVP OSAnyElement; + +/* XML string */ + +/** + * @struct OSXMLSTRING osSysTypes.h + * XML UTF-8 character string structure + * + * This structure is used in generated code for XML string types. + */ +typedef struct OSXMLSTRING { + OSBOOL cdata; /* encode as a CDATA section */ + const OSUTF8CHAR* value; +} OSXMLSTRING; + +/** + * @struct OSXSDDateTime + * Numeric date/time structure + * + * This structure is used in generated code for XSD date/time types + * when code generation is configured to use numeric date/time types + * (-numDateTime command-line option). + */ +typedef OSNumDateTime OSXSDDateTime; + +/** + * @struct OSBitMapItem + * Named bit in a bit map. + * + * This structure is used to equate a name with a bit in a bit map. + */ +typedef struct OSBitMapItem { + const OSUTF8CHAR* name; + OSUINT16 bitno; + OSUINT16 namelen; +} OSBitMapItem; + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxArrayList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxArrayList.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,206 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxArrayList.h + * ArrayList functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXARRAYLIST_H_ +#define _RTXARRAYLIST_H_ + +#include "rtxsrc/rtxContext.h" + +#define OSRT_ARRAYLIST_CAPACITY 10 + +typedef struct _OSRTArrayList { + OSRTDList segments; + size_t segmentSize; + size_t size; + size_t dataSize; + OSBOOL (*equalsFunc)(void*,void*,size_t); +} OSRTArrayList; + +typedef struct _OSRTArrayListIter { + OSRTArrayList* pArrayList; + OSRTDListNode* pSegment; + OSUINT32 index; +} OSRTArrayListIter; + +/* Iteration is done as follows: + * rtxArrayListInitIter (&iter, &arrayList, 0); + * while (rtxArrayListHasNextItem (&iter)) { + * pdata = rtxArrayListNextItem (&iter); + * ... + */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function initializes an array list structure. + * + * @param pArrayList Pointer to array list structure to initialize. + * @param capacity Initial capacity of the array or zero to use default. + */ +EXTERNRT void rtxArrayListInit +(OSRTArrayList* pArrayList, size_t capacity); + +/** + * This function creates a new array list to hold the initial capacity of + * elements. + * + * @param pctxt Pointer to a context structure. + * @param capacity Initial capacity of the array or zero to use default. + * @return Allocated array list structure or NULL if insufficient + * dynamic memory is available to hold the structure. + */ +EXTERNRT OSRTArrayList* rtxNewArrayList (OSCTXT* pctxt, size_t capacity); + +/** + * This function frees all dynamic memory held by the array list. It does + * not free the array list structure itself, just the internal data array. + * + * @param pctxt Pointer to a context structure. + * @param pArrayList Pointer to array list structure. + */ +EXTERNRT void rtxFreeArrayList (OSCTXT* pctxt, OSRTArrayList* pArrayList); + +/** + * This function adds an element to an array list. + * + * @param pctxt Pointer to a context structure. + * @param pArrayList Pointer to array list structure to initialize. + * @param pdata Pointer to data item to add. + * @param pindex Pointer to index variable to receive index at + * which entry was added. + * @return Zero if item was successfully added; a negative + * status code if error. + */ +EXTERNRT int rtxArrayListAdd +(OSCTXT* pctxt, OSRTArrayList* pArrayList, void* pdata, OSUINT32* pindex); + +/** + * This function removes an element from an array list. + * + * @param pctxt Pointer to a context structure. + * @param pArrayList Pointer to array list structure to initialize. + * @param pdata Pointer to data item to remove. + */ +EXTERNRT void rtxArrayListRemove +(OSCTXT* pctxt, OSRTArrayList* pArrayList, void* pdata); + +/** + * This function removes the element at the given index from the array list. + * + * @param pctxt Pointer to a context structure. + * @param pArrayList Pointer to array list structure to initialize. + * @param index Index of item to remove. -1 indicates tail item + * should be removed. + */ +EXTERNRT void rtxArrayListRemoveIndexed +(OSCTXT* pctxt, OSRTArrayList* pArrayList, int index); + +/** + * This function inserts an element at the given position in the array list. + * + * @param pctxt Pointer to a context structure. + * @param pArrayList Pointer to array list structure to initialize. + * @param pdata Pointer to data item to insert. + * @param index Index of location where item should be inserted. + * @return Zero if item was successfully added; a negative + * status code if error. + */ +EXTERNRT int rtxArrayListInsert +(OSCTXT* pctxt, OSRTArrayList* pArrayList, void* pdata, OSUINT32 index); + +/** + * This function replaces (overwrites) the element at the given position in + * the array list with the new element. + * + * @param pArrayList Pointer to array list structure to initialize. + * @param pdata Pointer to data item to insert. + * @param index Index of location where item should be inserted. + * @return Zero if item was successfully added; a negative + * status code if error. + */ +EXTERNRT int rtxArrayListReplace +(OSRTArrayList* pArrayList, void* pdata, OSUINT32 index); + +/** + * This function gets the indexed data item from the array list. + * + * @param pArrayList Pointer to array list structure to initialize. + * @param index Index of location where item should be inserted. + * @return Pointer to indexed data item or NULL if index + * is greater than max index in list. + */ +EXTERNRT void* rtxArrayListGetIndexed +(const OSRTArrayList* pArrayList, OSUINT32 index); + +/** + * This function returns the index of the given data item in the list. + * The 'equals' callback function is used to do comparisons. + * + * @param pArrayList Pointer to array list structure to initialize. + * @param pdata Pointer to data item to find in list. + * @return Index of item in list or -1 if not found. + */ +EXTERNRT int rtxArrayListIndexOf (OSRTArrayList* pArrayList, void* pdata); + +/* Iteration */ + +/** + * This function initializes an array list iterator with the given start + * index. + * + * @param piter Pointer to array list iterator structure. + * @param pArrayList Pointer to array list structure. + * @param startIndex Index from which iteration is to start. + * @return Zero if successfully initialized or RTERR_OUTOFBND + * if start index is beyond the current size of + * the array list. + */ +EXTERNRT int rtxArrayListInitIter +(OSRTArrayListIter* piter, OSRTArrayList* pArrayList, OSUINT32 startIndex); + +/** + * This function determines if another element exists at the next + * sequential position in the array list. + * + * @param piter Pointer to array list iterator structure. + * @return True if another element exists; false otherwise. + */ +EXTERNRT OSBOOL rtxArrayListHasNextItem (OSRTArrayListIter* piter); + +/** + * This function gets the next item from the array list. + * + * @param piter Pointer to array list iterator structure. + * @return Pointer to next item or null if beyond the + * end of the array. + */ +EXTERNRT void* rtxArrayListNextItem (OSRTArrayListIter* piter); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBase64.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBase64.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,99 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxBase64.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXBASE64_H_ +#define _RTXBASE64_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Encode binary data into base64 string form to a dynamic buffer. + * + * @param pctxt Pointer to context structure. + * @param pSrcData Pointer to binary data to encode. + * @param srcDataSize Length of the binary data in octets. + * @param ppDstData Pointer to pointer variable to hold address of + * dynamically allocated buffer the encoded base64 + * string. + * @return Completion status of operation: + * - number of binary bytes written + * - negative return value is error. + */ +EXTERNRT long rtxBase64EncodeData (OSCTXT* pctxt, const char* pSrcData, + size_t srcDataSize, OSOCTET** ppDstData); + +/** + * Decode base64 string to binary form into a dynamic buffer. + * + * @param pctxt Pointer to context structure. + * @param pSrcData Pointer to base64 string to decode. + * @param srcDataSize Length of the base64 string. + * @param ppDstData Pointer to pointer variable to hold address of + * dynamically allocated buffer to hold data. + * @return Completion status of operation: + * - number of binary bytes written + * - negative return value is error. + */ +EXTERNRT long rtxBase64DecodeData +(OSCTXT* pctxt, const char* pSrcData, size_t srcDataSize, OSOCTET** ppDstData); + +/** + * Decode base64 string to binary form into a fixed-size buffer. + * + * @param pctxt Pointer to context structure. + * @param pSrcData Pointer to base64 string to decode. + * @param srcDataSize Length of the base64 string. + * @param buf Address of buffer to receive decoded binary data. + * @param bufsiz Size of output buffer. + * @return Completion status of operation: + * - number of binary bytes written + * - negative return value is error. + */ +EXTERNRT long rtxBase64DecodeDataToFSB +(OSCTXT* pctxt, const char* pSrcData, size_t srcDataSize, + OSOCTET* buf, size_t bufsiz); + +/** + * Calculate number of byte required to hold a decoded base64 string + * in binary form. + * + * @param pSrcData Pointer to base64 string to decode. + * @param srcDataSize Length of the base64 string. + * @return Completion status of operation: + * If success, positive value is number of bytes, + * If failure, negative status code. + */ +EXTERNRT long rtxBase64GetBinDataLen +(const char* pSrcData, size_t srcDataSize); + +#ifdef __cplusplus +} +#endif + +#endif /* RTXBASE64 */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBigInt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBigInt.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,95 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxBigInt.h + */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXBIGINT_H_ +#define _RTXBIGINT_H_ + +#include "rtxsrc/rtxContext.h" + +/* Big Integer */ + +typedef struct OSBigInt { + int numocts; /* number of used octets in mag */ + OSOCTET *mag; /* magnitude */ + int sign; /* sign, can be -1, 0, 1 */ + + int allocated; /* number of allocated octets for mag */ + OSBOOL dynamic; /* is buffer dynamic? */ +} OSBigInt; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* BigInt functions */ + +EXTERNRT void rtxBigIntInit (OSBigInt* pInt); +EXTERNRT int rtxBigIntSetStr (OSCTXT* pCtxt, OSBigInt* pInt, + const char* value, int radix); +EXTERNRT int rtxBigIntSetInt64 (OSCTXT* pCtxt, OSBigInt* pInt, + OSINT64 value); +EXTERNRT int rtxBigIntSetUInt64 (OSCTXT* pCtxt, OSBigInt* pInt, + OSUINT64 value); +EXTERNRT int rtxBigIntSetBytes (OSCTXT* pCtxt, OSBigInt* pInt, + OSOCTET* value, int vallen); +EXTERNRT int rtxBigIntGetDataLen (const OSBigInt* pInt); +EXTERNRT int rtxBigIntGetData (OSCTXT* pCtxt, const OSBigInt* pInt, + OSOCTET* buffer, int bufSize); +EXTERNRT int rtxBigIntDigitsNum (const OSBigInt* pInt, int radix); +EXTERNRT int rtxBigIntCopy (OSCTXT* pCtxt, const OSBigInt* pSrc, OSBigInt* pDst); +EXTERNRT int rtxBigIntFastCopy (OSCTXT* pCtxt, const OSBigInt* pSrc, OSBigInt* pDst); +EXTERNRT int rtxBigIntToString (OSCTXT* pCtxt, const OSBigInt* pInt, int radix, + char* str, int strSize); +EXTERNRT int rtxBigIntPrint (const OSUTF8CHAR* name, const OSBigInt* bigint, int radix); +EXTERNRT int rtxBigIntCompare (const OSBigInt* arg1, const OSBigInt* arg2); +EXTERNRT int rtxBigIntStrCompare (OSCTXT* pCtxt, const char* arg1, + const char* arg2); +EXTERNRT void rtxBigIntFree (OSCTXT* pCtxt, OSBigInt* pInt); + +/* Arithmetic */ +EXTERNRT int rtxBigIntAdd + (OSCTXT* pctxt, + OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2); + +EXTERNRT int rtxBigIntSubtract + (OSCTXT* pctxt, + OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2); + +EXTERNRT int rtxBigIntMultiply + (OSCTXT* pctxt, + OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2); + +/* Common */ +EXTERNRT unsigned short rtxBigIntBitsPerDigit (int radix); +EXTERNRT short rtxBigIntDigitsPerByte (int halfRadix); +EXTERNRT short rtxBigIntByteRadix (int halfRadix); + +#ifdef __cplusplus +} +#endif + +#endif /* RTXBIGINT */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBitDecode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBitDecode.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,53 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxBitDecode.h + * Bit decode functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXBITDECODE_H_ +#define _RTXBITDECODE_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function decodes up to sizeof(unsigned) bits + * and returns the result in an unsigned integer value. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param pvalue Pointer to value to be receive decoded result. + * @param nbits Number of bits to read from decode buffer. + * @return Status of the operation. Zero if successful; a + * negative status code if failed. + */ +EXTERNRT int rtxDecBits (OSCTXT* pctxt, OSUINT32* pvalue, OSUINT32 nbits); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBitEncode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBitEncode.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,71 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxBitEncode.h + * Bit encode functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXBITENCODE_H_ +#define _RTXBITENCODE_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function will set the bit at the current encode bit cursor + * position to 1 or 0 and advance the cursor pointer. + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value The value to be encoded. + */ +EXTERNRT int rtxEncBit (OSCTXT* pctxt, OSBOOL value); + +/** + * This function will encode a series of bits (up to 32) from an unsigned + * integer value/ + * + * @param pctxt Pointer to a context structure. This provides a storage + * area for the function to store all working variables + * that must be maintained between function calls. + * @param value The value to be encoded. + * @param nbits Number of bits from the value to encode. + * @return Status of the operation. Zero if successful; a + * negative status code if failed. + */ +EXTERNRT int rtxEncBits (OSCTXT* pctxt, OSUINT32 value, OSUINT32 nbits); + +/** + * This macro will byte-align the encode buffer in the context. + */ +#define rtxByteAlign(pctxt) \ +if ((pctxt)->buffer.bitOffset != 8) { \ +(pctxt)->buffer.byteIndex++; (pctxt)->buffer.bitOffset = 8; } + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBitString.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBitString.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,112 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxBitString.h - Contains utility functions for setting, clearing, + * and testing bits at any position in an arbitrarily sized array of bytes. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXBITSTRING_H_ +#define _RTXBITSTRING_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup bitstrhelpers Bit String Functions + * @{ + * Bit string functions allow bits to be set, cleared, or tested in + * arbitrarily sized byte arrays. + */ +/** + * This macro is used to calculate the byte array size required to hold + * the given number of bits. + */ +#define OSRTBYTEARRAYSIZE(numbits) (((numbits-1)/8)+1) + +/** + * This function sets the specified bit in the bit string. + * + * @param pBits Pointer to octets of bit string. + * @param numbits Number of bits in the bit string. + * @param bitIndex Index of bit to be set. The bit with index 0 is a most + * significant bit in the octet with index 0. + * @return If successful, returns the previous state of bit. If bit + * was set the return value is positive, if bit was not + * set the return value is zero. Otherwise, return value + * is an error code: + * - RTERR_OUTOFBND = bitIndex is out of bounds + */ +EXTERNRT int rtxSetBit (OSOCTET* pBits, OSUINT32 numbits, OSUINT32 bitIndex); + +/** + * This function sets one or more bits to TRUE or FALSE in a 32-bit unsigned + * bit flag set. + * + * @param flags Flags to which mask will be applied. + * @param mask Mask with one or more bits set that will be applied + * to pBitMask. + * @param action Boolean action indicating if bits in flags should be + * set (TRUE) or cleared (FALSE). + * @return Updated flags after mask is applied. + */ +EXTERNRT OSUINT32 rtxSetBitFlags +(OSUINT32 flags, OSUINT32 mask, OSBOOL action); + +/** + * This function clears the specified bit in the bit string. + * + * @param pBits Pointer to octets of bit string. + * @param numbits Number of bits in the bit string. + * @param bitIndex Index of bit to be cleared. The bit with index 0 is a + * most significant bit in the octet with index 0. + * @return If successful, returns the previous state of bit. If bit + * was set the return value is positive, if bit was not + * set the return value is zero. Otherwise, return value + * is an error code: + * - RTERR_OUTOFBND = bitIndex is out of bounds + */ +EXTERNRT int rtxClearBit +(OSOCTET* pBits, OSUINT32 numbits, OSUINT32 bitIndex); + +/** + * This function tests the specified bit in the bit string. + * + * @param pBits Pointer to octets of bit string. + * @param numbits Number of bits in the bit string. + * @param bitIndex Index of bit to be tested. The bit with index 0 is a + * most significant bit in the octet with index 0. + * @return True if bit set or false if not set or array index is + * beyond range of number of bits in the string. + */ +EXTERNRT OSBOOL rtxTestBit +(const OSOCTET* pBits, OSUINT32 numbits, OSUINT32 bitIndex); + +/** + * @}bitstrhelpers + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxBuffer.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,51 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxBuffer.h + * Common runtime functions for reading from or writing to the message + * buffer defined within the context structure. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXBUFFER_H_ +#define _RTXBUFFER_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERNRT OSINT32 rtxCheckBuffer (OSCTXT* pctxt, size_t nbytes); + +EXTERNRT OSINT32 rtxCopyAsciiText (OSCTXT* pctxt, const char* text); + +EXTERNRT OSINT32 rtxCopyUTF8Text (OSCTXT* pctxt, const OSUTF8CHAR* text); + +EXTERNRT OSINT32 rtxCopyUnicodeText (OSCTXT* pctxt, const OSUNICHAR* text); + +EXTERNRT int rtxWriteBytes +(OSCTXT* pctxt, const OSOCTET* pdata, size_t nocts); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCharStr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCharStr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,182 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxCharStr.h + */ +/** + * @defgroup rtxCharStr Character string functions + * @{ + * These functions are more secure versions of several of the character + * string functions available in the standard C run-time library. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXCHARSTR_H_ +#define _RTXCHARSTR_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function concatanates the given string onto the string buffer. + * It is similar to the C \c strcat function except more secure because + * it checks for buffer overrun. + * + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param src Pointer to null-terminated string to copy. + * @return Pointer to destination buffer or NULL if copy failed. + */ +EXTERNRT char* rtxStrcat (char* dest, size_t bufsiz, const char* src); + +/** + * This function concatanates the given number of characters from the + * given string onto the string buffer. It is similar to the C \c strncat + * function except more secure because it checks for buffer overrun. + * + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param src Pointer to null-terminated string to copy. + * @param nchars Number of characters to copy. + * @return Pointer to destination buffer or NULL if copy failed. + */ +EXTERNRT char* rtxStrncat +(char* dest, size_t bufsiz, const char* src, size_t nchars); + +/** + * This function copies a null-terminated string to a target buffer. + * It is similar to the C \c strcpy function except more secure because + * it checks for buffer overrun. + * + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param src Pointer to null-terminated string to copy. + * @return Pointer to destination buffer or NULL if copy failed. + */ +EXTERNRT char* rtxStrcpy (char* dest, size_t bufsiz, const char* src); + +/** + * This function copies the given number of characters from a string to + * a target buffer. It is similar to the C \c strncpy function except more + * secure because it checks for buffer overrun and ensures a null-terminator + * is copied to the end of the target buffer + * + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param src Pointer to null-terminated string to copy. + * @param nchars Number of characters to copy. + * @return Pointer to destination buffer or NULL if copy failed. + */ +EXTERNRT char* rtxStrncpy +(char* dest, size_t bufsiz, const char* src, size_t nchars); + +/** + * This function converts a signed 32-bit integer into a character + * string. It is similar to the C \c itoa function. + * + * @param value Integer to convert. + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param padchar Left pad char, set to zero for no padding. + * @return Number of characters or negative status value if fail. + */ +EXTERNRT int rtxIntToCharStr +(OSINT32 value, char* dest, size_t bufsiz, char padchar); + +/** + * This function converts an unsigned 32-bit integer into a character + * string. It is similar to the C \c itoa function. + * + * @param value Integer to convert. + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param padchar Left pad char, set to zero for no padding. + * @return Number of characters or negative status value if fail. + */ +EXTERNRT int rtxUIntToCharStr +(OSUINT32 value, char* dest, size_t bufsiz, char padchar); + +#if !defined(_NO_INT64_SUPPORT) +/** + * This function converts a signed 64-bit integer into a character + * string. It is similar to the C \c itoa function. + * + * @param value Integer to convert. + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param padchar Left pad char, set to zero for no padding. + * @return Number of characters or negative status value if fail. + */ +EXTERNRT int rtxInt64ToCharStr +(OSINT64 value, char* dest, size_t bufsiz, char padchar); + +/** + * This function converts an unsigned 64-bit integer into a character + * string. It is similar to the C \c itoa function. + * + * @param value Integer to convert. + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param padchar Left pad char, set to zero for no padding. + * @return Number of characters or negative status value if fail. + */ +EXTERNRT int rtxUInt64ToCharStr +(OSUINT64 value, char* dest, size_t bufsiz, char padchar); + +#endif /* !defined(_NO_INT64_SUPPORT) */ + +/** + * This function returns a count of the number of bytes the would result + * from the conversion of a hexadecimal character string to binary. Any + * whitespace characters in the string are ignored. + * + * @param hexstr Hex character string to convert. + * @param nchars Number of characters in string. If zero, + * characters are read up to null-terminator. + * @return Number of bytes or negative status value if fail. + */ +EXTERNRT int rtxHexCharsToBinCount (const char* hexstr, size_t nchars); + +/** + * This function converts the given hex string to binary. The result is + * stored in the given binary buffer. Any whitespace characters in the + * string are ignored. + * + * @param hexstr Hex character string to convert. + * @param nchars Number of characters in string. If zero, + * characters are read up to null-terminator. + * @param binbuf Buffer to hold converted binary data. + * @param bufsize Size of the binary data buffer. + * @return Number of bytes or negative status value if fail. + */ +EXTERNRT int rtxHexCharsToBin +(const char* hexstr, size_t nchars, OSOCTET* binbuf, size_t bufsize); + +/** + * @} rtxCharStr + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxClock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxClock.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,114 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/* Defines a means of performing timing tests. The macros may be used as + * follows: + * + * DECLARE_BENCHMARK + * + * ... + * + * BEGIN_LOOP + * // code to be timed goes here + * END_LOOP + * + * PRINT_RESULTS_MS + * + * Convenience macros to start and stop the performance clock are also + * provided in case a loop is not necessary. In this case, the ITERCNT + * value should be redefined to the number of cases being tested. + * + * These timers should be reasonable accurate within microsecond resolution, + * but results will vary from platform to platform. On GNU/Linux systems, + * it is necessary to link against librt.a. + * + * If a program is terminated unexpectedly, results may fail to print since + * the output buffer may not be flushed. If exception handling is used, + * make sure to call fflush(stdout) or the appropriate call for your + * platform. */ + + +/** +@file +@internalTechnology +*/ + +#ifndef __RTXCLOCK_H__ +#define __RTXCLOCK_H__ + +#include + +#define ITERCNT 100000L + +#ifndef MSC_VER /* not MSVC++; does this work for Borland? */ + +#include + +#define DECLARE_BENCHMARK \ + timespec tp0, tp1; \ + long __clk__ = 0; + +#define CLOCK_START \ + clock_gettime(CLOCK_REALTIME, &tp0); + +#define CLOCK_STOP \ + clock_gettime(CLOCK_REALTIME, &tp1); + +#define BEGIN_LOOP \ + CLOCK_START \ + for (__clk__ = 0; __clk__ < ITERCNT; __clk__ ++) { + +#define END_LOOP \ + } \ + CLOCK_STOP + +#define PRINT_RESULTS_MS \ + long _ds = tp1.tv_sec - tp0.tv_sec, \ + _dn = tp1.tv_nsec - tp0.tv_nsec; \ + double _dms = (_ds * 1000.f) + (_dn / 1e6); \ + printf ("\t%.6f\t%.6f\n", _dms, _dms/(float)ITERCNT); + +#else /* MSVC++ */ + +#include + +#define DECLARE_BENCHMARK \ + LARGE_INTEGER _start, _stop, _freq; \ + long __clk__ = 0; \ + QueryPerformanceFrequency(&_freq); + +#define CLOCK_START \ + QueryPerformanceCounter(&_start); + +#define CLOCK_STOP \ + QueryPerformanceCounter(&_stop); + +#define BEGIN_LOOP \ + CLOCK_START \ + for (__clk__ = 0; __clk__ < ITERCNT; __clk__ ++) { + +#define END_LOOP \ + } \ + CLOCK_END + +#define PRINT_RESULTS_MS \ + double _delta = (_stop.QuadPart - _start.QuadPart), \ + _total = _delta / (double)_freq.QuadPart * 1000; \ + printf("\t%.6f\t%.6f\n", _total, _total/(float)ITERCNT); + +#endif + +#endif /* DEFINE __RTXCLOCK_H__ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCommon.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,89 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/*The following is the text for the main C Runtime index page.*/ +/*! \mainpage + *

C Common Runtime Library Functions

+ * + * The C run-time common library contains common C functions used by + * the low-level encode/decode functions. These functions are identified + * by their rtx prefixes. + * + * The categories of functions provided are as follows:
    + *
  • Context management functions handle the allocation, + * initialization, and destruction of context variables + * (variables of type OSCTXT) that handle the working data used + * during the encoding or decoding of a message.
  • + *
  • Memory allocation macros and functions provide an optimized memory + * management interface.
  • + *
  • Doubly linked list (DList) functions are used to manipulate linked + * list structures that are used to model repeating XSD types and + * elements.
  • + *
  • UTF-8 and Unicode character string functions provide support + * for conversions to and from these formats in C or C++.
  • + *
  • Date/time conversion functions provide utilities for converting + * system and structured numeric date/time values to XML schema standard + * string format.
  • + *
  • Pattern matching function compare strings against patterns specified + * using regular expressions (regexp's).
  • + *
  • Diagnostic trace functions allow the output of trace messages + * to standard output.
  • + *
  • Error formatting and print functions allow information about + * encode/decode errors to be added to a context block structure + * and printed out.
  • + *
  • Memory buffer management functions handle the allocation, + * expansion, and de-allocation of dynamic memory buffers used by some + * encode/decode functions.
  • + *
  • Formatted print functions allow binary data to be + * formatted and printed to standard output and other output devices.
  • + *
  • Big Integer helper functions are arbitrary-precision integer + * manipulating functions used to maintain big integers.
  • + *
+ * + */ +/** + * @file rtxCommon.h + * Common runtime constants, data structure definitions, and run-time functions + * to support various data encoding standards. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXCOMMON_H_ +#define _RTXCOMMON_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/osMacros.h" +#include "rtxsrc/rtxExternDefs.h" +#include "rtxsrc/rtxBigInt.h" +#include "rtxsrc/rtxBitString.h" +#include "rtxsrc/rtxBuffer.h" +#include "rtxsrc/rtxCharStr.h" +#include "rtxsrc/rtxCommonDefs.h" +#include "rtxsrc/rtxDateTime.h" +#include "rtxsrc/rtxDiag.h" +#include "rtxsrc/rtxEnum.h" +#include "rtxsrc/rtxError.h" +#include "rtxsrc/rtxFile.h" +#include "rtxsrc/rtxMemory.h" +#include "rtxsrc/rtxPattern.h" +#include "rtxsrc/rtxReal.h" +#include "rtxsrc/rtxUTF8.h" +#include "rtxsrc/rtxUtil.h" + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCommonDefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCommonDefs.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,195 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXCOMMONDEFS_H_ +#define _RTXCOMMONDEFS_H_ + +#include +#include +#include +#include +#include +#include + +/* Constants */ + +#define OSRTAGENT "OSYSRTX" +#define OSRTVERSION "0.5.0" +#define OSRTMEMBUFSEG 1024 /* memory buffer extent size */ + +/* + * Definitions for common run-time functions that may not be availabe on + * certain embedded platforms. These definitions can be changed to + * use custom functions for these operations. + */ +#if (!defined(BREW_MODULE) && !defined(FLAT_BREW)) +#define OSCRTLMEMSET memset +#define OSCRTLMEMCMP memcmp +#define OSCRTLMEMCPY memcpy +#define OSCRTLMEMMOVE memmove +#define OSCRTLSTRCHR strchr +#define OSCRTLSTRCPY strcpy +#define OSCRTLSTRNCPY strncpy +#define OSCRTLSTRCAT strcat +#define OSCRTLSTRNCAT strncat +#define OSCRTLSTRCMP strcmp +#define OSCRTLSTRNCMP strncmp +#define OSCRTLSTRLEN strlen +#define OSCRTLMALLOC malloc +#define OSCRTLREALLOC realloc +#define OSCRTLFREE free +#else +#define OSCRTLMEMSET MEMSET +#define OSCRTLMEMCMP MEMCMP +#define OSCRTLMEMCPY MEMCPY +#define OSCRTLMEMMOVE MEMMOVE +#define OSCRTLSTRCHR STRCHR +#define OSCRTLSTRCPY STRCPY +#define OSCRTLSTRNCPY STRNCPY +#define OSCRTLSTRCAT STRCAT +#define OSCRTLSTRNCAT STRNCAT +#define OSCRTLSTRCMP STRCMP +#define OSCRTLSTRNCMP STRNCMP +#define OSCRTLSTRLEN STRLEN +#define OSCRTLMALLOC MALLOC +#define OSCRTLREALLOC REALLOC +#define OSCRTLFREE FREE +#endif + +/* Macros */ + +#define OSRTMAX(a,b) (((a)>(b))?(a):(b)) +#define OSRTMIN(a,b) (((a)<(b))?(a):(b)) + +#define OSRTBUFCUR(pctxt) (pctxt)->buffer.data[(pctxt)->buffer.byteIndex] +#define OSRTBUFPTR(pctxt) &(pctxt)->buffer.data[(pctxt)->buffer.byteIndex] +#define OSRTBUFFER(pctxt) (pctxt)->buffer.data +#define OSRTBUFSIZE(pctxt) (pctxt)->buffer.size + +#define OSRTPUTCHAR(pctxt,ch) \ +(pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; + +#define OSRTPUTCHARREV(pctxt,ch) \ +(pctxt)->buffer.data[--(pctxt)->buffer.byteIndex]=(OSOCTET)ch; + +#define OSRTZTERM(pctxt) \ +(pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; + +#define OSRTSAFEZTERM(pctxt) \ +do { \ +if (rtxCheckBuffer (pctxt, 1) == 0) \ +(pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; \ +else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ +} while (0) + +#define OSRTSAFEPUTCHAR(pctxt,ch) \ +do { \ +if (rtxCheckBuffer (pctxt, 1) == 0) \ +(pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ +else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ +} while (0) + +#define OSRTSAFEPUTCHAR1(pctxt,ch,stat) \ +do { \ +if (rtxCheckBuffer (pctxt, 1) == 0) {\ +(pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ +stat = 0; }\ +else stat = LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ +} while (0) + +#define OSRTSAFEPUTCHAR2(pctxt,ch,prealloc) \ +do { \ +if (rtxCheckBuffer (pctxt, ((prealloc > 1)?prealloc:1)) == 0) \ +(pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ +else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ +} while (0) + +#define OSRTMEMCPY(pctxt,bdata,len) \ +do { \ +OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ +(pctxt)->buffer.byteIndex += len; \ +} while (0) + +#define OSRTMEMCPYREV(pctxt,bdata,len) \ +do { \ +(pctxt)->buffer.byteIndex -= len; \ +OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ +} while (0) + +#define OSRTSAFEMEMCPY(pctxt,bdata,len) \ +do { \ +if (rtxCheckBuffer (pctxt, len) == 0) { \ +OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ +(pctxt)->buffer.byteIndex += len; } \ +else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ +} while (0) + +#define OSRTSAFEMEMCPY1(pctxt,bdata,len,stat) \ +do { \ +if (rtxCheckBuffer (pctxt, len) == 0) { \ +OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ +(pctxt)->buffer.byteIndex += len; \ +stat = 0; }\ +else stat = RTERR_BUFOVFLW; \ +} while (0) + +#define OSRTCHKUTF8LEN(str,lower,upper,stat) \ +do { size_t nchars = rtxUTF8Len (str); \ +stat = (nchars >= lower && nchars <= upper) ? 0 : RTERR_CONSVIO; } while(0) + +#define OSRTGETBUFUTF8LEN(pctxt) \ +rtxCalcUTF8Len (OSRTBUFPTR (pctxt), OSRTBUFSIZE (pctxt)) + +#define OSRTCHKBUFUTF8LEN(pctxt,lower,upper,stat) \ +do { size_t nchars = OSRTGETBUFUTF8LEN (pctxt); \ +stat = (nchars >= lower && nchars <= upper) ? 0 : RTERR_CONSVIO; } while(0) + +#define HEXCHARTONIBBLE(ch,b) do { \ +if (ch >= '0' && ch <= '9') b = (unsigned char)(ch - '0'); \ +else if (ch >= 'a' && ch <= 'f') b = (unsigned char)((ch - 'a') + 10); \ +else if (ch >= 'A' && ch <= 'F') b = (unsigned char)((ch - 'A') + 10); \ +else b = 0xFF; } while(0) + +#define NIBBLETOHEXCHAR(b,ch) do { \ +if (b >= 0 && b <= 9) ch = (char)(b + '0'); \ +else if (b >= 0x0a && b <= 0x0f) ch = (char)((b - 10)+ 'a'); \ +else ch = '?'; } while(0) + +#define NIBBLETOUCHEXCHAR(b,ch) do { \ +if (b >= 0 && b <= 9) ch = (char)(b + '0'); \ +else if (b >= 0x0a && b <= 0x0f) ch = (char)((b - 10)+ 'A'); \ +else ch = '?'; } while(0) + +#define OSRTSAFECONSTCAST(towhere,ptr) ((towhere)((size_t)ptr)) + +#define OS_WHITESPACE_COLLAPSE 0 +#define OS_WHITESPACE_PRESERVE 1 +#define OS_WHITESPACE_REPLACE 2 + +#define OS_ISNULLPTR(ptr) (((const void*)0) == ptr) + +#if defined(_MSC_VER) +// this disables 'conditional expression is constant' warning +#pragma warning(disable: 4127) +// this disables 'unreferenced formal parameter' warning +#pragma warning(disable: 4100) +#endif + +#endif /* _RTXCOMMONDEFS_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxContext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxContext.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,453 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxContext.h + * Common run-time context definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXCONTEXT_H_ +#define _RTXCONTEXT_H_ + +#include "rtxsrc/rtxDList.h" + +#define OSRTENCBUFSIZ 16*1024 /* dynamic encode buffer extent size */ + +/** + * @addtogroup rtxCtxt + * @{ + */ +/* run-time error info structures */ + +#define OSRTERRSTKSIZ 8 /* error stack size */ +#define OSRTMAXERRPRM 5 /* maximum error parameters */ + +/** + * @struct OSRTErrLocn rtxContext.h + * Run-time error location structure + * + * This structure is a container structure that holds information on + * the location within a C source file where a run-time error occurred. + */ +typedef struct { + const OSUTF8CHAR* module; + OSINT32 lineno; +} OSRTErrLocn; + +/** + * @struct OSRTErrInfo rtxContext.h + * Run-time error information structure + * + * This structure is a container structure that holds information on + * run-time errors. The stack variable holds the trace stack information + * that shows where the error occurred in the source code. The parms + * variable holds error parameters that are substituted into the message + * that is returned to the user. + */ +typedef struct { + OSRTErrLocn stack[OSRTERRSTKSIZ]; + OSINT16 status; + OSUINT8 stkx; + OSUINT8 parmcnt; + OSUTF8CHAR* parms[OSRTMAXERRPRM]; + OSUTF8CHAR* elemName; +} OSRTErrInfo; + +typedef struct { + OSRTDList list; /* list of errors */ + OSRTErrInfo reserved; /* error info elem, used if nomem to alloc */ + OSRTDListNode reservedNode; /* node placeholder for errInfo elem */ +} OSRTErrInfoList; + +/** + * @struct OSRTBuffer rtxContext.h + * Run-time message buffer structure + * + * This structure holds encoded message data. For an encode operation, + * it is where the message being built is stored. For decode, it + * holds a copy of the message that is being decoded. + */ +typedef struct { + OSOCTET* data; /* pointer to start of data buffer */ + size_t byteIndex; /* byte index */ + size_t size; /* current buffer size */ + OSINT16 bitOffset; /* current bit offset (8 - 1) */ + OSBOOL dynamic; /* is buffer dynamic? */ + OSBOOL aligned; /* is buffer byte aligned? */ +} OSRTBuffer; + +typedef OSUINT32 OSRTFLAGS; + +/** + * @struct OSRTBufSave rtxContext.h + * Structure to save the current message buffer state + * + * This structure is used to save the current state of the buffer. + */ +typedef struct { + size_t byteIndex; /* byte index */ + OSINT16 bitOffset; /* current bit offset (8 - 1) */ + OSRTFLAGS flags; /* flag bits */ +} OSRTBufSave; + +/* OSRTCTXT flag mask values : bits 32 - 16 are for common flags, bits */ +/* 15 - 0 are reserved for application specific flags */ + +#define OSDIAG 0x80000000 /* diagnostic tracing enabled */ +#define OSTRACE 0x40000000 /* tracing enabled */ +#define OSDISSTRM 0x20000000 /* disable stream encode/decode */ +#define OSSAVEBUF 0x10000000 /* do not free dynamic encode buffer */ +#define OSNOSTRMBACKOFF 0x8000000 /* stream mark/reset funcs is not used */ + +struct OSCTXT; +/* + * OSRTFreeCtxtAppInfoPtr is a pointer to pctxt->pAppInfo free function, + * The pctxt->pAppInfo (pXMLInfo and pASN1Info) should contain the pointer + * to a structure and its first member should be a pointer to an appInfo + * free function. + */ +typedef int (*OSFreeCtxtAppInfoPtr)(struct OSCTXT* pctxt); + +/* + * OSRTResetCtxtAppInfoPtr is a pointer to pctxt->pAppInfo reset function, + * The pctxt->pAppInfo (pXMLInfo and pASN1Info) should contain the pointer + * to a structure and its second member should be a pointer to appInfo reset + * function. + */ +typedef int (*OSResetCtxtAppInfoPtr)(struct OSCTXT* pctxt); + +/* + * OSRTFreeCtxtGlobalPtr is a pointer to a memory free function. + * This type describes the custom global memory free function generated by + * the compiler to free global nmemory. A pointer to a function of this + * type may be stored in the context gblFreeFunc field in order to free + * global data (pGlobalData) when rtxFreeContext is called. + */ +typedef void (*OSFreeCtxtGlobalPtr)(struct OSCTXT* pctxt); + +/** + * @struct OSCTXT rtxContext.h + * Run-time context structure + * + * This structure is a container structure that holds all working + * variables involved in encoding or decoding a message. + */ +typedef struct OSCTXT { /* run-time context block */ + void* pMemHeap; /* internal message memory heap */ + OSRTBuffer buffer; /* data buffer */ + OSRTBufSave savedInfo; /* saved buffer info */ + OSRTErrInfoList errInfo; /* run-time error info */ + OSUINT32 initCode; /* code double word to indicate init */ + OSRTFLAGS flags; /* flag bits */ + OSOCTET level; /* nesting level */ + OSOCTET state; /* encode/decode process state */ + OSOCTET diagLevel; /* diagnostic trace level */ + OSOCTET spare[1]; /* word boundary padding */ + struct OSRTSTREAM* pStream; /* Stream */ + struct OSRTPrintStream *pPrintStrm; /* Print Stream */ + OSRTDList elemNameStack; /* element name stack */ + OSRTDList regExpCache; /* compiled regular expression cache */ + const OSOCTET* key; /* pointer to run-time key data */ + size_t keylen; /* run-time key length */ + OSVoidPtr pXMLInfo; /* XML specific info */ + OSVoidPtr pASN1Info; /* ASN.1 specific info */ + OSVoidPtr pEXIInfo; /* EXI specific info */ + OSVoidPtr pUserData; /* User defined data */ + OSVoidPtr pGlobalData; /* Global constant data */ + OSFreeCtxtGlobalPtr gblFreeFunc; /* Global free function */ +} OSCTXT; + +#define OSRT_GET_FIRST_ERROR_INFO(pctxt) \ +(((pctxt)->errInfo.list.head == 0) ? (OSRTErrInfo*)0 : \ +(OSRTErrInfo*)((pctxt)->errInfo.list.head->data)) + +#define OSRT_GET_LAST_ERROR_INFO(pctxt) \ +(((pctxt)->errInfo.list.tail == 0) ? (OSRTErrInfo*)0 : \ +(OSRTErrInfo*)((pctxt)->errInfo.list.tail->data)) + +/** + * @} + */ +#define OSRTISSTREAM(pctxt) \ +((pctxt)->pStream != 0 && !((pctxt)->flags & OSDISSTRM)) + +#define OSRTBUFSAVE(pctxt) { \ +(pctxt)->savedInfo.byteIndex = (pctxt)->buffer.byteIndex; \ +(pctxt)->savedInfo.flags = (pctxt)->flags; } + +#define OSRTBUFRESTORE(pctxt) { \ +(pctxt)->buffer.byteIndex = (pctxt)->savedInfo.byteIndex; \ +(pctxt)->flags = (pctxt)->savedInfo.flags; } + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxCtxt Context Management Functions + * @{ + * + * Context initialization functions handle the allocation, initialization, and + * destruction of context variables (variables of type OSCTXT). These variables + * hold all of the working data used during the process of encoding or decoding + * a message. The context provides thread safe operation by isolating what + * would otherwise be global variables within this structure. The context + * variable is passed from function to function as a message is encoded or + * decoded and maintains state information on the encoding or decoding process. + */ +/** + * This function initializes an OSCTXT block. It sets all key working + * parameters to their correct initial state values. It is required that this + * function be invoked before using a context variable. + * + * @param pctxt Pointer to the context structure variable to be + * initialized. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxInitContext (OSCTXT* pctxt); + +/** + * This function initializes a context for use in a thread. It is the + * same as rtxInitContext except that it copies the pointer to constant + * data from the given source context into the newly initialized thread + * context. It is assumed that the source context has been initialized + * and the custom generated global initialization function has been + * called. The main purpose of this function is to prevent multiple + * copies of global static data from being created within different + * threads. + * + * @param pctxt Pointer to the context structure variable to be + * initialized. + * @param pSrcCtxt Pointer to source context which has been fully + * initialized including a pointer to global + * constant data initialized via a call to a + * generated 'Init_<project>_Global' function. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxInitThreadContext (OSCTXT* pctxt, const OSCTXT* pSrcCtxt); + +/** + * This function assigns a message buffer to a context block. The block + * should have been previously initialized by rtxInitContext. + * + * @param pctxt The pointer to the context structure variable to be + * initialized. + * @param bufaddr For encoding, the address of a memory buffer to receive + * the encoded message. If this address is NULL (0), + * encoding to a dynamic buffer will be done. For + * decoding, the address of a buffer that contains the + * message data to be decoded. + * @param bufsiz The size of the memory buffer. For encoding, this + * argument may be set to zero to indicate a dynamic + * memory buffer should be used. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxInitContextBuffer (OSCTXT* pctxt, + OSOCTET* bufaddr, + size_t bufsiz); + +/** + * This function is used to set the internal buffer pointer for + * in-memory encoding or decoding. It must be called after the + * context variable is initialized before any other compiler generated + * or run-time library encode function. + * + * @param pctxt Pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * + * @param bufaddr A pointer to a memory buffer to use to encode a + * message or that holds a message to be decoded. + * The buffer should be declared as an array + * of unsigned characters (OCTETs). This parameter + * can be set to NULL to specify dynamic encoding (i.e., + * the encode functions will dynamically allocate a + * buffer to hold the encoded message). + * + * @param bufsiz The length of the memory buffer in bytes. Should + * be set to zero if NULL was specified for bufaddr + * (i.e. dynamic encoding was selected). + */ +EXTERNRT int rtxCtxtSetBufPtr +(OSCTXT* pctxt, OSOCTET* bufaddr, size_t bufsiz); + +/** + * This macro returns the start address of an encoded message. + * If a static buffer was used, this is simply the start address of + * the buffer. If dynamic encoding was done, this will return the + * start address of the dynamic buffer allocated by the encoder. + * + * Note that this macro will not work with ASN.1 BER in-memory encoding. + * In this case, the BER-specific version of the function must be used. + * + * @param pctxt Pointer to a context structure. + */ +#define rtxCtxtGetMsgPtr(pctxt) (pctxt)->buffer.data + +/** + * This macro returns the length of an encoded message. + * + * Note that this macro will not work with ASN.1 BER in-memory encoding. + * In this case, the BER-specific version of the function must be used. + * + * @param pctxt Pointer to a context structure. + */ +#define rtxCtxtGetMsgLen(pctxt) (pctxt)->buffer.byteIndex + +/** + * This function verifies that the given context structure is + * initialized and ready for use. + * + * @param pctxt Pointer to a context structure. + * @return Completion status of operation: + * - 0 = success, + * - RTERR_NOTINIT status code if not initialized + */ +EXTERNRT int rtxCheckContext (OSCTXT* pctxt); + +/** + * This function frees all dynamic memory associated with a context. This + * includes all memory allocated using the rtxMem functions using the given + * context parameter. + * + * @param pctxt Pointer to a context structure. + */ +EXTERNRT void rtxFreeContext (OSCTXT* pctxt); + +/* + * This function creates a copy of a context structure. The copy is a "shallow + * copy" (i.e. new copies of dynamic memory blocks held within the context are + * not made, only the pointers are transferred to the new context structure). + * This function is mainly for use from within compiler-generated code. + * + * @param pdest - Context structure to which data is to be copied. + * @param psrc - Context structure from which data is to be copied. + */ +EXTERNRT void rtxCopyContext (OSCTXT* pdest, OSCTXT* psrc); + +/** + * This function is used to set a processing flag within the context structure. + * + * @param pctxt - A pointer to a context structure. + * @param mask - Mask containing bit(s) to be set. + */ +EXTERNRT void rtxCtxtSetFlag (OSCTXT* pctxt, OSUINT32 mask); + +/** + * This function is used to clear a processing flag within the context + * structure. + * + * @param pctxt - A pointer to a context structure. + * @param mask - Mask containing bit(s) to be cleared. + */ +EXTERNRT void rtxCtxtClearFlag (OSCTXT* pctxt, OSUINT32 mask); + +/** + * This macro tests if the given bit flag is set in the context. + * + * @param pctxt - A pointer to a context structure. + * @param mask - Bit flag to be tested + */ +#define rtxCtxtTestFlag(pctxt,mask) ((pctxt->flags & mask) != 0) + +/** + * This function is used to push an element name onto the context + * element name stack. + * + * @param pctxt Pointer to a context structure. + * @param elemName Name of element to be pushed on stack. Note that + * a copy of the name is not made, the pointer to + * the name that is passed is stored. + * @return Completion status of operation: + * - 0 = success, + * - RTERR_NOMEM if mem alloc for name fails. + */ +EXTERNRT int rtxCtxtPushElemName (OSCTXT* pctxt, const OSUTF8CHAR* elemName); + +/** + * This function pops the last element name from the context stack. + * + * @param pctxt Pointer to a context structure. + * @return Element name popped from stack or NULL if stack + * is empty. + */ +EXTERNRT const OSUTF8CHAR* rtxCtxtPopElemName (OSCTXT* pctxt); + +EXTERNRT int rtxPreInitContext (OSCTXT* pctxt); +#if 0 +EXTERNRT void rtxResetContext (OSCTXT* pctxt); +#endif +EXTERNRT void rtxMemFreeOpenSeqExt +(OSCTXT* pctxt, struct OSRTDList *pElemList); + +/* + * This function sets flags to a heap. May be used to control the heap's + * behavior. + * + * @param pctxt Pointer to a memory block structure that contains the + * list of dynamic memory block maintained by these + * functions. + * @param flags The flags. + */ +EXTERNRT void rtxMemHeapSetFlags (OSCTXT* pctxt, OSUINT32 flags); + +/* + * This function clears memory heap flags. + * + * @param pctxt Pointer to a memory block structure that contains the + * list of dynamic memory block maintained by these + * functions. + * @param flags The flags + */ +EXTERNRT void rtxMemHeapClearFlags (OSCTXT* pctxt, OSUINT32 flags); + +/* + * This function sets the minimum size and the granularity of memory blocks + * in memory heap for the context. + * + * @param pctxt Pointer to a context block. + * @param blkSize The currently used minimum size and the granularity of + * memory blocks. + */ +EXTERNRT void rtxMemHeapSetDefBlkSize (OSCTXT* pctxt, OSUINT32 blkSize); + +/* + * This function returns the actual granularity of memory blocks in the + * context. + * + * @param pctxt Pointer to a context block. + */ +EXTERNRT OSUINT32 rtxMemHeapGetDefBlkSize (OSCTXT* pctxt); + + +#ifdef __cplusplus +} +#endif +/** + * @} rtxCtxt +*/ +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCtype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxCtype.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,49 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxCtype.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXCTYPE_H_ +#define _RTXCTYPE_H_ + +/* Ctype substitution macros */ + +#define OS_ISASCII(c) ((unsigned)(c) < 0x80) + +#define OS_ISUPPER(c) (c >= 'A' && c <= 'Z') +#define OS_ISLOWER(c) (c >= 'a' && c <= 'z') +#define OS_ISDIGIT(c) (c >= '0' && c <= '9') +#define OS_ISALPHA(c) (OS_ISUPPER(c) || OS_ISLOWER(c)) +#define OS_ISSPACE(c) ((c >= 0x09 && c <= 0x0d) || (c == ' ')) +#define OS_ISPUNCT(c) (c >= 0 && c <= 0x20) +#define OS_ISALNUM(c) (OS_ISALPHA(c) || OS_ISDIGIT(c)) +#define OS_ISPRINT(c) (c >= ' ' && c <= '~') +#define OS_ISGRAPH(c) (c >= '!' && c <= '~') +#define OS_ISCNTRL(c) ((c >= 0 && c <= 0x1F) || c == 0x7F) +#define OS_ISXDIGIT(c) \ +(OS_ISDIGIT(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) + +#define OS_TOLOWER(c) (OS_ISUPPER(c) ? (c) - 'A' + 'a' : (c)) +#define OS_TOUPPER(c) (OS_ISLOWER(c) ? (c) - 'a' + 'A' : (c)) + +#endif /* _RTXCTYPE_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDList.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,435 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxDList.h + * Doubly-Linked List Utility Functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXDLIST_H_ +#define _RTXDLIST_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" +#include "rtxsrc/rtxCommonDefs.h" +/** + * @defgroup ccfDList Doubly-Linked List Utility Functions + * + * The doubly-linked list utility functions provide common routines for + * managing linked lists. These lists are used to model XSD list and + * repeating element types within the generated code. This list type + * contains forward and backward pointers allowing the list to be + * traversed in either direction. + *@{ + */ + +/** + * @struct OSRTDListNode + * This structure is used to hold a single data item within the list. + * It contains a void pointer to point at any type of data item and + * forward and backward pointers to the next and previous entries in + * the list. + */ +typedef struct OSRTDListNode { + void* data; /**< Pointer to list data item. */ + struct OSRTDListNode* next; /**< Pointer to next node in list. */ + struct OSRTDListNode* prev; /**< Pointer to previous node in list. */ +} OSRTDListNode; + +/** + * @struct OSRTDList + * This is the main list structure. It contains a count of the number + * of elements in the list and pointers to the list head and tail + * elements. + */ +typedef struct OSRTDList { + OSUINT32 count; /**< Count of items in the list. */ + OSRTDListNode* head; /**< Pointer to first entry in list. */ + OSRTDListNode* tail; /**< Pointer to last entry in list. */ +} OSRTDList; + +struct OSCTXT; + +typedef struct OSRTDListBuf { + OSUINT32 n; + OSUINT32 nMax; + OSUINT32 nAll; + OSUINT32 firstSegSz; + size_t elemSize; + OSRTDList tmplist; + void** dataArray; +} OSRTDListBuf; + +#ifndef DLISTBUF_SEG +#define DLISTBUF_SEG 16 +#endif + +typedef struct OSRTDListUTF8StrNode { + OSRTDListNode node; + OSUTF8CHAR utf8chars[1]; +} OSRTDListUTF8StrNode; + +#ifdef __cplusplus +extern "C" { +#endif + +/* Doubly-linked list functions */ + +/** + * This function initializes a doubly linked list structure. It sets the + * number of elements to zero and sets all internal pointer values to NULL. + * A doubly linked-list structure is described by the \c OSRTDList type. + * Nodes of the list are of type \c OSRTDListNode. + * + *

Memory for the structures is allocated using the \c rtxMemAlloc + * run-time function and is maintained within the context structure that + * is a required parameter to all rtDList functions. This memory is + * released when \c rtxMemFree is called or the context is released. + * Unless otherwise noted, all data passed into the list functions is + * simply stored on the list by value (i.e. a deep-copy of the data is + * not done). + * + * @param pList A pointer to a linked list structure to be initialized. + */ +EXTERNRT void rtxDListInit (OSRTDList* pList); + +/** + * This function appends an item to the linked list structure. The data + * item is passed into the function as a void pointer that can point to + * an object of any type. The \c rtxMemAlloc function is used to allocate + * memory for the list node structure; therefore, all internal list memory + * will be released whenever \c rtxMemFree is called. The pointer + * to the data item itself is stored in the node structure - a copy is + * not made. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pList A pointer to a linked list structure onto which the + * data item will be appended. + * @param pData A pointer to the data item to be appended to the list. + * @return A pointer to an allocated node structure used to link + * the given data value into the list. + */ +EXTERNRT OSRTDListNode* rtxDListAppend +(struct OSCTXT* pctxt, OSRTDList* pList, void* pData); + +EXTERNRT OSRTDListNode* rtxDListAppendNode +(OSRTDList* pList, OSRTDListNode* pListNode); + +/** + * This function inserts an item into the linked list structure. The data + * item is passed into the function as a void pointer that can point to an + * object of any type. The \c rtxMemAlloc function is used to allocate + * memory for the list node structure; therefore, all internal list memory + * will be released when the \c rtxMemFree function is called. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pList A pointer to a linked list structure into which the + * data item is to be inserted. + * @param index Zero-based index into list where the specified item + * is to be inserted. + * @param pData A pointer to the data item to be inserted to the list. + * @return A pointer to an allocated node structure used to + * link the given data value into the list. + */ +EXTERNRT OSRTDListNode* rtxDListInsert +(struct OSCTXT* pctxt, OSRTDList* pList, OSUINT32 index, void* pData); + +EXTERNRT OSRTDListNode* rtxDListInsertNode +(OSRTDList* pList, OSUINT32 index, OSRTDListNode* pListNode); + +/** + * This function inserts an item into the linked list structure before the + * specified element. The \c rtxMemAlloc function is used to allocate + * memory for the list node structure; therefore, all internal list memory + * will be released when the \c rtxMemFree function is called. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pList A pointer to a linked list structure into which the + * data item is to be inserted. + * @param node The position in the list where the item is to be + * inserted. The item will be inserted before this + * node or appended to the list if node is null. + * @param pData A pointer to the data item to be inserted to the list. + * @return A pointer to an allocated node structure used to + * link the given data value into the list. + */ +EXTERNRT OSRTDListNode* rtxDListInsertBefore +(struct OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node, void* pData); + +/** + * This function inserts an item into the linked list structure after the + * specified element. The \c rtxMemAlloc function is used to allocate + * memory for the list node structure; therefore, all internal list memory + * will be released when the \c rtxMemFree function is called. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pList A pointer to a linked list structure into which the + * data item is to be inserted. + * @param node The position in the list where the item is to be + * inserted. The item will be inserted after this + * node or added as the head element if node is null. + * @param pData A pointer to the data item to be inserted to the list. + * @return A pointer to an allocated node structure used to + * link the given data value into the list. + */ +EXTERNRT OSRTDListNode* rtxDListInsertAfter +(struct OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node, void* pData); + +/** + * This function will return the node pointer of the indexed entry in + * the list. + * + * @param pList A pointer to a linked list structure. + * @param index Zero-based index into list where the specified item + * is located. If the list contains fewer items + * then the index, NULL is returned. + * @return A pointer to an allocated linked list node structure. + * To get the actual data item, the \c data member + * variable pointer within this structure must be + * dereferenced. + */ +EXTERNRT OSRTDListNode* +rtxDListFindByIndex (const OSRTDList* pList, OSUINT32 index); + +/** + * This function will return the node pointer of the given data item + * within the list or NULL if the item is not found. + * + * @param pList A pointer to a linked list structure. + * @param data Pointer to the data item to search for. Note that + * comparison of pointer values is done; not the items + * pointed at by the pointers. + * @return A pointer to an allocated linked list node structure. + */ +EXTERNRT OSRTDListNode* +rtxDListFindByData (const OSRTDList* pList, void* data); + +/** + * This function will return the index of the given data item + * within the list or -1 if the item is not found. + * + * @param pList A pointer to a linked list structure. + * @param data Pointer to the data item to search for. Note that + * comparison of pointer values is done; not the items + * pointed at by the pointers. + * @return Index of item within the list or -1 if not found. + */ +EXTERNRT int rtxDListFindIndexByData (const OSRTDList* pList, void* data); + +/** + * This function will remove the given node from the list and free memory. + * The data memory is not freed. It might be released when the \c rtxMemFree + * or \c rtFreeContext function is called with this context. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to a linked list structure. + * @param node Pointer to the list node to be removed. + */ +EXTERNRT void rtxDListFreeNode + (struct OSCTXT* pctxt, OSRTDList* pList, OSRTDListNode* node); + +/** + * This function will remove the given node from the list. The node + * memory is not freed. It will be released when the \c rtxMemFree + * or \c rtFreeContext function is called with this context. + * + * @param pList A pointer to a linked list structure. + * @param node Pointer to the list node to be removed. + */ +EXTERNRT void rtxDListRemove (OSRTDList* pList, OSRTDListNode* node); + +/** + * This function will free all of the dynamic memory used to hold + * the list node pointers. It does not free the data items because + * it is unknown how the memory was allocated for these items. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to a linked list structure. + */ +EXTERNRT void rtxDListFreeNodes (struct OSCTXT* pctxt, OSRTDList* pList); + +/** + * This function will free all of the dynamic memory used to hold + * the list node pointers and the data items. In this case, it is + * assumed that the \c rtxMemAlloc function was used to allocate + * memory for the data items. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to a linked list structure. + */ +EXTERNRT void rtxDListFreeAll (struct OSCTXT* pctxt, OSRTDList* pList); + +/** + * This function converts a doubly linked list to an array. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to a linked list structure. + * @param ppArray A pointer to a pointer to the destination array. + * @param pElemCount A pointer to the number of elements already + * allocated in \c ppArray. If pElements is NULL, or + * pElements is less than the number of nodes + * in the list, then a new array is allocated + * and the pointer is stored in \c ppArray. + * Memory is allocated via calls to the \c rtxMemAlloc + * function. + * @param elemSize The size of one element in the array. Use the + * \c sizeof() operator to pass this parameter. + * @return The number of elements in the returned array. + */ +EXTERNRT int rtxDListToArray +(struct OSCTXT* pctxt, OSRTDList* pList, void** ppArray, + OSUINT32* pElemCount, size_t elemSize); + +/** + * This function appends pointers to items in the given array to a doubly + * linked list structure. The array is assumed to hold an array of + * values as opposed to pointers. The actual address of each item in + * the array is stored - a copy of each item is not made. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to the linked list structure onto which + * the array items will be appended. + * @param pArray A pointer to the source array to be converted. + * @param numElements The number of elements in the array. + * @param elemSize The size of one element in the array. Use the + * \c sizeof() operator to pass this parameter. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxDListAppendArray +(struct OSCTXT* pctxt, OSRTDList* pList, void* pArray, + OSUINT32 numElements, size_t elemSize); + +/** + * This function appends a copy of each item in the given array to a doubly + * linked list structure. In this case, the \c rtxMemAlloc function is + * used to allocate memory for each item and a copy is made. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to the linked list structure onto which + * the array items will be appended. + * @param pArray A pointer to the source array to be converted. + * @param numElements The number of elements in the array. + * @param elemSize The size of one element in the array. Use the + * \c sizeof() operator to pass this parameter. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxDListAppendArrayCopy +(struct OSCTXT* pctxt, OSRTDList* pList, const void* pArray, + OSUINT32 numElements, size_t elemSize); + +/** + * This function concatanates all of the components in the given list + * to form a UTF-8 string. The list is assumed to contain null-terminated + * character string components. The given separator chraacter is + * inserted after each list component. The \c rtxMemAlloc function is + * used to allocate memory for the output string. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to the linked list structure onto which + * the array items will be appended. + * @param ppstr A pointer to a char pointer to hold output string. + * @param sep Separator character to add between string components. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxDListToUTF8Str +(struct OSCTXT* pctxt, OSRTDList* pList, OSUTF8CHAR** ppstr, char sep); + + + +typedef int (*PEqualsFunc) (const void* a, const void* b, + const void* sortCtxt); + +EXTERNRT OSRTDListNode* rtxDListInsertSorted +(struct OSCTXT* pctxt, OSRTDList* pList, void* pData, PEqualsFunc equalsFunc, + void* sortCtxt); + +EXTERNRT OSRTDListNode* rtxDListInsertNodeSorted +(OSRTDList* pList, OSRTDListNode* pListNode, PEqualsFunc equalsFunc, + void* sortCtxt); + +/** + * @} + */ +#if defined(_MSC_VER) +// this disables 'conditional expression is constant' warnings +// caused by using do { ... } while(0) in defines. +#pragma warning(disable: 4127) +#endif + +/* This rounds node size up to a 64-bit boundary to fix alignment issues */ +#define OSRTDLISTNODESIZE ((sizeof(OSRTDListNode)+7)&(~7)) + +#define rtxDListAllocNodeAndData(pctxt,type,ppnode,ppdata) do { \ +*ppnode = (OSRTDListNode*) \ +rtxMemAlloc (pctxt, sizeof(type)+OSRTDLISTNODESIZE); \ +if (0 != *ppnode) { \ +(*ppnode)->data = (void*)((char*)(*ppnode)+OSRTDLISTNODESIZE); \ +*ppdata = (type*)((*ppnode)->data); \ +} else { *ppdata = 0; } \ +} while (0) + +#define rtxDListAppendData(pctxt,pList,pData) do { \ +OSRTDListNode* _node = (OSRTDListNode*) \ +(((char*)(pData)) - sizeof(OSRTDListNode)); \ +_node->data = pData; \ +rtxDListAppendNode (pList, _node); \ +} while (0); + +#define rtxDListFastInit(pList) do { \ +if ((pList) != 0) { \ +(pList)->head = (pList)->tail = (OSRTDListNode*) 0; \ +(pList)->count = 0; } \ +} while (0) + +#define rtxDListFreeTailNode(pctxt,pList) \ +rtxDListFreeNode(pctxt,pList,(pList)->tail) + +#define rtxDListFreeHeadNode(pctxt,pList) \ +rtxDListFreeNode(pctxt,pList,(pList)->head) + +/* Doubly-linked list buffer functions */ + +EXTERNRT void rtxDListBufInit (OSRTDListBuf* pBuf, + OSUINT32 segSz, void** ppdata, size_t elemSz); + +EXTERNRT int rtxDListBufExpand (struct OSCTXT* pctxt, OSRTDListBuf* pBuf); + +EXTERNRT int rtxDListBufToArray (struct OSCTXT* pctxt, OSRTDListBuf* pBuf); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDateTime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDateTime.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,582 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxDateTime.h + * Common runtime functions for converting to and from various standard + * date/time formats. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXDATETIME_H_ +#define _RTXDATETIME_H_ + +#include +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup ccfDateTime Date/time conversion functions + * @{ + * + * These functions handle the conversion of date/time to and from various + * internal formats to XML schema standard string forms. + */ +/** + * This function formats a numeric date value consisting of individual date + * components (year, month, day) into XML schema standard format (CCYY-MM-DD). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * date components to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is at least nine bytes long to hold the formatted + * date and a null-terminator character. + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + *

    + *
  • 0(RT_OK) = success,
  • + *
  • negative return value is error
  • + *
+ */ +EXTERNRT int rtxDateToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function formats a numeric time value consisting of individual time + * components (hour, minute, second, fraction-of-second, time zone) into + * XML schema standard format (HH:MM:SS[.frac][TZ]). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * time components to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is large enough to hold the formatted time string. + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxTimeToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function formats a numeric date/time value of all components + * in the OSNumDateTime structure into XML schema standard format + * (CCYY-MM-DDTHH:MM:SS[.frac][TZ]). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * date/time components to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is large enough to hold the formatted time string. + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxDateTimeToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function formats a gregorian year value to a string (CCYY). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * year value to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is large enough to hold the formatted time string + * (in this case, at least 5 characters long). + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxGYearToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function formats a gregorian year and month value to a string + * (CCYY-MM). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * year and month value to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is large enough to hold the formatted time string + * (in this case, at least 8 characters long). + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxGYearMonthToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function formats a gregorian month value to a string (MM). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * month value to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is large enough to hold the formatted time string + * (in this case, at least 3 characters long). + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxGMonthToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function formats a gregorian month and day value to a string + * (MM-DD). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * month and day value to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is large enough to hold the formatted time string + * (in this case, at least 6 characters long). + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxGMonthDayToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function formats a gregorian day value to a string (DD). + * + * @param pvalue Pointer to OSNumDateTime structure containing + * day value to be formatted. + * @param buffer Buffer into which date is to be formatted. This is + * a fixed-sized buffer. The user must provide a buffer + * that is large enough to hold the formatted time string + * (in this case, at least 3 characters long). + * @param bufsize Size of the buffer to receive the formatted date. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxGDayToString + (const OSNumDateTime* pvalue, OSUTF8CHAR* buffer, size_t bufsize); + +/** + * This function reads the system date and time and stores the value in + * the given OSNumDateTime structure variable. + * + * @param pvalue Pointer to OSNumDateTime structure. + * @return Completion status of operation: + * - 0 in case success + * - negative in case failure + */ +EXTERNRT int rtxGetCurrDateTime (OSNumDateTime* pvalue); + +/** + * This function compares the date part of two OSNumDateTime structures and + * returns the result of the comparison. + * + * @param pvalue1 Pointer to OSNumDateTime structure. + * @param pvalue2 Pointer to OSNumDateTime structure. + * @return Completion status of operation: + * - 0 Dates are same + * - +1 First Date/Time is greater than second. + * - -1 First Date/Time is less than second. + */ +EXTERNRT int rtxCmpDate + (const OSNumDateTime* pvalue1, const OSNumDateTime* pvalue2); + +/** + * This function compares the date part of OSNumDateTime structure and + * date components, specified as parameters. + * + * @param pvalue Pointer to OSNumDateTime structure. + * @param year Year (-inf..inf) + * @param mon Month (1..12) + * @param day Day (1..31) + * @param tzflag TRUE, if time zone offset is set (see tzo parameter). + * @param tzo Time zone offset (-1440..1440). + * @return Completion status of operation: + * - 0 Dates are same + * - +1 First Date/Time is greater than second. + * - -1 First Date/Time is less than second. + */ +EXTERNRT int rtxCmpDate2 + (const OSNumDateTime* pvalue, + OSINT32 year, OSUINT8 mon, OSUINT8 day, OSBOOL tzflag, OSINT32 tzo); + +/** + * This function compares the time part of two OSNumDateTime structures and + * returns the result of the comparison. + * + * @param pvalue1 Pointer to OSNumDateTime structure. + * @param pvalue2 Pointer to OSNumDateTime structure. + * @return Completion status of operation: + * - 0 Times are same + * - +1 First Date/Time is greater than second. + * - -1 First Date/Time is less than second. + */ +EXTERNRT int rtxCmpTime + (const OSNumDateTime* pvalue1, const OSNumDateTime* pvalue2); + +/** + * This function compares the time part of OSNumDateTime structure and + * time components, specified as parameters. + * + * @param pvalue Pointer to OSNumDateTime structure. + * @param hour Hour (0..23) + * @param min Minutes (0..59) + * @param sec Seconds (0.0..59.(9)) + * @param tzflag TRUE, if time zone offset is set (see tzo parameter). + * @param tzo Time zone offset (-1440..1440). + * @return Completion status of operation: + * - 0 Times are same + * - +1 First Date/Time is greater than second. + * - -1 First Date/Time is less than second. + */ +EXTERNRT int rtxCmpTime2 + (const OSNumDateTime* pvalue, + OSUINT8 hour, OSUINT8 min, OSREAL sec, OSBOOL tzflag, OSINT32 tzo); + +/** + * This function compares two OSNumDateTime structures and + * returns the result of the comparison. + * + * @param pvalue1 Pointer to OSNumDateTime structure. + * @param pvalue2 Pointer to OSNumDateTime structure. + * @return Completion status of operation: + * - 0 Dates are same + * - +1 First Date/Time is greater than second. + * - -1 First Date/Time is less than second. + */ +EXTERNRT int rtxCmpDateTime + (const OSNumDateTime* pvalue1, const OSNumDateTime* pvalue2); + +/** + * This function compares the OSNumDateTime structure and + * dateTime components, specified as parameters. + * + * @param pvalue Pointer to OSNumDateTime structure. + * @param year Year (-inf..inf) + * @param mon Month (1..12) + * @param day Day (1..31) + * @param hour Hour (0..23) + * @param min Minutes (0..59) + * @param sec Seconds (0.0..59.(9)) + * @param tzflag TRUE, if time zone offset is set (see tzo parameter). + * @param tzo Time zone offset (-1440..1440). + * @return Completion status of operation: + * - 0 Dates are same + * - +1 First Date/Time is greater than second. + * - -1 First Date/Time is less than second. + */ +EXTERNRT int rtxCmpDateTime2 + (const OSNumDateTime* pvalue, + OSINT32 year, OSUINT8 mon, OSUINT8 day, + OSUINT8 hour, OSUINT8 min, OSREAL sec, OSBOOL tzflag, OSINT32 tzo); + +/** + * This function decodes a date value from a supplied string and sets the + * given OSNumDateTime argument to the decoded date value. + * + * @param inpdata Date string to be parsed/decoded as OSNumDateTime.
    + *
  • The format of date is CCYY-MM-DD
  • + *
  • The value of CCYY is from 0000-9999
  • + *
  • The value of MM is 01 - 12
  • + *
  • The value of DD is 01 - XX + * (where XX is the Days in MM month in CCYY year)
  • + *
+ * @param inpdatalen For decoding, consider inpdata string up to this length. + * @param pvalue The OSNumDateTime structure variable will be set + * to the decoded date value. + * - Only year, month,day value will be set. + * - The value of pvalue->year is in range 0 to 9999 + * - The value of pvalue->mon is in range 1 to 12 + * - The value of pvalue->day is in range 1 to XX + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseDateString +(const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + +/** + * This function decodes a time value from a supplied string and sets the + * given OSNumDateTime structure to the decoded time value. + * + * @param inpdata The inpdata is a time string to be parsed/decoded as + * OSNumDateTime. + * - The format of date is hh:mm:ss.ss (1) + * or hh:mm:ss.ssZ (2) + * or hh:mm:ss.ss+HH:MM (3) + * or hh:mm:ss.ss-HH:MM (4) + * - The value of hh is from 00-23 + * - The value of mm is 00 - 59 + * - The value of ss.ss is 00.00 - 59.99 + * - The value of HH:MM is 00.00 - 24.00 + * @param inpdatalen For decoding, consider the inpdata string up to + * this length. + * @param pvalue The OSNumDateTime structure variable will be + * set to the decoded time value. + * - Only hour, min, sec value will be set. + * - The value of pvalue->hour is in range 0 to 23 + * - The value of pvalue->mon is in range 0 to 59 + * - The value of pvalue->day is in range 0 to 59.99 + * - The value of pvalue->tz_flag is FALSE for + * format(1) otherwise TRUE + * - The value of pvalue->tzo is 0 for format(2) + * otherwise Calculation of pvalue->tzo for + * format (3),(4) is HH*60+MM + * - The value of pvalue->tzo is -1440 <= tzo <= 1440 for + * format(3),(4) otherwise + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseTimeString +(const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + + +/** + * This function decodes a datetime value from a supplied string and sets the + * given OSNumDateTime to the decoded date and time value. + * + * @param inpdata Input date/time string to be parsed. + * @param inpdatalen For decoding, consider the inpdata string up to this + * length. + * @param pvalue The pointed OSNumDateTime structure variable will be + * set to the decoded date and time value. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseDateTimeString + (const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + +/** + * This function decodes a gregorian year value from a supplied string + * and sets the year in the given OSNumDateTime to the decoded value. + * + * @param inpdata Input string to be parsed. + * @param inpdatalen For decoding, consider the inpdata string up to this + * length. + * @param pvalue The year field in the given OSNumDateTime structure + * variable will be set to the decoded value. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseGYearString + (const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + +/** + * This function decodes a gregorian year and month value from a supplied + * string and sets the year and month fields in the given OSNumDateTime to the + * decoded values. + * + * @param inpdata Input string to be parsed. + * @param inpdatalen For decoding, consider the inpdata string up to this + * length. + * @param pvalue The year and month fields in the given OSNumDateTime + * variable will be set to the decoded value. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseGYearMonthString + (const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + +/** + * This function decodes a gregorian month value from a supplied + * string and sets the month field in the given OSNumDateTime to the + * decoded value. + * + * @param inpdata Input string to be parsed. + * @param inpdatalen For decoding, consider the inpdata string up to this + * length. + * @param pvalue The month field in the given OSNumDateTime + * variable will be set to the decoded value. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseGMonthString + (const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + +/** + * This function decodes a gregorian month and day value from a supplied + * string and sets the month and day fields in the given OSNumDateTime to the + * decoded values. + * + * @param inpdata Input string to be parsed. + * @param inpdatalen For decoding, consider the inpdata string up to this + * length. + * @param pvalue The month and day fields in the given OSNumDateTime + * variable will be set to the decoded values. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseGMonthDayString + (const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + +/** + * This function decodes a gregorian day value from a supplied + * string and sets the day field in the given OSNumDateTime to the + * decoded value. + * + * @param inpdata Input string to be parsed. + * @param inpdatalen For decoding, consider the inpdata string up to this + * length. + * @param pvalue The day field in the given OSNumDateTime + * variable will be set to the decoded value. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxParseGDayString + (const OSUTF8CHAR* inpdata, size_t inpdatalen, OSNumDateTime* pvalue); + +/** + * This function converts millisecs to a duration string with format + * "PnYnMnDTnHnMnS". In case of negative duration a minus sign is prepended + * to the output string + * @param msecs Number of milliseconds. + * @param buf Output buffer to recieve formatted duration. + * @param bufsize Output buffer size. + * @return Completion status of operation: + * 0 successful are same + * -1 unsuccessul + */ +EXTERNRT int rtxMSecsToDuration +(OSINT32 msecs, OSUTF8CHAR* buf, OSUINT32 bufsize); + +/** + * This function converts a duration string to milliseconds. In the case + * of a string prepended with a minus sign (-) the duration in milliseconds + * will have negative value. + * + * @param buf Pointer to OSUTF8CHAR array. + * @param bufsize OSINT32 indicates the bufsize to be read. + * @param msecs OSINT32 updated after calculation. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + * (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_TOOBIG). + * Return value is taken from rtxErrCodes.h header file + */ +EXTERNRT int rtxDurationToMSecs +(OSUTF8CHAR* buf, OSUINT32 bufsize, OSINT32* msecs); + +/** + * This function converts a structure of type 'struct tm' to an + * OSNumDateTime structure. + * + * @param pvalue The pointed OSNumDateTime structure variable will be + * set to time value. + * @param timeStruct A pointer to tm structure to be converted. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtxSetDateTime (OSNumDateTime* pvalue, struct tm* timeStruct); + +/** + * This function converts a local date and time value to an OSNumDateTime + * structure. + * + * @param pvalue The pointed OSNumDateTime structure variable will be + * set to time value. + * @param timeMs A calendar time encoded as a value of type time_t. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtxSetLocalDateTime (OSNumDateTime* pvalue, time_t timeMs); + +/** + * This function converts a UTC date and time value to an OSNumDateTime + * structure. + * + * @param pvalue The pointed OSNumDateTime structure variable will be + * set to time value. + * @param timeMs A calendar time encoded as a value of type time_t. + * The time is represented as seconds elapsed since + * midnight (00:00:00), January 1, 1970, coordinated + * universal time (UTC). + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtxSetUtcDateTime (OSNumDateTime* pvalue, time_t timeMs); + +/** + * This function converts an OSNumDateTime structure to a calendar time + * encoded as a value of type time_t. + * + * @param pvalue The pointed OSNumDateTime structure variable to be + * converted. + * @param timeMs A pointer to time_t value to be set. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error. + */ +EXTERNRT int rtxGetDateTime (const OSNumDateTime* pvalue, time_t* timeMs); + +/** + * This function verifies that all members of the OSNumDateTime structure + * contains valid values. + * + * @param pvalue Pointer to OSNumDateTime structure to be checked. + * @return Boolean result: true means data is valid. + */ +EXTERNRT OSBOOL rtxDateTimeIsValid (const OSNumDateTime* pvalue); + +/** + * @} ccfDateTime + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDecimal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDecimal.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,53 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxDecimal.h + * Common runtime functions for working with xsd:decimal numbers. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXDECIMAL_H_ +#define _RTXDECIMAL_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxDecimal Decimal number utility functions + * @{ + * Decimal utility function provide run-time functions for handling + * decimal number types defined within a schema. + */ +/* These need to be documented.. */ + +EXTERNRT const char* rtxNR3toDecimal (OSCTXT *pctxt, const char* object_p); + +/** + * @} rtxDecimal + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDiag.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDiag.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,227 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxDiag.h + * Common runtime functions for diagnostic tracing and debugging. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXDIAG_H_ +#define _RTXDIAG_H_ + +#include +#include "rtxsrc/rtxContext.h" +#include "rtxsrc/rtxPrintToStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Diagnostic trace functions */ +/** + * @defgroup ccfDiag Diagnostic trace functions + * @{ + * + * These functions add diagnostic tracing to the generated code to assist in + * finding where a problem might occur. Calls to these macros and functions are + * added when the \c -trace command-line argument is used. The diagnostic + * message can be turned on and off at both C compile and run-time. To C + * compile the diagnostics in, the _TRACE macro must be defined (-D_TRACE). To + * turn the diagnostics on at run-time, the \c rtxSetDiag function must be + * invoked with the \c value argument set to TRUE. + */ +#ifdef _TRACE +#define RTDIAG1(pctxt,msg) rtxDiagPrint(pctxt,msg) +#define RTDIAG2(pctxt,msg,a) rtxDiagPrint(pctxt,msg,a) +#define RTDIAG3(pctxt,msg,a,b) rtxDiagPrint(pctxt,msg,a,b) +#define RTDIAG4(pctxt,msg,a,b,c) rtxDiagPrint(pctxt,msg,a,b,c) +#define RTDIAG5(pctxt,msg,a,b,c,d) rtxDiagPrint(pctxt,msg,a,b,c,d) +#define RTDIAGU(pctxt,ucstr) rtxDiagPrintUCS(pctxt,ucstr) +#define RTHEXDUMP(pctxt,buffer,numocts) rtxDiagHexDump(pctxt,buffer,numocts) +#define RTDIAGCHARS(pctxt,buf,nchars) rtxDiagPrintChars(pctxt,buf,nchars) +#define RTDIAGSTRM2(pctxt,msg) rtxDiagStream(pctxt,msg) +#define RTDIAGSTRM3(pctxt,msg,a) rtxDiagStream(pctxt,msg,a) +#define RTDIAGSTRM4(pctxt,msg,a,b) rtxDiagStream(pctxt,msg,a,b) +#define RTDIAGSTRM5(pctxt,msg,a,b,c) rtxDiagStream(pctxt,msg,a,b,c) +#define RTHEXDUMPSTRM(pctxt,buffer,numocts) \ +rtxDiagStreamHexDump(pctxt,buffer,numocts) +#define RTDIAGSCHARS(pctxt,buf,nchars) \ +rtxDiagStreamPrintChars(pctxt,buf,nchars) +#else +#define RTDIAG1(pctxt,msg) +#define RTDIAG2(pctxt,msg,a) +#define RTDIAG3(pctxt,msg,a,b) +#define RTDIAG4(pctxt,msg,a,b,c) +#define RTDIAG5(pctxt,msg,a,b,c,d) +#define RTDIAGU(pctxt,ucstr) +#define RTHEXDUMP(pctxt,buffer,numocts) +#define RTDIAGCHARS(pctxt,buf,nchars) +#define RTDIAGSTRM2(pctxt,msg) +#define RTDIAGSTRM3(pctxt,msg,a) +#define RTDIAGSTRM4(pctxt,msg,a,b) +#define RTDIAGSTRM5(pctxt,msg,a,b,c) +#define RTHEXDUMPSTRM(pctxt,buffer,numocts) +#define RTDIAGSCHARS(pctxt,buf,nchars) +#endif + +typedef enum { + OSRTDiagError, + OSRTDiagWarning, + OSRTDiagInfo, + OSRTDiagDebug +} OSRTDiagTraceLevel; + +/** + * This function is used to determine if diagnostic tracing is currently + * enabled for the specified context. It returns true if enabled, false + * otherwise. + * + * @param pctxt Pointer to context structure. + * @return Boolean result. + */ +EXTERNRT OSBOOL rtxDiagEnabled (OSCTXT* pctxt); + +/** + * This function is used to turn diagnostic tracing on or off at run-time on + * a per-context basis. Code generated using ASN1C or XBinder or a similar + * code generator must use the -trace command line option to enable + * diagnostic messages. The generated code must then be C compiled with + * _TRACE defined for the code to be present. + * + * @param pctxt Pointer to context structure. + * @param value Boolean switch: TRUE turns tracing on, FALSE off. + * @return Prior setting of the diagnostic trace switch in the + * context. + */ +EXTERNRT OSBOOL rtxSetDiag (OSCTXT* pctxt, OSBOOL value); + +#ifndef __SYMBIAN32__ +/** + * This function is used to turn diagnostic tracing on or off at run-time on + * a global basis. It is similar to rtxSetDiag except tracing is enabled + * within all contexts. + * + * @param value Boolean switch: TRUE turns tracing on, FALSE off. + * @return Prior setting of the diagnostic trace switch in the + * context. + */ +EXTERNRT OSBOOL rtxSetGlobalDiag (OSBOOL value); +#endif + +/** + * This function is used to print a diagnostics message to \c stdout. Its + * parameter specification is similar to that of the C runtime \c printf + * method. The \c fmtspec argument may contain % style modifiers into which + * variable arguments are substituted. This function is called in the generated + * code vai the RTDIAG macros to allow diagnostic trace call to easily be + * compiled out of the object code. + * + * @param pctxt Pointer to context structure. + * @param fmtspec A printf-like format specification string describing the + * message to be printed (for example, "string %s, ivalue + * %d\n"). A special character sequence (~L) may be + * used at the beginning of the string to select a + * trace level (L would be replaced with E for Error, + * W for warning, I for info, or D for debug). + * @param ... Variable list of parameters to be substituted into + * the format string. + */ +EXTERNRT void rtxDiagPrint (OSCTXT* pctxt, const char* fmtspec, ...); + +/** + * This function conditionally outputs diagnostic trace messages to an output + * stream defined within the context. A code generator embeds calls to this + * function into the generated source code when the -trace option is specified + * on the command line (note: it may embed the macro version of these calls - + * RTDIAGSTREAMx - so that these calls can be compiled out of the final code. + * + * @see rtxDiagPrint + */ +EXTERNRT void rtxDiagStream (OSCTXT* pctxt, const char* fmtspec, ...); + +/** + * This function is used to print a diagnostics hex dump of a section of + * memory. + * + * @param pctxt Pointer to context structure. + * @param data Start address of memory to dump. + * @param numocts Number of bytes to dump. + */ +EXTERNRT void rtxDiagHexDump +(OSCTXT* pctxt, const OSOCTET* data, OSUINT32 numocts); + +/** + * This function is used to print a diagnostics hex dump of a section of + * memory to a print stream. + * + * @param pctxt Pointer to context structure. + * @param data Start address of memory to dump. + * @param numocts Number of bytes to dump. + */ +EXTERNRT void rtxDiagStreamHexDump +(OSCTXT* pctxt, const OSOCTET* data, OSUINT32 numocts); + +/** + * This function is used to print a given number of characters to + * standard output. The buffer containing the characters does not + * need to be null-terminated. + * + * @param pctxt Pointer to context structure. + * @param data Start address of character string. + * @param nchars Number of characters to dump + * (this assumes 1-byte chars). + */ +EXTERNRT void rtxDiagPrintChars +(OSCTXT* pctxt, const char* data, OSUINT32 nchars); + +/** + * This function is used to print a given number of characters to + * a print stream. The buffer containing the characters does not + * need to be null-terminated. + * + * @param pctxt Pointer to context structure. + * @param data Start address of character string. + * @param nchars Number of characters to dump + * (this assumes 1-byte chars). + */ +EXTERNRT void rtxDiagStreamPrintChars +(OSCTXT* pctxt, const char* data, OSUINT32 nchars); + +/** + * This function is used to set the maximum trace level for diagnostic + * trace messages. Values are ERROR, WARNING, INFO, or DEBUG. The + * special string start sequence (~L) described in rtxDiagPrint + * function documentation is used to set a message level to be compared + * with the trace level. + * + * @param pctxt Pointer to context structure. + * @param level Trace level to be set. + */ +EXTERNRT void rtxDiagSetTraceLevel (OSCTXT* pctxt, OSRTDiagTraceLevel level); + +/** + * @} ccfDiag + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDiagBitTrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDiagBitTrace.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,197 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxDiagBitTrace.h + * Common runtime functions for tracing bit patterns written to or read + * from a stream. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXDIAGBITTRACE_H_ +#define _RTXDIAGBITTRACE_H_ + +#include +#include "rtxsrc/rtxMemBuf.h" +#include "rtxsrc/rtxSList.h" +#include "rtxsrc/rtxPrintToStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup ccfDiag + */ +typedef struct { + const char* elemName; + const char* nameSuffix; + size_t bitOffset; + size_t numbits; +} OSRTDiagBitField; + +typedef struct { + OSUINT16 disabledCount; + OSRTSList fieldList; /* list of OSRTDiagBitField */ + OSRTMEMBUF* pCaptureBuf; /* capture buffer for streams */ +} OSRTDiagBitFieldList; + +/* Macros */ + +#ifdef _TRACE +#define RTDIAG_INSBITFLDLEN(pctxt) rtxDiagInsBitFieldLen(pctxt) +#define RTDIAG_NEWBITFIELD(pctxt,suffix) rtxDiagNewBitField(pctxt,suffix) +#define RTDIAG_SETBITFLDOFFSET(pctxt) rtxDiagSetBitFldOffset(pctxt) +#define RTDIAG_SETBITFLDCOUNT(pctxt) rtxDiagSetBitFldCount(pctxt) +#else +#define RTDIAG_INSBITFLDLEN(pctxt) +#define RTDIAG_NEWBITFIELD(pctxt,suffix) +#define RTDIAG_SETBITFLDOFFSET(pctxt) +#define RTDIAG_SETBITFLDCOUNT(pctxt) +#endif + +/** + * This macro calculates the relative bit offset to the current + * buffer position. + */ +#define RTDIAG_GETCTXTBITOFFSET(pctxt) \ +(((pctxt)->buffer.byteIndex * 8) + (8 - (pctxt)->buffer.bitOffset)) + +/** + * This function enables bit field tracing. + * + * @param pctxt Pointer to a context structure. + * @param value Boolean value to turn trace on or off. + * @return Previous state of bit trace enabled setting. + */ +EXTERNRT OSBOOL rtxDiagSetBitTraceEnabled (OSCTXT* pctxt, OSBOOL value); + +/** + * This function check to see if bit field tracing is enabled. + * + * @param pctxt Pointer to a context structure. + * @return True if enabled; false otherwise. + */ +EXTERNRT OSBOOL rtxDiagBitTraceEnabled (OSCTXT* pctxt); + +/** + * This function initializes a bit field list structure. + * + * @param pctxt Pointer to a context structure. + * @param pBFList Pointer to bit field list structure. + */ +EXTERNRT void rtxDiagBitFieldListInit +(OSCTXT* pctxt, OSRTDiagBitFieldList* pBFList); + +/** + * This function inserts a special length field before the current record + * in the bit field list. + * + * @param pBFList Pointer to bit field list structure. + */ +EXTERNRT void rtxDiagInsBitFieldLen (OSRTDiagBitFieldList* pBFList); + +/** + * This function allocates a new bit field structure and adds it to + * the bit field list. + * + * @param pBFList Pointer to bit field list structure. + * @param nameSuffix Suffix to append to the bit field name. + * @return Allocated bit field structure. + */ +EXTERNRT OSRTDiagBitField* rtxDiagNewBitField +(OSRTDiagBitFieldList* pBFList, const char* nameSuffix); + +/** + * This function is used to set the bit offset in the current bit field + * structure. + * + * @param pBFList Pointer to bit field list structure. + */ +EXTERNRT void rtxDiagSetBitFldOffset (OSRTDiagBitFieldList* pBFList); + +/** + * This function is used to set the bit count in the current bit field + * structure. + * + * @param pBFList Pointer to bit field list structure. + */ +EXTERNRT void rtxDiagSetBitFldCount (OSRTDiagBitFieldList* pBFList); + +/** + * This function is used to set the name suffix in the current bit field + * structure. This text is printed after the element name when the + * field is displayed. + * + * @param pBFList Pointer to bit field list structure. + * @param nameSuffix Suffix to append to the bit field name. + */ +EXTERNRT void rtxDiagSetBitFldNameSuffix +(OSRTDiagBitFieldList* pBFList, const char* nameSuffix); + +/** + * This function increments or decrements the disabled count. This + * allows the list to be temporaily disabled to allow collection of + * more bits to form larger, aggregate fields. + * + * @param pBFList Pointer to bit field list structure. + * @param value Indicates if disabled count should be incremented + * (TRUE) or decremented (FALSE). + * @return TRUE if field operations are still disabled. + */ +EXTERNRT OSBOOL rtxDiagSetBitFldDisabled +(OSRTDiagBitFieldList* pBFList, OSBOOL value); + +/** + * This function prints the bit field list to a an output stream. By + * default, the output goes to stdout; but this can be changed by + * creating a print output stream within the context (see rtxPrintStream). + * + * @param pBFList Pointer to bit field list structure. + * @param varname A variable name that is prepended to each field. + */ +EXTERNRT void rtxDiagBitTracePrint +(OSRTDiagBitFieldList* pBFList, const char* varname); + +/** + * This function prints the bit field list to a an HTML document. + * + * @param filename Name of HTML file to be written. + * @param pBFList Pointer to bit field list structure. + * @param varname A variable name that is prepended to each field. + */ +EXTERNRT void rtxDiagBitTracePrintHTML +(const char* filename, OSRTDiagBitFieldList* pBFList, const char* varname); + +/** + * This function appends the given name part to the element name + * in the bit field. A dot (.) separator character is added + * after the existing name and before the name part. + * + * @param pBFList Pointer to bit field list structure. + * @param namePart A name part that is appended to the field. + */ +EXTERNRT void rtxDiagBitFldAppendNamePart +(OSRTDiagBitFieldList* pBFList, const char* namePart); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDynBitSet.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDynBitSet.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,165 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxDynBitSet.h - Implementation of a dynamic bit set similar to + * the Java BitSet class. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXDYNBITSET_H_ +#define _RTXDYNBITSET_H_ + +#include "rtxsrc/rtxBitString.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define OSRTBITSETSEGSIZE 16 /* Segment size in bytes */ + +typedef struct { + OSUINT16 nbytes; /* Number of bytes in allocated array */ + OSUINT16 maxbit; /* Maximum bit number currently set */ + OSUINT16 segsize; /* Segment size for expansions */ + OSUINT16 spare; /* 32-bit word boundary padding */ + OSOCTET* data; /* Dynamic array to hold bits */ +} OSRTDynBitSet; + +/** + * This function initializes a dynamic bit set structure. Memory is + * allocated for the initial segment. + * + * @param pctxt Pointer to a context structure. + * @param pbitset Pointer to bit set structure to be initialized. + * @param segNBytes Number of bytes per segment expansion. If zero, + * the default value is used. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynBitSetInit +(OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT16 segNBytes); + +/** + * This function frees dynamic memory held by the bit set. + * + * @param pctxt Pointer to a context structure. + * @param pbitset Pointer to bit set structure to be freed. + */ +EXTERNRT void rtxDynBitSetFree (OSCTXT* pctxt, OSRTDynBitSet* pbitset); + +/** + * This function creates a deep copy of the given bit set. + * + * @param pctxt Pointer to a context structure. + * @param pSrcBitSet Pointer to bit set structure to be copied. + * @param pDestBitSet Pointer to bit set structure to recieve copied data. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynBitSetCopy +(OSCTXT* pctxt, const OSRTDynBitSet* pSrcBitSet, OSRTDynBitSet* pDestBitSet); + +/** + * This function sets the bit at the given index. The bit set will be + * expanded if the given index is outside the currently allocated range. + * + * @param pctxt Pointer to a context structure. + * @param pbitset Pointer to bit set structure. + * @param index Index of bit to be set. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynBitSetSetBit +(OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT32 index); + +/** + * This function clears the bit at the given index. The bit set will be + * not be expanded if the given index is outside the currently allocated + * range. The bit will be assumed to already be clear since it is + * undefined. + * + * @param pbitset Pointer to bit set structure. + * @param index Index of bit to be clear. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynBitSetClearBit (OSRTDynBitSet* pbitset, OSUINT32 index); + +/** + * This function tests the bit at the given index. If the index is + * outside the range of the currently allocated set, the bit is + * assumed to be clear; otherwise, the state of the bit in the set + * is tested. + * + * @param pbitset Pointer to bit set structure. + * @param index Index of bit to be tested. + * @return Boolean result: true if bit set; false if clear. + */ +EXTERNRT OSBOOL rtxDynBitSetTestBit +(const OSRTDynBitSet* pbitset, OSUINT32 index); + +/** + * This function sets the bit at the given index to the give value. The + * bit set will be expanded if the given index is outside the currently + * allocated range. + * + * @param pctxt Pointer to a context structure. + * @param pbitset Pointer to bit set structure. + * @param index Index of bit to be set. + * @param value Boolean value to which bit is to be set. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynBitSetSetBitToValue +(OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT32 index, OSBOOL value); + +/** + * This function inserts a bit with the given value at the given index. + * All other bits are shifted to the right one position. If the maximum + * set bit number is at the end of the allocated range, the set is + * expanded. + * + * @param pctxt Pointer to a context structure. + * @param pbitset Pointer to bit set structure. + * @param index Index of position where bit is to be inserted. + * @param value Boolean value of the bit. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynBitSetInsertBit +(OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT32 index, OSBOOL value); + +#ifdef _TRACE +/** + * This function prints the contents of a bit set as a binary string. + * + * @param pbitset Pointer to bit set structure. + * @param varname Variable name associated with bit set. + */ +EXTERNRT void rtxDynBitSetPrint +(const OSRTDynBitSet* pbitset, const char* varname); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDynPtrArray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxDynPtrArray.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,72 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxDynPtrArray.h - Implementation of a dynamic pointer array. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXDYNPTRARRAY_H_ +#define _RTXDYNPTRARRAY_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + OSUINT16 capacity; /* Current size of the structure */ + OSUINT16 count; /* Number of pointers in array */ + void** data; /* The actual pointer values */ +} OSRTDynPtrArray; + +/** + * This function initializes a new dynamic pointer array structure. + * Memory is allocated for the initial capacity of pointers. + * + * @param pctxt Pointer to a context structure. + * @param pArray Pointer to dynamic pointer array structure. + * @param initialSize Initial capacilty of the array. The size will + * doubled on each expansion. If zero is provided, + * a default size will be used. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynPtrArrayInit +(OSCTXT* pctxt, OSRTDynPtrArray* pArray, OSUINT16 initialSize); + +/** + * This function adds a pointer to the end of the array and expands the + * array if necessary. + * + * @param pctxt Pointer to a context structure. + * @param pArray Pointer to dynamic pointer array structure. + * @param ptr Pointer to be added to the array. + * @return Status of operation: zero if success or a negative + * error code if failure. + */ +EXTERNRT int rtxDynPtrArrayAppend +(OSCTXT* pctxt, OSRTDynPtrArray* pArray, void* ptr); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxEnum.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxEnum.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,124 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxEnum.h + * Common runtime types and functions for performing operations on + * enumerated data items. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXENUM_H_ +#define _RTXENUM_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxEnum Enumeration utility functions + * @{ + * Enumeration utility function provide run-time functions for handling + * enumerations defined within a schema. + */ +typedef struct OSEnumItem { + const OSUTF8CHAR* name; + OSINT32 value; + OSUINT16 namelen; + OSUINT16 transidx; +} OSEnumItem; + +typedef struct OSNumericEnumItem { + OSINT32 start; + OSINT32 end; +} OSNumericEnumItem; + +typedef struct OSNumericEnumItemU32 { + OSUINT32 start; + OSUINT32 end; +} OSNumericEnumItemU32; + +typedef struct OSNumericEnumItem64 { + OSINT64 start; + OSINT64 end; +} OSNumericEnumItem64; + +typedef struct OSNumericEnumItemU64 { + OSUINT64 start; + OSUINT64 end; +} OSNumericEnumItemU64; + +/** + * This function will return the numeric value for the given enumerated + * identifier string. + * + * @param strValue Enumerated identifier value + * @param strValueSize Length of enumerated identifier + * @param enumTable Table containing the defined enumeration + * @param enumTableSize Number of rows in the table + * @return Index to enumerated item if found; otherwise, negative + * status code (RTERR_INVENUM). + */ +EXTERNRT OSINT32 rtxLookupEnum +(const OSUTF8CHAR* strValue, size_t strValueSize, + const OSEnumItem enumTable[], OSUINT16 enumTableSize); + +/** + * Lookup enum by integer value. Required for ASN.1 because enumerated + * values do not need to be sequential. + * + * @param value Integer value of the enumerated item. + * @param enumTable Table containing the defined enumeration + * @param enumTableSize Number of rows in the table + * @return Index to enumerated item if found; otherwiae, negative + * status code (RTERR_INVENUM). + */ +EXTERNRT OSINT32 rtxLookupEnumByValue +(OSINT32 value, const OSEnumItem enumTable[], size_t enumTableSize); + +/** + * This function determines if the given numeric enumerated value is within + * the defined numeration set. + * + * @param ivalue Numeric enumerated value + * @param enumTable Table containing the defined enumeration + * @param enumTableSize Number of rows in the table + * @return Zero (0) if item in table, RTERR_INVENUM if not + */ +EXTERNRT int rtxTestNumericEnum +(OSINT32 ivalue, const OSNumericEnumItem enumTable[], OSUINT16 enumTableSize); + +EXTERNRT int rtxTestNumericEnumU32 +(OSUINT32 ivalue, const OSNumericEnumItemU32 enumTable[], OSUINT16 enumTableSize); + +EXTERNRT int rtxTestNumericEnum64 +(OSINT64 ivalue, const OSNumericEnumItem64 enumTable[], OSUINT16 enumTableSize); + +EXTERNRT int rtxTestNumericEnumU64 +(OSUINT64 ivalue, const OSNumericEnumItemU64 enumTable[], OSUINT16 enumTableSize); +/** + * @} rtxEnum + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxErrCodes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxErrCodes.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,528 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxErrCodes.h + * List of numeric status codes that can be returned by common run-time + * functions and generated code. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXERRCODES_H_ +#define _RTXERRCODES_H_ + +/** + * @defgroup rtxErrCodes Run-time error status codes. + * This is a list of status codes that can be returned by the common + * run-time functions and generated code. In many cases, additional + * information and parameters for the different errors are stored in + * the context structure at the time the error in raised. This + * additional information can be output using the \c rtxErrPrint or + * \c rtxErrLogUsingCB run-time functions. + * @{ + */ + +/** + * Normal completion status. + */ +#define RT_OK 0 + +/** + * Message fragment return status. This is returned when a part of a + * message is successfully decoded. The application should continue + * to invoke the decode function until a zero status is returned. + */ +#define RT_OK_FRAG 2 + +/** + * Encode buffer overflow. This status code is returned when encoding + * into a static buffer and there is no space left for the item currently + * being encoded. + */ +#define RTERR_BUFOVFLW -1 + +/** + * Unexpected end-of-buffer. This status code is returned when decoding + * and the decoder expects more data to be available but instead runs + * into the end of the decode buffer. + */ +#define RTERR_ENDOFBUF -2 + +/** + * Expected identifier not found. This status is returned when the + * decoder is expecting a certain element to be present at the current + * position and instead something different is encountered. An example + * is decoding a sequence container type in which the declared elements + * are expected to be in the given order. If an element is encountered + * that is not the one expected, this error is raised. + */ +#define RTERR_IDNOTFOU -3 + +/** + * Invalid enumerated identifier. This status is returned when an + * enumerated value is being encoded or decoded and the given value + * is not in the set of values defined in the enumeration facet. + */ +#define RTERR_INVENUM -4 + +/** + * Duplicate element in set. This status code is returned when decoding + * an ASN.1 SET or XSD xsd:all construct. It is raised if a given element + * defined in the content model group occurs multiple times in the instance + * being decoded. + */ +#define RTERR_SETDUPL -5 + +/** + * Missing required element in set. This status code is returned when + * decoding an ASN.1 SET or XSD xsd:all construct and all required elements + * in the content model group are not found to be present in the instance + * being decoded. + */ +#define RTERR_SETMISRQ -6 + +/** + * Element not in set. This status code is returned when encoding or + * decoding an ASN.1 SET or XSD xsd:all construct. When encoding, it + * occurs when a value in the generated _order member variable is outside + * the range of indexes of items in the content model group. It occurs on + * the decode side when an element is received that is not defined in the + * content model group. + */ +#define RTERR_NOTINSET -7 + +/** + * Sequence overflow. This status code is returned when decoding a + * repeating element (ASN.1 SEQUENCE OF or XSD element with + * min/maxOccurs > 1) and more instances of the element are received + * than were defined in the constraint. + */ +#define RTERR_SEQOVFLW -8 + +/** + * Invalid option in choice. This status code is returned when encoding or + * decoding an ASN.1 CHOICE or XSD xsd:choice construct. When encoding, + * it occurs when a value in the generated 't' member variable is outside + * the range of indexes of items in the content model group. It occurs + * on the decode side when an element is received that is not defined in + * the content model group. + */ +#define RTERR_INVOPT -9 + +/** + * No dynamic memory available. This status code is returned when a + * dynamic memory allocation request is made and an insufficient amount + * of memory is available to satisfy the request. + */ +#define RTERR_NOMEM -10 + +/** + * Invalid hexadecimal string. This status code is returned when + * decoding a hexadecimal string value and a character + * is encountered in the string that is not in the valid hexadecimal + * character set ([0-9A-Fa-f] or whitespace). + */ +#define RTERR_INVHEXS -11 + +/** + * Invalid real number value. This status code is returned when + * decoding a numeric floating-point value and an invalid character is + * received (i.e. not numeric, decimal point, plus or minus sign, or + * exponent character). + */ +#define RTERR_INVREAL -12 + +/** + * String overflow. This status code is returned when a fixed-sized + * field is being decoded as specified by a size constraint and + * the item contains more characters or bytes then this amount. It + * can occur when a run-time function is called with a fixed-sixed + * static buffer and whatever operation is being done causes the + * bounds of this buffer to be exceeded. + */ +#define RTERR_STROVFLW -13 + +/** + * Bad value. This status code is returned anywhere where an API is + * expecting a value to be within a certain range and it not within + * this range. An example is the encoding or decoding date values + * when the month or day value is not within the legal range (1-12 for + * month and 1 to whatever the max days is for a given month). + */ +#define RTERR_BADVALUE -14 + +/** + * Nesting level too deep. This status code is returned when a preconfigured + * maximum nesting level for elements within a content model group is + * exceeded. + */ +#define RTERR_TOODEEP -15 + +/** + * Constraint violation. This status code is returned when constraints + * defined the schema are violated. These include XSD facets such as + * min/maxOccurs, min/maxLength, patterns, etc.. Also ASN.1 value range, + * size, and permitted alphabet constraints. + */ +#define RTERR_CONSVIO -16 + +/** + * Unexpected end-of-file error. This status code is returned when an + * unexpected end-of-file condition is detected on decode. It is similar + * to the ENDOFBUF error code described above except that in this case, + * decoding is being done from a file stream instead of from a memory buffer. + */ +#define RTERR_ENDOFFILE -17 + +/** + * Invalid UTF-8 character encoding. This status code is returned by + * the decoder when an invalid sequence of bytes is detected in a UTF-8 + * character string. + */ +#define RTERR_INVUTF8 -18 + +/** + * Array index out-of-bounds. This status code is returned when an + * attempt is made to add something to an array and the given index is + * outside the defined bounds of the array. + */ +#define RTERR_OUTOFBND -19 + +/** + * Invalid parameter passed to a function of method. This status code is + * returned by a function or method when it does an initial check on the + * values of parameters passed in. If a parameter is found to not have a + * value in the expected range, this error code is returned. + */ +#define RTERR_INVPARAM -20 + +/** + * Invalid value format. This status code is returned when a value is + * received or passed into a function that is not in the expected format. + * For example, the time string parsing function expects a string in the + * form "nn:nn:nn" where n's are numbers. If not in this format, this + * error code is returned. + */ +#define RTERR_INVFORMAT -21 + +/** + * Context not initialized. This status code is returned when the + * run-time context structure (OSCTXT) is attempted to be used without + * having been initialized. This can occur if rtxInitContext is not + * invoked to initialize a context variable before use in any other API + * call. It can also occur is there is a license violation (for example, + * evaluation license expired). + */ +#define RTERR_NOTINIT -22 + +/** + * Value will not fit in target variable. This status is returned by + * the decoder when a target variable is not large enough to hold a + * a decoded value. A typical case is an integer value that is too + * large to fit in the standard C integer type (typically a 32-bit value) + * on a given platform. If this occurs, it is usually necessary to use + * a configuration file setting to force the compiler to use a different + * data type for the item. For example, for integer, the \ + * setting can be used to force use of a big integer type. + */ +#define RTERR_TOOBIG -23 + +/** + * Invalid character. This status code is returned when a character is + * encountered that is not valid for a given data type. For example, + * if an integer value is being decoded and a non-numeric character is + * encountered, this error will be raised. + */ +#define RTERR_INVCHAR -24 + +/** + * XML state error. This status code is returned when the XML parser + * is not in the correct state to do a certain operation. + */ +#define RTERR_XMLSTATE -25 + +/** + * XML parser error. This status code in returned when the underlying + * XML parser application (by default, this is Expat) returns an error + * code. The parser error code or text is returned as a parameter in + * the errInfo structure within the context structure. + */ +#define RTERR_XMLPARSE -26 + +/** + * Sequence order error. This status code is returned when decoding + * an ASN.1 SEQUENCE or XSD xsd:sequence construct. It is raised if + * the elements were received in an order different than that specified + * in the content model group definition. + */ +#define RTERR_SEQORDER -27 + +/** + * File not found. This status code is returned if an attempt is made + * to open a file input stream for decoding and the given file does not + * exist. + */ +#define RTERR_FILNOTFOU -28 + +/** + * Read error. This status code if returned if a read I/O error is + * encountered when reading from an input stream associated with a + * physical device such as a file or socket. + */ +#define RTERR_READERR -29 + +/** + * Write error. This status code if returned if a write I/O error is + * encountered when attempting to output data to an output stream + * associated with a physical device such as a file or socket. + */ +#define RTERR_WRITEERR -30 + +/** + * Invalid Base64 encoding. This status code is returned when an + * error is detected in decoding base64 data. + */ +#define RTERR_INVBASE64 -31 + +/** + * Invalid socket. This status code is returned when an attempt is made + * to read or write from a scoket and the given socket handle is invalid. + * This may be the result of not having established a proper connection + * before trying to use the socket handle variable. + */ +#define RTERR_INVSOCKET -32 + +/** + * Invalid attribute. This status code is returned by the decoder when + * an attribute is encountered in an XML instance that was not defined + * in the XML schema. + */ +/* Parameters: + * 1. C type name + * 2. attribute name + */ +#define RTERR_INVATTR -33 + +/** + * Invalid regular expression. This status code is returned when a + * syntax error is detected in a regular expression value. Details + * of the syntax error can be obtained by invoking rtxErrPrint to + * print the details of the error contained within the context + * variable. + */ +#define RTERR_REGEXP -34 + +/** + * Pattern match error. This status code is returned by the decoder + * when a value in an XML instance does not match the pattern facet + * defined in the XML schema. It can also be returned by numeric encode + * functions that cannot format a numeric value to match the pattern + * specified for that value. + */ +#define RTERR_PATMATCH -35 + +/** + * Missing required attribute. This status code is returned by the decoder + * when an XML instance is missing a required attribute value as defined in + * the XML schema. + */ +#define RTERR_ATTRMISRQ -36 + +/** + * Host name could not be resolved. This status code is returned from + * run-time socket functions when they are unable to connect to a given + * host computer. + */ +#define RTERR_HOSTNOTFOU -37 + +/** + * HTTP protocol error. This status code is returned by functions doing + * HTTP protocol operations such as SOAP functions. It is returned when + * a protocol error is detected. Details on the specific error can be + * obtained by calling rtxErrPrint. + */ +#define RTERR_HTTPERR -38 + +/** + * SOAP error. This status code when an error is detected when trying + * to execute a SOAP operation. + */ +#define RTERR_SOAPERR -39 + +/** + * Evaluation license expired. This error is returned from evaluation + * versions of the run-time library when the hard-coded evaluation period + * is expired. + */ +#define RTERR_EXPIRED -40 + +/** + * Unexpected element encountered. This status code is returned when + * an element is encountered in a position where something else (for + * example, an attribute) was expected. + */ +#define RTERR_UNEXPELEM -41 + +/** + * Invalid number of occurrences. This status code is returned by the + * decoder when an XML instance contains a number of occurrences of a + * repeating element that is outside the bounds (minOccurs/maxOccurs) + * defined for the element in the XML schema. + */ +#define RTERR_INVOCCUR -42 + +/** + * Invalid message buffer has been passed to decode or validate + * method. This status code is returned by decode or validate method when + * the used message buffer instance has type different from + * OSMessageBufferIF::XMLDecode. + */ +#define RTERR_INVMSGBUF -43 + +/** + * Element decode failed. This status code and parameters are added to + * the failure status by the decoder to allow the specific element on + * which a decode error was detected to be identified. + */ +#define RTERR_DECELEMFAIL -44 + +/** + * Attribute decode failed. This status code and parameters are added to + * the failure status by the decoder to allow the specific attribute on + * which a decode error was detected to be identified. + */ +#define RTERR_DECATTRFAIL -45 + +/** + * Stream in-use. This status code is returned by stream functions + * when an attempt is made to initialize a stream or create a reader or + * writer when an existing stream is open in the context. The existing + * stream must first be closed before initializaing a stream for a new + * operation. + */ +#define RTERR_STRMINUSE -46 + +/** + * Null pointer. This status code is returned when a null pointer + * is encountered in a place where it is expected that the pointer + * value is to be set. + */ +#define RTERR_NULLPTR -47 + +/** + * General failure. Low level call returned error. + */ +#define RTERR_FAILED -48 + +/** + * Attribute fixed value mismatch. The attribute contained a value that + * was different than the fixed value defined in the schema for the + * attribute. + */ +/* Parameters: + * 1. attribute name + * 2. attribute value + */ +#define RTERR_ATTRFIXEDVAL -49 + +/** + * Multiple errors occurred during an encode or decode operation. + * See the error list within the context structure for a full list + * of all errors. + */ +/* Parameters: + * None + */ +#define RTERR_MULTIPLE -50 + +/** + * This error is returned when decoding a derived type definition + * and no information exists as to what type of data is in the + * element content. When decoding XML, this normally means that + * an xsi:type attribute was not found identifying the type of content. + */ +/* Parameters: + * None + */ +#define RTERR_NOTYPEINFO -51 + +/** + * Address already in use. This status code is returned when an attempt is + * made to bind a socket to an address that is already in use. + */ +#define RTERR_ADDRINUSE -52 + +/** + * Remote connection was reset. This status code is returned when the + * connection is reset by the remote host (via explicit command or a crash. + */ +#define RTERR_CONNRESET -53 + +/** + * Network failure. This status code is returned when the network or host + * is down or otherwise unreachable. + */ +#define RTERR_UNREACHABLE -54 + +/** + * Not connected. This status code is returned when an operation is issued on + * an unconnected socket. + */ +#define RTERR_NOCONN -55 + +/** + * Connection refused. This status code is returned when an attempt to + * communicate on an open socket is refused by the host. + */ +#define RTERR_CONNREFUSED -56 + +/** + * Invalid option. This status code is returned when an invalid option is + * passed to socket. + */ +#define RTERR_INVSOCKOPT -57 + +/** + * This error is returned when decoded SOAP envelope is fault message + */ +/* Parameters: + * None + */ +#define RTERR_SOAPFAULT -58 + +/** + * This error is returned when an attempt is made to mark a stream + * position on a stream type that does not support it. + */ +/* Parameters: + * None + */ +#define RTERR_MARKNOTSUP -59 + +/** + * Feature is not supported. This status code is returned when a + * feature that is currently not supported is encountered. Support may + * be added in a future release. + */ +#define RTERR_NOTSUPP -99 /* feature is not supported */ + +/** + * @} rtxErrCodes + */ +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxError.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxError.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,462 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxError.h + * Error handling function and macro definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef __RTXERROR_H__ +#define __RTXERROR_H__ + +#include "rtxsrc/rtxContext.h" +#include "rtxsrc/rtxErrCodes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Error handling */ + +/** + * @defgroup ccfErr Error Formatting and Print Functions + * @{ + * + * Error formatting and print functions allow information about encode/decode + * errors to be added to a context block structure and then printed when the + * error is propagated to the top level. + */ +/** + * This macro is used to log a run-time error in the context. It calls the \c + * rtxErrSetData function to set the status and error parameters. The C + * built-in __FILE__ and __LINE__ macros are used to record the position in the + * source file of the error. + * + * @param pctxt A pointer to a context structure. + * @param stat Error status value from \c rtxErrCodes.h + */ +#ifndef _COMPACT + +#ifndef __MODULE__ +#define LOG_RTERR(pctxt,stat) \ +rtxErrSetData(pctxt,stat,__FILE__,__LINE__) + +#define LOG_RTERRNEW(pctxt,stat) \ +rtxErrSetNewData(pctxt,stat,__FILE__,__LINE__) + +#else /* Should significantly decrease use of RAM in ARM systems */ +#define LOG_RTERR(pctxt,stat) \ +rtxErrSetData(pctxt,stat,__MODULE__,__LINE__) + +#define LOG_RTERRNEW(pctxt,stat) \ +rtxErrSetNewData(pctxt,stat,__MODULE__,__LINE__) +#endif /* not defined __MODULE__ */ + +/** + * This macro is used to check an assertion. This is a condition that is + * expected to be true. The \c rtxErrAssertionFailed function is called if the + * condition is not true. The C built-in __FILE__ and __LINE__ macros are used + * to record the position in the source file of the failure. + * + * @param condition Condition to check (for example, "(ptr != NULL)") + */ +#define OSRTASSERT(condition) \ +if (!(condition)) { rtxErrAssertionFailed(#condition,__LINE__,__FILE__); } + +/** + * This macro check a condition but takes no action. Its main use is + * to supress VC++ level 4 "argument not used" warnings. + * + * @param condition Condition to check (for example, "(ptr != NULL)") + */ +#define OSRTCHECKPARAM(condition) if (condition) { /* do nothing */ } +#else +#define LOG_RTERR(pctxt,stat) \ +rtxErrSetData(pctxt,stat,0,0) + +#define LOG_RTERRNEW(pctxt,stat) \ +rtxErrSetNewData(pctxt,stat,0,0) + +#define OSRTASSERT(condition) +#define OSRTCHECKPARAM(condition) +#endif /* _COMPACT */ + +#define LOG_RTERR1(pctxt,stat,a) \ +(a,LOG_RTERR (pctxt, stat),stat) + +#define LOG_RTERRNEW1(pctxt,stat,a) \ +(a,LOG_RTERRNEW (pctxt, stat),stat) + +#define LOG_RTERR2(pctxt,stat,a,b) \ +(a,b,LOG_RTERR (pctxt, stat),stat) + +#define LOG_RTERRNEW2(pctxt,stat,a,b) \ +(a,b,LOG_RTERRNEW (pctxt, stat),stat) + + +typedef int (*OSErrCbFunc) (const char* ptext, void* cbArg_p); + +/** + * This function adds the contents of the context buffer to the + * error information structure in the context. The buffer contents + * are assumed to contain only printable characters. + * + * @param pctxt A pointer to a context structure. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddCtxtBufParm (OSCTXT* pctxt); + +/** + * This function adds a double parameter to an error information + * structure. + * + * @param pctxt A pointer to a context structure. + * @param errParm The double error parameter. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddDoubleParm (OSCTXT* pctxt, double errParm); + +/** + * This function adds a set of error codes to the global error table. + * It is called within context initialization functions to add errors + * defined for a specific domain (for example, ASN.1 encoding/decoding) + * to be added to the global list of errors. + * + * @param ppStatusText Pointer to table of error status text messages. + * @param minErrCode Minimum error status code. + * @param maxErrCode Maximum error status code. + * @return The status of the operation (TRUE if entry + * sucessfully added to table). + */ +EXTERNRT OSBOOL rtxErrAddErrorTableEntry +#if !defined(_ARMTCC) && !defined(__SYMBIAN32__) +(const char* const* ppStatusText, OSINT32 minErrCode, OSINT32 maxErrCode); +#else +(); +#endif + +/** + * This function adds an element name parameter to the context error + * information structure. The element name is obtained from the context + * element name stack. If the stack is empty, a question mark characetr + * (?) is inserted for the name. + * + * @param pctxt A pointer to a context structure. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddElemNameParm (OSCTXT* pctxt); + +/** + * This function adds an integer parameter to an error information structure. + * Parameter substitution is done in much the same way as it is done in C + * printf statments. The base error message specification that goes along with + * a particular status code may have variable fields built in using '%' + * modifiers. These would be replaced with actual parameter data. + * + * @param pctxt A pointer to a context structure. + * @param errParm The integer error parameter. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddIntParm (OSCTXT* pctxt, int errParm); + +#if !defined(_NO_INT64_SUPPORT) +/** + * This function adds a 64-bit integer parameter to an error information + * structure. + * Parameter substitution is done in much the same way as it is done in C + * printf statments. The base error message specification that goes along with + * a particular status code may have variable fields built in using '%' + * modifiers. These would be replaced with actual parameter data. + * + * @param pctxt A pointer to a context structure. + * @param errParm The 64-bit integer error parameter. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddInt64Parm (OSCTXT* pctxt, OSINT64 errParm); +#endif /* !defined(_NO_INT64_SUPPORT) */ + +/** + * This function adds a character string parameter to an error information + * structure. + * + * @param pctxt A pointer to a context structure. + * @param pErrParm The character string error parameter. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddStrParm (OSCTXT* pctxt, const char* pErrParm); + +/** + * This function adds a given number of characters from a character string + * parameter to an error information structure. + * + * @param pctxt A pointer to a context structure. + * @param pErrParm The character string error parameter. + * @param nchars Number of characters to add from pErrParm. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddStrnParm + (OSCTXT* pctxt, const char* pErrParm, size_t nchars); + +/** + * This function adds a Unicode string parameter to an error information + * structure. + * + * @param pctxt A pointer to a context structure. + * @param pErrParm The Unicode string error parameter. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddUniStrParm (OSCTXT* pctxt, + const OSUNICHAR* pErrParm); + +/** + * This function adds an unsigned integer parameter to an error information + * structure. + * + * @param pctxt A pointer to a context structure. + * @param errParm The unsigned integer error parameter. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddUIntParm (OSCTXT* pctxt, unsigned int errParm); + +#if !defined(_NO_INT64_SUPPORT) +/** + * This function adds an unsigned 64-bit integer parameter to an error + * information structure. + * + * @param pctxt A pointer to a context structure. + * @param errParm The unsigned 64-bit integer error parameter. + * @return The status of the operation (TRUE if the parameter was + * sucessfully added). + */ +EXTERNRT OSBOOL rtxErrAddUInt64Parm (OSCTXT* pctxt, OSUINT64 errParm); +#endif /* !defined(_NO_INT64_SUPPORT) */ + +/** + * This function is used to record an assertion failure. It is used in + * conjunction with the \c OTRTASSERT macro. It outputs information on the + * condition to \c stderr and then calls \c exit to terminate the program. + * + * @param conditionText The condition that failed (for example, ptr != NULL) + * @param lineNo Line number in the program of the failure. + * @param fileName Name of the C source file in which the assertion + * failure occurred. + */ +EXTERNRT void rtxErrAssertionFailed (const char* conditionText, + int lineNo, const char* fileName); + +/** + * This function is used to free dynamic memory that was used in the recording + * of error parameters. After an error is logged, this function should be + * called to prevent memory leaks. + * + * @param pctxt A pointer to a context structure. + */ +EXTERNRT void rtxErrFreeParms (OSCTXT* pctxt); + +/** + * This function returns error text in a memory buffer. If buffer pointer and + * buffer size are specified in parameters (not NULL) then error text will be + * copied in the passed buffer. Otherwise, this function allocates memory + * using the 'rtxMemAlloc' function. This memory is automatically freed + * at the time the 'rtxMemFree' or 'rtxFreeContext' functions are called. + * The calling function may free the memory by using 'rtxMemFreePtr' function. + * + * @param pctxt A pointer to a context structure. + * @param pBuf A pointer to a destination buffer to obtain the error + * text. If NULL, dynamic buffer will be allocated. + * @param pBufSize A pointer to buffer size. If pBuf is NULL and this + * parameter is not, it will receive the size of + * allocated dynamic buffer. + * @return A pointer to a buffer with error text. If pBuf is not + * NULL, the return pointer will be equal to it. + * Otherwise, returns newly allocated buffer with error + * text. NULL, if error occurred. + */ +EXTERNRT char* rtxErrGetText (OSCTXT* pctxt, char* pBuf, size_t* pBufSize); + +/** + * This function returns error text in the given fixed-size memory buffer. + * If the text will not fit in the buffer, it is truncated. + * + * @param pctxt A pointer to a context structure. + * @param pbuf Pointer to a destination buffer to receive text. + * @param bufsiz Size of the buffer. + * @return Pointer to the buffer (pbuf). + */ +EXTERNRT char* rtxErrGetTextBuf (OSCTXT* pctxt, char* pbuf, size_t bufsiz); + +/** + * This function creates a new empty error record for the passed context. + * \c rtxErrSetData function call with bAllocNew = FALSE should be used to + * set the data for this node. + * + * @param pctxt A pointer to a context structure. + * @return A pointer to a newly allocated error record; NULL, if + * error occurred. + */ +EXTERNRT OSRTErrInfo* rtxErrNewNode (OSCTXT* pctxt); + +/** + * This function is a one-time initialization function that must be + * called before any other error processing functions can be called. + * It adds the common error status text codes to the global error + * table. + */ +EXTERNRT void rtxErrInit (); + +/** + * This function is used to reset the error state recorded in the context to + * successful. It is used in the generated code in places where automatic error + * correction can be done. + * + * @param pctxt A pointer to a context structure. + */ +EXTERNRT int rtxErrReset (OSCTXT* pctxt); + +/** + * This function allows error information to be logged using a user-defined + * callback routine. The callback information is invoked with error information + * in the context allowing the user to do application-specific handling (for + * example, it can be written to an error log or a Window display). The + * prototype of the callback function to be passed is as follows: + * + *

int cb (const char* ptext, void* cbArg_p);

+ * + *

where ptext is a pointer to the formatted error text string and + * cbArg_p is a pointer to a user-defined callback argument. + * + * @param pctxt A pointer to a context structure. + * @param cb Callback function pointer. + * @param cbArg_p Pointer to a user-defined argument that is passed to the + * callback function. + */ +EXTERNRT void rtxErrLogUsingCB (OSCTXT* pctxt, OSErrCbFunc cb, void* cbArg_p); + +/** + * This function is used to print the error information stored in the context + * to the standard output device. Parameter substitution is done so that + * recorded parameters are added to the output message text. + * + * @param pctxt A pointer to a context structure. + */ +EXTERNRT void rtxErrPrint (OSCTXT* pctxt); + +/** + * This function is used to print the error information stored in the error + * information element to the standard output device. Parameter substitution + * is done so that recorded parameters are added to the output message text. + * + * @param pErrInfo A pointer to an error information element. + */ +EXTERNRT void rtxErrPrintElement (OSRTErrInfo* pErrInfo); + +/** + * This function is used to record an error in the context structure. It is + * typically called via the \c LOG_RTERR macro in the generated code to trap + * error conditions. + * + * @param pctxt A pointer to a context structure. + * @param status The error status code from \c rtxErrCodes.h + * @param module The C source file in which the error occurred. + * @param lineno The line number within the source file of the error. + * @return The status code that was passed in. + */ +EXTERNRT int rtxErrSetData (OSCTXT* pctxt, int status, + const char* module, int lineno); + +/** + * This function is used to record an error in the context structure. It is + * typically called via the \c LOG_RTERRNEW macro in the generated code to trap + * error conditions. It always allocates new error record. + * + * @param pctxt A pointer to a context structure. + * @param status The error status code from \c rtxErrCodes.h + * @param module The C source file in which the error occurred. + * @param lineno The line number within the source file of the error. + * @return The status code that was passed in. + */ +EXTERNRT int rtxErrSetNewData (OSCTXT* pctxt, int status, + const char* module, int lineno); +/** + * This function returns the error code, stored in the first error record. + * + * @param pctxt A pointer to a context structure. + * @return The first status code; zero if no error records exist. + */ +EXTERNRT int rtxErrGetFirstError (const OSCTXT* pctxt); + +/** + * This function returns the error code, stored in the last error record. + * + * @param pctxt A pointer to a context structure. + * @return The last status code; zero if no error records exist. + */ +EXTERNRT int rtxErrGetLastError (const OSCTXT* pctxt); + +/** + * This function returns the total number of error records. + * + * @param pctxt A pointer to a context structure. + * @return The total number of error records in the context. + */ +EXTERNRT OSUINT32 rtxErrGetErrorCnt (const OSCTXT* pctxt); + +/** + * This function returns the status value from the context. It + * examines the error list to see how many errors were logged. If + * none, OK (zero) is returned; if one, then the status value in the + * single error record is returned; if more than one, the special code + * RTERR_MULTIPLE is returned to indicate that multiple errors occurred. + * + * @param pctxt A pointer to a context structure. + * @return Status code corresponding to errors in the context. + */ +EXTERNRT int rtxErrGetStatus (const OSCTXT* pctxt); + +/** + * This function resets last 'errorsToReset` errors in the context. + * + * @param pctxt A pointer to a context structure. + * @param errorsToReset A number of errors to reset, starting from the + * last record. + * @return Completion status of operation: + * - 0(RT_OK) = success, + * - negative return value is error + */ +EXTERNRT int rtxErrResetLastErrors (OSCTXT* pctxt, int errorsToReset); + +/** + * @} ccfErr + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxExternDefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxExternDefs.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,84 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXEXTERNDEFS_H_ +#define _RTXEXTERNDEFS_H_ + +/** + * @file rtxExternDefs.h + * Common definitions of external function modifiers used to define the + * scope of functions used in DLL's (Windows only). + */ + +/* Symbian requires different exporting rules, and so we define different + * constants to turn on or off the appropriate linkage types. See + * rtsrc/rtExternDefs.h for more detail. */ +#if defined(__SYMBIAN32__) /* OS: Symbian */ +#define EXTRTCLASS /* turn off class externs */ + +#ifndef EXTERN +#ifdef BUILDDLL +#define EXTERN EXPORT_C +#elif defined (USEDLL) +#define EXTERN IMPORT_C +#else +#define EXTERN +#endif /* BUILD/USE DLL */ +#endif /* EXTERN */ + +#ifndef EXTERNRT +#ifdef BUILDASN1RTDLL +#define EXTERNRT EXPORT_C +#define EXTRTMETHOD EXPORT_C /* turn on method externs */ +#elif defined (USEASN1RTDLL) +#define EXTERNRT IMPORT_C +#define EXTRTMETHOD IMPORT_C +#else +#define EXTERNRT +#define EXTRTMETHOD +#endif /* BUILDASN1RTDLL */ +#endif /* EXTERNRT */ + +#else /* OS: Win, Unix, Linux, ... */ +#define EXTRTMETHOD /* turn off method externs */ + +#ifndef EXTERNRT +#if defined(BUILDASN1RTDLL) || defined(BUILDRTXDLL) +#define EXTERNRT __declspec(dllexport) +#define EXTRTCLASS __declspec(dllexport) +#elif defined (USERTXDLL) || defined(USEASN1RTDLL) +#define EXTERNRT __declspec(dllimport) +#define EXTRTCLASS __declspec(dllimport) +#else +#define EXTERNRT +#define EXTRTCLASS +#endif /* BUILDASN1RTDLL */ +#endif /* EXTERNRT */ + +#ifdef BUILDDLL +#define EXTERN __declspec(dllexport) +#elif defined (USEDLL) +#define EXTERN __declspec(dllimport) +#else +#define EXTERN +#endif /* BUILDDLL */ + +#endif +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxFile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxFile.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,91 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxFile.h + * Common runtime functions for reading from or writing to files. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXFILE_H_ +#define _RTXFILE_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function reads the entire contents of a binary file into memory. A + * memory buffer is allocated for the file contents using the run-time + * memory management functions. + * + * @param pctxt Pointer to context block structure. + * @param filePath Complete file path name of file to read. + * @param ppMsgBuf Pointer to message buffer to receive allocated memory + * pointer. + * @param pLength Pointer to integer to receive length of data read. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - RTERR_FILNOTFOU = file not found + * - RTERR_FILEREAD = file read error (see errno) + */ +EXTERNRT int rtxFileReadBinary +(OSCTXT* pctxt, const char* filePath, OSOCTET** ppMsgBuf, size_t* pLength); + +/** + * This function reads the entire contents of an ASCII text file into + * memory. A memory buffer is allocated for the file contents using the + * run-time memory management functions. This function is identical to + * rtxReadFileBinary except that a) the file is opened in text mode, and + * b) and extra byte is allocated at the end for a null-terminator + * character. + * + * @param pctxt Pointer to context block structure. + * @param filePath Complete file path name of file to read. + * @param ppMsgBuf Pointer to message buffer to receive allocated memory + * pointer. + * @param pLength Pointer to integer to receive length of data read. + * @return Completion status of operation: + * - 0 (ASN_OK) = success, + * - RTERR_FILNOTFOU = file not found + * - RTERR_FILEREAD = file read error (see errno) + */ +EXTERNRT int rtxFileReadText +(OSCTXT* pctxt, const char* filePath, OSOCTET** ppMsgBuf, size_t* pLength); + +/** + * This function writes binary data from memory to the given file. + * + * @param filePath Complete file path name of file to be written to. + * @param pMsgBuf Pointer to buffer containing data to be written. + * @param length Size (in bytes) of data to be written + * @return Completion status of operation: + * - 0 = success, + * - negative status code if error + */ +EXTERNRT int rtxFileWriteBinary +(const char* filePath, const OSOCTET* pMsgBuf, size_t length); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxFloat.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxFloat.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,79 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxFloat.h + */ + + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXFLOAT_H_ +#define _RTXFLOAT_H_ + +#include "rtxsrc/rtxCommon.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _NO_ULP_EQUAL + +/* Fall back to normal equality test */ +#define rtxFloatEqual(a, b) (a == b) +#define rtxFloatGreater(a, b) (a > b) +#define rtxFloatGreaterOrEqual(a, b) (a >= b) +#define rtxFloatSmaller(a, b) (a < b) +#define rtxFloatSmallerOrEqual(a, b) (a <= b) +#ifndef __SYMBIAN32__ +#define rtxDoubleEqual(a, b) (a == b) +#define rtxDoubleGreater(a, b) (a > b) +#define rtxDoubleGreaterOrEqual(a, b) (a >= b) +#define rtxDoubleSmaller(a, b) (a < b) +#define rtxDoubleSmallerOrEqual(a, b) (a <= b) +#endif /* not building for Symbian */ + +#else /* _NO_ULP_EQUAL */ + +#define rtxFloatEqual(a, b) rtxFloatEqualImpl(a, b) +#define rtxFloatGreater(a, b) ((a>b) && !rtxFloatEqual(a,b)) +#define rtxFloatGreaterOrEqual(a, b) ((a>b) || rtxFloatEqual(a,b)) +#define rtxFloatSmaller(a, b) ((ab) && !rtxDoubleEqual(a,b)) +#define rtxDoubleGreaterOrEqual(a, b) ((a>b) || rtxDoubleEqual(a,b)) +#define rtxDoubleSmaller(a, b) ((abuffer + (pmb)->startidx) +#define OSMEMBUFENDPTR(pmb) ((pmb)->buffer + (pmb)->startidx + (pmb)->usedcnt) +#define OSMEMBUFUSEDSIZE(pmb) ((size_t)(pmb)->usedcnt) + +#define OSMBAPPENDSTR(pmb,str) \ +rtxMemBufAppend(pmb,(OSOCTET*)str,OSCRTLSTRLEN(str)) + +#define OSMBAPPENDUTF8(pmb,str) \ +rtxMemBufAppend(pmb,(OSOCTET*)str,rtxUTF8LenBytes(str)) + +#ifdef __cplusplus +extern "C" { +#endif + +/* Memory buffer functions */ + +/** + * This function appends the data to the end of a memory buffer. If the buffer + * was dynamic and full then the buffer will be reallocated. If it is static + * (the static buffer was assigned by a call to rtxMemBufInitBuffer) or it is + * empty (no memory previously allocated) then a new buffer will be allocated. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @param pdata The pointer to the buffer to be appended. The data will + * be copied at the end of the memory buffer. + * @param nbytes The number of bytes to be copied from pData. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxMemBufAppend +(OSRTMEMBUF* pMemBuf, const OSOCTET* pdata, size_t nbytes); + +/** + * This function cuts off the part of memory buffer. The beginning of the + * cutting area is specified by offset "fromOffset" and the length is specified + * by "nbytes". All data in this part will be lost. The data from the offset + * "fromOffset + nbytes" will be moved to "fromOffset" offset. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @param fromOffset The offset of the beginning part, being cut off. + * @param nbytes The number of bytes to be cut off from the memory + * buffer. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxMemBufCut (OSRTMEMBUF* pMemBuf, size_t fromOffset, size_t nbytes); + +/** + * This function frees the memory buffer. If memory was allocated then it will + * be freed. Do not use the memory buffer structure after this function is + * called. + * + * @param pMemBuf A pointer to a memory buffer structure. + */ +EXTERNRT void rtxMemBufFree (OSRTMEMBUF* pMemBuf); + +/** + * This function returns the pointer to the used part of a memory buffer. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @param length The pointer to the length of the used part of the memory + * buffer. + * @return The pointer to the used part of the memory buffer. + */ +EXTERNRT OSOCTET* rtxMemBufGetData (OSRTMEMBUF* pMemBuf, int* length); + +/** + * This function returns the length of the used part of a memory buffer. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @return The length of the used part of the buffer. + */ +EXTERNRT int rtxMemBufGetDataLen (OSRTMEMBUF* pMemBuf); + +/** + * This function initializes a memory buffer structure. It does not allocate + * memory; it sets the fields of the structure to the proper states. This + * function must be called before any operations with the memory buffer. + * + * @param pCtxt A provides a storage area for the function to store all + * working variables that must be maintained between + * function calls. + * @param pMemBuf A pointer to the initialized memory buffer structure. + * @param segsize The number of bytes in which the memory buffer will be + * expanded incase it is full. + */ +EXTERNRT void rtxMemBufInit (OSCTXT* pCtxt, OSRTMEMBUF* pMemBuf, + size_t segsize); + +/** + * This function assigns a static buffer to the memory buffer structure. It + * does not allocate memory; it sets the pointer to the passed buffer. If + * additional memory is required (for example, additional data is appended to + * the buffer using rtxMemBufAppend), a dynamic buffer will be allocated and + * all data copied to the new buffer. + * + * @param pCtxt A pointer to a context structure. This provides a + * storage area for the function t store all working + * variables that must be maintained between function + * calls. + * @param pMemBuf A pointer to a memory buffer structure. + * @param buf A pointer to the buffer to be assigned. + * @param bufsize The size of the buffer. + * @param segsize The number of bytes on which the memory buffer will be + * expanded in case it is full. + */ +EXTERNRT void rtxMemBufInitBuffer (OSCTXT* pCtxt, OSRTMEMBUF* pMemBuf, + OSOCTET* buf, size_t bufsize, + size_t segsize); + +/** + * This function allocates a buffer with a predetermined amount of space. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @param nbytes The number of bytes to be copied from pData. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxMemBufPreAllocate (OSRTMEMBUF* pMemBuf, size_t nbytes); + +/** + * This function resets the memory buffer structure. It does not free memory, + * just sets the pointer to the beginning and the used length to zero. + * + * @param pMemBuf A pointer to a memory buffer structure. + */ +EXTERNRT void rtxMemBufReset (OSRTMEMBUF* pMemBuf); + +/** + * This function sets part of a memory buffer to a specified octet value. The + * filling is started from the end of the memory buffer. If the buffer is + * dynamic and full, then the buffer will be reallocated. If it is static (a + * static buffer was assigned by a call to rtxMemBufInitBuffer) or it is empty + * (no memory previously was allocated) then a new buffer will be allocated. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @param value The pointer to the buffer to be appended. The data will + * be copied at the end of the memory buffer. + * @param nbytes The number of bytes to be copied from pData. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxMemBufSet (OSRTMEMBUF* pMemBuf, OSOCTET value, size_t nbytes); + +/** + * This function sets "isExpandable" flag for the memory buffer object. + * By default, this flag is set to TRUE, thus, memory buffer could be + * expanded, even if it was initialized by static buffer (see + * \c rtMemBufInitBuffer). If flag is cleared and buffer is full the + * rtMemBufAppend/rtMemBufPreAllocate functions will return error status. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @param isExpandable TRUE, if buffer should be expandable. + * @return Previous state of "isExpandable" flag. + */ +EXTERNRT OSBOOL rtxMemBufSetExpandable +(OSRTMEMBUF* pMemBuf, OSBOOL isExpandable); + +/** + * This function trims white space of the memory buffer. + * + * @param pMemBuf A pointer to a memory buffer structure. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxMemBufTrimW (OSRTMEMBUF* pMemBuf); + +/** + * @} buffermanfun + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxMemLeakCheck.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxMemLeakCheck.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,62 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxMemLeakCheck.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXMEMLEAKCHECK_H_ +#define _RTXMEMLEAKCHECK_H_ + +/* VC++ and _DEBUG/_TRACE only */ +#if defined (_MSC_VER) && defined (_DEBUG) && defined (_TRACE) +#include +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#define DECLARE_MEMLEAK_DETECTOR0 { \ +int LeakTmpFlag; \ +_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); \ +_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT); \ +_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); \ +_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT); \ +_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); \ +_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT); \ +LeakTmpFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); \ +LeakTmpFlag |= _CRTDBG_CHECK_ALWAYS_DF; \ +LeakTmpFlag |= _CRTDBG_LEAK_CHECK_DF; \ +LeakTmpFlag |= _CRTDBG_DELAY_FREE_MEM_DF; \ +_CrtSetDbgFlag(LeakTmpFlag); \ +} + +#ifdef __cplusplus +#define DECLARE_MEMLEAK_DETECTOR static class ___MemLeakDetector___ { \ +public: \ +___MemLeakDetector___ () DECLARE_MEMLEAK_DETECTOR0 \ +} ___memleakdetector__ +#else +#define DECLARE_MEMLEAK_DETECTOR DECLARE_MEMLEAK_DETECTOR0 +#endif /* __cplusplus */ + +#else /* NOT VC++ OR NOT _DEBUG OR NOT _TRACE */ +#define DECLARE_MEMLEAK_DETECTOR +#endif /* _MSC_VER */ + +#endif /* _RTXMEMLEAKCHECK_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxMemory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxMemory.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,464 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxMemory.h + * Memory management function and macro definitions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef __RTXMEMORY_H__ +#define __RTXMEMORY_H__ + +#include "rtxsrc/rtxContext.h" + +#define RT_MH_DONTKEEPFREE 0x1 + +#define OSRTMH_PROPID_DEFBLKSIZE 1 +#define OSRTMH_PROPID_SETFLAGS 2 +#define OSRTMH_PROPID_CLEARFLAGS 3 + +#define OSRTMH_PROPID_USER 10 + +#define OSRTXM_K_MEMBLKSIZ (4*1024) + +/** + * @defgroup rtmem Memory Allocation Macros and Functions + * + * Memory allocation functions and macros handle memory management for the + * XBinder C run-time. Special algorithms are used for allocation and + * deallocation of memory to improve the run-time performance. @{ + */ +/** + * This macro allocates a single element of the given type. + * + * @param pctxt - Pointer to a context block + * @param type - Data type of record to allocate + */ +#define OSRTALLOCTYPE(pctxt,type) \ +(type*) rtxMemHeapAlloc (&(pctxt)->pMemHeap, sizeof(type)) + +/** + * This macro allocates and zeros a single element of the given type. + * + * @param pctxt - Pointer to a context block + * @param type - Data type of record to allocate + */ +#define OSRTALLOCTYPEZ(pctxt,type) \ +(type*) rtxMemHeapAllocZ (&(pctxt)->pMemHeap, sizeof(type)) + +/* + * Reallocate an array. This macro reallocates an array (either expands or + * contracts) to hold the given number of elements. The number of elements is + * specified in the n member variable of the pseqof argument. + * + * @param pctxt - Pointer to a context block + * @param pseqof - Pointer to a generated SEQUENCE OF array structure. + * The n member variable must be set to the number + * of records to allocate. + * @param type - Data type of an array record + */ +#define OSRTREALLOCARRAY(pctxt,pseqof,type) do {\ +if (sizeof(type)*(pseqof)->n < (pseqof)->n) return RTERR_NOMEM; \ +if (((pseqof)->elem = (type*) rtxMemHeapRealloc \ +(&(pctxt)->pMemHeap, (pseqof)->elem, sizeof(type)*(pseqof)->n)) == 0) \ +return RTERR_NOMEM; \ +} while (0) + +#ifndef _NO_MALLOC +#define OSCRTMALLOC0(nbytes) malloc(nbytes) +#define OSCRTFREE0(ptr) free(ptr) +#else + +#ifdef _NO_THREADS +extern EXTERNRT OSCTXT g_ctxt; + +#define OSCRTMALLOC0(nbytes) rtxMemAlloc(&g_ctxt,(nbytes)) +#define OSCRTFREE0(ptr) rtxMemFreePtr(&g_ctxt,(ptr)) +#else +#define OSCRTMALLOC0(nbytes) (void*)0 +#define OSCRTFREE0(ptr) (void*)0 + +#endif /* _NO_THREADS */ +#endif /* _NO_MALLOC */ + +#define OSCRTMALLOC rtxMemAlloc +#define OSCRTFREE rtxMemFreePtr + +struct OSRTDList; + +#ifdef __cplusplus +extern "C" { +#endif + +/* Alias for __cdecl modifier; if __cdecl keyword is not supported, + * redefine it as empty macro. */ + +#if !defined(OSCDECL) +#if defined(_MSC_VER) || defined(__BORLANDC__) +#define OSCDECL __cdecl +#else +#define OSCDECL +#endif +#endif /* OSCDECL */ + +/* Pointers to C Run-Time memory allocation functions * + * (See rtxMemSetAllocFuncs) */ + +typedef void *(OSCDECL *OSMallocFunc ) (size_t size); +typedef void *(OSCDECL *OSReallocFunc) (void *ptr, size_t size); +typedef void (OSCDECL *OSFreeFunc ) (void *ptr); + +#ifdef _RT_ALLOC_FUNC_WITH_CONTEXT + +/* Variation of the memory allocation functions only available * + * after recompilation of the runtime with the macro defined. * + * (See rtxMemSetAllocCtxtFuncs) */ + +typedef void *(OSCDECL *OSMallocCtxtFunc ) (OSCTXT* pctxt, size_t size); +typedef void *(OSCDECL *OSReallocCtxtFunc) (OSCTXT* pctxt, void *ptr, size_t size); +typedef void (OSCDECL *OSFreeCtxtFunc ) (OSCTXT* pctxt, void *ptr); + +#endif + +EXTERNRT void rtxMemHeapAddRef (void** ppvMemHeap); +EXTERNRT void* rtxMemHeapAlloc (void** ppvMemHeap, size_t nbytes); +EXTERNRT void* rtxMemHeapAllocZ (void** ppvMemHeap, size_t nbytes); +EXTERNRT int rtxMemHeapCheckPtr (void** ppvMemHeap, void* mem_p); +EXTERNRT int rtxMemHeapCreate (void** ppvMemHeap); +EXTERNRT void rtxMemHeapFreeAll (void** ppvMemHeap); +EXTERNRT void rtxMemHeapFreePtr (void** ppvMemHeap, void* mem_p); +EXTERNRT void* rtxMemHeapMarkSaved (void** ppvMemHeap, + const void* mem_p, + OSBOOL saved); +EXTERNRT void* rtxMemHeapRealloc (void** ppvMemHeap, + void* mem_p, size_t nbytes_); +EXTERNRT void rtxMemHeapRelease (void** ppvMemHeap); +EXTERNRT void rtxMemHeapReset (void** ppvMemHeap); +EXTERNRT void rtxMemHeapSetProperty (void** ppvMemHeap, + OSUINT32 propId, void* pProp); + + + +EXTERNRT void* rtxMemNewArray (size_t nbytes); +EXTERNRT void* rtxMemNewArrayZ (size_t nbytes); +EXTERNRT void rtxMemDeleteArray (void* mem_p); + +EXTERNRT void* rtxMemHeapAutoPtrRef (void** ppvMemHeap, void* ptr); +EXTERNRT int rtxMemHeapAutoPtrUnref (void** ppvMemHeap, void* ptr); +EXTERNRT int rtxMemHeapAutoPtrGetRefCount (void** ppvMemHeap, void* mem_p); + +#ifndef __SYMBIAN32__ +/** + * This function sets the pointers to standard allocation functions. These + * functions are used to allocate/reallocate/free memory blocks. By + * default, standard C functions - 'malloc', 'realloc' and 'free' - are used. + * But if some platforms do not support these functions (or some other reasons + * exist) they can be overloaded. The functions being overloaded should have + * the same prototypes as the standard functions. + * + * @param malloc_func Pointer to the memory allocation function ('malloc' by + * default). + * @param realloc_func Pointer to the memory reallocation function ('realloc' + * by default). + * @param free_func Pointer to the memory deallocation function ('free' by + * default). + */ +EXTERNRT void rtxMemSetAllocFuncs (OSMallocFunc malloc_func, + OSReallocFunc realloc_func, + OSFreeFunc free_func); +#endif + +#ifdef _RT_ALLOC_FUNC_WITH_CONTEXT + +EXTERNRT void rtxMemSetAllocCtxtFuncs (OSMallocCtxtFunc malloc_func, + OSReallocCtxtFunc realloc_func, + OSFreeCtxtFunc free_func); + +#endif + +EXTERNRT void rtxMemFreeOpenSeqExt +(OSCTXT* pctxt, struct OSRTDList *pElemList); + +/* + * This function returns the actual granularity of memory blocks in the + * context. + * + * @param pctxt Pointer to a context block. + */ +EXTERNRT OSUINT32 rtxMemHeapGetDefBlkSize (OSCTXT* pctxt); + +#ifndef __SYMBIAN32__ +/** + * This function sets the minimum size and the granularity of memory blocks + * for newly created memory heaps. + * + * @param blkSize The minimum size and the granularity of + * memory blocks. + */ +EXTERNRT void rtxMemSetDefBlkSize (OSUINT32 blkSize); +#endif + +/** + * This function returns the actual granularity of memory blocks. + * + * @return The currently used minimum size and the granularity of + * memory blocks. + */ +EXTERNRT OSUINT32 rtxMemGetDefBlkSize (); + +/** + * This helper function determines if an arbitrarily sized block of + * memory is set to zero. + * + * @param pmem Pointer to memory block to check + * @param memsiz Size of the memory block + * @return Boolean result: true if memory is all zero + */ +EXTERNRT OSBOOL rtxMemIsZero (const void* pmem, size_t memsiz); + +#ifdef _STATIC_HEAP +EXTERNRT void rtxMemSetStaticBuf (void* memHeapBuf, OSUINT32 blkSize); +#endif + +/* + * Allocate memory. This macro allocates the given number of bytes. It is + * similar to the C \c malloc run-time function. + * + * @param pctxt - Pointer to a context block + * @param nbytes - Number of bytes of memory to allocate + * @return - Void pointer to allocated memory or NULL if insufficient memory + * was available to fulfill the request. + */ +#define rtxMemAlloc(pctxt,nbytes) \ +rtxMemHeapAlloc(&(pctxt)->pMemHeap,nbytes) + +/* + * Allocate and zero memory. This macro allocates the given number of bytes + * and then initializes the memory block to zero. + * + * @param pctxt - Pointer to a context block + * @param nbytes - Number of bytes of memory to allocate + * @return - Void pointer to allocated memory or NULL if insufficient memory + * was available to fulfill the request. + */ +#define rtxMemAllocZ(pctxt,nbytes) \ +rtxMemHeapAllocZ(&(pctxt)->pMemHeap,nbytes) + +/* + * Reallocate memory. This macro reallocates a memory block (either + * expands or contracts) to the given number of bytes. It is + * similar to the C \c realloc run-time function. + * + * @param pctxt - Pointer to a context block + * @param mem_p - Pointer to memory block to reallocate. This must have been + * allocated using the rtxMemAlloc macro or the rtxMemHeapAlloc function. + * @param nbytes - Number of bytes of memory to which the block is to be + * resized. + * @return - Void pointer to allocated memory or NULL if insufficient memory + * was available to fulfill the request. This may be the same as the pmem + * pointer that was passed in if the block did not need to be relocated. + */ +#define rtxMemRealloc(pctxt,mem_p,nbytes) \ +rtxMemHeapRealloc(&(pctxt)->pMemHeap, (void*)mem_p, nbytes) + +/* + * Free memory pointer. This macro frees memory at the given pointer. + * The memory must have been allocated using the rtxMemAlloc (or similar) + * macros or the rtxMem memory allocation macros. This macro is + * similar to the C \c free function. + * + * @param pctxt - Pointer to a context block + * @param mem_p - Pointer to memory block to free. This must have + * been allocated using the rtxMemAlloc or rtxMemAlloc macro or the + * rtxMemHeapAlloc function. + */ +#define rtxMemFreePtr(pctxt,mem_p) \ +rtxMemHeapFreePtr(&(pctxt)->pMemHeap, (void*)mem_p) + +/* + * Free memory associated with a context. This macro frees all memory + * held within a context. This is all memory allocated using the + * rtxMemAlloc (and similar macros) and the rtxMem memory allocation + * functions using the given context variable. + * + * @param pctxt - Pointer to a context block + */ +#define rtxMemFree(pctxt) \ +rtxMemHeapFreeAll(&(pctxt)->pMemHeap) + +/* + * Reset memory associated with a context. This macro resets all memory + * held within a context. This is all memory allocated using the rtxMemAlloc + * (and similar macros) and the rtxMem memory allocation functions using the + * given context variable. + * + *

The difference between this and the OSMEMFREE macro is that the + * memory blocks held within the context are not actually freed. Internal + * pointers are reset so the existing blocks can be reused. This can + * provide a performace improvement for repetitive tasks such as decoding + * messages in a loop. + * + * @param pctxt - Pointer to a context block + */ +#define rtxMemReset(pctxt) \ +rtxMemHeapReset(&(pctxt)->pMemHeap) + +/** + * Allocate type. This macro allocates memory to hold a variable of the + * given type. + * + * @param pctxt - Pointer to a context block + * @param ctype - Name of C typedef + * @return - Pointer to allocated memory or NULL if insufficient memory + * was available to fulfill the request. + */ +#define rtxMemAllocType(pctxt,ctype) \ +(ctype*)rtxMemHeapAlloc(&(pctxt)->pMemHeap,sizeof(ctype)) + +/** + * Allocate type and zero memory. This macro allocates memory to hold a + * variable of the given type and initializes the allocated memory to zero. + * + * @param pctxt - Pointer to a context block + * @param ctype - Name of C typedef + * @return - Pointer to allocated memory or NULL if insufficient memory + * was available to fulfill the request. + */ +#define rtxMemAllocTypeZ(pctxt,ctype) \ +(ctype*)rtxMemHeapAllocZ(&(pctxt)->pMemHeap,sizeof(ctype)) + +/* + * Free memory pointer. This macro frees memory at the given pointer. + * The memory must have been allocated using the rtxMemAlloc (or similar) + * macros or the rtxMem memory allocation macros. This macro is + * similar to the C \c free function. + * + * @param pctxt - Pointer to a context block + * @param mem_p - Pointer to memory block to free. This must have + * been allocated using the rtxMemAlloc or rtxMemAlloc macro or the + * rtxMemHeapAlloc function. + */ +#define rtxMemFreeType(pctxt,mem_p) \ +rtxMemHeapFreePtr(&(pctxt)->pMemHeap, (void*)mem_p) + +/** + * Allocate a dynamic array. This macro allocates a dynamic array of + * records of the given type. The pointer to the allocated array is + * returned to the caller. + * + * @param pctxt - Pointer to a context block + * @param n - Number of records to allocate + * @param type - Data type of an array record + */ +#define rtxMemAllocArray(pctxt,n,type) \ +(type*)rtxMemHeapAlloc (&(pctxt)->pMemHeap, sizeof(type)*n) + +#define rtxMemAllocArrayZ(pctxt,n,type) \ +(type*)rtxMemHeapAllocZ (&(pctxt)->pMemHeap, sizeof(type)*n) + +/* + * Free memory pointer. This macro frees memory at the given pointer. + * The memory must have been allocated using the rtxMemAlloc (or similar) + * macros or the rtxMem memory allocation macros. This macro is + * similar to the C \c free function. + * + * @param pctxt - Pointer to a context block + * @param mem_p - Pointer to memory block to free. This must have + * been allocated using the rtxMemAlloc or rtxMemAlloc macro or the + * rtxMemHeapAlloc function. + */ +#define rtxMemFreeArray(pctxt,mem_p) \ +rtxMemHeapFreePtr(&(pctxt)->pMemHeap, (void*)mem_p) + +/* + * Reallocate memory. This macro reallocates a memory block (either + * expands or contracts) to the given number of bytes. It is + * similar to the C \c realloc run-time function. + * + * @param pctxt - Pointer to a context block + * @param mem_p - Pointer to memory block to reallocate. This must have been + * allocated using the rtxMemAlloc macro or the rtxMemHeapAlloc function. + * @param nbytes - Number of bytes of memory to which the block is to be + * resized. + * @return - Void pointer to allocated memory or NULL if insufficient memory + * was available to fulfill the request. This may be the same as the pmem + * pointer that was passed in if the block did not need to be relocated. + */ +#define rtxMemReallocArray(pctxt,mem_p,n,type) \ +(type*)rtxMemHeapRealloc(&(pctxt)->pMemHeap, (void*)mem_p, sizeof(type)*n) + +/* Auto-pointer functions */ +/** + * This function allocates a new block of memory and creates an auto-pointer + * with reference count set to one. The \c rtxMemAutoPtrRef and + * \c rtxMemAutoPtrUnref functions can be used to increment and decrement + * the reference count. When the count goes to zero, the memory held by + * the pointer is freed. + * + * @param pctxt Pointer to a context structure. + * @param nbytes Number of bytes to allocate. + * @return Pointer to allocated memory or NULL if not enough + * memory is available. + */ +#define rtxMemNewAutoPtr(pctxt,nbytes) \ +rtxMemHeapAlloc(&(pctxt)->pMemHeap, nbytes) + +/** + * This function increments the auto-pointer reference count. + * + * @param pctxt Pointer to a context structure. + * @param ptr Pointer on which reference count is to be incremented. + * @return Referenced pointer value (ptr argument) or NULL + * if reference count could not be incremented. + */ +#define rtxMemAutoPtrRef(pctxt,ptr) \ +rtxMemHeapAutoPtrRef(&(pctxt)->pMemHeap, ptr) + +/** + * This function decrements the auto-pointer reference count. If the count + * goes to zero, the memory is freed. + * + * @param pctxt Pointer to a context structure. + * @param ptr Pointer on which reference count is to be decremented. + * @return Positive reference count or a negative error + * code. If zero, memory held by pointer will + * have been freed. + */ +#define rtxMemAutoPtrUnref(pctxt,ptr) \ +rtxMemHeapAutoPtrUnref(&(pctxt)->pMemHeap, ptr) + +/** + * This function returns the reference count of the given pointer. + * goes to zero, the memory is freed. + * + * @param pctxt Pointer to a context structure. + * @param ptr Pointer on which reference count is to be fetched. + * @return Pointer reference count. + */ +#define rtxMemAutoPtrGetRefCount(pctxt,ptr) \ +rtxMemHeapAutoPtrGetRefCount(&(pctxt)->pMemHeap, ptr) + +#ifdef __cplusplus +} +#endif +/** + * @} + */ +#endif /*__RTXMEMORY_H__*/ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPattern.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPattern.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,67 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxPattern.h + * Pattern matching functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXPATTERN_H_ +#define _RTXPATTERN_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup ccfPattern Pattern matching functions + * @{ + * + * These functions handle pattern matching which is required to to process XML + * schema pattern constraints. + */ +/** + * This function compares the given string to the given pattern. It returns + * true if match, false otherwise. + * + * @param pctxt Pointer to context structure. + * @param text Text to be matched. + * @param pattern Regular expression. + * @return Boolean result. + */ +EXTERNRT OSBOOL rtxMatchPattern (OSCTXT* pctxt, + const OSUTF8CHAR* text, + const OSUTF8CHAR* pattern); + +EXTERNRT OSBOOL rtxMatchPattern2 (OSCTXT* pctxt, + const OSUTF8CHAR* pattern); +/** + * @} ccfPattern + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPrint.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPrint.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,363 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxPrint.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXPRINT_H_ +#define _RTXPRINT_H_ + +#include +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" +#include "rtxsrc/rtxDList.h" + +#define OSRTINDENTSPACES 3 /* number of spaces for indent */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Run-time print utility functions */ + +/** + * @defgroup valsToStdout Print Functions + * @{ + * + * These functions simply print the output in a "name=value" format. The value + * format is obtained by calling one of the ToString functions with the given + * value. + */ +/** + * This function converts a byte value into its hex string equivalent. + * + * @param byte Byte to format. + * @param buf Output buffer. + * @param bufsize Output buffer size. + */ +EXTERNRT int rtxByteToHexChar (OSOCTET byte, char* buf, size_t bufsize); + +/** + * Prints a boolean value to stdout. + * + * @param name The name of the variable to print. + * @param value Boolean value to print. + */ +EXTERNRT void rtxPrintBoolean (const char* name, OSBOOL value); + +/** + * Prints a date value to stdout. + * + * @param name Name of the variable to print. + * @param pvalue Pointer to a structure that holds numeric + * DateTime value to print. + */ +EXTERNRT void rtxPrintDate + (const char* name, const OSNumDateTime *pvalue); + +/** + * Prints a time value to stdout. + * + * @param name Name of the variable to print. + * @param pvalue Pointer to a structure that holds numeric + * DateTime value to print. + */ +EXTERNRT void rtxPrintTime + (const char* name, const OSNumDateTime *pvalue); + +/** + * Prints a dateTime value to stdout. + * + * @param name Name of the variable to print. + * @param pvalue Pointer to a structure that holds numeric + * DateTime value to print. + */ +EXTERNRT void rtxPrintDateTime + (const char* name, const OSNumDateTime *pvalue); + +EXTERNRT void rtxPrintGYear + (const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintGYearMonth + (const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintGMonth + (const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintGMonthDay + (const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintGDay + (const char* name, const OSNumDateTime* pvalue); + +/** + * Prints an integer value to stdout. + * + * @param name The name of the variable to print. + * @param value Integer value to print. + */ +EXTERNRT void rtxPrintInteger (const char* name, OSINT32 value); + +/** + * Prints a 64-bit integer value to stdout. + * + * @param name The name of the variable to print. + * @param value 64-bit integer value to print. + */ +EXTERNRT void rtxPrintInt64 (const char* name, OSINT64 value); + +/** + * Prints an unsigned integer value to stdout. + * + * @param name The name of the variable to print. + * @param value Unsigned integer value to print. + */ +EXTERNRT void rtxPrintUnsigned (const char* name, OSUINT32 value); + +/** + * Prints an unsigned 64-bit integer value to stdout. + * + * @param name The name of the variable to print. + * @param value Unsigned 64-bit integer value to print. + */ +EXTERNRT void rtxPrintUInt64 (const char* name, OSUINT64 value); + +/** + * This function prints the value of a binary string in hex format + * to standard output. If the string is 32 bytes or less, it is printed + * on a single line with a '0x' prefix. If longer, a formatted hex dump + * showing both hex and ascii codes is done. + * + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + */ +EXTERNRT void rtxPrintHexStr +(const char* name, OSUINT32 numocts, const OSOCTET* data); + +/** + * Prints an octet string value in hex binary format to stdout. + * + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + */ +EXTERNRT void rtxPrintHexBinary +(const char* name, OSUINT32 numocts, const OSOCTET* data); + +/** + * Prints an ASCII character string value to stdout. + * + * @param name The name of the variable to print. + * @param cstring A pointer to the character string to be printed. + */ +EXTERNRT void rtxPrintCharStr (const char* name, const char* cstring); + +/** + * Prints a UTF-8 encoded character string value to stdout. + * + * @param name The name of the variable to print. + * @param cstring A pointer to the character string to be printed. + */ +EXTERNRT void rtxPrintUTF8CharStr +(const char* name, const OSUTF8CHAR* cstring); + +/** + * This function prints a Unicode string to standard output. Characters + * in the string that are within the normal Ascii range are printed as + * single characters. Characters outside the Ascii range are printed + * as 4-byte hex codes (0xnnnn). + * + * @param name The name of the variable to print. + * @param str Pointer to unicode sring to be printed. String is + * an array of C unsigned short data variables. + * @param nchars Number of characters in the string. If value is + * negative, string is assumed to be null-terminated + * (i.e. ends with a 0x0000 character). + */ +EXTERNRT void rtxPrintUnicodeCharStr +(const char* name, const OSUNICHAR* str, int nchars); + +/** + * Prints a REAL (float, double, decimal) value to stdout. + * + * @param name The name of the variable to print. + * @param value REAL value to print. + */ +EXTERNRT void rtxPrintReal (const char* name, OSREAL value); + +/** + * Prints a NULL value to stdout. + * + * @param name The name of the variable to print. + */ +EXTERNRT void rtxPrintNull (const char* name); + +/** + * Prints a name-value pair to stdout. + * + * @param name The name of the variable to print. + * @param value A pointer to name-value pair structure to print. + */ +EXTERNRT void rtxPrintNVP (const char* name, const OSUTF8NVP* value); + +/** + * This function prints the contents of a text file to stdout. + * + * @param filename The name of the text file to print. + * @return Status of operation, 0 if success. + */ +EXTERNRT int rtxPrintFile (const char* filename); + +#ifndef __SYMBIAN32__ + +/** + * This function prints indentation spaces to stdout. + */ +EXTERNRT void rtxPrintIndent (void); + +/** + * This function increments the current indentation level. + */ +EXTERNRT void rtxPrintIncrIndent (void); + +/** + * This function decrements the current indentation level. + */ +EXTERNRT void rtxPrintDecrIndent (void); + +/** + * This function closes a braced region by decreasing the indent level, + * printing indent spaces, and printing the closing brace. + */ +EXTERNRT void rtxPrintCloseBrace (void); + +/** + * This function opens a braced region by printing indent spaces, + * printing the name and opening brace, and increasing the indent level. + */ +EXTERNRT void rtxPrintOpenBrace (const char*); + +#endif + +/** + * This function outputs a hexadecimal dump of the current buffer contents to + * the file with the given name. The file is opened or created and then + * closed after the writer operation is complete. + * + * @param filename Full path to file to which data should be output. + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed + */ +EXTERNRT void rtxHexDumpToNamedFile +(const char* filename, const OSOCTET* data, OSUINT32 numocts); + +/** + * This function outputs a hexadecimal dump of the current buffer contents to a + * file. + * + * @param fp A pointer to FILE structure. The file should be opened + * for writing. + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed + */ +EXTERNRT void rtxHexDumpToFile +(FILE* fp, const OSOCTET* data, OSUINT32 numocts); + +/** + * This function outputs a hexadecimal dump of the current buffer to a file, + * but it may output the dump as an array of bytes, words, or double words. + * + * @param fp A pointer to FILE structure. The file should be opened + * for writing. + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed. + * @param bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 + * (word), or 4 (double word). + */ +EXTERNRT void rtxHexDumpToFileEx +(FILE* fp, const OSOCTET* data, OSUINT32 numocts, int bytesPerUnit); + +/** + * This function outputs a hexadecimal dump of the current buffer contents to + * stdout. + * + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed. + */ +EXTERNRT void rtxHexDump (const OSOCTET* data, OSUINT32 numocts); + +/** + * This function outputs a hexadecimal dump of the current buffer contents to + * stdout, but it may display the dump as an array or bytes, words, or double + * words. + * + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed. + * @param bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 + * (word), or 4 (double word). + */ +EXTERNRT void rtxHexDumpEx +(const OSOCTET* data, OSUINT32 numocts, int bytesPerUnit); + +/** + * This function formats a hexadecimal dump of the current buffer contents to a + * string. + * + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed. + * @param buffer The destination string buffer. + * @param bufferIndex The starting position in the destination buffer. The + * formatting of the dump will begin at this position. + * @param bufferSize The total size of the destination buffer. + * @return The length of the final string. + */ +EXTERNRT int rtxHexDumpToString +(const OSOCTET* data, OSUINT32 numocts, char* buffer, int bufferIndex, + int bufferSize); + +/** + * This function formats a hexadecimal dump of the current buffer contents to a + * string, but it may output the dump as an array of bytes, words, or double + * words. + * + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed. + * @param buffer The destination string buffer. + * @param bufferIndex The starting position in the destination buffer. The + * formatting of the dump will begin at this position. + * @param bufferSize The total size of the destination buffer. + * @param bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 + * (word), or 4 (double word). + * @return The length of the final string. + */ +EXTERNRT int rtxHexDumpToStringEx +(const OSOCTET* data, OSUINT32 numocts, char* buffer, + int bufferIndex, int bufferSize, int bytesPerUnit); + +/** + * @} valsToStdout + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPrintStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPrintStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,144 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxPrintStream.h + * Functions that allow printing diagnostic message to a stream using a + * callback function. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXPRINTSTREAM_H_ +#define _RTXPRINTSTREAM_H_ + +#include +#include "rtxsrc/rtxContext.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup ccfDiag + * @{ + */ +/** + * Callback function definition for print stream. + */ +typedef void (*rtxPrintCallback) +(void* pPrntStrmInfo, const char* fmtspec, va_list arglist); + +/** + * Structure to hold information about a global PrintStream. + */ +typedef struct OSRTPrintStream { + rtxPrintCallback pfPrintFunc; + void * pPrntStrmInfo; +} OSRTPrintStream; + +#ifndef __SYMBIAN32__ +/** + * Global PrintStream + */ +extern OSRTPrintStream g_PrintStream; +#endif + +/** + * This function is for setting the callback function for a PrintStream. Once a + * callback function is set, then all print and debug output ia sent to + * the defined callback function. + * + * @param pctxt Pointer to a context in which callback print function + * will be set + * @param myCallback Pointer to a callback print function. + * @param pStrmInfo Pointer to user defined PrintInfo structure where users + * can store information required by the callback function + * across calls. Ex. An open File handle for callbak + * function which directs stream to a file. + * + * @return Completion status, 0 on success, negative value on failure + */ +EXTERNRT int rtxSetPrintStream +(OSCTXT *pctxt, rtxPrintCallback myCallback, void* pStrmInfo); + +#ifndef __SYMBIAN32__ +/** + * This function is for setting the callback function for a PrintStream. + * This version of the function sets a callback at the global level. + * + * @param myCallback Pointer to a callback print function. + * @param pStrmInfo Pointer to user defined PrintInfo structure where users + * can store information required by the callback function + * across calls. Ex. An open File handle for callbak + * function which directs stream to a file. + * + * @return Completion status, 0 on success, negative value on failure + */ +EXTERNRT int rtxSetGlobalPrintStream +(rtxPrintCallback myCallback, void* pStrmInfo); +#endif + +/** + * Print-to-stream function which in turn calls the user registered callback + * function of the context for printing. If no callback function is registered + * it prints to standard output by default. + * + * @param pctxt Pointer to context to be used. + * @param fmtspec A printf-like format specification string describing the + * message to be printed (for example, "string %s, ivalue + * %d\n"). + * @param ... A variable list of arguments. + * + * @return Completion status, 0 on success, negative value on failure + */ +EXTERNRT int rtxPrintToStream (OSCTXT* pctxt, const char* fmtspec, ...); + +/** + * Diagnostics print-to-stream function. This is the same as the + * \c rtxPrintToStream function except that it checks if diagnostic tracing + * is enabled before invoking the callback function. + * + * @param pctxt Pointer to context to be used. + * @param fmtspec A printf-like format specification string describing the + * message to be printed (for example, "string %s, ivalue + * %d\n"). + * @param arglist A variable list of arguments passed as va_list + * + * @return Completion status, 0 on success, negative value on failure + */ +EXTERNRT int rtxDiagToStream +(OSCTXT *pctxt, const char* fmtspec, va_list arglist); + +/** + * This function releases the memory held by PrintStream in the context + * + * @param pctxt Pointer to a context for which the memory has to be + * released. + * + * @return Completion status, 0 on success, negative value on failure + */ +EXTERNRT int rtxPrintStreamRelease (OSCTXT* pctxt); + +#ifdef __cplusplus +} +#endif +/** + * @} ccfDiag + */ +#endif /* _RTXPRINTSTREAM_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPrintToStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxPrintToStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,308 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + + +/** + * @file rtxPrintToStream.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXPRINTTOSTREAM_H_ +#define _RTXPRINTTOSTREAM_H_ + +#include +#include "rtxsrc/rtxContext.h" + +#define OSRTINDENTSPACES 3 /* number of spaces for indent */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Run-time print utility functions */ + +/** + * @defgroup prtToStrm Print-To-Stream Functions + * @{ + * + * These functions print typed data in a "name=value" format. The output + * is redirected to the print stream defined within the context or to a + * global print stream. Print streams are set using the rtxSetPrintStream + * or rtxSetGlobalPrintStream function. + */ +/** + * Prints a boolean value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param value Boolean value to print. + */ +EXTERNRT void rtxPrintToStreamBoolean + (OSCTXT* pctxt, const char* name, OSBOOL value); + +/** + * Prints a date value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name Name of the variable to print. + * @param pvalue Pointer to a structure that holds numeric + * DateTime value to print. + */ +EXTERNRT void rtxPrintToStreamDate + (OSCTXT* pctxt, const char* name, const OSNumDateTime *pvalue); + +/** + * Prints a time value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name Name of the variable to print. + * @param pvalue Pointer to a structure that holds numeric + * DateTime value to print. + */ +EXTERNRT void rtxPrintToStreamTime + (OSCTXT* pctxt, const char* name, const OSNumDateTime *pvalue); + +/** + * Prints a dateTime value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name Name of the variable to print. + * @param pvalue Pointer to a structure that holds numeric + * DateTime value to print. + */ +EXTERNRT void rtxPrintToStreamDateTime + (OSCTXT* pctxt, const char* name, const OSNumDateTime *pvalue); + +EXTERNRT void rtxPrintToStreamGYear + (OSCTXT* pctxt, const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintToStreamGYearMonth + (OSCTXT* pctxt, const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintToStreamGMonth + (OSCTXT* pctxt, const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintToStreamGMonthDay + (OSCTXT* pctxt, const char* name, const OSNumDateTime* pvalue); + +EXTERNRT void rtxPrintToStreamGDay + (OSCTXT* pctxt, const char* name, const OSNumDateTime* pvalue); + +/** + * Prints an integer value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param value Integer value to print. + */ +EXTERNRT void rtxPrintToStreamInteger + (OSCTXT* pctxt, const char* name, OSINT32 value); + +/** + * Prints a 64-bit integer value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param value 64-bit integer value to print. + */ +EXTERNRT void rtxPrintToStreamInt64 + (OSCTXT* pctxt, const char* name, OSINT64 value); + +/** + * Prints an unsigned integer value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param value Unsigned integer value to print. + */ +EXTERNRT void rtxPrintToStreamUnsigned + (OSCTXT* pctxt, const char* name, OSUINT32 value); + +/** + * Prints an unsigned 64-bit integer value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param value Unsigned 64-bit integer value to print. + */ +EXTERNRT void rtxPrintToStreamUInt64 + (OSCTXT* pctxt, const char* name, OSUINT64 value); + +/** + * This function prints the value of a binary string in hex format + * to standard output. If the string is 32 bytes or less, it is printed + * on a single line with a '0x' prefix. If longer, a formatted hex dump + * showing both hex and ascii codes is done. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + */ +EXTERNRT void rtxPrintToStreamHexStr + (OSCTXT* pctxt, const char* name, OSUINT32 numocts, const OSOCTET* data); + +/** + * Prints an octet string value in hex binary format to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param numocts The number of octets to be printed. + * @param data A pointer to the data to be printed. + */ +EXTERNRT void rtxPrintToStreamHexBinary + (OSCTXT* pctxt, const char* name, OSUINT32 numocts, const OSOCTET* data); + +/** + * Prints an ASCII character string value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param cstring A pointer to the character string to be printed. + */ +EXTERNRT void rtxPrintToStreamCharStr + (OSCTXT* pctxt, const char* name, const char* cstring); + +/** + * Prints a UTF-8 encoded character string value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param cstring A pointer to the character string to be printed. + */ +EXTERNRT void rtxPrintToStreamUTF8CharStr + (OSCTXT* pctxt, const char* name, const OSUTF8CHAR* cstring); + +/** + * This function prints a Unicode string to standard output. Characters + * in the string that are within the normal Ascii range are printed as + * single characters. Characters outside the Ascii range are printed + * as 4-byte hex codes (0xnnnn). + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param str Pointer to unicode sring to be printed. String is + * an array of C unsigned short data variables. + * @param nchars Number of characters in the string. If value is + * negative, string is assumed to be null-terminated + * (i.e. ends with a 0x0000 character). + */ +EXTERNRT void rtxPrintToStreamUnicodeCharStr + (OSCTXT* pctxt, const char* name, const OSUNICHAR* str, int nchars); + +/** + * Prints a REAL (float, double, decimal) value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param value REAL value to print. + */ +EXTERNRT void rtxPrintToStreamReal + (OSCTXT* pctxt, const char* name, OSREAL value); + +/** + * Prints a NULL value to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + */ +EXTERNRT void rtxPrintToStreamNull (OSCTXT* pctxt, const char* name); + +/** + * Prints a name-value pair to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param name The name of the variable to print. + * @param value A pointer to name-value pair structure to print. + */ +EXTERNRT void rtxPrintToStreamNVP + (OSCTXT* pctxt, const char* name, const OSUTF8NVP* value); + +/** + * This function prints the contents of a text file to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param filename The name of the text file to print. + * @return Status of operation, 0 if success. + */ +EXTERNRT int rtxPrintToStreamFile (OSCTXT* pctxt, const char* filename); + +#ifndef __SYMBIAN32__ +/** + * This function prints indentation spaces to a print stream. + */ +EXTERNRT void rtxPrintToStreamIndent (OSCTXT* pctxt); + +/** + * This function increments the current indentation level. + */ +EXTERNRT void rtxPrintToStreamIncrIndent (void); + +/** + * This function decrements the current indentation level. + */ +EXTERNRT void rtxPrintToStreamDecrIndent (void); + +/** + * This function closes a braced region by decreasing the indent level, + * printing indent spaces, and printing the closing brace. + */ +EXTERNRT void rtxPrintToStreamCloseBrace (OSCTXT* pctxt); + +/** + * This function opens a braced region by printing indent spaces, + * printing the name and opening brace, and increasing the indent level. + */ +EXTERNRT void rtxPrintToStreamOpenBrace (OSCTXT* pctxt, const char*); + +#endif + +/** + * This function outputs a hexadecimal dump of the current buffer contents + * to a print stream. + * + * @param pctxt A pointer to a context structure. + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed + */ +EXTERNRT void rtxHexDumpToStream + (OSCTXT* pctxt, const OSOCTET* data, OSUINT32 numocts); + +/** + * This function outputs a hexadecimal dump of the current buffer to a + * print stream, but it may output the dump as an array of bytes, words, + * or double words. + * + * @param pctxt A pointer to a context structure. + * @param data The pointer to a buffer to be displayed. + * @param numocts The number of octets to be displayed. + * @param bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 + * (word), or 4 (double word). + */ +EXTERNRT void rtxHexDumpToStreamEx + (OSCTXT* pctxt, const OSOCTET* data, OSUINT32 numocts, int bytesPerUnit); + +/** + * @} prtToStrm + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxReal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxReal.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,103 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxReal.h + * Common runtime functions for working with floating-point numbers. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXREAL_H_ +#define _RTXREAL_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxReal Floating-point number utility functions + * @{ + * Floating-point utility function provide run-time functions for handling + * floating-point number types defined within a schema. + */ + +/** + * Returns the IEEE negative infinity value. This is defined as + * 0xfff0000000000000 in IEEE standard 754. We assume the presence of the + * IEEE double type, that is, 64-bits of precision. */ +EXTERNRT OSREAL rtxGetMinusInfinity (void); + +/** + * Returns the IEEE minus zero value. This is defined as + * 0x8000000000000000 in IEEE standard 754. We assume the presence of the + * IEEE double type, that is, 64-bits of precision. */ +EXTERNRT OSREAL rtxGetMinusZero (void); + +/** + * Returns the IEEE Not-A-Number (NaN) value. This is defined as + * 0x7ff8000000000000 in IEEE standard 754. We assume the presence of the + * IEEE double type, that is, 64-bits of precision. */ +EXTERNRT OSREAL rtxGetNaN (void); + +/** + * Returns the IEEE posative infinity value. This is defined as + * 0x7ff0000000000000 in IEEE standard 754. We assume the presence of the + * IEEE double type, that is, 64-bits of precision. */ +EXTERNRT OSREAL rtxGetPlusInfinity (void); + +/** + * A utility function that compares the given input value to the IEEE 754 + * value for negative infinity. + * + * @param value The input real value. */ +EXTERNRT OSBOOL rtxIsMinusInfinity (OSREAL value); + +/** + * A utility function that compares the given input value to the IEEE 754 + * value for minus zero. + * + * @param value The input real value. */ +EXTERNRT OSBOOL rtxIsMinusZero (OSREAL value); + +/** + * A utility function that compares the given input value to the IEEE 754 + * value for Not-A-Number (NaN). + * + * @param value The input real value. */ +EXTERNRT OSBOOL rtxIsNaN (OSREAL value); + +/** + * A utility function that compares the given input value to the IEEE 754 + * value for positive infinity. + * + * @param value The input real value. */ +EXTERNRT OSBOOL rtxIsPlusInfinity (OSREAL value); + +/** + * @} rtxReal + */ + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxRegExp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxRegExp.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,134 @@ +/* + * regexp.h : describes the basic API for libxml regular expressions handling + * + * See Copyright for the status of this software. + * + * Daniel Veillard + */ +/* +NOTE: the copyright notice below applies only to source and header files +that include this notice. It does not apply to other Objective Systems +software with different attached notices. + +Except where otherwise noted in the source code (e.g. the files hash.c, +list.c and the trio files, which are covered by a similar licence but +with different Copyright notices) all the files are: + + Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is fur- +nished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- +NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- +NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Daniel Veillard shall not +be used in advertising or otherwise to promote the sale, use or other deal- +ings in this Software without prior written authorization from him. +*/ +/** + * @file rtxRegExp.h + */ +/** + * Changes made to original libxml source file (xmlregexp.h) by + * Objective Systems, Inc are as follows: + * + * 1. Changed to fit Objective Systems run-time environment including + * common type name changes and use of OSys mem mgmt. + * + * 2. Name change from xmlregexp to rtxRegExp to reflect fact that the + * code will be used in other non-XML environments. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef __RTXREGEXP_H__ +#define __RTXREGEXP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * rtxRegexpPtr: + * + * A libxml regular expression, they can actually be far more complex + * than POSIX regex expressions. + */ +typedef struct _rtxRegexp rtxRegexp; +typedef rtxRegexp *rtxRegexpPtr; + +/** + * rtxRegExecCtxtPtr: + * + * A libxml progressive regular expression evaluation context + */ +typedef struct _rtxRegExecCtxt rtxRegExecCtxt; +typedef rtxRegExecCtxt *rtxRegExecCtxtPtr; + +#ifdef __cplusplus +} +#endif +#include +#include "rtxsrc/rtxContext.h" +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The POSIX like API + */ +EXTERNRT rtxRegexpPtr rtxRegexpCompile +(OSCTXT* pOSCTXT, const OSUTF8CHAR* regexp); + +EXTERNRT void rtxRegFreeRegexp (OSCTXT* pOSCTXT, rtxRegexpPtr regexp); + +EXTERNRT int rtxRegexpExec +(OSCTXT* pOSCTXT, rtxRegexpPtr comp, const OSUTF8CHAR *value); + +EXTERNRT void rtxRegexpPrint (FILE *output, rtxRegexpPtr regexp); + +EXTERNRT int rtxRegexpIsDeterminist (OSCTXT* pOSCTXT, rtxRegexpPtr comp); + +EXTERNRT int +rtxRegexpFill(OSCTXT* pOSCTXT, rtxRegexpPtr regexp, const OSUTF8CHAR** ppDest); + +/* + * Callback function when doing a transition in the automata + */ +typedef void (*rtxRegExecCallbacks) (rtxRegExecCtxtPtr exec, + const OSUTF8CHAR *token, + void *transdata, + void *inputdata); + +/* + * The progressive API + */ +rtxRegExecCtxtPtr rtxRegNewExecCtxt (OSCTXT* pOSCTXT, + rtxRegexpPtr comp, + rtxRegExecCallbacks callback, + void *data); +void rtxRegFreeExecCtxt (rtxRegExecCtxtPtr exec); +int rtxRegExecPushString (rtxRegExecCtxtPtr exec, + const OSUTF8CHAR *value, + void *data); + +#ifdef __cplusplus +} +#endif + +#endif /*__RTXREGEXP_H__ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxSList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxSList.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,188 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxSList.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSLIST_H_ +#define _RTXSLIST_H_ + +#include "rtxsrc/rtxContext.h" + +/** + * @defgroup ccfSList Linked List Utility Functions + * + * Singly linked list structures have only a single link pointer and can + * therefore only be traversed in a single direction (forward). The node + * structures consume less memory than those of a doubly linked list. + * + * Another difference between the singly linked list implementation and doubly + * linked lists is that the singly linked list uses conventional memory + * allocation functions (C malloc and free) for less storage instead of the + * rtxMem functions. Therefore, it is not a requirement to have an initialized + * context structure to work with these lists. However, performance may suffer + * if the lists become large due to the use of non-optimized memory management. + *@{ + */ + +/** + * @struct _OSRTSListNode + * This structure is used to hold a single data item within the list. + * It contains a void pointer to point at any type of data item and + * forward pointer to the next entry in the list. + */ +typedef struct _OSRTSListNode { + void* data; /**< Pointer to list data item. */ + struct _OSRTSListNode* next; /**< Pointer to next node in list. */ +} OSRTSListNode; + +struct OSCTXT; + +/** + * @struct _OSRTSList + * This is the main list structure. It contains a count of the number + * of elements in the list and pointers to the list head and tail + * elements. + */ +typedef struct _OSRTSList { + OSUINT32 count; /**< Count of items in the list. */ + OSRTSListNode* head; /**< Pointer to first entry in list. */ + OSRTSListNode* tail; /**< Pointer to last entry in list. */ + struct OSCTXT* pctxt; +} OSRTSList; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function initializes a singly linked list structure. It sets the number + * of elements to zero and sets all internal pointer values to NULL. + * + * @param pList A pointer to a linked list structure to be initialized. + */ +EXTERNRT void rtxSListInit (OSRTSList* pList); + +/** + * This function is similar to rtxSListInit but it also sets the pctxt (pointer + * to a context structure member of OSRTSList structure). This context will be + * used for further memory allocations; otherwise the standard malloc is used. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pList A pointer to a linked list structure to be initialized. + */ +EXTERNRT void rtxSListInitEx (OSCTXT* pctxt, OSRTSList* pList); + +/** + * This function removes all nodes from the linked list structure and releases + * memory that was allocated for storing node structures (OSRTSListNode). + * The data will not be freed. + * + * @param pList A pointer to a linked list onto which the data item is + * to be appended. + */ +EXTERNRT void rtxSListFree (OSRTSList* pList); + +/** + * This function removes all nodes from the linked list structure and releases + * memory that was allocated for storing node structures (OSRTSListNode). + * It also frees the data structures which are assumed to have been + * allocated using the rtxMemAlloc function. + * + * @param pList A pointer to a linked list onto which the data item is + * to be appended. + */ +EXTERNRT void rtxSListFreeAll (OSRTSList* pList); + +/** + * This function creates a new linked list structure. It allocates memory for + * the structure and calls rtxSListInit to initialize the structure. + * + * @return A pointer to the allocated linked list structure. + */ +EXTERNRT OSRTSList* rtxSListCreate (void); + +/** + * The rtxSListAppend function appends an item to linked list structure. The + * data is passed into the function as a void that can point to an object of + * any type. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @return A pointer to the allocated linked list structure. + */ +EXTERNRT OSRTSList* rtxSListCreateEx (OSCTXT* pctxt); + +/** + * This function appends an item to a linked list structure. The data item is + * passed into the function as a void parameter that can point to an object of + * any type. + * + * @param pList A pointer to a linked list onto which the data item is + * to be appended. + * @param pData A pointer to a data item to be appended to the list. + * @return A pointer to the allocated linked list structure. + */ +EXTERNRT OSRTSListNode* rtxSListAppend (OSRTSList* pList, void* pData); + +/** + * This function finds an item in the linked list structure. The data item is + * passed into the function as a void pointer that can point to an object of + * any type. If the appropriate node is found in the list this function returns + * TRUE, otherwise FALSE. + * + * @param pList A pointer to a linked list onto which the data item is + * to be appended. + * @param pData A pointer to a data item to be appended to the list. + * @return TRUE, if the node is found, otherwise FALSE. + */ +EXTERNRT OSBOOL rtxSListFind (OSRTSList* pList, void* pData); + +/** + * This function finds an item in the linked list structure and removes it from + * the list. The data item is passed into the function as a void pointer that + * can point to an object of any type. + * + * @param pList A pointer to a linked list onto which the data item is + * to be appended. + * @param pData A pointer to a data item to be appended to the list. + */ +EXTERNRT void rtxSListRemove (OSRTSList* pList, void* pData); + +/** + * @} + */ + +#define OSALLOCELEMSNODE(pctxt,type) \ +(type*) (((char*)rtxMemAllocZ (pctxt, sizeof(type) + \ +sizeof(OSRTSListNode))) + sizeof(OSRTSListNode)) + + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxScalarDList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxScalarDList.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,230 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxScalarDList.h + * Doubly-linked list utility functions to hold scalar data variables. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSCALARDLIST_H_ +#define _RTXSCALARDLIST_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct OSCTXT; + +/* Kept externally to avoid breakage on intolerant compilers like aCC. */ +typedef enum { + ScalarDList_undefined, + ScalarDList_double, + ScalarDList_float, + ScalarDList_int32, + ScalarDList_uint32, + ScalarDList_int64, + ScalarDList_uint64 +} e_ident; /**< Data item identifier */ + +/** + * @defgroup rtxScalarDList Doubly-Linked List Utility Functions + * + * The doubly-linked list utility functions provide common routines for + * managing linked lists. This module is identical to the rtxDList module + * except that the data varaibles that can be added to the lists are + * scalars (integer, double, float, etc.) whereas the standard rtxDList + * type hold pointers to more complex data items. + *@{ + */ +/** + * @struct OSRTScalarDListNode + * This structure is used to hold a single data item within the list. + * The data item is a union of all of the possible scalar types it can + * hold. The node also contains forward and backward pointers to the + * next and previous entries in the list. + */ +typedef struct OSRTScalarDListNode { + e_ident ident; + + union { + OSDOUBLE dfltval; /**< Double prec floating point value */ + OSFLOAT fltval; /**< Single prec floating point value */ + OSINT32 i32val; /**< 32-bit signed integer */ + OSUINT32 ui32val; /**< 32-bit unsigned integer */ +#if !defined(_NO_INT64_SUPPORT) + OSINT64 i64val; /**< 64-bit signed integer */ + OSUINT64 ui64val; /**< 64-bit unsigned integer */ +#endif + } u; + + struct OSRTScalarDListNode* next; /**< Pointer to next node in list */ + struct OSRTScalarDListNode* prev; /**< Pointer to previous node in list */ +} OSRTScalarDListNode; + +/** + * @struct OSRTScalarDList + * This is the main list structure. It contains a count of the number + * of elements in the list and pointers to the list head and tail + * elements. + */ +typedef struct OSRTScalarDList { + OSUINT32 count; /**< Count of items in the list */ + OSRTScalarDListNode* head; /**< Pointer to first entry in list */ + OSRTScalarDListNode* tail; /**< Pointer to last entry in list */ +} OSRTScalarDList; + +/** + * This function initializes a doubly linked list structure. It sets the + * number of elements to zero and sets all internal pointer values to NULL. + * A doubly-linked scalar list structure is described by the \c + * OSRTScalarDList type. Nodes of the list are of type \c OSRTScalarDListNode. + * + * @param pList A pointer to a linked list structure to be initialized. + */ +EXTERNRT void rtxScalarDListInit (OSRTScalarDList* pList); + +/** + * This set of functions appends an item of the given scalar type to + * the linked list structure. Separate functions exist for all of the + * different supported scalar types. + * + * @param pctxt A pointer to a context structure. This provides a + * storage area for the function to store all working + * variables that must be maintained between function + * calls. + * @param pList A pointer to a linked list structure onto which the + * data item will be appended. + * @param value Data item to be appended to the list. + * @return A pointer to an allocated node structure used to link + * the given data value into the list. + */ +EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendDouble +(struct OSCTXT* pctxt, OSRTScalarDList* pList, OSDOUBLE value); + +EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendFloat +(struct OSCTXT* pctxt, OSRTScalarDList* pList, OSFLOAT value); + +EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendInt32 +(struct OSCTXT* pctxt, OSRTScalarDList* pList, OSINT32 value); + +EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendUInt32 +(struct OSCTXT* pctxt, OSRTScalarDList* pList, OSUINT32 value); + +#if !defined(_NO_INT64_SUPPORT) +EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendInt64 +(struct OSCTXT* pctxt, OSRTScalarDList* pList, OSINT64 value); + +EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendUInt64 +(struct OSCTXT* pctxt, OSRTScalarDList* pList, OSUINT64 value); +#endif + +/** + * This function is used to append a node to the linked list. This + * can be used instead of a scalar value append function. It requires + * the user to allocate and populate the list node structure. + * + * @param pList A pointer to a linked list structure onto which the + * list node will be appended. + * @param pListNode List node structure to be appended to the list. If + * this memory is to be released with the standard + * list memory free function, then it must be + * allocated using the rtxMemAlloc function. + * @return A pointer to an allocated node structure used to link + * the given data value into the list. This is the + * node structure that was passed in. + */ +EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendNode +(OSRTScalarDList* pList, OSRTScalarDListNode* pListNode); + +/** + * This function is used to insert a node into the linked list. + * + * @param pList A pointer to a linked list structure onto which the + * list node will be appended. + * @param index Zero-based index into list where the specified node + * is to be inserted. + * @param pListNode List node structure to be appended to the list. If + * this memory is to be released with the standard + * list memory free function, then it must be + * allocated using the rtxMemAlloc function. + * @return A pointer to an allocated node structure used to link + * the given data value into the list. This is the + * node structure that was passed in. + */ +EXTERNRT OSRTScalarDListNode* rtxScalarDListInsertNode +(OSRTScalarDList* pList, OSUINT32 index, OSRTScalarDListNode* pListNode); + +/** + * This function will return the node pointer of the indexed entry in + * the list. + * + * @param pList A pointer to a linked list structure. + * @param index Zero-based index into list where the specified item + * is located. If the list contains fewer items + * then the index, NULL is returned. + * @return A pointer to an allocated linked list node structure. + * To get the actual data item, the ident field + * must be examined to determine what type of value + * is stored in the union structure. + */ +EXTERNRT OSRTScalarDListNode* +rtxScalarDListFindByIndex (const OSRTScalarDList* pList, OSUINT32 index); + +/** + * This function will remove the given node from the list and free memory. + * It is assumed that memory for the list node structure was allocated + * using the \c rtxMemAlloc function. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to a linked list structure. + * @param node Pointer to the list node to be removed. + */ +EXTERNRT void rtxScalarDListFreeNode +(struct OSCTXT* pctxt, OSRTScalarDList* pList, OSRTScalarDListNode* node); + +/** + * This function will remove the given node from the list. + * + * @param pList A pointer to a linked list structure. + * @param node Pointer to the list node to be removed. + */ +EXTERNRT void rtxScalarDListRemove +(OSRTScalarDList* pList, OSRTScalarDListNode* node); + +/** + * This function will free all of the dynamic memory used to hold + * the list node pointers. + * + * @param pctxt A pointer to a context structure. + * @param pList A pointer to a linked list structure. + */ +EXTERNRT void rtxScalarDListFreeNodes +(struct OSCTXT* pctxt, OSRTScalarDList* pList); + +#ifdef __cplusplus +} +#endif +/** + * @} rtxScalarDList + */ +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxSocket.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxSocket.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,262 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxSocket.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSOCKET_H_ +#define _RTXSOCKET_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (_WIN64) && !defined(__SYMBIAN32__) +typedef unsigned __int64 OSRTSOCKET; /**< socket handle */ +#elif defined (_WIN32) && !defined(__SYMBIAN32__) +typedef unsigned int OSRTSOCKET; /**< socket handle */ +#else +typedef int OSRTSOCKET; /**< socket handle */ +#endif + +#define OSRTSOCKET_INVALID ((OSRTSOCKET)-1) + +/** + * @defgroup ccfSocket TCP/IP or UDP socket utility functions + * @{ + */ +/** + * The IP address represented as unsigned long value. The most significant 8 + * bits in this unsigned long value represent the first number of the IP + * address. The least significant 8 bits represent the last number of the IP + * address. + */ +typedef unsigned long OSIPADDR; + +#define OSIPADDR_ANY ((OSIPADDR)0) +#define OSIPADDR_LOCAL ((OSIPADDR)0x7f000001UL) /* 127.0.0.1 */ + +struct in_addr; + +/** + * This function permits an incoming connection attempt on a socket. It + * extracts the first connection on the queue of pending connections on socket. + * It then creates a new socket and returns a handle to the new socket. The + * newly created socket is the socket that will handle the actual connection + * and has the same properties as original socket. See description of 'accept' + * socket function for further details. + * + * @param socket The socket handle created by call to ::rtxSocketCreate + * function. + * @param pNewSocket The pointer to variable to receive the new socket + * handle. + * @param destAddr Optional pointer to a buffer that receives the IP + * address of the connecting entity. It may be NULL. + * @param destPort Optional pointer to a buffer that receives the port of + * the connecting entity. It may be NULL. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketAccept (OSRTSOCKET socket, OSRTSOCKET *pNewSocket, + OSIPADDR* destAddr, int* destPort); + +/** + * This function converts an IP address to its string representation. + * + * @param ipAddr The IP address to be converted. + * @param pbuf Pointer to the buffer to receive a string with the IP + * address. + * @param bufsize Size of the buffer. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketAddrToStr (OSIPADDR ipAddr, char* pbuf, size_t bufsize); + +/** + * This function associates a local address with a socket. It is used on an + * unconnected socket before subsequent calls to the ::rtxSocketConnect or + * ::rtxSocketListen functions. See description of 'bind' socket function for + * further details. + * + * @param socket The socket handle created by call to ::rtxSocketCreate + * function. + * @param addr The local IP address to assign to the socket. + * @param port The local port number to assign to the socket. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketBind (OSRTSOCKET socket, OSIPADDR addr, int port); + +/** + * This function closes an existing socket. + * + * @param socket The socket handle created by call to ::rtxSocketCreate + * or ::rtxSocketAccept function. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketClose (OSRTSOCKET socket); + +/** + * This function establishes a connection to a specified socket. It is used to + * create a connection to the specified destination. When the socket call + * completes successfully, the socket is ready to send and receive data. See + * description of 'connect' socket function for further details. + * + * @param socket The socket handle created by call to ::rtxSocketCreate + * function. + * @param host The null-terminated string with the IP address in the + * following format: "NNN.NNN.NNN.NNN", where NNN is a + * number in the range (0..255). + * @param port The destination port to connect. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketConnect (OSRTSOCKET socket, const char* host, int port); + +/** + * This function creates a TCP socket. + * + * @param psocket The pointer to the socket handle variable to receive + * the handle of new socket. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketCreate (OSRTSOCKET* psocket); + +/* + * This function creates a UDP socket. + * + * @param psocket The Pointer to the socket handle variable to receive + * the handle of the new socket. + * + * @return 0 upon success, < 0 upon failure. */ +EXTERNRT int rtxSocketCreateUDP (OSRTSOCKET *psocket); + +/** + * This function resolves the given host name to an IP address. The + * resulting address is stored in the given socket address structure. + * + * @param host Host name to resolve + * @param inaddr Socket address structure to receive resolved IP address + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketGetHost (const char* host, struct in_addr *inaddr); + +/** + * This function initiates use of sockets by an application. This function must + * be called first before use sockets. + * + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketsInit (); + +/** + * This function places a socket a state where it is listening for an incoming + * connection. To accept connections, a socket is first created with the + * ::rtxSocketCreate function and bound to a local address with the + * ::rtxSocketBind function, a maxConnection for incoming connections is + * specified with ::rtxSocketListen, and then the connections are accepted with + * the ::rtxSocketAccept function. See description of 'listen' socket function + * for further details. + * + * @param socket The socket handle created by call to + * ::rtxSocketCreate function. + * @param maxConnection Maximum length of the queue of pending connections. + * @return Completion status of operation: 0 (0) = + * success, negative return value is error. + */ +EXTERNRT int rtxSocketListen (OSRTSOCKET socket, int maxConnection); + +/** + * This function parses a simple URL of the form + * \://\:\ + * into its individual components. It is assumed that the buffer the + * URL is provided in is modifiable. Null-terminators are inserted in the + * buffer to delimit the individual components. If the user needs to use + * the URL in unparsed form for any other purpose, they will need to make + * a copy of it before calling this function. + * + * @param url URL to be parsed. Buffer will be altered. + * @param protocol Protocol string parsed from the URL. + * @param address IP address or domain name parsed from URL. + * @param port Optional port number. Zero if no port provided. + * @return Zero if parse successful or negative error code. + */ +EXTERNRT int rtxSocketParseURL +(char* url, char** protocol, char** address, int* port); + +/** + * This function receives data from a connected socket. It is used to read + * incoming data on sockets. The socket must be connected before calling this + * function. See description of 'recv' socket function for further details. + * + * @param socket The socket handle created by call to ::rtxSocketCreate + * or ::rtxSocketAccept function. + * @param pbuf Pointer to the buffer for the incoming data. + * @param bufsize Length of the buffer. + * @return If no error occurs, returns the number of bytes + * received. Otherwise, the negative value is error code. + */ +EXTERNRT int rtxSocketRecv (OSRTSOCKET socket, OSOCTET* pbuf, int bufsize); + +/** + * This function sends data on a connected socket. It is used to write outgoing + * data on a connected socket. See description of 'send' socket function for + * further details. + * + * @param socket The socket handle created by call to ::rtxSocketCreate + * or ::rtxSocketAccept function. + * @param pdata Buffer containing the data to be transmitted. + * @param size Length of the data in pdata. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketSend (OSRTSOCKET socket, const OSOCTET* pdata, int size); + +/** + * This function converts the string with IP address to a double word + * representation. The converted address may be used with the ::rtxSocketBind + * function. + * + * @param pIPAddrStr The null-terminated string with the IP address in the + * following format: "NNN.NNN.NNN.NNN", where NNN is a + * number in the range (0..255). + * @param pIPAddr Pointer to the converted IP address. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxSocketStrToAddr (const char* pIPAddrStr, OSIPADDR* pIPAddr); + +/** + * @} + */ +#ifdef __cplusplus +} +#endif + +#endif /* _RTXSOCKET_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStack.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStack.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,123 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxStack.h + * Simple FIFO stack for storing void pointers to any type of data. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTACK_H_ +#define _RTXSTACK_H_ + +#include "rtxsrc/rtxContext.h" + +/** + * @defgroup ccfStack Stack Utility Functions + * + * This is a simple stack structure with supporting push and pop functions. + * Different initialization routines are provided to permit different + * memory management schemes. + * + *@{ + */ +/** + * @struct _OSRTStack + * This is the main stack structure. It uses a linked list structure. + */ +typedef struct _OSRTStack { + OSCTXT* pctxt; + OSRTDList dlist; +} OSRTStack; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function creates a new stack structure. It allocates memory for the + * structure and calls rtxStackInit to initialize the structure. + * + * @param pctxt A pointer to the context with which the stack is + * associated. + * @return A pointer to an allocated stack structure. + */ +EXTERNRT OSRTStack* rtxStackCreate (OSCTXT* pctxt); + +/** + * This function initializes a stack structure. It sets the number of elements + * to zero and sets all internal pointer values to NULL. + * + * @param pctxt A pointer to the context with which the stack is + * associated. + * @param pStack A pointer to a stack structure to be initialized. + */ +EXTERNRT void rtxStackInit (OSCTXT* pctxt, OSRTStack* pStack); + +/** + * This macro tests if the stack is empty. + * + * @param stack Stack structure variable to be tested. + */ +#define rtxStackIsEmpty(stack) (OSBOOL)((stack).dlist.count == 0) + +/** + * This function pops an item off the stack. + * + * @param pStack The pointer to the stack structure from which the value + * is to be popped. Pointer to the updated stack + * structure. + * @return The pointer to the item popped from the stack + */ +EXTERNRT void* rtxStackPop (OSRTStack* pStack); + +/** + * This function pushes an item onto the stack. + * + * @param pStack A pointer to the structure onto which the data item is + * to be pushed. The pointer updated to the stack + * structure + * @param pData A pointer to the data item to be pushed on the stack. + * @return Completion status of operation: + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNRT int rtxStackPush (OSRTStack* pStack, void* pData); + +/** + * This functions returns the data item on the top of the stack. + * + * @param pStack A pointer to the structure onto which the data item is + * to be pushed. The pointer updated to the stack + * structure + * @return Pointer to data item at top of stack or NULL if + * stack empty. + * - 0 (0) = success, + * - negative return value is error. + */ +EXTERNRT void* rtxStackPeek (OSRTStack* pStack); + +/** + * @} + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStream.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,413 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxStream.h + * Input/output data stream type definitions and function prototypes. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTREAM_H_ +#define _RTXSTREAM_H_ + +#include "rtxsrc/rtxContext.h" +#include "rtxsrc/rtxMemBuf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxStream Input/Output Data Stream Utility Functions + * @{ + * + * Stream functions are used for unbuffered stream operations. All of the + * operations with streams are performed using a context block to maintain + * state information. + * + *

These functions may be used for any input/output operations with streams. + * Each stream should be initialized first by call to the \c rtxStreamInit + * function. After initialization, the stream may be opened for reading or + * writing by calling one of the following functions: + * - \c rtxStreamFileOpen + * - \c rtxStreamFileAttach + * - \c rtxStreamSocketAttach + * - \c rtxStreamMemoryCreate + * - \c rtxStreamMemoryAttach + */ + +struct OSRTSTREAM; + +/** + * Stream read function pointer type. A user may implement a customized read + * function for specific input streams. The read function is defined in the + * OSRTSTREAM control structure. + */ +typedef long (*OSRTStreamReadProc) + (struct OSRTSTREAM* pStream, OSOCTET* pbuffer, size_t bufSize); + +/** + * Stream blockingRead function pointer type. A user may implement a customized + * read function for specific input streams. The blockingRead function is + * defined in the OSRTSTREAM control structure. + */ +typedef long (*OSRTStreamBlockingReadProc) + (struct OSRTSTREAM* pStream, OSOCTET* pbuffer, size_t toReadBytes); + +/** + * Stream write function pointer type. A user may implement a customized write + * function for any specific output streams. The write function is defined in + * the OSRTSTREAM control structure. + */ +typedef long (*OSRTStreamWriteProc)(struct OSRTSTREAM* pStream, + const OSOCTET* data, size_t numocts); + +/** + * Stream flush function pointer type. A user may implement a customized flush + * function for any specific output streams. The flush function is defined in + * the OSRTSTREAM control structure. + */ +typedef int (*OSRTStreamFlushProc)(struct OSRTSTREAM* pStream); + +/** + * Stream close function pointer type. A user may implement a customized close + * function for any specific input or output streams. The close function is + * defined in the OSRTSTREAM control structure. + */ +typedef int (*OSRTStreamCloseProc)(struct OSRTSTREAM* pStream); + +/** + * Stream skip function pointer type. A user may implement a customized + * function for a specific input stream type. The skip function is defined in + * the OSRTSTREAM control structure. + */ +typedef int (*OSRTStreamSkipProc) + (struct OSRTSTREAM* pStream, size_t skipBytes); + +/** + * Stream mark function pointer type. A user may implement a customized + * function for a specific input stream type. The mark function is defined in + * the OSRTSTREAM control structure. + */ +typedef int (*OSRTStreamMarkProc) + (struct OSRTSTREAM* pStream, size_t readAheadLimit); + +/** + * Stream reset function pointer type. A user may implement a customized + * function for a specific input stream type. The reset function is defined in + * the OSRTSTREAM control structure. + */ +typedef int (*OSRTStreamResetProc) (struct OSRTSTREAM* pStream); + +#define OSRTSTRMF_INPUT 0x0001 +#define OSRTSTRMF_OUTPUT 0x0002 +#define OSRTSTRMF_BUFFERED 0x8000 /* direct-buffer stream */ +#define OSRTSTRMF_UNBUFFERED 0x4000 /* force unbuffered stream */ +#define OSRTSTRMF_POSMARKED 0x2000 /* stream has marked position */ + +#define OSRTSTRMF_BUF_INPUT (OSRTSTRMF_INPUT|OSRTSTRMF_BUFFERED) +#define OSRTSTRMF_BUF_OUTPUT (OSRTSTRMF_OUTPUT|OSRTSTRMF_BUFFERED) + + +#define OSRTSTRMID_FILE 1 +#define OSRTSTRMID_SOCKET 2 +#define OSRTSTRMID_MEMORY 3 +#define OSRTSTRMID_BUFFERED 4 +#define OSRTSTRMID_DIRECTBUF 5 +#define OSRTSTRMID_CTXTBUF 6 +#define OSRTSTRMID_ZLIB 7 +#define OSRTSTRMID_USER 1000 + +#define OSRTSTRM_K_BUFSIZE 1024 + +#define OSRTSTRM_K_INVALIDMARK ((size_t)-1) + +#define OSRTSTREAM_BYTEINDEX(pctxt) \ +(((pctxt)->pStream->id == OSRTSTRMID_DIRECTBUF) ? \ +((pctxt)->pStream->bytesProcessed + (pctxt)->buffer.byteIndex) : \ +((pctxt)->pStream->ioBytes)) + +#define OSRTSTREAM_ID(pctxt) ((pctxt)->pStream->id) +#define OSRTSTREAM_FLAGS(pctxt) ((pctxt)->pStream->flags) + +/** + * The stream control block. A user may implement a customized stream by + * defining read, skip, close functions for input streams and write, flush, + * close for output streams. + */ +typedef struct OSRTSTREAM { + OSRTStreamReadProc read; /*\< pointer to read function */ + OSRTStreamBlockingReadProc blockingRead;/*\< pointer to blockingRead function*/ + OSRTStreamWriteProc write; /*< pointer to write function */ + OSRTStreamFlushProc flush; /*< pointer to flush function */ + OSRTStreamCloseProc close; /*< pointer to close function */ + OSRTStreamSkipProc skip; /*\< pointer to skip function */ + OSRTStreamMarkProc mark; /*\< pointer to mark function */ + OSRTStreamResetProc reset; /*\< pointer to reset function */ + + void* extra; /*< pointer to stream-specific data */ + + size_t bufsize; /*< physical size of pctxt->buffer.data buf */ + size_t readAheadLimit; /*< read ahead limit (used by ::rtxStreamMark/::rtxStreamReset */ + size_t bytesProcessed; /*\< the number of bytes already processed */ + size_t markedBytesProcessed; /*< the marked number of bytes already processed */ + size_t ioBytes; /*< the actual number of bytes already read/written */ + size_t nextMarkOffset; /* offset of next appropriate mark position */ + + OSUINT32 id; /*< id of stream (see OSRTSTRMID_* macros */ + + /** + * Buffer into which data read from stream can be captured for + * debugging purposes. + */ + OSRTMEMBUF* pCaptureBuf; + + OSUINT16 flags; /*< flags (see OSRTSTRMF_* macros */ +} OSRTSTREAM; + +/** + * This function closes the input or output stream and releases any system + * resources associated with the stream. For output streams this function also + * flushes all internal buffers to the stream. + * + * @param pctxt Pointer to a context structure variable which has been + * initialized for stream operations via a call to \c + * rtxStreamInit. + */ +EXTERNRT int rtxStreamClose (OSCTXT* pctxt); + +/** + * This function flushes the output stream and forces any buffered output + * octets to be written out. + * + * @param pctxt Pointer to a context structure variable which has been + * initialized for stream operations via a call to \c + * rtxStreamInit. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamFlush (OSCTXT* pctxt); + +/** + * This function initializes a stream part of the context block. This function + * should be called first before any operation with a stream. + * + * @param pctxt Pointer to context structure variable, for which stream + * to be initialized. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamInit (OSCTXT* pctxt); + +/** + * This function reads up to 'bufsize' bytes of data from the input stream into + * an array of octets. An attempt is made to read as many as bufsize octets, + * but a smaller number may be read, possibly zero. The number of octets + * actually read is returned as an integer. This functions blocks until input + * data is available, end of file is detected, or another error is occurred. + * + * @param pctxt Pointer to a context structure variable which has been + * initialized for stream operations via a call to + * ::rtxStreamInit. + * @param pbuffer Pointer to a buffer to receive data. + * @param bufSize Size of the buffer. + * @return The total number of octets read into the buffer, or + * negative value with error code if any error is + * occurred. + */ +EXTERNRT long rtxStreamRead + (OSCTXT* pctxt, OSOCTET* pbuffer, size_t bufSize); + +/** + * This function reads up to 'bufsize' bytes of data from the input stream into + * an array of octets. An attempt is made to read as many as bufsize octets, + * but a smaller number may be read, possibly zero. The number of octets + * actually read is returned as an integer. This functions blocks until input + * data is available, end of file is detected, or another error is occurred. + * + * @param pctxt Pointer to a context structure variable which has been + * initialized for stream operations via a call to + * ::rtxStreamInit. + * @param pbuffer Pointer to a buffer to receive data. + * @param readBytes Number of bytes to read. + * @return The total number of octets read into the buffer, or + * negative value with error code if any error is + * occurred. + */ +EXTERNRT long rtxStreamBlockingRead + (OSCTXT* pctxt, OSOCTET* pbuffer, size_t readBytes); + +/** + * This function skips over and discards the specified amount of data octets + * from this input stream. + * + * @param pctxt Pointer to a context structure variable which has been + * initialized for stream operations via a call to + * ::rtxStreamInit. + * @param skipBytes The number of octets to be skipped. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamSkip (OSCTXT* pctxt, size_t skipBytes); + +/** + * This function writes the specified amount of octets from the specified array + * to the output stream. + * + * @param pctxt Pointer to a context structure variable which has been + * initialized for stream operations via a call to + * ::rtxStreamInit. + * @param data The pointer to data to be written. + * @param numocts The number of octets to write. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT long rtxStreamWrite + (OSCTXT* pctxt, const OSOCTET* data, size_t numocts); + +/** + * This function returns the number of processed octets. If the stream was + * opened as an input stream, then it returns the total number of read octets. + * If the stream was opened as an output stream, then it returns the total + * number of written octets. Otherwise, this function returns an error code. + * + * @param pctxt Pointer to a context structure variable which has been + * initialized for stream operations via a call to \c + * rtxStreamInit. + * @param pPos Pointer to argument to receive total number of + * processed octets. + * @return The total number of processed octets or error code + * (negative value). + */ +EXTERNRT int rtxStreamGetIOBytes (OSCTXT* pctxt, size_t* pPos); + +/** + * Marks the current position in this input stream. A subsequent call to the + * ::rtxStreamReset function repositions this stream at the last marked + * position so that subsequent reads re-read the same bytes. The + * \c readAheadLimit argument tells this input stream to allow many bytes + * to be read before the mark position gets invalidated. + * + * @param pctxt Pointer to a context structure variable that has + * been initialized for stream operations. + * @param readAheadLimit The maximum limit of bytes that can be read before + * the mark position becomes invalid. + * @return Completion status of operation: 0 = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamMark (OSCTXT* pctxt, size_t readAheadLimit); + +/** + * Repositions this stream to the position recorded by the last call to the + * ::rtxStreamMark function. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamReset (OSCTXT* pctxt); + +/** + * Tests if this input stream supports the mark and reset methods. Whether or + * not mark and reset are supported is an invariant property of a particular + * input stream instance. By default, it returns FALSE. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @return TRUE if this stream instance supports the mark and reset + * methods; FALSE otherwise. + */ +EXTERNRT OSBOOL rtxStreamMarkSupported (OSCTXT* pctxt); + +/** + * Tests if this stream opened (for reading or writing). + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @return TRUE if this stream is opened for reading or writing; + * FALSE otherwise. + */ +EXTERNRT OSBOOL rtxStreamIsOpened (OSCTXT* pctxt); + +/** + * Tests if this stream opened for reading. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @return TRUE if this stream is opened for reading; FALSE + * otherwise. + */ +EXTERNRT OSBOOL rtxStreamIsReadable (OSCTXT* pctxt); + +/** + * Tests if this stream opened for writing. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @return TRUE if this stream is opened for writing; FALSE + * otherwise. + */ +EXTERNRT OSBOOL rtxStreamIsWritable (OSCTXT* pctxt); + +/** + * This function releases the stream's resources. If it is opened for reading + * or writing it will be closed. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamRelease (OSCTXT* pctxt); + +/** + * This function sets a capture buffer for the stream. This is + * used to record all data read from the stream. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pmembuf Pointer to an initialized memory buffer structure. + * This argument may be set to NULL to disable + * capture if previously set. + */ +EXTERNRT void rtxStreamSetCapture (OSCTXT* pctxt, OSRTMEMBUF* pmembuf); + +/** + * This function returns the capture buffer currently assigned to the + * stream. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pmembuf Pointer to an initialized memory buffer structure. + * This argument may be set to NULL to disable + * capture if previously set. + * @return Pointer to memory buffer that was previously assigned + * as a capture buffer to the stream. + */ +EXTERNRT OSRTMEMBUF* rtxStreamGetCapture (OSCTXT* pctxt); + +/** @} rtxStream */ + +#ifdef __cplusplus +} +#endif + +#endif /* _RTXSTREAM_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamBuffered.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamBuffered.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,51 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxStreamBuffered.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTREAMBUFFERED_H_ +#define _RTXSTREAMBUFFERED_H_ + +#include "rtxsrc/rtxStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define OSRTSTRMCM_RESTORE_UNDERLAYING_AFTER_RESET 0x0001 + +EXTERNRT int rtxStreamBufferedCreate (OSCTXT* pctxt, OSUINT32 mode); + +EXTERNRT int rtxStreamBufferedRelease (OSCTXT* pctxt); + +EXTERNRT int rtxStreamBufferedSetPreReadBuf + (OSCTXT* pctxt, const OSOCTET* pdata, size_t datalen); + +EXTERNRT int rtxStreamBufferedPrependReadBuf + (OSCTXT* pctxt, const OSOCTET* pdata, size_t datalen); + +#ifdef __cplusplus +} +#endif + +#endif /* _RTXSTREAMBUFFERED_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamCtxtBuf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamCtxtBuf.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,90 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/* + * @file rtxStreamCtxtBuf.h + * Stream functions that work directly with the context buffer. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTREAMCTXTBUF_H_ +#define _RTXSTREAMCTXTBUF_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" +#include "rtxsrc/rtxStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This function create and initializes a context-buffered stream. This + * function should be called first before any operation with the stream. + * + * @param pctxt Pointer to context structure variable. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamCtxtBufCreate (OSCTXT* pctxt); + +/* + * This function pre-reads a 'size' number of octets of data from the input + * stream into the internal stream buffer. This functions blocks until all + * necessary data is read, end of file is detected, or another error + * occurs. This function guarantees that the internal buffer will contain at + * least the 'size' number of octets. Thus, it is possible to obtain direct + * access to the memory buffer with pre-read data by using the 'buffer' field + * of the OSCTXT context block. + * + * @param pctxt Pointer to a context structure variable that has + * been initialized for stream operations. + * @param size Number of octets to be pre-read. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamCtxtBufPreRead (OSCTXT* pctxt, size_t size); + +/* + * This function checks if the stream is already context-buffered or not. + * If not, the stream will be created above the existing stream. + * If the stream cannot be opened, an error code is returned. + * + * @param pctxt Pointer to a context structure variable that has + * been initialized for stream operations. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamCtxtBufCheck (OSCTXT* pctxt); + +/* + * This function frees a context-buffered stream and restores the underlying stream. + * + * @param pctxt Pointer to context structure variable. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamCtxtBufFree (OSCTXT* pctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* _RTXSTREAMCTXTBUF_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamFile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamFile.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,106 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxStreamFile.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTREAMFILE_H_ +#define _RTXSTREAMFILE_H_ + +#include +#include "rtxsrc/rtxStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxStreamFile File stream functions. + * File stream functions are used for stream operations with files. @{ + */ +/** + * Attaches the existing file structure pointer to the stream. The file should + * be already opened either for the reading or writing. The 'flags' parameter + * specifies the access mode for the stream - input or output. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pFile Pointer to FILE structure. File should be already opened + * either for the writing or reading. + * @param flags Specifies the access mode for the stream: + * - OSRTSTRMF_INPUT = input (reading) stream; + * - OSRTSTRMF_OUTPUT = output (writing) stream. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamFileAttach (OSCTXT* pctxt, + FILE* pFile, OSUINT16 flags); + +/** + * Opens a file stream. The 'flags' parameter specifies the access mode for the + * stream - input or output. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pFilename Pointer to null-terminated string that contains the name + * of file. + * @param flags Specifies the access mode for the stream: + * - OSRTSTRMF_INPUT = input (reading) stream; + * - OSRTSTRMF_OUTPUT = output (writing) stream. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamFileOpen (OSCTXT* pctxt, + const char* pFilename, OSUINT16 flags); + +/** + * This function creates an input file stream using the specified file name. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pFilename Pointer to null-terminated string that contains the name + * of file. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamFileCreateReader (OSCTXT* pctxt, const char* pFilename); + +/** + * This function creates an output file stream using the file name. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pFilename Pointer to null-terminated string that contains the name + * of file. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamFileCreateWriter (OSCTXT* pctxt, const char* pFilename); + + +#ifdef __cplusplus +} +#endif +/** + * @} rtxStreamFile + */ +#endif /* _RTXSTREAMFILE_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamMemory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamMemory.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,119 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxStreamMemory.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTREAMMEMORY_H_ +#define _RTXSTREAMMEMORY_H_ + +#include "rtxsrc/rtxStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxStreamMemory Memory stream functions. + * Memory stream functions are used for memory stream operations. @{ + */ +/** + * Opens a memory stream. A memory buffer will be created by this function. The + * 'flags' parameter specifies the access mode for the stream - input or + * output. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param flags Specifies the access mode for the stream: + * - OSRTSTRMF_INPUT = input (reading) stream; + * - OSRTSTRMF_OUTPUT = output (writing) stream. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamMemoryCreate (OSCTXT* pctxt, OSUINT16 flags); + +/** + * Opens a memory stream using the specified memory buffer. The 'flags' + * parameter specifies the access mode for the stream - input or output. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pMemBuf The pointer to the buffer. + * @param bufSize The size of the buffer. + * @param flags Specifies the access mode for the stream: + * - OSRTSTRMF_INPUT = input (reading) stream; + * - OSRTSTRMF_OUTPUT = output (writing) stream. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamMemoryAttach (OSCTXT* pctxt, OSOCTET* pMemBuf, + size_t bufSize, OSUINT16 flags); + +/** + * This function returns the memory buffer and its size for the given memory + * stream. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pSize The pointer to size_t to receive the size of buffer. + * @return The pointer to memory buffer. NULL, if error occurred. + */ +EXTERNRT OSOCTET* rtxStreamMemoryGetBuffer (OSCTXT* pctxt, size_t* pSize); + +/** + * This function creates an input memory stream using the specified buffer. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pMemBuf The pointer to the buffer + * @param bufSize The size of the buffer + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamMemoryCreateReader + (OSCTXT* pctxt, OSOCTET* pMemBuf, size_t bufSize); + +/** + * This function creates an output memory stream using the specified buffer. If + * \c pMemBuf or \c bufSize is NULL then new buffer will be allocated. + * + * @param pctxt Pointer to a context structure variable that has been + * initialized for stream operations. + * @param pMemBuf The pointer to the buffer. Can be NULL - new buffer will + * be allocated in this case. + * @param bufSize The size of the buffer. Can be 0 - new buffer will be + * allocated in this case. + * @return Completion status of operation: 0 = success, negative + * return value is error. + */ +EXTERNRT int rtxStreamMemoryCreateWriter + (OSCTXT* pctxt, OSOCTET* pMemBuf, size_t bufSize); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* _RTXSTREAMMEMORY_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamSocket.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamSocket.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,98 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxStreamSocket.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTREAMSOCKET_H_ +#define _RTXSTREAMSOCKET_H_ + +#include "rtxsrc/rtxStream.h" +#include "rtxsrc/rtxSocket.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup rtxStreamSocket Socket stream functions. + * Socket stream functions are used for socket stream operations. + * @{ + */ +/** + * Attaches the existing socket handle to the stream. The socket should be + * already opened and connected. The 'flags' parameter specifies the access + * mode for the stream - input or output. + * + * @param pctxt Pointer to a context structure variable that has + * been initialized for stream operations. + * @param socket The socket handle created by \c rtxSocketCreate. + * @param flags Specifies the access mode for the stream: + * - OSRTSTRMF_INPUT = input (reading) stream; + * - OSRTSTRMF_OUTPUT = output (writing) stream. + * @return Completion status of operation: 0 = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamSocketAttach (OSCTXT* pctxt, + OSRTSOCKET socket, OSUINT16 flags); + +/** + * This function closes a socket stream. + * + * @param pctxt Pointer to a context structure variable that has + * been initialized for stream operations. + * @return Completion status of operation: 0 = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamSocketClose (OSCTXT* pctxt); + +/** + * This function opens a socket stream for writing. + * + * @param pctxt Pointer to a context structure variable that has + * been initialized for stream operations. + * @param host Name of host or IP address to which to connect. + * @param port Port number to which to connect. + * @return Completion status of operation: 0 = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamSocketCreateWriter (OSCTXT* pctxt, + const char* host, int port); + +/** + * This function transfers ownership of the socket to or from the + * stream instance. The socket will be closed and deleted when the stream + * is closed or goes out of scope. By default stream socket owns the socket. + * + * @param pctxt Pointer to a context structure variable that has + * been initialized for stream operations. + * @param ownSocket Boolean value. + */ +EXTERNRT int rtxStreamSocketSetOwnership (OSCTXT* pctxt, OSBOOL ownSocket); + +#ifdef __cplusplus +} +#endif +/** + * @} rtxStreamSocket + */ + +#endif /* _RTXSTREAMSOCKET_H_ */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamZlib.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxStreamZlib.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,130 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/* + * @file rtxStreamZlib.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXSTREAMZLIB_H_ +#define _RTXSTREAMZLIB_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" +#include "rtxsrc/rtxStream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This function initializes a zlib compressed stream. This function should + * be called first before any operation with a zlib compressed stream. + * + * @param pctxt Pointer to context structure variable. + * @param flags Specifies the access mode for the stream: + * - OSRTSTRMF_INPUT = input (reading) stream; + * - OSRTSTRMF_OUTPUT = output (writing) stream. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamZlibAttach (OSCTXT* pctxt, OSUINT16 flags); + +/* + * This function finish compressed block. Stream switched to transparent mode. + * + * @param pctxt Pointer to context structure variable. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamZlibEnd (OSCTXT* pctxt); + +/* + * This function free a zlib compressed stream and restore underlying stream. + * + * @param pctxt Pointer to context structure variable. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamZlibFree (OSCTXT* pctxt); + +/* + * This function finish compressed block and start new block. + * Stream remained in compressed mode. + * + * @param pctxt Pointer to context structure variable. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamZlibReset (OSCTXT* pctxt); + +/* + * This function start compression parameters. + * + * @param pctxt Pointer to context structure variable. + * @param level Set compression level 0..9. + * 0 - Z_NO_COMPRESSION + * 1 - Z_BEST_SPEED + * 9 - Z_BEST_COMPRESSION + * -1 - Z_DEFAULT_COMPRESSION - like level 6 + * @param windowBits Set decompression window size. + * 8..15 - ZLIB header (RFC 1950) + * -8..-15 - header is absent (RFC 1951) + * (8..15) + 16 - GZIP header (RFC 1952) + * @param memLevel Set memory usage level 1..9. + * 1 - use minimum memory + * 9 - use maximum memory + * @param strategy Set copression algorithm. + * 0 - Z_DEFAULT_STRATEGY - common method any data + * other possible values defined in zlib.h + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamZlibSetDeflateParams +(OSCTXT* pctxt, int level, int windowBits, int memLevel, int strategy); + +/* + * This function start decompression parameter. + * + * @param pctxt Pointer to context structure variable. + * @param windowBits Set decompression window size. + * 8..15 - ZLIB header (RFC 1950) + * -8..-15 - header is absent (RFC 1951) + * (8..15) + 16 - GZIP header (RFC 1952) + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamZlibSetInflateParams +(OSCTXT* pctxt, int windowBits); + +/* + * This function start compressed block. + * + * @param pctxt Pointer to context structure variable. + * @return Completion status of operation: 0 (0) = success, + * negative return value is error. + */ +EXTERNRT int rtxStreamZlibStart (OSCTXT* pctxt); + +#ifdef __cplusplus +} +#endif + +#endif /* _RTXSTREAMZLIB_H_ */ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxToken.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxToken.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,58 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxToken.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXTOKEN_H_ +#define _RTXTOKEN_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + OSUTF8CHAR* pStr; + const OSUTF8CHAR* pEndStr; + const char* delimiters; + size_t delimSize; + OSUTF8CHAR* pLastToken; + size_t lastTokenSize; +} OSTOKENCTXT; + +EXTERNRT OSBOOL rtxTokIsWhiteSpace (OSTOKENCTXT* pTokCtxt, OSUTF8CHAR ch); + +EXTERNRT OSUTF8CHAR* rtxTokSkipWhiteSpaces (OSTOKENCTXT* pTokCtxt); + +EXTERNRT const OSUTF8CHAR* rtxTokGetNext (OSTOKENCTXT* pTokCtxt); + +EXTERNRT const OSUTF8CHAR* rtxTokGetFirst +(OSTOKENCTXT* pTokCtxt, OSUTF8CHAR* pStr, size_t strSize, + const char* delimiters, size_t delimSize); + +#ifdef __cplusplus +} +#endif + +#endif /*_RTXTOKEN_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxTokenConst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxTokenConst.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,62 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXTOKEN_H_ +#define _RTXTOKEN_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + const OSUTF8CHAR* pStr; + const OSUTF8CHAR* pEndStr; + const char* delimiters; + size_t delimSize; + + const OSUTF8CHAR* pLastToken; + size_t lastTokenSize; + + OSBOOL bFinal; +} OSCONSTTOKENCTXT; + +EXTERNRT OSBOOL +rtxTokIsWhiteSpaceConst (OSCONSTTOKENCTXT* pTokCtxt, OSUTF8CHAR ch); + +EXTERNRT const OSUTF8CHAR* +rtxTokSkipWhiteSpacesConst (OSCONSTTOKENCTXT* pTokCtxt); + +EXTERNRT const OSUTF8CHAR* +rtxTokGetNextConst (OSCONSTTOKENCTXT* pTokCtxt, size_t* pTokenLength); + +EXTERNRT const OSUTF8CHAR* +rtxTokGetFirstConst (OSCONSTTOKENCTXT* pTokCtxt, + const OSUTF8CHAR* pStr, size_t strSize, + const char* delimiters, size_t delimSize, + size_t* pTokenLength, OSBOOL isFinal); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxUTF8.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxUTF8.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,589 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxUTF8.h + * Utility functions for handling UTF-8 strings. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXUTF8_H_ +#define _RTXUTF8_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* UTF-8 string functions */ +/** + * @defgroup ccfUTF8 UTF-8 String Functions + * @{ + * + * The UTF-8 string functions handle string operations on UTF-8 encoded + * strings. This is the default character string data type used for encoded XML + * data. UTF-8 strings are represented in C as strings of unsigned characters + * (bytes) to cover the full range of possible single character encodings. + */ +/** + * This function converts a UTF-8 string to a Unicode string (UTF-16). The + * Unicode string is stored as an array of 16-bit characters (unsigned short + * integers). + * + * @param pctxt A pointer to a context structure. + * @param inbuf UTF-8 string to convert. + * @param outbuf Output buffer to receive converted Unicode data. + * @param outbufsiz Size of the output buffer in bytes. + * @return Completion status of operation: + * - number of Unicode characters in the string + * - negative return value is error. + */ +EXTERNRT long rtxUTF8ToUnicode (OSCTXT* pctxt, const OSUTF8CHAR* inbuf, + OSUNICHAR* outbuf, size_t outbufsiz); + +/** + * This function will validate a UTF-8 encoded string to ensure that it is + * encoded correctly. + * + * @param pctxt A pointer to a context structure. + * @param inbuf A pointer to the null-terminated UTF-8 encoded string. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxValidateUTF8 (OSCTXT* pctxt, const OSUTF8CHAR* inbuf); + +/** + * This function will return the length (in characters) of a null-terminated + * UTF-8 encoded string. + * + * @param inbuf A pointer to the null-terminated UTF-8 encoded string. + * @return Number of characters in string. Note that this may be + * different than the number of bytes as UTF-8 characters + * can span multiple-bytes. + */ +EXTERNRT size_t rtxUTF8Len (const OSUTF8CHAR* inbuf); +EXTERNRT size_t rtxCalcUTF8Len (const OSUTF8CHAR* inbuf, size_t inbufBytes); + +/** + * This function will return the length (in bytes) of a null-terminated UTF-8 + * encoded string. + * + * @param inbuf A pointer to the null-terminated UTF-8 encoded string. + * @return Number of bytes in the string. + */ +EXTERNRT size_t rtxUTF8LenBytes (const OSUTF8CHAR* inbuf); + +/** + * This function will return the number of bytes needed to encode the given + * 32-bit universal character value as a UTF-8 character. + * + * @param wc 32-bit wide character value. + * @return Number of bytes needed to encode as UTF-8. + */ +EXTERNRT int rtxUTF8CharSize (OS32BITCHAR wc); + +/** + * This function will convert a wide character into an encoded UTF-8 character + * byte string. + * + * @param wc 32-bit wide character value. + * @param buf Buffer to receive encoded UTF-8 character value. + * @param bufsiz Size of the buffer ot receive the encoded value. + * @return Number of bytes consumed to encode character or + * negative status code if error. + */ +EXTERNRT int rtxUTF8EncodeChar (OS32BITCHAR wc, OSOCTET* buf, size_t bufsiz); + +/** + * This function will convert an encoded UTF-8 character byte string into + * a wide character value. + * + * @param pctxt A pointer to a context structure. + * @param pinbuf Pointer to UTF-8 byte sequence to be decoded. + * @param pInsize Number of bytes that were consumed (i.e. size of the + * character). + * @return 32-bit wide character value. + */ +EXTERNRT int rtxUTF8DecodeChar +(OSCTXT* pctxt, const OSUTF8CHAR* pinbuf, int* pInsize); + +/** + * Thia function will convert a UTF-8 encoded character value into a wide + * character. + * + * @param buf Pointer to UTF-8 character value. + * @param len Pointer to integer to receive decoded size (in bytes) of + * the UTF-8 character value sequence. + * @return Converted wide character value. + */ +EXTERNRT OS32BITCHAR rtxUTF8CharToWC (const OSUTF8CHAR* buf, OSUINT32* len); + +/** + * This function finds a character in the given UTF-8 character string. It is + * similar to the C \c strchr function. + * + * @param utf8str Null-terminated UTF-8 string to be searched. + * @param utf8char 32-bit Unicode character to find. + * @return Pointer to to the first occurrence of character in + * string, or NULL if character is not found. + */ +EXTERNRT OSUTF8CHAR* rtxUTF8StrChr (OSUTF8CHAR* utf8str, + OS32BITCHAR utf8char); + +/** + * This function creates a duplicate copy of the given UTF-8 character string. + * It is similar to the C \c strdup function. Memory for the duplicated string + * is allocated using the \c rtxMemAlloc function. + * + * @param pctxt A pointer to a context structure. + * @param utf8str Null-terminated UTF-8 string to be duplicated. + * @return Pointer to duplicated string value. + */ +EXTERNRT OSUTF8CHAR* rtxUTF8Strdup (OSCTXT* pctxt, const OSUTF8CHAR* utf8str); + +/** + * This function creates a duplicate copy of the given UTF-8 character string. + * It is similar to the \c rtxUTF8Strdup function except that it allows the + * number of bytes to convert to be specified. Memory for the duplicated string + * is allocated using the \c rtxMemAlloc function. + * + * @param pctxt A pointer to a context structure. + * @param utf8str UTF-8 string to be duplicated. + * @param nbytes Number of bytes from \c utf8str to duplicate. + * @return Pointer to duplicated string value. + */ +EXTERNRT OSUTF8CHAR* rtxUTF8Strndup +(OSCTXT* pctxt, const OSUTF8CHAR* utf8str, size_t nbytes); + +/** + * This function check to see if the given UTF8 string pointer exists + * on the memory heap. If it does, its reference count is incremented; + * otherwise, a duplicate copy is made. + * + * @param pctxt A pointer to a context structure. + * @param utf8str Null-terminated UTF-8 string variable. + * @return Pointer to string value. This will either be the + * existing UTF-8 string pointer value (utf8str) + * or a new value. + */ +EXTERNRT OSUTF8CHAR* rtxUTF8StrRefOrDup +(OSCTXT* pctxt, const OSUTF8CHAR* utf8str); + +/** + * This function compares two UTF-8 string values for equality. + * + * @param utf8str1 UTF-8 string to be compared. + * @param utf8str2 UTF-8 string to be compared. + * @return TRUE if equal, FALSE if not. + */ +EXTERNRT OSBOOL rtxUTF8StrEqual +(const OSUTF8CHAR* utf8str1, const OSUTF8CHAR* utf8str2); + +/** + * This function compares two UTF-8 string values for equality. + * It is similar to the \c rtxUTF8StrEqual function except that it allows the + * number of bytes to compare to be specified. + * + * @param utf8str1 UTF-8 string to be compared. + * @param utf8str2 UTF-8 string to be compared. + * @param count Number of bytes to compare. + * @return TRUE if equal, FALSE if not. + */ +EXTERNRT OSBOOL rtxUTF8StrnEqual (const OSUTF8CHAR* utf8str1, + const OSUTF8CHAR* utf8str2, + size_t count); + +/** + * This function compares two UTF-8 character strings and returns a trinary + * result (equal, less than, greater than). It is similar to the C \c strcmp + * function. + * + * @param utf8str1 UTF-8 string to be compared. + * @param utf8str2 UTF-8 string to be compared. + * @return -1 if utf8str1 is less than utf8str2, 0 if the + * two string are equal, and +1 if the utf8str1 is + * greater than utf8str2. + */ +EXTERNRT int rtxUTF8Strcmp (const OSUTF8CHAR* utf8str1, + const OSUTF8CHAR* utf8str2); + +/** + * This function compares two UTF-8 character strings and returns a trinary + * result (equal, less than, greater than). In this case, a maximum count of + * the number of bytes to compare can be specified. It is similar to the C + * \c strncmp function. + * + * @param utf8str1 UTF-8 string to be compared. + * @param utf8str2 UTF-8 string to be compared. + * @param count Number of bytes to compare. + * @return -1 if utf8str1 is less than utf8str2, 0 if the + * two string are equal, and +1 if the utf8str1 is + * greater than utf8str2. + */ +EXTERNRT int rtxUTF8Strncmp (const OSUTF8CHAR* utf8str1, + const OSUTF8CHAR* utf8str2, + size_t count); +/** + * This function copies a null-terminated UTF-8 string to a target buffer. + * It is similar to the C \c strcpy function except more secure because + * it checks for buffer overrun. + * + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param src Pointer to null-terminated string to copy. + * @return Pointer to destination buffer or NULL if copy failed. + */ +EXTERNRT OSUTF8CHAR* rtxUTF8Strcpy +(OSUTF8CHAR* dest, size_t bufsiz, const OSUTF8CHAR* src); + +/** + * This function copies the given number of characters from a UTF-8 string to + * a target buffer. It is similar to the C \c strncpy function except more + * secure because it checks for buffer overrun and ensures a null-terminator + * is copied to the end of the target buffer + * + * @param dest Pointer to destination buffer to receive string. + * @param bufsiz Size of the destination buffer. + * @param src Pointer to null-terminated string to copy. + * @param nchars Number of characters to copy. + * @return Pointer to destination buffer or NULL if copy failed. + */ +EXTERNRT OSUTF8CHAR* rtxUTF8Strncpy +(OSUTF8CHAR* dest, size_t bufsiz, const OSUTF8CHAR* src, size_t nchars); + +/** + * This function computes a hash code for the given string value. + * + * @param str Pointer to string. + * @return Hash code value. + */ +EXTERNRT OSUINT32 rtxUTF8StrHash (const OSUTF8CHAR* str); + +/** + * This function concatanates up to five substrings together into a + * single string. + * + * @param pctxt Pointer to a context block structure. + * @param str1 Pointer to substring to join. + * @param str2 Pointer to substring to join. + * @param str3 Pointer to substring to join. + * @param str4 Pointer to substring to join. + * @param str5 Pointer to substring to join. + * @return Composite string consisting of all parts. Memory + * is allocated for this string using rtxMemAlloc + * and must be freed using either rtxMemFreePtr or + * rtxMemFree. If memory allocation for the string + * fails, NULL is returned. + */ +EXTERNRT const OSUTF8CHAR* rtxUTF8StrJoin +(OSCTXT* pctxt, const OSUTF8CHAR* str1, const OSUTF8CHAR* str2, + const OSUTF8CHAR* str3, const OSUTF8CHAR* str4, const OSUTF8CHAR* str5); + +/** + * This function converts the given null-terminated UTF-8 string to + * a boolean (true/false) value. It is assumed the string + * contains only the tokens 'true', 'false', '1', or '0'. + * + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to boolean value to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrToBool (const OSUTF8CHAR* utf8str, OSBOOL* pvalue); + +/** + * This function converts the given part of UTF-8 string to + * a boolean (true/false) value. It is assumed the string + * contains only the tokens 'true', 'false', '1', or '0'. + * + * @param utf8str Null-terminated UTF-8 string to convert + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to boolean value to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrnToBool + (const OSUTF8CHAR* utf8str, size_t nbytes, OSBOOL* pvalue); + +/** + * This function converts the given null-terminated UTF-8 string to + * a floating point (C/C++ double) value. It is assumed the string + * contains only numeric digits, special floating point characters + * (+,-,E,.), and whitespace. It is similar to the C atof function + * except that the result is returned as a separate argument and + * an error status value is returned if the conversion cannot be + * performed successfully. + * + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to double to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrToDouble (const OSUTF8CHAR* utf8str, OSREAL* pvalue); + +/** + * This function converts the given part of UTF-8 string to + * a double value. It is assumed the string contains only numeric + * digits, whitespace, and other special floating point characters. + * It is similar to the C atof function except that the result is + * returned as a separate argument and an error status value is returned + * if the conversion cannot be performed successfully. + * + * @param utf8str UTF-8 string to convert. Not necessary to be + * null-terminated. + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to double to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrnToDouble + (const OSUTF8CHAR* utf8str, size_t nbytes, OSREAL* pvalue); + +/** + * This function converts the given null-terminated UTF-8 string + * to an integer value. It is assumed the string contains only numeric + * digits and whitespace. It is similar to the C atoi function + * except that the result is returned as a separate argument and + * an error status value is returned if the conversion cannot be + * performed successfully. + * + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrToInt (const OSUTF8CHAR* utf8str, OSINT32* pvalue); + +#define rtxUTF8StrToInt32 rtxUTF8StrToInt + +/** + * This function converts the given part of UTF-8 string to + * an integer value. It is assumed the string contains only numeric + * digits and whitespace. It is similar to the C atoi function + * except that the result is returned as a separate argument and + * an error status value is returned if the conversion cannot be + * performed successfully. + * + * @param utf8str UTF-8 string to convert. Not necessary to be + * null-terminated. + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrnToInt + (const OSUTF8CHAR* utf8str, size_t nbytes, OSINT32* pvalue); + +/** + * This function converts the given null-terminated UTF-8 string to + * an unsigned integer value. It is assumed the string contains only + * numeric digits and whitespace. + * + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrToUInt (const OSUTF8CHAR* utf8str, OSUINT32* pvalue); + +#define rtxUTF8StrToUInt32 rtxUTF8StrToUInt + +/** + * This function converts the given part of UTF-8 string to + * an unsigned integer value. It is assumed the string contains + * only numeric digits and whitespace. + * + * @param utf8str UTF-8 string to convert. Not necessary to be + * null-terminated. + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrnToUInt + (const OSUTF8CHAR* utf8str, size_t nbytes, OSUINT32* pvalue); + +#ifndef _NO_INT64_SUPPORT +/** + * This function converts the given null-terminated UTF-8 string to + * a 64-bit integer value. It is assumed the string contains only numeric + * digits and whitespace. + * + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrToInt64 (const OSUTF8CHAR* utf8str, OSINT64* pvalue); + +/** + * This function converts the given part of UTF-8 string to + * a 64-bit integer value. It is assumed the string contains only numeric + * digits and whitespace. + * + * @param utf8str UTF-8 string to convert. Not necessary to be + * null-terminated. + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrnToInt64 + (const OSUTF8CHAR* utf8str, size_t nbytes, OSINT64* pvalue); + +/** + * This function converts the given null-terminated UTF-8 string to + * an unsigned 64-bit integer value. It is assumed the string contains + * only numeric digits and whitespace. + * + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrToUInt64 (const OSUTF8CHAR* utf8str, OSUINT64* pvalue); + +/** + * This function converts the given part of UTF-8 string to + * an unsigned 64-bit integer value. It is assumed the string contains + * only numeric digits and whitespace. + * + * @param utf8str UTF-8 string to convert. Not necessary to be + * null-terminated. + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to integer to receive result + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrnToUInt64 + (const OSUTF8CHAR* utf8str, size_t nbytes, OSUINT64* pvalue); + +#endif /* _NO_INT64_SUPPORT */ + +/** + * This function converts the given UTF-8 string to a Unicode string. + * Memory is allocated for the Unicode string using the rtxMemAlloc + * function. This memory will be freed when the context is freed + * (rtxFreeContext) or it can be freed using rtxMemFreePtr. + * + * @param pctxt A pointer to a context structure. + * @param utf8str UTF-8 string to convert, null-terminated. + * @param ppdata Pointer to pointer to receive output string. + * @param pnchars Pointer to integer to receive number of chars decoded. + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8ToDynUniStr + (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, + const OSUNICHAR** ppdata, OSUINT32* pnchars); + +/** + * This function removes leading and trailing whitespace from a + * string. + * + * @param utf8instr Input UTF-8 string from which to removed whitespace. + * @param nbytes Size in bytes of utf8instr. + * @param putf8outstr Pointer to receive result string. + * @return Positive value = length of result string, + * negative value = error code. + */ +EXTERNRT int rtxUTF8RemoveWhiteSpace +(const OSUTF8CHAR* utf8instr, size_t nbytes, const OSUTF8CHAR** putf8outstr); + +/** + * Compare UTF-8 string to a string literal. + * + * @param name UTF-8 string variable. + * @param lstr C string literal value (quoted contant such as "a") + */ +#define RTUTF8STRCMPL(name,lstr) \ +rtxUTF8Strcmp(name,(const OSUTF8CHAR*)lstr) + +/** + * This function converts the given null-terminated UTF-8 string to + * a octet string value. The string consists of a series of hex digits. + * This is the dynamic version in which memory is allocated for + * the returned octet string variable. + * + * @param pctxt Pointer to context block structure. + * @param utf8str Null-terminated UTF-8 string to convert + * @param pvalue Pointer to a variable to receive the decoded octet + * string value. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxUTF8StrToDynHexStr +(OSCTXT* pctxt, const OSUTF8CHAR* utf8str, OSDynOctStr* pvalue); + +/** + * This function converts the given part of UTF-8 string to + * a octet string value. The string consists of a series of hex digits. + * This is the dynamic version in which memory is allocated for + * the returned octet string variable. + * + * @param pctxt Pointer to context block structure. + * @param utf8str Null-terminated UTF-8 string to convert + * @param nbytes Size in bytes of utf8Str. + * @param pvalue Pointer to a variable to receive the decoded octet + * string value. + * @return Completion status of operation: + * - 0 = success, + * - negative return value is error. + */ +EXTERNRT int rtxUTF8StrnToDynHexStr +(OSCTXT* pctxt, const OSUTF8CHAR* utf8str, size_t nbytes, OSDynOctStr* pvalue); + +/** + * This function converts the given null-terminated UTF-8 string + * to named bit items. The token-to-bit mappings are defined by + * a bit map table that is passed into the function. It is assumed + * the string contains a space-separated list of named bit token + * values. + * + * @param pctxt Context structure + * @param utf8str Null-terminated UTF-8 string to convert + * @param pBitMap Bit map defining bit to otken mappings + * @param pvalue Pointer to byte array to receive result. + * @param pnbits Pointer to integer to received number of bits. + * @param bufsize Size of byte array to received decoded bits. + * @return Status: 0 = OK, negative value = error + */ +EXTERNRT int rtxUTF8StrToNamedBits (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, + const OSBitMapItem* pBitMap, OSOCTET* pvalue, OSUINT32* pnbits, + OSUINT32 bufsize); + +/** + * This function returns the next whitespace-separated token from the + * input string. It also returns a pointer to the first non-whitespace + * chracter after the parsed token. Note that the input string is + * altered in the operation as null-terminators are insterted to mark + * the token boundaries. + * + * @param utf8str Null-terminated UTF-8 string to parse. This + * string will be altered. Use rtxUTF8Strdup to + * make a copy of original string before calling + * this function if the original string cannot + * be altered. + * @param ppNext Pointer to receive next location in string after + * parsed token. This can be used as input to get + * the next token. If NULL returned, all tokens in + * in the string have been parsed. + * @return Pointer to next parsed token. NULL if no more tokens. + */ +EXTERNRT const OSUTF8CHAR* rtxUTF8StrNextTok +(OSUTF8CHAR* utf8str, OSUTF8CHAR** ppNext); + +/** + * @} ccfUTF8 + */ +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxUnicode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxUnicode.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,576 @@ +/** + * @file rtxUnicode.h + * This is an open source header file derived from the libxml2 + * project. It defines UNICODE data types and macros. See the header + * file for further details. + */ +/* +The software in this module is open source software that has been +derived from various sources. All applicable copyright notices are +contained within. + +NOTE: the copyright notice below applies only to source and header files +that include this notice. It does not apply to other Objective Systems +software with different attached notices. + +*** +Except where otherwise noted in the source code (trio files, hash.c and list.c) +covered by a similar licence but with different Copyright notices: + + Copyright (C) 1998-2002 Daniel Veillard. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is fur- +nished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- +NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- +NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Daniel Veillard shall not +be used in advertising or otherwise to promote the sale, use or other deal- +ings in this Software without prior written authorization from him. +*/ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTX_UNICODE_H_ +#define _RTX_UNICODE_H_ + +#include +#include "rtxsrc/rtxContext.h" + +/************************************************************************ + * * + * UNICODE version of the macros. * + * * + ************************************************************************/ +/* + * IS_CHAR: + * @param c: a UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [2] Char ::= \#x9 | \#xA | \#xD | [\#x20-\#xD7FF] | [\#xE000-\#xFFFD] + * | [\#x10000-\#x10FFFF] + * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + */ +#define OS_IS_CHAR(c) \ + ((((c) >= 0x20) && ((c) <= 0xD7FF)) || \ + ((c) == 0x09) || ((c) == 0x0A) || ((c) == 0x0D) || \ + (((c) >= 0xE000) && ((c) <= 0xFFFD)) || \ + (((c) >= 0x10000) && ((c) <= 0x10FFFF))) + +/* + * IS_BLANK: + * @param c: a UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [3] S ::= (\#x20 | \#x9 | \#xD | \#xA)+ + */ +#define OS_IS_BLANK(c) \ +(((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || ((c) == 0x0D)) + +/* + * IS_BASECHAR: + * @param c: a UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [85] BaseChar ::= ... long list see REC ... + */ +#define OS_IS_BASECHAR(c) rtxUCSIsBaseChar(c) + +/* + * IS_DIGIT: + * @param c: a UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [88] Digit ::= ... long list see REC ... + */ +#define OS_IS_DIGIT(c) rtxUCSIsDigit(c) + +/* + * IS_COMBINING: + * @param c: a UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * [87] CombiningChar ::= ... long list see REC ... + */ +#define OS_IS_COMBINING(c) rtxUCSIsCombining(c) + +/* + * IS_EXTENDER: + * @param c: a UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [89] Extender ::= \#x00B7 | \#x02D0 | \#x02D1 | \#x0387 | \#x0640 | + * \#x0E46 | \#x0EC6 | \#x3005 | [\#x3031-\#x3035] | + * [\#x309D-\#x309E] | [\#x30FC-\#x30FE] + */ +#define OS_IS_EXTENDER(c) rtxUCSIsExtender(c) + +/* + * IS_IDEOGRAPHIC: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [86] Ideographic ::= [\#x4E00-\#x9FA5] | \#x3007 | [\#x3021-\#x3029] + */ +#define OS_IS_IDEOGRAPHIC(c) rtxUCSIsIdeographic(c) + +/* + * IS_LETTER: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [84] Letter ::= BaseChar | Ideographic + */ +#define OS_IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c)) + + +/* + * IS_PUBIDCHAR: + * @c: an UNICODE value (int) + * + * Macro to check the following production in the XML spec: + * + * + * [13] PubidChar ::= \#x20 | \#xD | \#xA | [a-zA-Z0-9] | [-'()+,./:=?;!*\#\@\$_%] + */ +#define OS_IS_PUBIDCHAR(c) xmlIsPubidChar(c) + +#ifdef __cplusplus +extern "C" { +#endif + +/* Unicode string functions */ + +EXTERNRT OSBOOL rtxUCSStrCmp (const OSUNICHAR* text1, + const OSUNICHAR* text2); + +EXTERNRT OSBOOL rtxUCSStrCmpAsc (const OSUNICHAR* text1, + const char* text2); + +EXTERNRT size_t rtxUCSStrLen (const OSUNICHAR* text); + +EXTERNRT void rtxUCSStrPrint (const OSUNICHAR* text); + +EXTERNRT void rtxUCSStrPrintFile (FILE* fp, const OSUNICHAR* text); + +EXTERNRT char* rtxUCSToCStr (OSCTXT* pctxt, const OSUNICHAR* text); + +EXTERNRT long rtxUCSToUTF8 (OSCTXT* pctxt, const OSUNICHAR* inbuf, + size_t inlen, OSOCTET* outbuf, size_t outbufsiz); + +/** + * This function converts a null-terminated Unicode string into a + * UTF-8 string. Memory is allocated for the output string using the + * built-in memory management functions. + * + * @param pctxt Pointer to context structure. + * @param inbuf Null-terminated Unicode string to convert. + * @return Converted UTF-8 character string. + */ +EXTERNRT const OSUTF8CHAR* +rtxUCSToDynUTF8 (OSCTXT* pctxt, const OSUNICHAR* inbuf); + +/** + * rtxUCSIsChar: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [2] Char ::= \#x9 | \#xA | \#xD | [\#x20-\#xD7FF] | [\#xE000-\#xFFFD] + * | [\#x10000-\#x10FFFF] + * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + * Also available as a macro IS_CHAR() + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsChar (OS32BITCHAR c); + +/** + * rtxUCSIsBlank: + * @param c: a UNICODE character (int) + * + * Check whether the character is allowed by the production + * [3] S ::= (\#x20 | \#x9 | \#xD | \#xA)+ + * Also available as a macro IS_BLANK() + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsBlank (OS32BITCHAR c); + +/** + * rtxUCSIsBaseChar: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [85] BaseChar ::= ... long list see REC ... + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsBaseChar (OS32BITCHAR c); + +/** + * rtxUCSIsDigit: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [88] Digit ::= ... long list see REC ... + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsDigit (OS32BITCHAR c); + +/** + * rtxUCSIsCombining: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [87] CombiningChar ::= ... long list see REC ... + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsCombining (OS32BITCHAR c); + +/** + * rtxUCSIsExtender: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [89] Extender ::= \#x00B7 | \#x02D0 | \#x02D1 | \#x0387 | \#x0640 | + * \#x0E46 | \#x0EC6 | \#x3005 | [\#x3031-\#x3035] | + * [\#x309D-\#x309E] | [\#x30FC-\#x30FE] + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsExtender (OS32BITCHAR c); + +/** + * rtxUCSIsIdeographic: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [86] Ideographic ::= [\#x4E00-\#x9FA5] | \#x3007 | [\#x3021-\#x3029] + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsIdeographic (OS32BITCHAR c); + +/** + * rtxUCSIsLetter: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [84] Letter ::= BaseChar | Ideographic + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsLetter (OS32BITCHAR c); + +/** + * rtxUCSIsPubidChar: + * @param c: an unicode character (int) + * + * Check whether the character is allowed by the production + * [13] PubidChar ::= \#x20 | \#xD | \#xA | [a-zA-Z0-9] | [-'()+,./:=?;!*\#\@\$_%] + * + * Returns 0 if not, non-zero otherwise + */ +EXTERNRT OSBOOL rtxUCSIsPubidChar (OS32BITCHAR c); + +EXTERNRT OSBOOL rtxUCSIsAlphabeticPresentationForms (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsArabic (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsArabicPresentationFormsA (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsArabicPresentationFormsB (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsArmenian (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsArrows (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsBasicLatin (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsBengali (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsBlockElements (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsBopomofo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsBopomofoExtended (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsBoxDrawing (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsBraillePatterns (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsByzantineMusicalSymbols (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKCompatibility (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKCompatibilityForms (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKCompatibilityIdeographs (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKCompatibilityIdeographsSupplement (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKRadicalsSupplement (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKSymbolsandPunctuation (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKUnifiedIdeographs (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKUnifiedIdeographsExtensionA (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCJKUnifiedIdeographsExtensionB (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCherokee (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCombiningDiacriticalMarks (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCombiningHalfMarks (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCombiningMarksforSymbols (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsControlPictures (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCurrencySymbols (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCyrillic (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsDeseret (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsDevanagari (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsDingbats (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsEnclosedAlphanumerics (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsEnclosedCJKLettersandMonths (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsEthiopic (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGeneralPunctuation (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGeometricShapes (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGeorgian (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGothic (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGreek (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGreekExtended (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGujarati (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsGurmukhi (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHalfwidthandFullwidthForms (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHangulCompatibilityJamo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHangulJamo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHangulSyllables (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHebrew (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHighPrivateUseSurrogates (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHighSurrogates (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsHiragana (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsIPAExtensions (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsIdeographicDescriptionCharacters (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsKanbun (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsKangxiRadicals (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsKannada (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsKatakana (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsKhmer (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsLao (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsLatin1Supplement (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsLatinExtendedA (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsLatinExtendedB (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsLatinExtendedAdditional (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsLetterlikeSymbols (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsLowSurrogates (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMalayalam (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMathematicalAlphanumericSymbols (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMathematicalOperators (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMiscellaneousSymbols (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMiscellaneousTechnical (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMongolian (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMusicalSymbols (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsMyanmar (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsNumberForms (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsOgham (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsOldItalic (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsOpticalCharacterRecognition (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsOriya (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsPrivateUse (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsRunic (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsSinhala (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsSmallFormVariants (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsSpacingModifierLetters (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsSpecials (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsSuperscriptsandSubscripts (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsSyriac (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsTags (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsTamil (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsTelugu (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsThaana (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsThai (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsTibetan (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsUnifiedCanadianAboriginalSyllabics (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsYiRadicals (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsYiSyllables (OS32BITCHAR code) ; + +EXTERNRT int rtxUCSIsBlock (OS32BITCHAR code, const char *block) ; + +EXTERNRT OSBOOL rtxUCSIsCatC (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatCc (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatCf (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatCo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatCs (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatL (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatLl (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatLm (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatLo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatLt (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatLu (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatM (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatMc (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatMe (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatMn (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatN (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatNd (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatNl (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatNo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatP (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatPc (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatPd (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatPe (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatPf (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatPi (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatPo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatPs (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatS (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatSc (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatSk (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatSm (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatSo (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatZ (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatZl (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatZp (OS32BITCHAR code) ; + +EXTERNRT OSBOOL rtxUCSIsCatZs (OS32BITCHAR code) ; + +EXTERNRT int rtxUCSIsCat (OS32BITCHAR code, const char *cat) ; + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxUtil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxUtil.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,68 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXUTIL_H_ +#define _RTXUTIL_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Utility functions */ + +EXTERNRT OSUINT32 rtxGetIdentByteCount (OSUINT32 ident); + +EXTERNRT OSUINT32 rtxIntByteCount (OSINT32 val); + +EXTERNRT OSUINT32 rtxOctetBitLen (OSOCTET w); + +EXTERNRT OSUINT32 rtxUInt32BitLen (OSUINT32 w); + +/** + * This function retrieves the binary logarithm of the given value + * (by excess). + * + * @param w Word value for which to get binary logarithm. + * @return The smallest x such as w <= 2^x + */ +EXTERNRT OSUINT32 rtxLog2Ceil (OSUINT32 w); + +/** + * This function retrieves the binary logarithm of the given value + * (by default). + * + * @param w Word value for which to get binary logarithm. + * @return The smallest x such as 2^x <= w < 2^(x+1) + */ +EXTERNRT OSUINT32 rtxLog2Floor (OSUINT32 w); + +#if !defined(_NO_INT64_SUPPORT) +EXTERNRT OSUINT32 rtxGetIdent64ByteCount (OSUINT64 ident); +EXTERNRT OSUINT32 rtxUInt64BitLen (OSUINT64 w); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxXmlQName.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxXmlQName.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,133 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxXmlQName.h + * XML QName type definition and associated utility functions. + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXXMLQNAME_H_ +#define _RTXXMLQNAME_H_ + +#include "rtxsrc/rtxContext.h" + +/** + * This version of QName contains complete namespace info (prefix + URI) + */ +typedef struct { + const OSUTF8CHAR* nsURI; + const OSUTF8CHAR* nsPrefix; + const OSUTF8CHAR* localName; +} OSXMLFullQName; + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function creates a new full QName structure given the parts. + * Memory is allocated for the structure using rtxMemAlloc. Copies + * are not made of the string variables - the pointers are stored. + * + * @param pctxt Pointer to a context structure. + * @param localName Element local name. + * @param prefix Namespace prefix. + * @param nsuri Namespace URI. + * @return QName value. Memory for the value will have been + * allocated by rtxMemAlloc and thus must be freed + * using one of the rtxMemFree functions. The + * value will be NULL if no dynamic memory was + * available. + */ +EXTERNRT OSXMLFullQName* rtxNewFullQName +(OSCTXT* pctxt, const OSUTF8CHAR* localName, const OSUTF8CHAR* prefix, + const OSUTF8CHAR* nsuri); + +/** + * This function allocates a new QName instance and makes a deep copy + * of the given QName including the strings inside. + * + * @param pctxt Pointer to a context structure. + * @param pqname Pointer to QName to be copied. + * @return Deep copy of QName structure. + */ +EXTERNRT OSXMLFullQName* rtxNewFullQNameDeepCopy +(OSCTXT* pctxt, const OSXMLFullQName* pqname); + +/** + * This function makes a deep copy of the given QName including the + * strings inside. + * + * @param pctxt Pointer to a context structure. + * @param pdest Pointer to QName to receive copied data. + * @param psrc Pointer to QName to be copied. + */ +EXTERNRT void rtxQNameDeepCopy +(OSCTXT* pctxt, OSXMLFullQName* pdest, const OSXMLFullQName* psrc); + +/** + * This function frees all memory within a QName structure, + * + * @param pctxt Pointer to a context structure. + * @param pqname Pointer to QName in which memory will be freed. + * @param dynamic Boolean indicating if pqname is dynamic. If true, + * the memory for pqname is freed. + */ +EXTERNRT void rtxQNameFreeMem +(OSCTXT* pctxt, OSXMLFullQName* pqname, OSBOOL dynamic); + +/** + * This function computes a hash code for the given QName. + * + * @param pqname Pointer to QName structure. + * @return Computed hash code. + */ +EXTERNRT OSUINT32 rtxQNameHash (const OSXMLFullQName* pqname); + +/** + * This function tests 2 QNames for equality. + * + * @param pqname1 Pointer to QName structure. + * @param pqname2 Pointer to QName structure. + * @return True if names equal; false, otherwise. + */ +EXTERNRT OSBOOL rtxQNamesEqual +(const OSXMLFullQName* pqname1, const OSXMLFullQName* pqname2); + +/** + * This function returns the QName in the following stringified + * format: {uri}/localName + * + * @param pqname Pointer to QName structure. + * @param buffer Buffer into which to return name. + * @param bufsiz Size of buffer into which name is to be returned. + * If name will not fit in buffer, it is truncated. + * @return Pointer to string (address of 'buffer' argument). + */ +EXTERNRT const OSUTF8CHAR* rtxQNameToString +(const OSXMLFullQName* pqname, OSUTF8CHAR* buffer, OSUINT32 bufsiz); + +#ifdef __cplusplus +} +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxXmlStr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/rtxXmlStr.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,87 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file rtxXmlStr.h + */ + +/** +@file +@internalTechnology +*/ + +#ifndef _RTXXMLSTR_H_ +#define _RTXXMLSTR_H_ + +#include "rtxsrc/rtxContext.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function creates an instance of XML UTF-8 character string structure + * (OSXMLSTRING type) and initializes it by the passed values. + * This function uses \c rtxMemAlloc to allocate the memory for the + * OSXMLSTRING structure. String \c pStr is not copied: the pointer will be + * assigned to "value" member of OSXMLSTRING structure. + * To free memory, \c rtxMemFreePtr function may be used: + * + *

OSXMLSTRING* pStr = rtxCreateXmlStr (....);

+ *

....

+ *

rtxMemFreePtr (pctxt, pStr);

+ * + *

Note, user is responsible to free pStr->value if it is not static + * and was allocated dynamically. + * + * @param pctxt Pointer to a context block + * @param pStr Pointer to a character string to be assigned. + * @param cdata This indicates if this string should be encoded as a + * CDATA section in an XML document. + * @return The allocated and initialized instance of OSXMLSTRING + * type. + */ +EXTERNRT OSXMLSTRING* rtxCreateXmlStr + (OSCTXT* pctxt, const OSUTF8CHAR* pStr, OSBOOL cdata); + +/** + * This function creates an instance of XML UTF-8 character string structure + * (OSXMLSTRING type) and initializes it by the passed values. In contrary to + * \c rtxCreateXmlStr function, the string value is copied. + * This function uses \c rtxMemAlloc to allocate the memory for the + * OSXMLSTRING structure and for the string value being copied. + * To free memory, \c rtxMemFreePtr function may be used for both value and + * structure itself: + * + *

OSXMLSTRING* pStr = rtxCreateCopyXmlStr (....);

+ *

....

+ *

rtxMemFreePtr (pctxt, pStr->value);

+ *

rtxMemFreePtr (pctxt, pStr);

+ * + * @param pctxt Pointer to a context block + * @param pStr Pointer to a character string to be copied. + * @param cdata This indicates if this string should be encoded as a + * CDATA section in an XML document. + * @return The allocated and initialized instance of OSXMLSTRING + * type. + */ +EXTERNRT OSXMLSTRING* rtxCreateCopyXmlStr + (OSCTXT* pctxt, const OSUTF8CHAR* pStr, OSBOOL cdata); + +#ifdef __cplusplus +} +#endif + +#endif /*_RTXXMLSTR_H_*/ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/wceAddon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/asn1runtime/rtxsrc/wceAddon.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,83 @@ +// Copyright (c) 2001-2009 Objective Systems, Inc. (http://www.obj-sys.com) +// 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: +// Objective Systems, Inc - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + * @file wceAddon.h + */ + +/** +@file +@internalTechnology +*/ + +#if defined(_WIN32_WCE) + +#ifndef _WCEADDON_H_ +#define _WCEADDON_H_ + +#include "rtxsrc/osSysTypes.h" +#include "rtxsrc/rtxExternDefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _TM_DEFINED +#define _TM_DEFINED +struct tm { + int tm_sec; /* seconds after the minute - [0,59] */ + int tm_min; /* minutes after the hour - [0,59] */ + int tm_hour; /* hours since midnight - [0,23] */ + int tm_mday; /* day of the month - [1,31] */ + int tm_mon; /* months since January - [0,11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday - [0,6] */ + int tm_yday; /* days since January 1 - [0,365] */ + int tm_isdst; /* daylight savings time flag */ +}; +#endif /* _TM_DEFINED */ + +EXTERNRT time_t rtWCEMkTime (struct tm* ptm); +EXTERNRT struct tm* rtWCELocalTime (const time_t *ptime); +EXTERNRT struct tm* rtWCEGmtTime (const time_t *ptime); +EXTERNRT time_t rtWCETime (time_t *ptime); +EXTERNRT int rtWCEIsindst (struct tm *ptm); + +EXTERNRT void rtWCEAbort (void); + +#ifdef __cplusplus +} +#endif + +#ifndef _CLOCK_T_DEFINED +typedef long clock_t; +#define _CLOCK_T_DEFINED + +/* Clock ticks macro - ANSI version */ + +#define CLOCKS_PER_SEC 1000 +#endif + +/* macros to replace wanting functions */ +#define mktime rtWCEMkTime +#define time rtWCETime +#define localtime rtWCELocalTime +#define gmtime rtWCEGmtTime +#define _isindst rtWCEIsindst +#define abort rtWCEAbort + +#endif /*_WCEADDON_H_*/ + +#endif /* _WIN32_WCE */ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/group/asn1export.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/group/asn1export.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,32 @@ +// 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: +// LbsSuplPush.iby +// +// + +#ifndef __ASN1_EXPORT_IBY__ +#define __ASN1_EXPORT_IBY__ + + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) +#if defined(SYMBIAN_INCLUDE_LOCATION_SUPLv10) || defined(SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY) + +file=ABI_DIR\DEBUG_DIR\asn1rt.dll System\libs\asn1rt.dll +file=ABI_DIR\DEBUG_DIR\asn1per.dll System\libs\asn1per.dll + +#endif // SYMBIAN_INCLUDE_LOCATION_SUPLv10 || SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY +#endif // SYMBIAN_EXCLUDE_LOCATION + + +#endif // __ASN1_EXPORT_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/group/asn1rrlp.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/group/asn1rrlp.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,31 @@ +// 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: +// An iby file for the SUPL/RRLP ASN1 component +// +// + +#ifndef __LBS_ASN1_RRLP_IBY__ +#define __LBS_ASN1_RRLP_IBY__ + + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) +#if defined(SYMBIAN_INCLUDE_LOCATION_SUPLv10) || defined(SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY) + +file=ABI_DIR\DEBUG_DIR\asn1rrlp.dll System\libs\asn1rrlp.dll + +#endif // SYMBIAN_INCLUDE_LOCATION_SUPLv10 || SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY +#endif // SYMBIAN_EXCLUDE_LOCATION + + +#endif // __LBS_ASN1_RRLP_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/group/asn1supl.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/group/asn1supl.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,31 @@ +// 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: +// An iby file for the SUPL/RRLP ASN1 component +// +// + +#ifndef __LBS_ASN1_SUPL_IBY__ +#define __LBS_ASN1_SUPL_IBY__ + + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) +#if defined(SYMBIAN_INCLUDE_LOCATION_SUPLv10) || defined(SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY) + +file=ABI_DIR\DEBUG_DIR\asn1supl.dll System\libs\asn1supl.dll + +#endif // SYMBIAN_INCLUDE_LOCATION_SUPLv10 || SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY +#endif // SYMBIAN_EXCLUDE_LOCATION + + +#endif // __LBS_ASN1_SUPL_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,24 @@ +// Copyright (c) 2010 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: Published header files for ASN1 core and SUPL/RRLP functionality +// +PRJ_PLATFORMS +GCCE WINSCW ARMV5 + +PRJ_MMPFILES + +PRJ_EXPORTS +asn1export.iby /epoc32/rom/include/asn1export.iby +asn1rrlp.iby /epoc32/rom/include/asn1rrlp.iby +asn1supl.iby /epoc32/rom/include/asn1supl.iby + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmasn1_pub/group/lbs_networkpmasn1_pub.mrp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmasn1_pub/group/lbs_networkpmasn1_pub.mrp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +# +# Copyright (c) 2010 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: +# + +component lbs_networkpmasn1_pub + +source \sf\os\lbs\networkprotocolmodules\networkpmasn1_pub + +notes_source \component_defs\release.src + +ipr E + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,18 @@ +// Copyright (c) 2007-2010 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: A collection of utility libraries available for Network Protocol Modules +// + +#include "../supldevlogger/group/bld.inf" +#include "../utils/group/bld.inf" + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/group/lbs_networkpmutils.mrp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/group/lbs_networkpmutils.mrp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2010 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: +# + +component lbs_networkpmutils + +source \sf\os\lbs\networkprotocolmodules\networkpmutils + +binary \sf\os\lbs\networkprotocolmodules\networkpmutils\supldevlogger\group all +binary \sf\os\lbs\networkprotocolmodules\networkpmutils\utils\group all + +exports \sf\os\lbs\networkprotocolmodules\networkpmutils\supldevlogger\group +exports \sf\os\lbs\networkprotocolmodules\networkpmutils\utils\group + +notes_source \component_defs\release.src + +ipr E + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/BWINS/supldevloggeru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/BWINS/supldevloggeru.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,10 @@ +EXPORTS + ?Cancel@CSuplMemoryUsageLogger@@QAEXXZ @ 1 NONAME ; void CSuplMemoryUsageLogger::Cancel(void) + ?GetMessageProcessName@SuplDevLogger@@SAXABVRMessage2@@AAV?$TBuf@$0BAA@@@@Z @ 2 NONAME ; void SuplDevLogger::GetMessageProcessName(class RMessage2 const &, class TBuf<256> &) + ?HexDump@SuplDevLogger@@SAXW4TSuplLogPriority@@PBEH@Z @ 3 NONAME ; void SuplDevLogger::HexDump(enum TSuplLogPriority, unsigned char const *, int) + ?NewLC@CSuplMemoryUsageLogger@@SAPAV1@XZ @ 4 NONAME ; class CSuplMemoryUsageLogger * CSuplMemoryUsageLogger::NewLC(void) + ?OverWrite@SuplDevLogger@@SAXABVTDesC16@@@Z @ 5 NONAME ; void SuplDevLogger::OverWrite(class TDesC16 const &) + ?OverWrite@SuplDevLogger@@SAXABVTDesC8@@@Z @ 6 NONAME ; void SuplDevLogger::OverWrite(class TDesC8 const &) + ?Write@SuplDevLogger@@SAXW4TSuplLogType@@W4TSuplLogPriority@@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 7 NONAME ; void SuplDevLogger::Write(enum TSuplLogType, enum TSuplLogPriority, class TRefByValue, ...) + ?Write@SuplDevLogger@@SAXW4TSuplLogType@@W4TSuplLogPriority@@V?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 8 NONAME ; void SuplDevLogger::Write(enum TSuplLogType, enum TSuplLogPriority, class TRefByValue, ...) + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/eabi/supldevloggeru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/eabi/supldevloggeru.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,10 @@ +EXPORTS + _ZN13SuplDevLogger21GetMessageProcessNameERK9RMessage2R4TBufILi256EE @ 1 NONAME + _ZN13SuplDevLogger5WriteE12TSuplLogType16TSuplLogPriority11TRefByValueIK6TDesC8Ez @ 2 NONAME + _ZN13SuplDevLogger5WriteE12TSuplLogType16TSuplLogPriority11TRefByValueIK7TDesC16Ez @ 3 NONAME + _ZN13SuplDevLogger7HexDumpE16TSuplLogPriorityPKhi @ 4 NONAME + _ZN13SuplDevLogger9OverWriteERK6TDesC8 @ 5 NONAME + _ZN13SuplDevLogger9OverWriteERK7TDesC16 @ 6 NONAME + _ZN22CSuplMemoryUsageLogger5NewLCEv @ 7 NONAME + _ZN22CSuplMemoryUsageLogger6CancelEv @ 8 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,24 @@ +// 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: +// + +PRJ_EXPORTS + +supldevlogger.iby /epoc32/rom/include/supldevlogger.iby + +PRJ_MMPFILES +supldevlogger.mmp + +PRJ_TESTEXPORTS +PRJ_TESTMMPFILES diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/group/supldevlogger.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/group/supldevlogger.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +// 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: +// An iby file for the SUPL Dev Logger component +// +// + +#ifndef __SUPL_DEV_LOGGER_IBY__ +#define __SUPL_DEV_LOGGER_IBY__ + +#ifdef _DEBUG +file=ABI_DIR\DEBUG_DIR\supldevlogger.dll System\libs\supldevlogger.dll +#endif + +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/group/supldevlogger.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/group/supldevlogger.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,35 @@ +// 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: +// + +TARGET supldevlogger.dll +TARGETTYPE dll +CAPABILITY ALL -TCB +UID 0x1000008d 0x10285AB1 +VENDORID 0x70000001 + +MACRO ENABLE_SUPL_DEV_LOGGER + +SOURCEPATH ../src +SOURCE supldevlogger.cpp +SOURCE suplmemlogger.cpp + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +USERINCLUDE ../inc + +LIBRARY euser.lib +LIBRARY flogger.lib +LIBRARY hal.lib + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/inc/supldevlogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/inc/supldevlogger.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,113 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef SUPL_DEV_LOGGER_H +#define SUPL_DEV_LOGGER_H + +//************************************************************************************************************ +#include + +// Literals used +_LIT(KSuplDevLogger, "SuplDevLogger"); + +//------------------------------------------------------------------------------- +/** Enum for log txt priority +Priorities 0 - 2 are for logging component internal events. +Priority 3 is for logging major component events that may have a major influence on other components. +Priorities 4 - 5 are currently unassigned (TBD) +Priorities 6 - 7 are for logging internal API +Priorities 8 - 9 are for logging public API +@internalTechnology +@deprecated +*/ +enum TSuplLogPriority + { + /** The lowest priority. Use for hex dump and other low priority information. */ + ELogP0 = 0, + /** Use for method enter/exit logging. */ + ELogP1 = 1, + /** Use for low priority, component internal event and data logging. */ + ELogP2 = 2, + /** Use for important component events like timeouts, warnings and errors. */ + ELogP3 = 3, + /** TBD (May temporarily contain old values that should be P7)*/ + ELogP4 = 4, + /** TBD (May temporarily contain old entries that should be P9)*/ + ELogP5 = 5, + /** Use for Internal API */ + ELogP6 = 6, //Minor Values + ELogP7 = 7, //Major Values + /** The highest priority. Use only for really major user, network or hardware events and Published API + values. For example: + - MTLR/X3P/Self locate request/response/cancel + - location update from GPS + - change in configuration + - privacy response from user + - Sequence Diagram log entries*/ + ELogP8 = 8, //Minor Values + ELogP9 = 9 //Major Values + }; + +/** Log entry type. +@internalTechnology +@deprecated +*/ +enum TSuplLogType + { + ELogNormal = 0, + ELogWarning = 1, + ELogError = 2 + }; + +//------------------------------------------------------------------------------- +/** Logger for development and debug purpose +The log format will be + +Time | ProcessName | Process Id | Log Priority | StackPointer | Log text +08:51:00.997500 | File Name | Process Id | Log Text Priority | StackPointer | Any Log text + +note the maximum buffer size limitation KLogBufferSize=150 + +[File Name] see RProcess::FileName() +[Process Id]see RProcess::Id() +[Log Text Priority] - [P0]- [P9] + +@internalTechnology +@deprecated +*/ +class SuplDevLogger + { +public: + IMPORT_C static void OverWrite(const TDesC8& aFmt); + IMPORT_C static void OverWrite(const TDesC16& aFmt); + + IMPORT_C static void Write(TSuplLogType aType, TSuplLogPriority aPrior, TRefByValue aFmt, ...); + IMPORT_C static void Write(TSuplLogType aType, TSuplLogPriority aPrior, TRefByValue aFmt, ...); + + IMPORT_C static void HexDump(TSuplLogPriority aPrior, const TUint8 *aPtr, TInt aLen); + + IMPORT_C static void GetMessageProcessName(const RMessage2& aMessage, TFileName& aName); +private: + static void CreateLogTxt(TSuplLogType aType, TSuplLogPriority aPrior, TInt* aStackPtr, TDes16& aBuf); + static void CreateLogTxt(TSuplLogType aType, TSuplLogPriority aPrior, TInt* aStackPtr, TDes8& aBuf); + }; + +#endif //SUPL_DEV_LOGGER_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/inc/supldevloggermacros.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/inc/supldevloggermacros.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,406 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef SUPL_DEV_LOGGER_MACROS_H +#define SUPL_DEV_LOGGER_MACROS_H + +#include "supldevlogger.h" + +#if defined(ENABLE_SUPL_DEV_LOGGER) && (defined(_DEBUG)||defined(__WINS__)) +/** + ----------------------- + Standard Logging Macros + ----------------------- +**/ + #define SUPLLOG_BEGIN() SUPLLOG(ELogP9, "StartSP\n"); + #define SUPLNEWLOG(L) SuplDevLogger::OverWrite(_L(L)) + #define SUPLLOG(L1,L2) SuplDevLogger::Write(ELogNormal, L1, _L(L2)) + #define SUPLLOG2(L1,L2,L3) SuplDevLogger::Write(ELogNormal, L1, _L(L2), L3) + #define SUPLLOG3(L1,L2,L3,L4) SuplDevLogger::Write(ELogNormal, L1, _L(L2), L3, L4) + #define SUPLLOG4(L1,L2,L3,L4,L5) SuplDevLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5) + #define SUPLLOG5(L1,L2,L3,L4,L5,L6) SuplDevLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5, L6) + #define SUPLLOG6(L1,L2,L3,L4,L5,L6,L7) SuplDevLogger::Write(ELogNormal, L1, _L(L2), L3, L4, L5, L6, L7) + #define SUPLLOGHEX(L1,L2,L3) SuplDevLogger::HexDump(L1,L2,L3) + + #define SUPLLOG2_L8(L1,L2,L3) SuplDevLogger::Write(ELogNormal, L1, _L8(L2), L3) + #define SUPLLOG3_L8(L1,L2,L3,L4) SuplDevLogger::Write(ELogNormal, L1, _L8(L2), L3, L4) + #define SUPLLOG4_L8(L1,L2,L3,L4,L5) SuplDevLogger::Write(ELogNormal, L1, _L8(L2), L3, L4, L5) + + #define SUPLLOG_ERR(L1,L2) SuplDevLogger::Write(ELogError, L1, _L(L2)) + #define SUPLLOG_ERR2(L1,L2,L3) SuplDevLogger::Write(ELogError, L1, _L(L2), L3) + #define SUPLLOG_ERR3(L1,L2,L3,L4) SuplDevLogger::Write(ELogError, L1, _L(L2), L3, L4) + #define SUPLLOG_ERR4(L1,L2,L3,L4,L5) SuplDevLogger::Write(ELogError, L1, _L(L2), L3, L4, L5) + #define SUPLLOG_ERR5(L1,L2,L3,L4,L5,L6) SuplDevLogger::Write(ELogError, L1, _L(L2), L3, L4, L5, L6) + #define SUPLLOG_ERR6(L1,L2,L3,L4,L5,L6,L7) SuplDevLogger::Write(ELogError, L1, _L(L2), L3, L4, L5, L6, L7) + + #define SUPLLOG_WARN(L1,L2) SuplDevLogger::Write(ELogWarning, L1, _L(L2)) + #define SUPLLOG_WARN2(L1,L2,L3) SuplDevLogger::Write(ELogWarning, L1, _L(L2), L3) + #define SUPLLOG_WARN3(L1,L2,L3,L4) SuplDevLogger::Write(ELogWarning, L1, _L(L2), L3, L4) + #define SUPLLOG_WARN4(L1,L2,L3,L4,L5) SuplDevLogger::Write(ELogWarning, L1, _L(L2), L3, L4, L5) + #define SUPLLOG_WARN5(L1,L2,L3,L4,L5,L6) SuplDevLogger::Write(ELogWarning, L1, _L(L2), L3, L4, L5, L6) + #define SUPLLOG_WARN6(L1,L2,L3,L4,L5,L6,L7) SuplDevLogger::Write(ELogWarning, L1, _L(L2), L3, L4, L5, L6, L7) + + //Macro for getting the processname + #define SUPLLOG_GETPROCESSNAME(L1,L2) SuplDevLogger::GetMessageProcessName(L1,L2) + + //Macro for logging contents of ObjSys Data Structures (not for general use) + #define SUPLLOG_PDU(L1) L1->Print() + +/** + ------------------------------------------------- + Common logging macros (for logging large values) + ------------------------------------------------- +**/ + +// Logs TLbsNetSessionId + #define SUPLLOG_SESSIONID(L1) \ + { \ + SUPLLOG2(ELogP9, " - TUid iSessionOwner = 0x%08X\n", L1.SessionOwner().iUid); \ + SUPLLOG2(ELogP9, " - TUint32 iSessionNum = %u\n", L1.SessionNum()); \ + } + +/* Logs TPositionInfoBase + * This also logs the variables for all of the derived classes (if Applicable): + * - TPositionInfo + * - TPositionCourseInfo + * - TPositionSatelliteInfo + * - TPositionGpsMeasurementInfo + */ + #define SUPLLOG_TPOSITIONINFOBASE(L1) \ + { \ + /* Find out what the class type is*/ \ + TUint32 classTypeM = L1.PositionClassType(); \ + /* Log the TPositionInfoBase information */ \ + SUPLLOG2(ELogP9, " - TUint32 iPositionClassType = 0x%08X\n", classTypeM); \ + SUPLLOG2(ELogP9, " - TPositionModuleId iModuleId = 0x%08X\n", L1.ModuleId().iUid); \ + SUPLLOG2(ELogP9, " - TUint32 iUpdateType = %u\n", L1.UpdateType()); \ + SUPLLOG2(ELogP9, " - TPositionModuleInfo::TTechnologyType iPositionMode = 0x%04X\n", L1.PositionMode()); \ + SUPLLOG2(ELogP9, " - TPositionModeReason iPositionModeReason = %u\n", L1.PositionModeReason()); \ + /* Log the TPositionInfo information*/ \ + if(classTypeM & EPositionInfoClass) \ + { \ + const TPositionInfo& posInfoM = (reinterpret_cast(L1)); \ + TPosition posM; \ + posInfoM.GetPosition(posM); \ + TTime timeM = posM.Time(); \ + SUPLLOG5(ELogP9, " - TTime iTime = %02d:%02d:%02d.%06d\n", timeM.DateTime().Hour(), \ + timeM.DateTime().Minute(), \ + timeM.DateTime().Second(), \ + timeM.DateTime().MicroSecond()); \ + SUPLLOG2(ELogP9, " - TReal32 iHorizontalAccuracy = %3.6g\n", posM.HorizontalAccuracy()); \ + SUPLLOG2(ELogP9, " - TReal32 iVerticalAccuracy = %3.6g\n", posM.VerticalAccuracy()); \ + SUPLLOG2(ELogP9, " - TReal64 iLatitude = %3.6g\n", posM.Latitude()); \ + SUPLLOG2(ELogP9, " - TReal64 iLongitude = %3.6g\n", posM.Longitude()); \ + SUPLLOG2(ELogP9, " - TReal32 iAltitude = %3.6g\n", posM.Altitude()); \ + SUPLLOG2(ELogP8, " - TPositionDatumId iDatum = 0x%08X\n", posM.Datum()); \ + } \ + /* Log the TPositionCourseInfo information*/ \ + if(classTypeM & EPositionCourseInfoClass) \ + { \ + const TPositionCourseInfo& courseInfoM = (reinterpret_cast(L1)); \ + TCourse courseM; \ + courseInfoM.GetCourse(courseM); \ + SUPLLOG2(ELogP8, " - TReal32 iSpeed = %3.6g\n", courseM.Speed()); \ + SUPLLOG2(ELogP8, " - TReal32 iHeading = %3.6g\n", courseM.Heading()); \ + SUPLLOG2(ELogP8, " - TReal32 iSpeedAccuracy = %3.6g\n", courseM.SpeedAccuracy()); \ + SUPLLOG2(ELogP8, " - TReal32 iHeadingAccuracy = %3.6g\n", courseM.HeadingAccuracy()); \ + } \ + /* Log the TPositionSatelliteInfo information*/ \ + if(classTypeM & EPositionSatelliteInfoClass) \ + { \ + const TPositionSatelliteInfo& satInfoM = (reinterpret_cast(L1)); \ + TInt numSatInViewM = satInfoM.NumSatellitesInView(); \ + SUPLLOG2(ELogP8, " - TUint iNumSatellitesInView = %u\n", numSatInViewM); \ + SUPLLOG2(ELogP8, " - TUint iNumSatellitesUsed = %u\n", satInfoM.NumSatellitesUsed()); \ + SUPLLOG2(ELogP8, " - TReal32 iHorizontalDoPValue = %3.6g\n", satInfoM.HorizontalDoP()); \ + SUPLLOG2(ELogP8, " - TReal32 iVerticalDoPValue = %3.6g\n", satInfoM.VerticalDoP()); \ + SUPLLOG2(ELogP8, " - TReal32 iTimeDoPValue = %3.6g\n", satInfoM.TimeDoP()); \ + for(TInt satNumM=0; ((satNumM < numSatInViewM) && (satNumM < KPositionMaxSatellitesInView)); ++satNumM) \ + { \ + TSatelliteData satDataM; \ + satInfoM.GetSatelliteData(satNumM, satDataM); \ + SUPLLOG2(ELogP8, " - TSatelliteData iSatellitesInView[%d] =\n", satNumM); \ + SUPLLOG2(ELogP8, " - TInt iSatelliteId = %d\n", satDataM.SatelliteId()); \ + SUPLLOG2(ELogP8, " - TReal32 iAzimuth = %3.6g\n", satDataM.Azimuth()); \ + SUPLLOG2(ELogP8, " - TReal32 iElevation = %3.6g\n", satDataM.Elevation()); \ + SUPLLOG2(ELogP8, " - TBool iIsUsed = %d\n", satDataM.IsUsed()); \ + SUPLLOG2(ELogP8, " - TInt iSignalStrength = %d\n", satDataM.SignalStrength()); \ + } \ + } \ + /* Log the TPositionGpsMeasurementInfo*/ \ + if(classTypeM & EPositionGpsMeasurementInfoClass) \ + { \ + const TPositionGpsMeasurementInfo& gpsInfoM = (reinterpret_cast(L1)); \ + TInt numMeasurementsM = gpsInfoM.NumMeasurements(); \ + SUPLLOG2(ELogP8, " - TInt iGpsTimeOfWeek = %d\n", gpsInfoM.GpsTimeOfWeek()); \ + SUPLLOG2(ELogP8, " - TUint iNumMeasurements = %d\n", numMeasurementsM); \ + for(TInt gpsNumM=0; ((gpsNumM < numMeasurementsM) && (gpsNumM < KPositionGpsMaxMeasurements)); ++gpsNumM) \ + { \ + TPositionGpsMeasurementData tempGpsDataM; \ + gpsInfoM.GetMeasurementData(gpsNumM, tempGpsDataM); \ + SUPLLOG2(ELogP8, " - TPositionGpsMeasurementData iMeasurementData[%d] = \n", gpsNumM); \ + SUPLLOG2(ELogP8, " - TInt iSatelliteId = %d\n", tempGpsDataM.SatelliteId()); \ + SUPLLOG2(ELogP8, " - TInt iCarrierNoiseRatio = %d\n", tempGpsDataM.CarrierNoiseRatio()); \ + SUPLLOG2(ELogP8, " - TInt iDoppler = %d\n", tempGpsDataM.Doppler()); \ + SUPLLOG2(ELogP8, " - TInt iWholeGpsChips = %d\n", tempGpsDataM.WholeGpsChips()); \ + SUPLLOG2(ELogP8, " - TInt iFractionalGpsChips = %d\n", tempGpsDataM.FractionalGpsChips()); \ + SUPLLOG2(ELogP8, " - TMultiPathIndicator iMultiPathIndicator = %d\n", tempGpsDataM.MultiPathIndicator()); \ + SUPLLOG2(ELogP8, " - TUint iPseudoRangeRmsError = %u\n", tempGpsDataM.PseudoRangeRmsError()); \ + } \ + } \ + } + +// Logs TPositionQuality + #define SUPLLOG_TPOSITIONQUALITY(L1) \ + { \ + SUPLLOG2(ELogP9, " - TReal32 iHorizontalAccuracy = %3.6g\n", L1.HorizontalAccuracy()); \ + SUPLLOG2(ELogP9, " - TReal32 iVerticalAccuracy = %3.6g\n", L1.VerticalAccuracy()); \ + SUPLLOG2(ELogP9, " - TTimeIntervalMicroSeconds iTimeToFirstFix = %ld\n", L1.TimeToFirstFix().Int64()); \ + SUPLLOG2(ELogP9, " - TTimeIntervalMicroSeconds iTimeToNextFix = %ld\n", L1.TimeToNextFix().Int64()); \ + SUPLLOG2(ELogP9, " - TCostIndicator iCostIndicator = %d\n", L1.CostIndicator()); \ + SUPLLOG2(ELogP9, " - TPowerConsumption iPowerConsumption = %d\n", L1.PowerConsumption()); \ + } + +// Logs TPositionModuleInfo + #define SUPLLOG_TPOSITIONMODULE(L1) \ + { \ + if(L1.PositionClassType() & EPositionModuleInfoClass) \ + { \ + const TPositionModuleInfo& positionInfoM = (reinterpret_cast(L1)); \ + SUPLLOG2(ELogP9, " - TPositionModuleId iModuleId = 0x%08X\n", positionInfoM.ModuleId().iUid); \ + SUPLLOG2(ELogP9, " - TBool iIsAvailable = %d\n", positionInfoM.IsAvailable()); \ + TBuf tempModuleNameM; \ + positionInfoM.GetModuleName(tempModuleNameM); \ + SUPLLOG2(ELogP9, " - TBuf iModuleName = %S\n", &tempModuleNameM); \ + TPositionQuality tempPositionQualityM; \ + positionInfoM.GetPositionQuality(tempPositionQualityM); \ + SUPLLOG_TPOSITIONQUALITY(tempPositionQualityM); \ + SUPLLOG2(ELogP9, " - TTechnologyType iTechnologyType = %x02X\n", positionInfoM.TechnologyType()); \ + SUPLLOG2(ELogP9, " - TDeviceLocation iDeviceLocation = %x02X\n", positionInfoM.DeviceLocation()); \ + SUPLLOG2(ELogP9, " - TCapabilities iCapabilities = %x04X\n", positionInfoM.Capabilities()); \ + SUPLLOG4(ELogP9, " - TVersion iVersion = (%d %d %d)\n", positionInfoM.Version().iMajor, \ + positionInfoM.Version().iMinor, \ + positionInfoM.Version().iBuild);\ + } \ + } + +// Logs TLbsExternalRequestInfo + #define SUPLLOG_TLBSEXTERNALREQ(L1) \ + { \ + /* Find out what the class type is*/ \ + TUint32 classTypeM = L1.ClassType(); \ + /* Output shared info */ \ + SUPLLOG2(ELogP9, " - TNetworkType iNetworkType = %x02X\n", L1.NetworkType()); \ + SUPLLOG2(ELogP9, " - TRequestType iRequestType = %x02X\n", L1.RequestType()); \ + SUPLLOG2(ELogP9, " - TFormatIndicator iRequesterIdFormat = %x02X\n", L1.RequesterIdFormat()); \ + SUPLLOG2(ELogP9, " - TFormatIndicator iClientNameFormat = %x02X\n", L1.ClientNameFormat()); \ + TBuf8 externalSizeM; \ + L1.GetClientExternalId(externalSizeM); \ + SUPLLOG2_L8(ELogP9, " - TLbsClientExternalId iClientExternalId = %S", &externalSizeM); \ + /* Output type specific info */ \ + if (classTypeM == EExternalRequestInfoClass) \ + { \ + const TLbsExternalRequestInfo& info = reinterpret_cast(L1); \ + TBuf8 requesterIdM; \ + info.GetRequesterId(requesterIdM); \ + TBuf8 clientNameM; \ + info.GetClientName(clientNameM); \ + SUPLLOG2_L8(ELogP9, " - TLbsRequesterId iRequesterId = %S", &requesterIdM); \ + SUPLLOG2_L8(ELogP9, " - TLbsClientName iClientName = %S", &clientNameM); \ + SUPLLOG2(ELogP9, " - TFormatIndicator iRequesterIdCodingScheme = %x02X\n", info.RequesterIdCodingScheme()); \ + SUPLLOG2(ELogP9, " - TFormatIndicator iClientNameCodingScheme = %x02X\n", info.ClientNameCodingScheme()); \ + } \ + else if (classTypeM == (EExternalRequestInfoClass | EExternalRequestInfoClass2)) \ + { \ + const TLbsExternalRequestInfo2& info = reinterpret_cast(L1); \ + TBuf16 requesterIdM; \ + info.GetRequesterId(requesterIdM); \ + TBuf16 clientNameM; \ + info.GetClientName(clientNameM); \ + SUPLLOG2(ELogP9, " - TLbsRequesterId iRequesterId = %S", &requesterIdM); \ + SUPLLOG2(ELogP9, " - TLbsClientName iClientName = %S", &clientNameM); \ + } \ + } + +// Logs TLbsNetPosRequestOptionsAssistance + #define SUPLLOG_REQUESTOPTIONSASSISTANCE(L1) \ + { \ + SUPLLOG2(ELogP9, " - TLbsAsistanceDataGroup iDataRequestMask = 0x%08X\n", L1.DataRequestMask()); \ + SUPLLOG2(ELogP9, " - TPositionModuleInfo::TTechnologyType iPosMode = 0x%04X\n", L1.PosMode()); \ + } + +// Logs TLbsNetPosRequestPrivacy + #define SUPLLOG_POSREQUESTPRIVACY(L1) \ + { \ + SUPLLOG2(ELogP9, " - TLbsRequestAction iAction = %d", L1.RequestAction()); \ + SUPLLOG2(ELogP9, " - TLbsRequestAdvice iAdvice = %d", L1.RequestAdvice()); \ + } + +// Logs TLbsNetPosRequestQuality + #define SUPLLOG_POSREQUESTQUALITY(L1) \ + { \ + SUPLLOG2(ELogP9, " - TReal32 iMinHorizontalAccuracy = %3.6g\n", L1.MinHorizontalAccuracy()); \ + SUPLLOG2(ELogP9, " - TReal32 iMinVerticalAccuracy = %3.6g\n", L1.MinVerticalAccuracy()); \ + SUPLLOG2(ELogP9, " - TTimeIntervalMicroSeconds iMaxFixTime = %ld\n", L1.MaxFixTime().Int64()); \ + SUPLLOG2(ELogP9, " - TTimeIntervalMicroSeconds iMaxFixAge = %ld\n", L1.MaxFixAge().Int64()); \ + } + +// Logs TLbsNetPosRequestOptions + #define SUPLLOG_POSREQUESTOPTIONS(L1) \ + { \ + SUPLLOG2(ELogP9, " - TBool iNewClient = %d\n", L1.NewClientConnected()); \ + TLbsNetPosRequestQuality qualityM; \ + L1.GetRequestQuality(qualityM); \ + SUPLLOG_POSREQUESTQUALITY(qualityM); \ + } + +// Logs TPositionUpdateOptionsBase + #define SUPLLOG_POSITIONOPTIONBASE(L1) \ + { \ + SUPLLOG2(ELogP9, " - TTimeIntervalMicroSeconds iUpdateInterval = %ld\n", L1.UpdateInterval().Int64()); \ + SUPLLOG2(ELogP9, " - TTimeIntervalMicroSeconds iUpdateTimeOut = %ld\n", L1.UpdateTimeOut().Int64()); \ + SUPLLOG2(ELogP9, " - TTimeIntervalMicroSeconds iMaxUpdateAge = %ld\n", L1.MaxUpdateAge().Int64()); \ + } + +// Logs TPositionCriteriaBase + #define SUPLLOG_POSITIONCRITERIABASE(L1) \ + { \ + SUPLLOG2(ELogP9, " - TPositionModuleInfo::TCapabilities iRequiredCaps = 0x%04X\n", L1.RequiredCapabilities()); \ + TPositionQuality tempPositionQualityM; \ + L1.GetRequiredQuality(tempPositionQualityM); \ + SUPLLOG_TPOSITIONQUALITY(tempPositionQualityM); \ + } + +// Logs TPositionModuleStatusBase + #define SUPLLOG_POSMODULESTATUS(L1) \ + { \ + if(L1.PositionClassType() & EPositionModuleStatusClass) \ + { \ + const TPositionModuleStatus& positionStatusM = (reinterpret_cast(L1)); \ + SUPLLOG2(ELogP9, " - TDeviceStatus iDeviceStatus = %d\n", positionStatusM.DeviceStatus()); \ + SUPLLOG2(ELogP9, " - TDataQualityStatus iDataQualityStatus = %d\n", positionStatusM.DataQualityStatus()); \ + } \ + } + +// Logs TPositionModuleStatusEventBase + #define SUPLLOG_POSMODULESTATUSEVENT(L1) \ + { \ + SUPLLOG2(ELogP9, " - TModuleEvent iRequestedEvents = %u\n", L1.RequestedEvents()); \ + SUPLLOG2(ELogP9, " - TModuleEvent iOccurredEvents = %u\n", L1.OccurredEvents()); \ + SUPLLOG2(ELogP9, " - TSystemModuleEvent iSystemModuleEvent = %u\n", L1.SystemModuleEvent()); \ + SUPLLOG2(ELogP9, " - TPositionModuleId iModuleId = 0x%08X\n", L1.ModuleId().iUid); \ + } + +// Logs TLbsNetPosRequestMethod + #define SUPLLOG_POSREQUESTMETHOD(L1) \ + { \ + TInt numPosMethodsM = L1.NumPosMethods(); \ + SUPLLOG2(ELogP9, " - TInt iNumPosMethods = %d\n", numPosMethodsM); \ + TLbsNetPosMethod posMethodM; \ + for(TInt posNumM=0; ((posNumM < numPosMethodsM) && ( posNumM < KLbsMaxNetPosMethods)); ++posNumM) \ + { \ + SUPLLOG2(ELogP9, " - TLbsNetPosMethod posMethod[%d]\n", posNumM); \ + if((L1.GetPosMethod(posNumM, posMethodM))) \ + { \ + SUPLLOG2(ELogP9, " - TUid iPosMeans = 0x%08X\n", posMethodM.PosMeans()); \ + SUPLLOG2(ELogP9, " - TPositionModuleInfo::TTechnologyType iPosMode = %d\n", posMethodM.PosMode()); \ + } \ + } \ + } + +// Logs TLbsGpsOptions + #define SUPLLOG_TLBSGPSOPTIONS(L1) \ + { \ + SUPLLOG2(ELogP9, " - CLbsAdmin::TGpsMode iGpsMode = 0x%02X\n", L1.GpsMode()); \ + if (L1.ClassType() & ELbsGpsOptionsArrayClass) \ + { \ + const TLbsGpsOptionsArray& optionsArrayM = (reinterpret_cast(L1)); \ + TInt numOptionsM = optionsArrayM.NumOptionItems(); \ + SUPLLOG2(ELogP9, " - TUint iNumItems = %u\n", numOptionsM); \ + for(TInt optionsNumM=0; ((optionsNumM < numOptionsM) && (optionsNumM < KLbsMaxGpsOptions)); ++optionsNumM) \ + { \ + TLbsGpsOptionsItem tempOptionsM; \ + optionsArrayM.GetOptionItem(optionsNumM, tempOptionsM); \ + SUPLLOG2(ELogP9, " - TLbsGpsOptionsItem iOptions[%d] =\n", optionsNumM); \ + SUPLLOG2(ELogP9, " - TPosUpdateType iPosUpdateType = %d", tempOptionsM.PosUpdateType()); \ + } \ + } \ + } + +#else +/** + Standard Logging Macros +**/ + #define SUPLLOG_BEGIN() + #define SUPLNEWLOG(L) + #define SUPLLOG(L1,L2) + #define SUPLLOG2(L1,L2,L3) + #define SUPLLOG3(L1,L2,L3,L4) + #define SUPLLOG4(L1,L2,L3,L4,L5) + #define SUPLLOG5(L1,L2,L3,L4,L5,L6) + #define SUPLLOG6(L1,L2,L3,L4,L5,L6,L7) + #define SUPLLOGHEX(L1,L2,L3) + + #define SUPLLOG2_L8(L1,L2,L3) + #define SUPLLOG3_L8(L1,L2,L3,L4) + #define SUPLLOG4_L8(L1,L2,L3,L4,L5) + + #define SUPLLOG_ERR(L1,L2) + #define SUPLLOG_ERR2(L1,L2,L3) + #define SUPLLOG_ERR3(L1,L2,L3,L4) + #define SUPLLOG_ERR4(L1,L2,L3,L4,L5) + #define SUPLLOG_ERR5(L1,L2,L3,L4,L5,L6) + #define SUPLLOG_ERR6(L1,L2,L3,L4,L5,L6,L7) + + #define SUPLLOG_WARN(L1,L2) + #define SUPLLOG_WARN2(L1,L2,L3) + #define SUPLLOG_WARN3(L1,L2,L3,L4) + #define SUPLLOG_WARN4(L1,L2,L3,L4,L5) + #define SUPLLOG_WARN5(L1,L2,L3,L4,L5,L6) + #define SUPLLOG_WARN6(L1,L2,L3,L4,L5,L6,L7) + +/** + Common logging macros (for logging large values) +**/ + #define SUPLLOG_SESSIONID(L1) + #define SUPLLOG_TPOSITIONINFOBASE(L1) + #define SUPLLOG_TPOSITIONQUALITY(L1) + #define SUPLLOG_TPOSITIONMODULE(L1) + #define SUPLLOG_TLBSEXTERNALREQ(L1) + #define SUPLLOG_REQUESTOPTIONSASSISTANCE(L1) + #define SUPLLOG_POSREQUESTPRIVACY(L1) + #define SUPLLOG_POSREQUESTQUALITY(L1) + #define SUPLLOG_POSREQUESTOPTIONS(L1) + #define SUPLLOG_POSITIONOPTIONBASE(L1) + #define SUPLLOG_POSITIONCRITERIABASE(L1) + #define SUPLLOG_POSMODULESTATUS(L1) + #define SUPLLOG_POSMODULESTATUSEVENT(L1) + #define SUPLLOG_POSREQUESTMETHOD(L1) + #define SUPLLOG_TLBSGPSOPTIONS(L1) + + #define SUPLLOG_GETPROCESSNAME(L1,L2) + + #define SUPLLOG_PDU(L1) + +#endif // ENABLE_SUPL_DEV_LOGGER + +#endif //SUPL_DEV_LOGGER_MACROS_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/inc/suplmemlogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/inc/suplmemlogger.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,77 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef SUPL_MEMORY_USAGE_LOGGER_H +#define SUPL_MEMORY_USAGE_LOGGER_H + + +#include +#include + +/** +*/ +NONSHARABLE_CLASS(CSuplMemoryUsageLogger) : public CBase + { +public: + IMPORT_C static CSuplMemoryUsageLogger* NewLC(); + ~CSuplMemoryUsageLogger(); + + IMPORT_C void Cancel(); + +private: + CSuplMemoryUsageLogger(); + void ConstructL(); + + void WriteToLog(); + void WriteMaxHeapToLog(); + + static TInt PeriodicCallback(TAny* aSelf); + +private: + CPeriodic* iPeriodic; + TInt iInterval; + + RProcess iProcess; + RHeap& iHeap; + TInt iStackSize; + TInt iMaxHeapTotal; + TInt iMaxChunkTotal; + TTime iStartTime; + RFileLogger iLogger; + TFileName iFileName; + }; + + +#ifdef ENABLE_SUPL_MEM_LOGGER + +#define SUPLMEMLOG_BEGIN() { CSuplMemoryUsageLogger* memoryUsageLogger = CSuplMemoryUsageLogger::NewLC(); } + +#define SUPLMEMLOG_END() { CleanupStack::PopAndDestroy(1); } + +#else // ENABLE_SUPL_MEM_LOGGER + +#define SUPLMEMLOG_BEGIN() + +#define SUPLMEMLOG_END() + +#endif // ENABLE_SUPL_MEM_LOGGER + +#endif //SUPL_MEMORY_USAGE_LOGGER_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/src/supldevlogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/src/supldevlogger.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,479 @@ +// 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: +// System +// +// + +/** + @file + @internalTechnology + +*/ + +#include +#include +#include + +// Component +#include "supldevlogger.h" + + +const TInt KSuplDevLogMaxBufSize = 300; +_LIT(KTimeFormat, "%H:%T:%S.%C"); +_LIT(KSuplDevLogFolder, "lbs"); +_LIT(KSuplDevLogFile,"lbs.txt"); +_LIT(KSuplDevLogError, "Error: "); +_LIT(KSuplDevLogWarning, "Warning: "); +_LIT(KSuplDevLogSep," | "); + +const TInt KSuplHexDumpWidth=16; +_LIT(KSuplFirstFormatString,"%04x : "); +_LIT(KSuplSecondFormatString,"%02x "); +_LIT(KSuplThirdFormatString,"%c"); +_LIT(KSuplThreeSpaces," "); +_LIT(KSuplTwoSpaces," "); +const TText KSuplFullStopChar='.'; + +// Declare structures which will hold variables on the heap. +typedef struct + { + TTime currentTime; + TBuf16<32> cTimeStr; + TFileName dirName; + TInt16 pos; + TUint64 procId; + TUint32 stackUsage; + } +TCreateLog16; + +typedef struct + { + TTime currentTime; + TBuf8<32> cTimeStr8; + TBuf16<32> cTimeStr; + TFileName dirName; + TInt pos; + TUint64 procId; + TUint32 stackUsage; + } +TCreateLog8; + +typedef struct + { + RThread localThread; + RProcess localProcess; + TFileName fName; + TInt16 pos; + } +TMessageProcessName; + +//#define ENABLE_SUPL_DEV_LOGGER_RDEBUG +//----------------------------------------------------------------------------- +// SuplDevLogger +//----------------------------------------------------------------------------- + +/** Static function, one parameter, overwrite the previous log +@param aFmt TDes string reference +*/ +EXPORT_C void SuplDevLogger::OverWrite(const TDesC16& aFmt) + { + TInt stackInt = 0; + + // Grab some meory off the heap, give up if no memory available. + RFileLogger *logger = new RFileLogger; + if (logger == NULL) + return; + + RBuf16 txt; + TInt err = txt.Create(KSuplDevLogMaxBufSize); + if (err != KErrNone) + { + delete logger; + return; + } + + err = logger->Connect(); + if (err == KErrNone) + { + CreateLogTxt(ELogNormal, ELogP5, &stackInt, txt); + txt.Append(aFmt.Left(KSuplDevLogMaxBufSize - txt.Length())); + + logger->CreateLog(KSuplDevLogFolder, KSuplDevLogFile, EFileLoggingModeOverwrite); + logger->SetDateAndTime(EFalse, EFalse); + logger->Write(txt); + + #ifdef ENABLE_SUPL_DEV_LOGGER_RDEBUG + txt.Append(_L("\n\r")); + RDebug::RawPrint(txt); + #endif + } + logger->Close(); + + // Free up heap space + txt.Close(); + delete logger; + } + +/** Static function, one parameter +@param aPrior Log entry priority +@param aFmt TDes string reference +*/ +EXPORT_C void SuplDevLogger::Write(TSuplLogType aType, TSuplLogPriority aPrior, TRefByValue aFmt, ...) + { + TInt stackInt = 0; + + // Grab space on the heap for varibles we are going to need here. + RFileLogger *logger = new RFileLogger; + if (logger == NULL) + { + return; + } + + TInt err = logger->Connect(); + if (err == KErrNone) + { + VA_LIST list; + VA_START(list, aFmt); + RBuf16 strList; + err = strList.Create(KSuplDevLogMaxBufSize); + + if (err == KErrNone) + { + strList.FormatList(aFmt, list); + VA_END(list); + + RBuf16 txt; + err = txt.Create(KSuplDevLogMaxBufSize); + if (err == KErrNone) + { + CreateLogTxt(aType, aPrior, &stackInt, txt); + txt.Append(strList.Left(KSuplDevLogMaxBufSize - txt.Length())); + + logger->CreateLog(KSuplDevLogFolder, KSuplDevLogFile, EFileLoggingModeAppend); + logger->SetDateAndTime(EFalse, EFalse); + logger->Write(txt); + + #ifdef ENABLE_SUPL_DEV_LOGGER_RDEBUG + txt.Append(_L("\n\r")); + RDebug::RawPrint(txt); + #endif + + txt.Close(); + } + strList.Close(); + } + } + + logger->Close(); + delete logger; + } + +/** Static function to dump the hex data +@param aPrior Log entry priority +@param aPtr TUnit8 pointer to hex data +@param aLen length of hex data +*/ +EXPORT_C void SuplDevLogger::HexDump(TSuplLogPriority aPrior, const TUint8 *aPtr, TInt aLen) + { + TInt stackInt = 0; + + if (aPtr==NULL) // nothing to do + return; + + RFileLogger* logger = new RFileLogger; + if (logger == NULL) + return; + + TInt err = logger->Connect(); + logger->CreateLog(KSuplDevLogFolder, KSuplDevLogFile, EFileLoggingModeAppend); + logger->SetDateAndTime(EFalse, EFalse); + + RBuf buf; + err = buf.Create(KSuplDevLogMaxBufSize); + if (err == KErrNone) + { + RBuf8 temp; + err= temp.Create(KSuplDevLogMaxBufSize); + if (err == KErrNone) + { + RBuf8 prefix; + if (prefix.Create(KSuplDevLogMaxBufSize) == KErrNone) + { + CreateLogTxt(ELogNormal, aPrior, &stackInt, prefix); + + TInt i=0; + while (aLen>0) + { + TInt n=(aLen>KSuplHexDumpWidth ? KSuplHexDumpWidth : aLen); + buf.Copy(prefix); + buf.AppendFormat(KSuplFirstFormatString,i); + + TInt j; + for (j=0; j126) ? KSuplFullStopChar : aPtr[i+j]); + + logger->Write(buf); + + #ifdef ENABLE_SUPL_DEV_LOGGER_RDEBUG + buf.Append(_L("\n\r")); + RDebug::RawPrint(buf); + #endif + + buf.SetLength(0); + temp.SetLength(0); + aLen-=n; + i+=n; + } + prefix.Close(); + } + temp.Close(); + } + buf.Close(); + } //end if buf created ok + + logger->Close(); + delete logger; + } + +/** private function, create common log text +@param aPrior Log entry priority +@param aBuf The log prefix buffer +@internalTechnology +*/ +void SuplDevLogger::CreateLogTxt(TSuplLogType aType, TSuplLogPriority aPrior, TInt* aStackPtr, TDes16& aBuf) + { + // Grab space on the heap for all the varibles we are going to need here. + TCreateLog16* vars = new TCreateLog16; + if (vars == NULL) + return; + + vars->currentTime.UniversalTime(); + TRAPD(err, vars->currentTime.FormatL(vars->cTimeStr, KTimeFormat)); + if (err) + { + User::Panic(KSuplDevLogger, KErrNoMemory); + } + + vars->dirName = RProcess().FileName(); + vars->pos = vars->dirName.LocateReverse('\\') + 1; + TPtr16 fileName = vars->dirName.MidTPtr(vars->pos); + vars->procId = RProcess().Id(); + + aBuf.Append(vars->cTimeStr); + aBuf.Append(KSuplDevLogSep); + + aBuf.Append(fileName); + aBuf.Append(KSuplDevLogSep); + + aBuf.AppendFormat(_L16("%LX"),vars->procId); + aBuf.Append(KSuplDevLogSep); + + aBuf.AppendFormat(_L16("P%d"),aPrior); + aBuf.Append(KSuplDevLogSep); + + aBuf.AppendFormat(_L16("%08X"), aStackPtr); + aBuf.Append(KSuplDevLogSep); + + if (aType == ELogError) + { + aBuf.Append(KSuplDevLogError); + } + else if (aType == ELogWarning) + { + aBuf.Append(KSuplDevLogWarning); + } + + delete vars; + } + +/** Static function, one parameter, overwrite the previous log +@param aFmt TDes string reference +*/ +EXPORT_C void SuplDevLogger::OverWrite(const TDesC8& aFmt) + { + TInt stackInt = 0; + + RFileLogger* logger = new RFileLogger; + if (logger == NULL) + return; + + TInt err = logger->Connect(); + if (err == KErrNone) + { + RBuf8 txt; + err = txt.Create(KSuplDevLogMaxBufSize); + + if (err == KErrNone) + { + CreateLogTxt(ELogNormal, ELogP5, &stackInt, txt); + txt.Append(aFmt.Left(KSuplDevLogMaxBufSize - txt.Length())); + + logger->CreateLog(KSuplDevLogFolder, KSuplDevLogFile, EFileLoggingModeOverwrite); + logger->SetDateAndTime(EFalse, EFalse); + logger->Write(txt); + + #ifdef ENABLE_SUPL_DEV_LOGGER_RDEBUG + txt.Append(_L("\n\r")); + RDebug::RawPrint(txt); + #endif + + txt.Close(); + } + } // end if logger connect ok + + logger->Close(); + delete logger; + } + +/** Static function, one parameter +@param aPrior Log entry priority +@param aFmt Log entry +*/ +EXPORT_C void SuplDevLogger::Write(TSuplLogType aType, TSuplLogPriority aPrior, TRefByValue aFmt, ...) + { + TInt stackInt = 0; + + RFileLogger* logger = new RFileLogger; + if (logger == NULL) + return; + + TInt err = logger->Connect(); + if (err == KErrNone) + { + VA_LIST list; + VA_START(list, aFmt); + + RBuf8 strList; + err = strList.Create(KSuplDevLogMaxBufSize); + if (err == KErrNone) + { + strList.FormatList(aFmt, list); + VA_END(list); + + RBuf8 txt; + err = txt.Create(KSuplDevLogMaxBufSize); + + if (err == KErrNone) + { + CreateLogTxt(aType, aPrior, &stackInt, txt); + txt.Append(strList.Left(KSuplDevLogMaxBufSize - txt.Length())); + + logger->CreateLog(KSuplDevLogFolder, KSuplDevLogFile, EFileLoggingModeAppend); + logger->SetDateAndTime(EFalse, EFalse); + logger->Write(txt); + + #ifdef ENABLE_SUPL_DEV_LOGGER_RDEBUG + txt.Append(_L("\n\r")); + RDebug::RawPrint(txt); + #endif + + txt.Close(); + } + + strList.Close(); + } // end if strList memory alloc'd ok + + } // end if logger connected ok + + logger->Close(); + delete logger; + } + +/** private function, create common log text +@param aPrior Log entry priority +@param aBuf The log prefix buffer +@internalTechnology +*/ +void SuplDevLogger::CreateLogTxt(TSuplLogType aType, TSuplLogPriority aPrior, TInt* aStackPtr, TDes8& aBuf) + { + // Grab space on the heap for all the varibles we are going to need here. + TCreateLog8* vars = new TCreateLog8; + if (vars == NULL) + { + return; + } + + vars->currentTime.UniversalTime(); + TRAPD(err, vars->currentTime.FormatL(vars->cTimeStr, KTimeFormat)); + if (err) + { + User::Panic(KSuplDevLogger, KErrNoMemory); + } + vars->cTimeStr8.Copy(vars->cTimeStr); + + vars->dirName = RProcess().FileName(); + vars->pos = vars->dirName.LocateReverse('\\') + 1; + TPtr fileName = vars->dirName.MidTPtr(vars->pos); + vars->procId = RProcess().Id(); + + aBuf.Append(vars->cTimeStr8); + aBuf.Append(KSuplDevLogSep); + + aBuf.Append(fileName); + aBuf.Append(KSuplDevLogSep); + + aBuf.AppendFormat(_L8("%LX"),vars->procId); + aBuf.Append(KSuplDevLogSep); + + aBuf.AppendFormat(_L8("P%d"),aPrior); + aBuf.Append(KSuplDevLogSep); + + aBuf.AppendFormat(_L8("%08X"), aStackPtr); + aBuf.Append(KSuplDevLogSep); + + if (aType == ELogError) + { + aBuf.Append(KSuplDevLogError); + } + else if (aType == ELogWarning) + { + aBuf.Append(KSuplDevLogWarning); + } + + delete vars; + } + +/** + This function uses the message to get the process and thread information in + order to get the process name for the log file + @param aMessage Client\server message about to be completed + @param aName Contains the filename of the process to which this message belongs +**/ +EXPORT_C void SuplDevLogger::GetMessageProcessName(const RMessage2& aMessage, TFileName& aName) + { + TMessageProcessName* vars = new TMessageProcessName; + if (vars == 0) + return; + + //Get the thread and process information + if (aMessage.Client(vars->localThread) != KErrNone) + return; + + vars->localThread.Process(vars->localProcess); + + aName = vars->localProcess.FileName(); + vars->pos = aName.LocateReverse('\\') + 1; + aName = aName.Mid(vars->pos); + + delete vars; + + return; + } diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/supldevlogger/src/suplmemlogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/supldevlogger/src/suplmemlogger.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,209 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include +#include +#include +#include "suplmemlogger.h" + + +/** Time interval between the first and second updates. */ +const TInt KTimerInitialDelay = 1000000; + +/** Time interval between the second and third and all the other updates. */ +const TInt KTimerInitialInterval = 2000000; + +const TInt KSuplDevLogMaxBufSize = 256; + +_LIT(KSuplDevLogFolder, "lbs"); +_LIT(KHeader, "TIME\tUID\tSTACK SIZE\tHEAP TOTAL\tHEAP AVAIL\tCHUNK TOTAL\tCHUNK AVAIL\tCELLS TOTAL\tCELLS AVAIL\tH/S TOTAL\tRAM TOTAL\tRAM AVAIL"); +_LIT(KLogFormat, "%d\t%x\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d"); + +EXPORT_C CSuplMemoryUsageLogger* CSuplMemoryUsageLogger::NewLC() + { + CSuplMemoryUsageLogger* self = new (ELeave) CSuplMemoryUsageLogger(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CSuplMemoryUsageLogger::CSuplMemoryUsageLogger() : + iHeap(User::Heap()) + { + } + +CSuplMemoryUsageLogger::~CSuplMemoryUsageLogger() + { + // Cancel and delete periodic timer + iPeriodic->Cancel(); + delete iPeriodic; + + // Close iLogger handle + iLogger.Write(KNullDesC8); + iLogger.Close(); + + // Write the max params to a separate file + WriteMaxHeapToLog(); + + // Close RProcess handle + iProcess.Close(); + } + +void CSuplMemoryUsageLogger::ConstructL() + { + //create periodic timer object + iPeriodic = CPeriodic::NewL(CActive::EPriorityHigh); + + //get process name + TFileName processFilename(iProcess.FileName()); + + //create log file name out of process name + TInt pos = processFilename.LocateReverse(TChar('\\')); + iFileName = processFilename.Mid(pos + 1); + iFileName = iFileName.Mid(0, iFileName.Length() - 3); + iFileName.Append(_L("txt")); + + //connect to file iLogger + User::LeaveIfError(iLogger.Connect()); + + //get total stack size + RThread currentThread; + TThreadStackInfo stackInfo; + currentThread.StackInfo(stackInfo); + iStackSize = stackInfo.iBase - stackInfo.iLimit; + + //create log file + iLogger.CreateLog(KSuplDevLogFolder, iFileName, EFileLoggingModeAppend); + + //write header to log file + iLogger.SetDateAndTime(ETrue, ETrue); + iLogger.Write(KNullDesC8); + iLogger.SetDateAndTime(EFalse, EFalse); + iLogger.WriteFormat(KHeader); + + //setup time stamp for calculating time passed + iStartTime.UniversalTime(); + + //first write to log file + WriteToLog(); + + //start periodic timer + iPeriodic->Start(KTimerInitialDelay, KTimerInitialInterval, TCallBack(PeriodicCallback, this)); + } + +EXPORT_C void CSuplMemoryUsageLogger::Cancel() + { + iPeriodic->Cancel(); + } + +TInt CSuplMemoryUsageLogger::PeriodicCallback(TAny* aSelf) + { + CSuplMemoryUsageLogger* self = static_cast(aSelf); + self->WriteToLog(); + return KErrNone; + } + +void CSuplMemoryUsageLogger::WriteToLog() + { + //seconds passed since start of application + TTime currentTime; + TTimeIntervalSeconds seconds; + currentTime.UniversalTime(); + currentTime.SecondsFrom(iStartTime, seconds); + + if (seconds.Int() <= 60) + { + TInt heapTotal = 0; + TInt heapAvail = 0; + TInt chunkTotal = 0; + TInt chunkAvail = 0; + TInt cellsTotal = 0; + TInt cellsAvail = 0; + TInt heapStackTotal = 0; + TInt ramTotal = 0; + TInt ramAvail = 0; + + //get system memory info from hardware abstraction layer + HAL::Get(HAL::EMemoryRAM, ramTotal); + HAL::Get(HAL::EMemoryRAMFree, ramAvail); + + //get process UID + TSecureId processUid(iProcess.SecureId()); + + //get various heap and chunk memory sizes + iHeap.AllocSize(heapTotal); + if (heapTotal > iMaxHeapTotal) + { + iMaxHeapTotal = heapTotal; + } + iHeap.Available(heapAvail); + chunkTotal = iHeap.Size(); + chunkAvail = chunkTotal - heapTotal; + if (chunkTotal > iMaxChunkTotal) + { + iMaxChunkTotal = chunkTotal; + } + + //get cells info + cellsTotal = iHeap.Count(cellsAvail); + + //sum up the total heap and stack sizes + heapStackTotal = heapTotal + iStackSize; + + //create log text and write to log file + TBuf16 logData; + logData.Format(KLogFormat, seconds.Int(), processUid.iId, iStackSize, heapTotal, heapAvail, chunkTotal, chunkAvail, cellsTotal, cellsAvail, heapStackTotal, ramTotal, ramAvail); + iLogger.Write(logData); + } + } + +void CSuplMemoryUsageLogger::WriteMaxHeapToLog() + { + _LIT(KLogMaxHeapFormat, "%d, %d"); + + //connect to file iLogger + TInt err = iLogger.Connect(); + if (KErrNone == err) + { + //create new log file name out of existing + TInt pos = iFileName.LocateReverse(TChar('.')); + if (KErrNotFound != pos) + { + iFileName.Insert(pos, _L("_max_ram")); + + //create log file + iLogger.CreateLog(KSuplDevLogFolder, iFileName, EFileLoggingModeOverwrite); + + //write header to log file +// iLogger.SetDateAndTime(ETrue, ETrue); +// iLogger.Write(KNullDesC8); + iLogger.SetDateAndTime(EFalse, EFalse); + + //create log text and write to log file + TBuf16 logData; + logData.Format(KLogMaxHeapFormat, iMaxHeapTotal, iMaxChunkTotal); + iLogger.Write(logData); + iLogger.Write(KNullDesC8); + } + iLogger.Close(); + } + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/utils/BWINS/netpmutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/utils/BWINS/netpmutilsu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + ?Uncertainty@NetPmUtils@@SAHABM@Z @ 1 NONAME ; int NetPmUtils::Uncertainty(float const &) + ?EncodeAltitude@NetPmUtils@@SAHABM@Z @ 2 NONAME ; int NetPmUtils::EncodeAltitude(float const &) + ?UncertaintyAltitude@NetPmUtils@@SAHABM@Z @ 3 NONAME ; int NetPmUtils::UncertaintyAltitude(float const &) + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/utils/eabi/netpmutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/utils/eabi/netpmutilsu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + _ZN10NetPmUtils11UncertaintyERKf @ 1 NONAME + _ZN10NetPmUtils14EncodeAltitudeERKf @ 2 NONAME + _ZN10NetPmUtils19UncertaintyAltitudeERKf @ 3 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/utils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/utils/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +// 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: +// + +PRJ_EXPORTS + +netpmutils.iby /epoc32/rom/include/netpmutils.iby + +//../inc/netpmutils.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/netpmutils.h) + +PRJ_MMPFILES +netpmutils.mmp + +PRJ_TESTEXPORTS +PRJ_TESTMMPFILES diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/utils/group/netpmutils.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/utils/group/netpmutils.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,22 @@ +// 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: +// An iby file for the network PM utilities library +// + +#ifndef __NETPM_UTILS_IBY__ +#define __NETPM_UTILS_IBY__ + +file=ABI_DIR\DEBUG_DIR\netpmutils.dll System\libs\netpmutils.dll + +#endif //__NETPM_UTILS_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/utils/group/netpmutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/utils/group/netpmutils.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,35 @@ +// 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: +// + +TARGET netpmutils.dll +TARGETTYPE dll +CAPABILITY ALL -TCB +UID 0x1000008d 0x102871F4 +VENDORID 0x70000001 + +MACRO ENABLE_SUPL_DEV_LOGGER + +SOURCEPATH ../src +SOURCE netpmutils.cpp + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../inc + +// Standard Libraries +LIBRARY euser.lib +LIBRARY estlib.lib + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/utils/inc/netpmutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/utils/inc/netpmutils.h Tue Jul 13 12:25:28 2010 +0100 @@ -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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef NET_PM_UTILS_H +#define NET_PM_UTILS_H + +//************************************************************************************************************ +#include + +// Literals used +_LIT(KNetPMUtils, "NetPMUtils"); + +/** +Constants used in the encoding of position values. +*/ +const TReal KLbsLatitudeConst = (8388608 / 90); // 2^23 / 90 +const TReal KLbsLongitudeConst = (16777216 / 360); // 2^24 / 360 +const TInt KLbsMaxAltitude = 32767; // 2^15 - 1 + +/** +Constants used in velocity conversion +1 meter per second = 3.6 kilometers per hour +*/ +const TReal KLbsMpsKmphConstant = 3.6; + +class NetPmUtils + { + public: + + public: // New functions + IMPORT_C static TInt NetPmUtils::Uncertainty(const TReal32& aDistance); + IMPORT_C static TInt EncodeAltitude(const TReal32& aAltitude); + IMPORT_C static TInt UncertaintyAltitude(const TReal32& aDistance); + private: + NetPmUtils( const NetPmUtils& ); + }; + + +#endif //NET_PM_UTILS_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkpmutils/utils/src/netpmutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkpmutils/utils/src/netpmutils.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,129 @@ +// 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: +// System +// +// + +/** + @file + @internalTechnology + +*/ + +#include +#include + +// Component +#include "netpmutils.h" + +/** +Constants used in encoding of uncertainty data + +@see CSuplStart::Uncertainty() +@see CSuplStart::UncertaintyAltitude() +*/ +const TReal KLbsLogOnePointOne = 0.095310179804324860043952123280765; +const TReal KLbsLogOnePointZeroTwoFive = 0.02469261259037150101430767543669; +const TInt KLbsMaxUncert = 127; + +/** + * TODO: update asn1 code to use this version and delete the CSuplMessageBase version? +Uncertainty() + +Converts a minumum accuracy value in meters to an uncertainty value K as +described in 3GPP 23.032 (Universal Geographical Area Description) section 6.2. + +r = C((1+x)^K - 1) + +where r = distance in meters + C = 10 + x = 0.1 + K = uncertainty value + +hence K = ln(r/C + 1) / ln(1.1) + +@param aDistance - distance measurement in meters +@return uncertainty value K +*/ +EXPORT_C TInt NetPmUtils::Uncertainty(const TReal32& aDistance) + { + TReal uncert; + Math::Ln(uncert, (aDistance/10) + 1 ); + uncert /= KLbsLogOnePointOne; + if (uncert>KLbsMaxUncert) + { + uncert = KLbsMaxUncert; + } + + // round to nearest whole number + TReal uncertRounded; + Math::Round(uncertRounded, uncert, 0); + + return (TInt)uncertRounded; + } + + +/** +UncertaintyAltitude() + +Converts a minumum accuracy value in meters to an uncertainty altitude value K as +described in 3GPP 23.032 (Universal Geographical Area Description) section 6.4. + +r = C((1+x)^K - 1) + +where r = distance in meters + C = 45 + x = 0.1 + K = uncertainty value + +hence K = ln(r/C + 1) / ln(1.1) + +@param aDistance - altitude accuracy in meters +@return uncertainty altitude value K +*/ +EXPORT_C TInt NetPmUtils::UncertaintyAltitude(const TReal32& aDistance) + { + + TReal uncert; + Math::Ln(uncert, (aDistance/45) + 1 ); + uncert /= KLbsLogOnePointZeroTwoFive; + if (uncert>KLbsMaxUncert) + { + uncert = KLbsMaxUncert; + } + // round to nearest whole number + TReal uncertRounded; + Math::Round(uncertRounded, uncert, 0); + + return (TInt)uncertRounded; + } + +/** +EncodeAltitude() + +Converts an value for altiutude to an 15 bit binary coded number N + +@param aAltitude - altitude in meters +@return uncertainty altitude value K +*/ +EXPORT_C TInt NetPmUtils::EncodeAltitude(const TReal32& aAltitude) + { + TInt altEncoded = (TInt)aAltitude; + if (altEncoded>KLbsMaxAltitude) + { + altEncoded = KLbsMaxAltitude; + } + + return altEncoded; + } diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/networkprotocolmodule/LbsNetSim/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/networkprotocolmodule/LbsNetSim/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,30 @@ +// Copyright (c) 2005-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: +// Network Simulator BLD.INF +// +// + +#include "../test/group/bld.inf" + +PRJ_EXPORTS +./lbsnetsim.iby /epoc32/rom/include/lbsnetsim.iby +../inc/lbsnetsimgateway.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/lbsnetsimgateway.h) +../inc/lbsnetsimtest.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/lbsnetsimtest.h) +../inc/lbsnetsimgatewayobserver.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/lbsnetsimgatewayobserver.h) +../inc/lbsnetsimtestobserver.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/lbsnetsimtestobserver.h) +../inc/lbsnetsimstatus.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(lbs/test/lbsnetsimstatus.h) + +PRJ_MMPFILES +lbsnetsimclient.mmp +lbsnetsimserver.mmp diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/privacyprotocolmodule/ClientAPI/NetworkPrivacyAPI/inc/EPos_NetworkPrivacyPanicDeclaration.h --- a/networkprotocolmodules/privacyprotocolmodule/ClientAPI/NetworkPrivacyAPI/inc/EPos_NetworkPrivacyPanicDeclaration.h Mon May 03 13:50:32 2010 +0300 +++ b/networkprotocolmodules/privacyprotocolmodule/ClientAPI/NetworkPrivacyAPI/inc/EPos_NetworkPrivacyPanicDeclaration.h Tue Jul 13 12:25:28 2010 +0100 @@ -26,7 +26,7 @@ #ifndef NETWORKPRIVACYPANICDECLARATION_H #define NETWORKPRIVACYPANICDECLARATION_H -#include +#include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/privacyprotocolmodule/test/te_dummynetgateway/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/privacyprotocolmodule/test/te_dummynetgateway/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,17 @@ +// Copyright (c) 2007-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: +// + +PRJ_TESTMMPFILES +te_dummynetgateway.mmp \ No newline at end of file diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/privacyprotocolmodule/test/te_lbsprivfwcap/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/privacyprotocolmodule/test/te_lbsprivfwcap/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,34 @@ +// Copyright (c) 2007-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: +// + +PRJ_TESTMMPFILES + +lbsprivfwcap.MMP + + + +PRJ_TESTEXPORTS + +../scripts/Cap_00022010_lbsprivfwcapSub.script c:/testdata/scripts/cap_00022010_lbsprivfwcapsub.script +../scripts/Cap_00022000_lbsprivfwcapSub.script c:/testdata/scripts/cap_00022000_lbsprivfwcapsub.script +../scripts/Cap_00020010_lbsprivfwcapSub.script c:/testdata/scripts/cap_00020010_lbsprivfwcapsub.script +../scripts/Cap_00002010_lbsprivfwcapSub.script c:/testdata/scripts/cap_00002010_lbsprivfwcapsub.script +../scripts/Cap_00020000_lbsprivfwcapSub.script c:/testdata/scripts/cap_00020000_lbsprivfwcapsub.script +../scripts/Cap_00000010_lbsprivfwcapSub.script c:/testdata/scripts/cap_00000010_lbsprivfwcapsub.script +../scripts/Cap_00000002_lbsprivfwcapSub.script c:/testdata/scripts/cap_00000002_lbsprivfwcapsub.script +../scripts/lbsprivfwcap.script c:/testdata/scripts/lbsprivfwcap.script + + +./lbsprivfwcap.IBY /epoc32/rom/include/lbsprivfwcap.iby diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,17 @@ +// Copyright (c) 2007-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: control plane protocol handler(s) for use by SUPL Protocol Modules +// + +// RRLP protocol: +#include "../suplrrlpprotocol/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/group/lbs_suplcontrolplaneprotocols.mrp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/group/lbs_suplcontrolplaneprotocols.mrp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,29 @@ +# +# Copyright (c) 2010 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: +# + +component lbs_suplcontrolplaneprotocols + +source \sf\os\lbs\networkprotocolmodules\suplcontrolplaneprotocols + +binary \sf\os\lbs\networkprotocolmodules\suplcontrolplaneprotocols\suplrrlpprotocol\group all + +exports \sf\os\lbs\networkprotocolmodules\suplcontrolplaneprotocols\suplrrlpprotocol\group + +notes_source \component_defs\release.src + +ipr E + +ipr T \sf\os\lbs\networkprotocolmodules\suplcontrolplaneprotocols\suplrrlpprotocol\test \ No newline at end of file diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplpositioningprotbase/inc/suplpositioningprotocolfsm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplpositioningprotbase/inc/suplpositioningprotocolfsm.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,153 @@ +// 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 file defines the base class and observer to allow a SUPL protocol +// to send/receive messages to/from positioning protocol state machines. +// +// + +/** + @file + @internalTechnology + +*/ + +#ifndef CSUPLPOSITIONINGPROTOCOLFSM_H +#define CSUPLPOSITIONINGPROTOCOLFSM_H + +#include +#include +#include +#include +#include +#include "lbstimer.h" +#include +#include +#include "suplpos.h" + + +class CStateHandlerBase; + +/** Positioning Protocol observer mixin definition. + This defines an interface to be implemented by an observer of the Positioning Protocol. + The SUPL state machines implement this. +*/ +class MSuplPositioningProtocolFsmObserver + { +public: + + /** Pass assistance data to the observer. + @return + */ + virtual void ProcessAssistanceData(const TLbsAsistanceDataGroup& aGroupMask, TInt aReason)= 0; + + /** Send a positioning request to the observer. + */ + virtual void ProcessPositioningRequest(const TLbsNetPosRequestQuality& aQuality, + const TLbsNetPosRequestMethod& aPosMethod) = 0; + + /** Request from the observer that a SUPL POS is sent to the SLP with the provided payload + */ + virtual void PositioningPayloadToNetwork(const CSuplPosPayload* aPositioningPayload) = 0; + + /** Inform the observer that there has been an error in the positioning protocol. Expected + action is termination of the SUPL session via SUPL END. + */ + virtual void PositioningProtocolError(const TInt& aError) = 0; + + /** Inform observer that the Positioning session has finished **/ + virtual void PositioningSessionEnded() = 0; + }; + + +//----------------------------------------------------------------------------- +// Positioning Protocol State Machine Base Class +//----------------------------------------------------------------------------- + +/** Base class definition for positioning protocol state machines. +This class provides support for common features of all state machines +of positioning protocols associated to SUPL. + +A significant aspect incorporated in this base class is the active object +mechanism for performing state transitions. This feature is used to provide +state machines with the ability to perform autonomous and asynchronous actions +e.g. to receive a indication of positioning protocol messages arriving from the +network and to perform interactions with SUPL state machines. + +The base class includes various attributes that describe protocol activity, +together with access methods used to retrieve the value of these attributes. +*/ +class CSuplPositioningProtocolFsm : public CActive + { +public: + + /** State machine protocol state. + This defines the general protocol state for state machines. + */ + enum TPositioningProtocolState + { + /** Not valid */ + EStateNull, + /** Ready to use, but not currently active. */ + EStateReady, + /** Actively performing a protocol procedure.*/ + EStateActive, + /** In the process of cancelling. */ + EStateCancelling + }; + + /** State machine cancel source. + This defines the source of a cancellation. + */ + enum TCancelSource + { + /** Not cancelling */ + ECancelNone, + /** The SUPL FSM cancelled the procedure */ + ESuplFsmCancel, + /** A network error occurred */ + ECancelNetworkError, + /** A network timeout occurred */ + ECancelNetworkTimeout, + /** State machine is closing down (destruction)*/ + ECancelClosing + }; + + +public: + + virtual ~CSuplPositioningProtocolFsm(); + + // CActive derived methods + void RunL() = 0; + void DoCancel() = 0; + + // Methods that must be overriden in derived classes + virtual void ProcessPositioningMessage(CSuplPosPayload* aMessage) = 0; + virtual void CancelMachine(const TCancelSource& aCancelSource, TInt aReason) = 0; + virtual void AssistanceDataRequest(const TLbsAssistanceDataGroup& aMask) = 0; + virtual void LocationResp(TInt aReason, const TPositionInfoBase& aPosInfo) = 0; + virtual bool IsAssistDataRequestAllowed() = 0; + +protected: + + CSuplPositioningProtocolFsm(MSuplPositioningProtocolFsmObserver& aObserver); + +protected: + + /** Reference to State machine observer + */ + MSuplPositioningProtocolFsmObserver& iObserver; + }; + +#endif // CSUPLPOSITIONINGPROTOCOLFSM_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplpositioningprotbase/inc/suplpositioningprotocolfsm.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplpositioningprotbase/inc/suplpositioningprotocolfsm.inl Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,35 @@ +// 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 file defines the base class and observer to allow a SUPL protocol +// to send/receive messages to/from positioning protocol state machines. +// +// + +/** + @file + @internalTechnology + +*/ + +#include "suplpositioningprotocolfsm.h" + +// Constructors +CSuplPositioningProtocolFsm::CSuplPositioningProtocolFsm(MSuplPositioningProtocolFsmObserver& aObserver) : + CActive(EPriorityStandard), iObserver(aObserver) + { + } + +CSuplPositioningProtocolFsm::~CSuplPositioningProtocolFsm() + { + } diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/bwins/suplrrlpprotocolu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/bwins/suplrrlpprotocolu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,8 @@ +EXPORTS + ?ProcessPositioningMessage@CSuplRrlpFsm@@UAEXPAVCSuplPosPayload@@@Z @ 1 NONAME ; void CSuplRrlpFsm::ProcessPositioningMessage(class CSuplPosPayload *) + ?NewL@CSuplRrlpFsm@@SAPAV1@AAVMSuplPositioningProtocolFsmObserver@@AAVRLbsAssistanceDataBuilderSet@@@Z @ 2 NONAME ; class CSuplRrlpFsm * CSuplRrlpFsm::NewL(class MSuplPositioningProtocolFsmObserver &, class RLbsAssistanceDataBuilderSet &) + ?AssistanceDataRequest@CSuplRrlpFsm@@UAEXABK@Z @ 3 NONAME ; void CSuplRrlpFsm::AssistanceDataRequest(unsigned long const &) + ?LocationResp@CSuplRrlpFsm@@UAEXHABVTPositionInfoBase@@@Z @ 4 NONAME ; void CSuplRrlpFsm::LocationResp(int, class TPositionInfoBase const &) + ?IsAssistDataRequestAllowed@CSuplRrlpFsm@@UAE_NXZ @ 5 NONAME ; bool CSuplRrlpFsm::IsAssistDataRequestAllowed(void) + ?CancelMachine@CSuplRrlpFsm@@UAEXABW4TCancelSource@CSuplPositioningProtocolFsm@@H@Z @ 6 NONAME ; void CSuplRrlpFsm::CancelMachine(enum CSuplPositioningProtocolFsm::TCancelSource const &, int) + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/eabi/suplrrlpprotocolu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/eabi/suplrrlpprotocolu.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,12 @@ +EXPORTS + _ZN12CSuplRrlpFsm12LocationRespEiRK17TPositionInfoBase @ 1 NONAME + _ZN12CSuplRrlpFsm13CancelMachineERKN27CSuplPositioningProtocolFsm13TCancelSourceEi @ 2 NONAME + _ZN12CSuplRrlpFsm21AssistanceDataRequestERKm @ 3 NONAME + _ZN12CSuplRrlpFsm25ProcessPositioningMessageEP15CSuplPosPayload @ 4 NONAME + _ZN12CSuplRrlpFsm26IsAssistDataRequestAllowedEv @ 5 NONAME + _ZN12CSuplRrlpFsm4NewLER35MSuplPositioningProtocolFsmObserverR28RLbsAssistanceDataBuilderSet @ 6 NONAME + _ZTI12CSuplRrlpFsm @ 7 NONAME + _ZTI27CSuplPositioningProtocolFsm @ 8 NONAME + _ZTV12CSuplRrlpFsm @ 9 NONAME + _ZTV27CSuplPositioningProtocolFsm @ 10 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,24 @@ +// 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: +// + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +suplrrlpprotocol.iby /epoc32/rom/include/suplrrlpprotocol.iby + +PRJ_MMPFILES +suplrrlpprotocol.mmp + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/group/suplrrlpprotocol.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/group/suplrrlpprotocol.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,29 @@ +// 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: +// + +#ifndef __SUPL_RRLP_PROTOCOL_IBY__ +#define __SUPL_RRLP_PROTOCOL_IBY__ + + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) +#if defined(SYMBIAN_INCLUDE_LOCATION_SUPLv10) || defined(SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY) + +file=ABI_DIR\DEBUG_DIR\suplrrlpprotocol.dll System\libs\suplrrlpprotocol.dll + +#endif // SYMBIAN_INCLUDE_LOCATION_SUPLv10 || SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY +#endif // SYMBIAN_EXCLUDE_LOCATION + + +#endif // __SUPL_RRLP_PROTOCOL_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/group/suplrrlpprotocol.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/group/suplrrlpprotocol.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,49 @@ + +// 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: suplrrlpprotocol.mmp - This is the project specification file for SuplRRLPProtocol. +// +// + +TARGET suplrrlpprotocol.dll +TARGETTYPE DLL +UID 0 0x10283764 + +CAPABILITY ALL -TCB + +// Sources +SOURCEPATH ../src +SOURCE suplrrlpstatemachine.cpp +SOURCE dllmain.cpp + +// +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_LIBC_SYSTEMINCLUDE + +// Includes +USERINCLUDE ../inc +USERINCLUDE ../../suplpositioningprotbase/inc/ +USERINCLUDE ../../../suplpmcore/suplrrlpasn1/inc/ +USERINCLUDE ../../../../locationmgmt/locationcore/LbsPartnerCommon/inc +USERINCLUDE ../../../networkpmutils/supldevlogger/inc + +// Libraries +LIBRARY lbspartnercommon.lib +LIBRARY euser.lib +LIBRARY lbsnetprotocol.lib +LIBRARY lbsassistancedata.lib +LIBRARY lbs.lib +LIBRARY suplrrlpasn1.lib +LIBRARY supldevlogger.lib + +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/inc/suplrrlpstatemachine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/inc/suplrrlpstatemachine.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,190 @@ +// 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: +// csuplrrlpfsm.h +// This file defines the class for the RRLP protocol state machine. +// +// + +/** + @file + @internalTechnology + +*/ + +#ifndef __CSUPLRRLPFSM_H__ +#define __CSUPLRRLPFSM_H__ + +#include + +#include "rrlpmessagebase.h" +#include "rrlpmeasureposrequest.h" +#include "rrlpprotocolerror.h" +#include "suplpositioningprotocolfsm.h" + +// Forwards +class CRrlpAssistanceData; +class CRrlpAssistanceDataAck; + +/** This class implementes the RRLP protocol. + +Only those messages and parameters required by SUPL for AGPS positioning +are supported. Optional parameters not related to AGPS are not implemented. + +@see CStateMachineBase + +The class also implements a timer observer interface defined by MLbsCallbackTimerObserver +@see MLbsCallbackTimerObserver +*/ +class CSuplRrlpFsm : public CSuplPositioningProtocolFsm, public MLbsCallbackTimerObserver + { +public: + // Constructors + IMPORT_C static CSuplRrlpFsm* NewL(MSuplPositioningProtocolFsmObserver& aObserver,RLbsAssistanceDataBuilderSet& aDataBuilder); + virtual ~CSuplRrlpFsm(); + + // Methods derived from base class (must be implemented) + IMPORT_C void ProcessPositioningMessage(CSuplPosPayload* aMessage); + IMPORT_C void CancelMachine(const TCancelSource& aCancelSource, TInt aReason); + IMPORT_C void AssistanceDataRequest(const TLbsAssistanceDataGroup& aMask); + IMPORT_C void LocationResp(TInt aReason, const TPositionInfoBase& aPosInfo); + IMPORT_C bool IsAssistDataRequestAllowed(); + +protected: + // CActive + void RunL(); + void DoCancel(); + +private: + /** RRLP states (when used with SUPL) + These identify the current state within the + RRLP procedure. + */ + enum TRrlpState + { + /** Not valid */ + EStateNull, + /** Assistance Data Message received (more on the way)*/ + EStateAssitDataChunkRecvd, + /** Assitance Data Message received (no more assistance data messages on the way) */ + EStateAssitDataAcknowledged, + /** Measure Position Request message received from the network */ + EStateMeasureReqRecvd, + /** A positioning request has been sent to SUPL */ + EStateRequestHandled, + /** A request for additional Assistance Data from LBS is sent to the network */ + EStateMoreAssistDataRequested, + /** Location response sent to network */ + EStateMeasureRespSent, + /** An error or a cancel has occured */ + EStateErrorRecvd + }; + + /** Timer ID's + */ + enum TTimerIds + { + EAssitanceDataChunk, + ERequest, + EResponseDelay, + EMeasureRequestWithAssistanceDataDelay + }; +private: + // Constructor + CSuplRrlpFsm(MSuplPositioningProtocolFsmObserver& aObserver, RLbsAssistanceDataBuilderSet& aDataBuilder); + void ConstructL(); + + // MLbsCallbackTimerObserver methods + void OnTimerEventL(TInt aTimerId); + TInt OnTimerError(TInt aTimerId, TInt aError); + + // Protocol Timers. + void StartAssitanceDataChunkTimer(); + void ReceivedAssistanceDataChunkTimer(); + void StartRequestTimer(); + void ReceivedRequestTimer(); + void StartPosResultTimer(TTimeIntervalMicroSeconds aMicroSeconds); + void ReceivedPosResultTimer(); + // Other timers + void StartMeasureRequestWithAssitanceDataTimer(TInt aTime); + void ReceivedMeasureRequestWithAssitanceDataTimer(); + + // Handler functions + void HandleAssistanceDataMessage(CRrlpAssistanceData* aData); + void HandleMeasurementPositionRequest(CRrlpMeasurePositionRequest* aData); + void HandleProtocolError(CRrlpProtocolError* aError); + + // Others + TBool TransistionTo(TRrlpState aState); + void TransistionToError(TInt aError); + void AddReference(CRrlpMessageBase& aMessage); +private: + /** Current RRLP state + */ + TRrlpState iCurrentState; + TRrlpState iNextState; + + /** Last reference number received + */ + TRrlpReference iLastReferenceNumber; + + /** Timer in between RRLP messages + (it is a protocol error when this timer expires and more assistance data is expected) + */ + static const TInt KAssistanceDataChunkTimeout; + CLbsCallbackTimer* iAssistanceDataChunkTimer; + + /** Timer for RRLP Measure Position Request after Assitance Data message + (it is not always a protocol error when this timer expires) + */ + const static TInt KRequestTimeout; + CLbsCallbackTimer* iRequestTimer; + + /** Timer for overseeing that LBS responds within the expected delay + (the delay is specified in the RRLP Measure Position Request, this + timer lasts longer to give LBS's response a chance to arrive before expiry) + */ + const static TInt KResponseDelayAddition; + const static TInt KResponseDelayTimeout; + CLbsCallbackTimer* iResponseDelayTimer; + + /** Timer for allowing assistance data to be processed by LBS if received + in the Measurement Request + */ + const static TInt KMeasureRequestWithAssistanceDataDelay; + CLbsCallbackTimer* iMeasureRequestWithAssitanceDataDelayTimer; + + /** Flag to show location request has been sent to LBS. + */ + TBool iIsLocReqSentToLbs; + + /** Location request quality. + */ + TLbsNetPosRequestQuality iLocReqQuality; + + /** Location request positioning method. + */ + TLbsNetPosRequestMethod iPosMethod; + + /** Assistance data + */ + RLbsAssistanceDataBuilderSet& iAssistanceData; + + /** Assistance data mask + */ + TLbsAssistanceDataGroup iAssistanceDataMask; + + }; + +#endif // __CSUPLRRLPFSM_H__ + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/src/dllmain.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +// 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: +// + +#include + +#ifdef EKA2 +GLDEF_C TInt E32Dll() +#else +GLDEF_C TInt E32Dll(TDllReason /*aReason*/) +#endif + { + return(KErrNone); + } diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/src/suplrrlpstatemachine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplcontrolplaneprotocols/suplrrlpprotocol/src/suplrrlpstatemachine.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,557 @@ +#include +// 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: +// + +/** + @file + @internalTechnology + +*/ + + +#include "rrlpassistancedata.h" +#include "rrlpassistancedataack.h" +#include "rrlpmeasureposrequest.h" +#include "rrlpmeasureposresponse.h" +#include "supldevloggermacros.h" +#include "suplrrlpstatemachine.h" +#include "suplpositioningprotocolfsm.inl" + +// statics +const TInt CSuplRrlpFsm::KAssistanceDataChunkTimeout = 10; // Seconds +const TInt CSuplRrlpFsm::KRequestTimeout = 60; // Seconds +const TInt CSuplRrlpFsm::KResponseDelayAddition = 1000; // Micro-Seconds +const TInt CSuplRrlpFsm::KResponseDelayTimeout = 60; // Seconds +const TInt CSuplRrlpFsm::KMeasureRequestWithAssistanceDataDelay = 10000; // Micro-Seconds + + +// Construction +EXPORT_C CSuplRrlpFsm* CSuplRrlpFsm::NewL(MSuplPositioningProtocolFsmObserver& aObserver, RLbsAssistanceDataBuilderSet& aDataBuilder) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::NewL() Begin\n"); + CSuplRrlpFsm* self = new(ELeave)CSuplRrlpFsm(aObserver,aDataBuilder); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + SUPLLOG(ELogP1, "CSuplRrlpFsm::NewL() End\n"); + return self; + } + +CSuplRrlpFsm::CSuplRrlpFsm(MSuplPositioningProtocolFsmObserver& aObserver, RLbsAssistanceDataBuilderSet& aDataBuilder) : + CSuplPositioningProtocolFsm(aObserver), iCurrentState(EStateNull), iAssistanceData(aDataBuilder) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::CSuplRrlpFsm() Begin\n"); + SUPLLOG(ELogP1, "CSuplRrlpFsm::CSuplRrlpFsm() End\n"); + } + +void CSuplRrlpFsm::ConstructL() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::ConstructL() Begin\n"); + iAssistanceDataChunkTimer = CLbsCallbackTimer::NewL(*this); + iRequestTimer = CLbsCallbackTimer::NewL(*this); + iResponseDelayTimer = CLbsCallbackTimer::NewL(*this); + iMeasureRequestWithAssitanceDataDelayTimer = CLbsCallbackTimer::NewL(*this); + SUPLLOG(ELogP1, "CSuplRrlpFsm::ConstructL() End\n"); + } + +CSuplRrlpFsm::~CSuplRrlpFsm() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::~CSuplRrlpFsm() Begin\n"); + delete iAssistanceDataChunkTimer; + delete iRequestTimer; + delete iResponseDelayTimer; + delete iMeasureRequestWithAssitanceDataDelayTimer; + SUPLLOG(ELogP1, "CSuplRrlpFsm::~CSuplRrlpFsm() End\n"); + } + +// Base class functions +EXPORT_C void CSuplRrlpFsm::ProcessPositioningMessage(CSuplPosPayload* aMessage) + { + TInt message = aMessage->MessageType(); + SUPLLOG2(ELogP1, "CSuplRrlpFsm::ProcessPositioningMessage() Begin. Message: %d\n", message); + + // Set the reference number + CRrlpMessageBase* base = static_cast(aMessage); + base->GetReference(iLastReferenceNumber); + + switch (message) + { + case CSuplPosPayload::ERrlpAssistanceData: + { + CRrlpAssistanceData* pAssData = static_cast(aMessage); + + HandleAssistanceDataMessage(pAssData); + break; + } + case CSuplPosPayload::ERrlpMeasurePositionReq: + { + CRrlpMeasurePositionRequest* pReq = static_cast(aMessage); + HandleMeasurementPositionRequest(pReq); + break; + } + case CSuplPosPayload::ERrlpProtocolError: + { + CRrlpProtocolError* pErr = static_cast(aMessage); + HandleProtocolError(pErr); + break; + } + default: + { + iObserver.PositioningProtocolError(KErrNotFound); + } + } // switch + + delete aMessage; + SUPLLOG(ELogP1, "CSuplRrlpFsm::ProcessPositioningMessage() End\n"); + } + +EXPORT_C void CSuplRrlpFsm::CancelMachine(const TCancelSource& /*aCancelSource*/, TInt /*aReason*/) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::CancelMachine() Begin\n"); + iResponseDelayTimer->Cancel(); + iAssistanceDataChunkTimer->Cancel(); + iRequestTimer->Cancel(); + iMeasureRequestWithAssitanceDataDelayTimer->Cancel(); + + TransistionTo(EStateNull); + SUPLLOG(ELogP1, "CSuplRrlpFsm::CancelMachine() End\n"); + } + +EXPORT_C void CSuplRrlpFsm::AssistanceDataRequest(const TLbsAssistanceDataGroup& aData) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::AssistanceDataRequest() Begin\n"); + if (TransistionTo(EStateMoreAssistDataRequested)) + { + iResponseDelayTimer->Cancel(); + CRrlpMeasurePositionResponse* pResp = NULL; + TRAPD(err, pResp = CRrlpMeasurePositionResponse::NewL()); + if (err == KErrNone) + { + AddReference(*pResp); + pResp->SetLocationError(ERrlpLocErrorGpsAssDataMissing, aData); + + iObserver.PositioningPayloadToNetwork(pResp); + pResp = NULL; + } // if + + if (err != KErrNone) + { + TransistionToError(err); + } // if + } // if + SUPLLOG(ELogP1, "CSuplRrlpFsm::AssistanceDataRequest() End\n"); + } + +EXPORT_C void CSuplRrlpFsm::LocationResp(TInt aReason, const TPositionInfoBase& aPosInfo) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::LocationResp() Begin\n"); + // No call to TrnasistionTo as we to ignore if we are not in the correct state + if (iCurrentState == EStateRequestHandled) + { + SUPLLOG(ELogP1, "iCurrentState == EStateRequestHandled\n"); + if(aReason != KErrNone) + { + SUPLLOG2(ELogP1, "Location error %d\n", aReason); + TransistionToError(aReason); + } + else + { + iCurrentState = EStateMeasureRespSent; + + // Cancel the timeout timer + iResponseDelayTimer->Cancel(); + + CRrlpMeasurePositionResponse* pResp = NULL; + TRAPD(err, pResp = CRrlpMeasurePositionResponse::NewL()); + if (err == KErrNone) + { + AddReference(*pResp); + + // Is aPosInfo measurements or position? + TPositionInfoBase* pBase = const_cast(&aPosInfo); + + if ((aPosInfo.PositionClassType() & EPositionGpsMeasurementInfoClass)) + { + err = pResp->SetMeasurementInformation(*pBase); + } + else + { + err = pResp->SetLocationInformation(*pBase); + } + + if (err == KErrNone) + { + iObserver.PositioningSessionEnded(); + iObserver.PositioningPayloadToNetwork(pResp); + pResp = NULL; + TransistionTo(EStateNull); + } + else + { + delete pResp; + } + } // if + if (err != KErrNone) + { + TransistionToError(err); + } // if + } // else + } // if + SUPLLOG(ELogP1, "CSuplRrlpFsm::LocationResp() End\n"); + } + +EXPORT_C bool CSuplRrlpFsm::IsAssistDataRequestAllowed() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::IsAssistDataRequestAllowed() Begin\n"); + SUPLLOG(ELogP1, "CSuplRrlpFsm::IsAssistDataRequestAllowed() End\n"); + return ((iCurrentState == EStateNull) || (iCurrentState == EStateRequestHandled)); + } + + +// Handler functions +void CSuplRrlpFsm::HandleAssistanceDataMessage(CRrlpAssistanceData* aData) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::HandleAssistanceDataMessage() Begin\n"); + TLbsAsistanceDataGroup dataMask = 0; + if (TransistionTo(EStateAssitDataChunkRecvd)) + { + // Kick off the timer + StartAssitanceDataChunkTimer(); + + TInt err = KErrNone; + + if ((err == KErrNone) && (aData->AssistanceDataPresent())) // It is possible for an empty assistance data message + // we just ignore it + { + err = aData->BuildAssistanceData(dataMask, iAssistanceData); + } // if + + if (err == KErrNone) + { + iAssistanceDataMask |= dataMask; + // Ack the assistance data + CRrlpAssistanceDataAck* pAck = NULL; + TRAP(err, pAck = CRrlpAssistanceDataAck::NewL()); + if (err == KErrNone) + { + if(!aData->MoreAssDataToBeSent()) + { + // Inform observer that these could be the last + // RRLP messages sent. + iObserver.PositioningSessionEnded(); + } + AddReference(*pAck); + iObserver.PositioningPayloadToNetwork(pAck); + pAck = NULL; + } + } + + if ((err == KErrNone) && (!aData->MoreAssDataToBeSent())) + { + TransistionTo(EStateAssitDataAcknowledged); + + // Pass the assistance data to LBS + iObserver.ProcessAssistanceData(iAssistanceDataMask,KErrNone); + iAssistanceDataMask = 0; + + // Start the request timer + iAssistanceDataChunkTimer->Cancel(); + StartRequestTimer(); + + } // if + + if (err != KErrNone) + { + TransistionToError(err); + } + } // if + SUPLLOG(ELogP1, "CSuplRrlpFsm::HandleAssistanceDataMessage() End\n"); + } + +void CSuplRrlpFsm::HandleMeasurementPositionRequest(CRrlpMeasurePositionRequest* aReq) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::HandleMeasurementPositionRequest() Begin\n"); + TLbsAsistanceDataGroup dataMask = 0; + if (TransistionTo(EStateMeasureReqRecvd)) + { + // Cancel any outstanding timers + iAssistanceDataChunkTimer->Cancel(); // We could be expecting an assistance data chunk + // Is there assistance data + TInt delay = 0; + TInt err = KErrNone; + if (aReq->AssistanceDataPresent()) + { + err = aReq->BuildAssistanceData(dataMask, iAssistanceData); + iAssistanceDataMask |= dataMask; + if (err == KErrNone) + { + // Pass the assistance data to LBS + iObserver.ProcessAssistanceData(iAssistanceDataMask,KErrNone); + iAssistanceDataMask = 0; + delay = KMeasureRequestWithAssistanceDataDelay; + } // if + } // if + + if (err == KErrNone) + { + // Store quality and method for later request + aReq->GetPositionInstruct(iLocReqQuality, iPosMethod); + + // Start a timer to give LBS a chance to handle the assistance data(this could be 0) + StartMeasureRequestWithAssitanceDataTimer(delay); + } + + if (err != KErrNone) + { + TransistionToError(err); + } + } // if + SUPLLOG(ELogP1, "CSuplRrlpFsm::HandleMeasurementPositionRequest() End\n"); + } + +void CSuplRrlpFsm::HandleProtocolError(CRrlpProtocolError* aError) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::HandleProtocolError() Begin\n"); + if (TransistionTo(EStateNull)) + { + TRrlpErrorCode error; + aError->GetProtocolError(error); + iObserver.PositioningProtocolError(error); + } + SUPLLOG(ELogP1, "CSuplRrlpFsm::HandleProtocolError() End\n"); + } + +// Timers +// MLbsCallbackTimerObserver methods +void CSuplRrlpFsm::OnTimerEventL(TInt aTimerId) + { + SUPLLOG2(ELogP1, "CSuplRrlpFsm::OnTimerEventL() Begin, aTimerId: %d\n", aTimerId); + switch (aTimerId) + { + case EAssitanceDataChunk: + ReceivedAssistanceDataChunkTimer(); + break; + case ERequest: + ReceivedRequestTimer(); + break; + case EResponseDelay: + ReceivedPosResultTimer(); + break; + case EMeasureRequestWithAssistanceDataDelay: + ReceivedMeasureRequestWithAssitanceDataTimer(); + break; + default: + ASSERT(EFalse); + } // switch + SUPLLOG(ELogP1, "CSuplRrlpFsm::OnTimerEventL() End\n"); + } + +TInt CSuplRrlpFsm::OnTimerError(TInt /*aTimerId*/, TInt aError) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::OnTimerEventL() Begin\n"); + return aError; + SUPLLOG(ELogP1, "CSuplRrlpFsm::OnTimerEventL() End\n"); + } + +void CSuplRrlpFsm::StartAssitanceDataChunkTimer() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartAssitanceDataChunkTimer() Begin\n"); + // Cancel current one if running + iAssistanceDataChunkTimer->Cancel(); + + // Start again + TTimeIntervalSeconds time(KAssistanceDataChunkTimeout); + iAssistanceDataChunkTimer->EventAfter(time, EAssitanceDataChunk); + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartAssitanceDataChunkTimer() End\n"); + } + +void CSuplRrlpFsm::ReceivedAssistanceDataChunkTimer() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedAssistanceDataChunkTimer() Begin\n"); + // If we receive this then there has been a timeout in receiving the assistance data chunks + // this is an error + iObserver.PositioningProtocolError(KErrTimedOut); + TransistionTo(EStateNull); + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedAssistanceDataChunkTimer() End\n"); + } + +void CSuplRrlpFsm::StartRequestTimer() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartRequestTimer() Begin\n"); + // Cancel this it its running + iRequestTimer->Cancel(); + + // Start timer + TTimeIntervalSeconds time(KRequestTimeout); + iRequestTimer->EventAfter(time, ERequest); + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartRequestTimer() End\n"); + } + +void CSuplRrlpFsm::ReceivedRequestTimer() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedRequestTimer() Begin\n"); + // If we receive this then there has been a timeout in receiving a measurement request + // after receiving assistance data + iObserver.PositioningProtocolError(KErrTimedOut); + TransistionTo(EStateNull); + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedRequestTimer() End\n"); + } + +void CSuplRrlpFsm::StartPosResultTimer(TTimeIntervalMicroSeconds aTime) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartPosResultTimer() Begin\n"); + // Add on the extra time to allow it to filter through from LBS + aTime = aTime.Int64() + KResponseDelayAddition; + + iResponseDelayTimer->EventAfter(aTime, EResponseDelay); + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartPosResultTimer() End\n"); + } + +void CSuplRrlpFsm::ReceivedPosResultTimer() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedPosResultTimer() Begin\n"); + // If we recieve this then LBS has timed out + iObserver.PositioningProtocolError(KErrTimedOut); + TransistionTo(EStateNull); + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedPosResultTimer() End\n"); + } + +void CSuplRrlpFsm::StartMeasureRequestWithAssitanceDataTimer(TInt aTimer) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartMeasureRequestWithAssitanceDataTimer() Begin\n"); + TTimeIntervalMicroSeconds time(aTimer); + iAssistanceDataChunkTimer->EventAfter(time, EMeasureRequestWithAssistanceDataDelay); + SUPLLOG(ELogP1, "CSuplRrlpFsm::StartMeasureRequestWithAssitanceDataTimer() End\n"); + } +void CSuplRrlpFsm::ReceivedMeasureRequestWithAssitanceDataTimer() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedMeasureRequestWithAssitanceDataTimer() Begin\n"); + if (TransistionTo(EStateRequestHandled)) + { + iObserver.ProcessPositioningRequest(iLocReqQuality, iPosMethod); + + // Expect results from LBS before the MaxFixTime elapses (allow an + // additional second for the results to propagate through LBS) + StartPosResultTimer(iLocReqQuality.MaxFixTime().Int64() + (1000*KResponseDelayAddition)); + } + SUPLLOG(ELogP1, "CSuplRrlpFsm::ReceivedMeasureRequestWithAssitanceDataTimer() End\n"); + } + + +// Others +TBool CSuplRrlpFsm::TransistionTo(TRrlpState aNewState) + { + SUPLLOG3(ELogP1, "CSuplRrlpFsm::TransistionTo() Begin, iCurrentState %d, aNewState %d\n", iCurrentState, aNewState); + + TBool ret = EFalse; + + if (aNewState != EStateNull) + { + switch (iCurrentState) + { + case EStateNull: + case EStateAssitDataChunkRecvd: + { + ret = (aNewState == EStateAssitDataChunkRecvd) || + (aNewState == EStateAssitDataAcknowledged) || + (aNewState == EStateMeasureReqRecvd); + break; + } + case EStateAssitDataAcknowledged: + { + ret = (aNewState == EStateMeasureReqRecvd); + break; + } + case EStateMeasureReqRecvd: + { + ret = (aNewState == EStateRequestHandled); + break; + } + case EStateRequestHandled: + { + ret = (aNewState == EStateMoreAssistDataRequested) || + (aNewState == EStateMeasureRespSent); + break; + } + case EStateMeasureRespSent: + { + ret = (aNewState == EStateNull); + break; + } + case EStateMoreAssistDataRequested: + { + ret = (aNewState == EStateMeasureReqRecvd); + break; + } + } + } + else + { + ret = ETrue; + } + + if (ret) + { + iCurrentState = aNewState; + } + else + { + TransistionToError(KErrGeneral); + } + + SUPLLOG(ELogP1, "CSuplRrlpFsm::TransistionTo() End\n"); + return ret; + } + +void CSuplRrlpFsm::TransistionToError(TInt aError) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::TransistionToError() Begin\n"); + + iObserver.PositioningProtocolError(aError); + + // Prevent delayed actions from happening + iResponseDelayTimer->Cancel(); + iAssistanceDataChunkTimer->Cancel(); + iRequestTimer->Cancel(); + iMeasureRequestWithAssitanceDataDelayTimer->Cancel(); + + // Go back to null state + TransistionTo(EStateNull); + SUPLLOG(ELogP1, "CSuplRrlpFsm::TransistionToError() End\n"); + } + +void CSuplRrlpFsm::AddReference(CRrlpMessageBase& aMessage) + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::AddReference() Begin\n"); + aMessage.SetReference(iLastReferenceNumber); + SUPLLOG(ELogP1, "CSuplRrlpFsm::AddReference() End\n"); + } + + +// Unused functions from base class +void CSuplRrlpFsm::RunL() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::RunL() Begin\n"); + ASSERT(EFalse); + SUPLLOG(ELogP1, "CSuplRrlpFsm::RunL() End\n"); + } +void CSuplRrlpFsm::DoCancel() + { + SUPLLOG(ELogP1, "CSuplRrlpFsm::DoCancel() Begin\n"); + ASSERT(EFalse); + SUPLLOG(ELogP1, "CSuplRrlpFsm::DoCancel() End\n"); + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2010 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: SUPL / RRLP ASN1 abstraction library for SUPL Protocol Modules +// + +#include "../suplrrlpasn1/group/bld.inf" + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/group/lbs_suplpmcore.mrp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/group/lbs_suplpmcore.mrp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,29 @@ +# +# Copyright (c) 2010 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: +# + +component lbs_suplpmcore + +source \sf\os\lbs\networkprotocolmodules\suplpmcore + +binary \sf\os\lbs\networkprotocolmodules\suplpmcore\suplrrlpasn1\group all + +exports \sf\os\lbs\networkprotocolmodules\suplpmcore\suplrrlpasn1\group + +notes_source \component_defs\release.src + +ipr E + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/BWINS/suplrrlpasn1u.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/BWINS/suplrrlpasn1u.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,113 @@ +EXPORTS + ?NewL@CRrlpProtocolError@@SAPAV1@H@Z @ 1 NONAME ; class CRrlpProtocolError * CRrlpProtocolError::NewL(int) + ?NewL@CSuplAsn1DecoderImpl@@SAPAV1@XZ @ 2 NONAME ; class CSuplAsn1DecoderImpl * CSuplAsn1DecoderImpl::NewL(void) + ?NewL@CSuplEnd@@SAPAV1@H@Z @ 3 NONAME ; class CSuplEnd * CSuplEnd::NewL(int) + ??1CSuplFqdn@@UAE@XZ @ 4 NONAME ; CSuplFqdn::~CSuplFqdn(void) + ??8CSuplSlpSessionId@@QBEHABV0@@Z @ 5 NONAME ; int CSuplSlpSessionId::operator==(class CSuplSlpSessionId const &) const + ??8CSuplSlpAddress@@QBEHABV0@@Z @ 6 NONAME ; int CSuplSlpAddress::operator==(class CSuplSlpAddress const &) const + ??1CSuplGsmCellInfo@@UAE@XZ @ 7 NONAME ; CSuplGsmCellInfo::~CSuplGsmCellInfo(void) + ?SetLocationError@CRrlpMeasurePositionResponse@@QAEHKABK@Z @ 8 NONAME ; int CRrlpMeasurePositionResponse::SetLocationError(unsigned long, unsigned long const &) + ?NewL@CSuplPosInit@@SAPAV1@XZ @ 9 NONAME ; class CSuplPosInit * CSuplPosInit::NewL(void) + ?DecodePosPayloadL@CSuplPosPayload@@SAPAV1@PBVHBufC8@@AAH@Z @ 10 NONAME ; class CSuplPosPayload * CSuplPosPayload::DecodePosPayloadL(class HBufC8 const *, int &) + ??1CSuplCdmaCellInfo@@UAE@XZ @ 11 NONAME ; CSuplCdmaCellInfo::~CSuplCdmaCellInfo(void) + ?SetQoP@CSuplStart@@QAEHAAVTLbsNetPosRequestQuality@@@Z @ 12 NONAME ; int CSuplStart::SetQoP(class TLbsNetPosRequestQuality &) + ?AssistanceDataPresent@CRrlpAssistanceData@@QAEHXZ @ 13 NONAME ; int CRrlpAssistanceData::AssistanceDataPresent(void) + ?SetCapabilities@CSuplPosInit@@QAEHABVTLbsNetPosCapabilities@@@Z @ 14 NONAME ; int CSuplPosInit::SetCapabilities(class TLbsNetPosCapabilities const &) + ?GetSlpAddress@CSuplInit@@QAEHAAVCSuplSlpAddress@@@Z @ 15 NONAME ; int CSuplInit::GetSlpAddress(class CSuplSlpAddress &) + ?ExternalRequestInfoPresent@CSuplInit@@QAEHXZ @ 16 NONAME ; int CSuplInit::ExternalRequestInfoPresent(void) + ?GetSessionId@CSuplMessageBase@@QAEHAAVCSuplSessionId@@@Z @ 17 NONAME ; int CSuplMessageBase::GetSessionId(class CSuplSessionId &) + ??8CSuplSetId@@QBEHABV0@@Z @ 18 NONAME ; int CSuplSetId::operator==(class CSuplSetId const &) const + ?NewL@CSuplCdmaCellInfo@@SAPAV1@XZ @ 19 NONAME ; class CSuplCdmaCellInfo * CSuplCdmaCellInfo::NewL(void) + ?NewL@CSuplVersion@@SAPAV1@XZ @ 20 NONAME ; class CSuplVersion * CSuplVersion::NewL(void) + ?PosPayload@CSuplPos@@QAEPAVCSuplPosPayload@@XZ @ 21 NONAME ; class CSuplPosPayload * CSuplPos::PosPayload(void) + ?NewL@CRrlpAssistanceData@@SAPAV1@XZ @ 22 NONAME ; class CRrlpAssistanceData * CRrlpAssistanceData::NewL(void) + ?SetLocationInformation@CRrlpMeasurePositionResponse@@QAEHAAVTPositionInfoBase@@@Z @ 23 NONAME ; int CRrlpMeasurePositionResponse::SetLocationInformation(class TPositionInfoBase &) + ?SetVersion@CSuplMessageBase@@QAEXAAVCSuplVersion@@@Z @ 24 NONAME ; void CSuplMessageBase::SetVersion(class CSuplVersion &) + ?SetPosition@CSuplEnd@@QAEHABVTPositionInfoBase@@@Z @ 25 NONAME ; int CSuplEnd::SetPosition(class TPositionInfoBase const &) + ??8CSuplSessionId@@QBEHABV0@@Z @ 26 NONAME ; int CSuplSessionId::operator==(class CSuplSessionId const &) const + ?NewLC@CSuplSessionId@@SAPAV1@XZ @ 27 NONAME ; class CSuplSessionId * CSuplSessionId::NewLC(void) + ?SlpAddressPresent@CSuplInit@@QAEHXZ @ 28 NONAME ; int CSuplInit::SlpAddressPresent(void) + ?SetLocationId@CSuplStart@@QAEHABVCSuplLocationId@@@Z @ 29 NONAME ; int CSuplStart::SetLocationId(class CSuplLocationId const &) + ??1CSuplSetSessionId@@UAE@XZ @ 30 NONAME ; CSuplSetSessionId::~CSuplSetSessionId(void) + ?NewL@CSuplSetId@@SAPAV1@XZ @ 31 NONAME ; class CSuplSetId * CSuplSetId::NewL(void) + ??1CSuplIpAddress@@UAE@XZ @ 32 NONAME ; CSuplIpAddress::~CSuplIpAddress(void) + ?NewL@CSuplAsn1Decoder@@SAPAV1@XZ @ 33 NONAME ; class CSuplAsn1Decoder * CSuplAsn1Decoder::NewL(void) + ??1CSuplSlpAddress@@UAE@XZ @ 34 NONAME ; CSuplSlpAddress::~CSuplSlpAddress(void) + ??1CSuplWcdmaCellInfo@@UAE@XZ @ 35 NONAME ; CSuplWcdmaCellInfo::~CSuplWcdmaCellInfo(void) + ?SetLocationId@CSuplPosInit@@QAEHABVCSuplLocationId@@@Z @ 36 NONAME ; int CSuplPosInit::SetLocationId(class CSuplLocationId const &) + ?LogMessageContent@CSuplMessageBase@@QAEXXZ @ 37 NONAME ; void CSuplMessageBase::LogMessageContent(void) + ?DecodeL@CSuplAsn1Decoder@@QAEPAVCSuplMessageBase@@PBVTPtrC8@@AAH@Z @ 38 NONAME ; class CSuplMessageBase * CSuplAsn1Decoder::DecodeL(class TPtrC8 const *, int &) + ?SetReference@CRrlpMessageBase@@QAEHABVTRrlpReference@@@Z @ 39 NONAME ; int CRrlpMessageBase::SetReference(class TRrlpReference const &) + ?NewLC@CSuplStart@@SAPAV1@XZ @ 40 NONAME ; class CSuplStart * CSuplStart::NewLC(void) + ?SetVer@CSuplEnd@@QAEHABVTDesC8@@@Z @ 41 NONAME ; int CSuplEnd::SetVer(class TDesC8 const &) + ?SetSessionId@CSuplMessageBase@@QAEHAAVCSuplSessionId@@@Z @ 42 NONAME ; int CSuplMessageBase::SetSessionId(class CSuplSessionId &) + ?NewLC@CSuplPos@@SAPAV1@H@Z @ 43 NONAME ; class CSuplPos * CSuplPos::NewLC(int) + ?NewL@CSuplFqdn@@SAPAV1@XZ @ 44 NONAME ; class CSuplFqdn * CSuplFqdn::NewL(void) + ?EncodeToL@CSuplMessageBase@@QAEHAAVTPtr8@@@Z @ 45 NONAME ; int CSuplMessageBase::EncodeToL(class TPtr8 &) + ?SetPosition@CSuplPosInit@@QAEHABVTPositionInfoBase@@@Z @ 46 NONAME ; int CSuplPosInit::SetPosition(class TPositionInfoBase const &) + ??1CSuplSessionId@@UAE@XZ @ 47 NONAME ; CSuplSessionId::~CSuplSessionId(void) + ?BuildAssistanceData@CRrlpMeasurePositionRequest@@QAEHAAKAAVRLbsAssistanceDataBuilderSet@@@Z @ 48 NONAME ; int CRrlpMeasurePositionRequest::BuildAssistanceData(unsigned long &, class RLbsAssistanceDataBuilderSet &) + ?GetQop@CSuplInit@@QAEHAAVTLbsNetPosRequestQuality@@@Z @ 49 NONAME ; int CSuplInit::GetQop(class TLbsNetPosRequestQuality &) + ?BuildAssistanceData@CRrlpAssistanceData@@QAEHAAKAAVRLbsAssistanceDataBuilderSet@@@Z @ 50 NONAME ; int CRrlpAssistanceData::BuildAssistanceData(unsigned long &, class RLbsAssistanceDataBuilderSet &) + ?GetPosition@CSuplEnd@@QAEHAAVTPosition@@@Z @ 51 NONAME ; int CSuplEnd::GetPosition(class TPosition &) + ??8CSuplSetSessionId@@QBEHABV0@@Z @ 52 NONAME ; int CSuplSetSessionId::operator==(class CSuplSetSessionId const &) const + ?GetReference@CRrlpMessageBase@@QAEHAAVTRrlpReference@@@Z @ 53 NONAME ; int CRrlpMessageBase::GetReference(class TRrlpReference &) + ?NewLC@CSuplEnd@@SAPAV1@H@Z @ 54 NONAME ; class CSuplEnd * CSuplEnd::NewLC(int) + ??1CSuplVersion@@UAE@XZ @ 55 NONAME ; CSuplVersion::~CSuplVersion(void) + ?NewL@CSuplSlpAddress@@SAPAV1@XZ @ 56 NONAME ; class CSuplSlpAddress * CSuplSlpAddress::NewL(void) + ?NewL@CSuplInit@@SAPAV1@XZ @ 57 NONAME ; class CSuplInit * CSuplInit::NewL(void) + ?GetPositionInstruct@CRrlpMeasurePositionRequest@@QAEHAAVTLbsNetPosRequestQuality@@AAVTLbsNetPosRequestMethod@@@Z @ 58 NONAME ; int CRrlpMeasurePositionRequest::GetPositionInstruct(class TLbsNetPosRequestQuality &, class TLbsNetPosRequestMethod &) + ??8CSuplFqdn@@QBEHABV0@@Z @ 59 NONAME ; int CSuplFqdn::operator==(class CSuplFqdn const &) const + ?StatusCodePresent@CSuplEnd@@QAEHXZ @ 60 NONAME ; int CSuplEnd::StatusCodePresent(void) + ?DecodeL@CSuplAsn1DecoderImpl@@QAEPAVCSuplMessageBase@@PBVTPtrC8@@AAH@Z @ 61 NONAME ; class CSuplMessageBase * CSuplAsn1DecoderImpl::DecodeL(class TPtrC8 const *, int &) + ?SetLocationError@CRrlpMeasurePositionResponse@@QAEHK@Z @ 62 NONAME ; int CRrlpMeasurePositionResponse::SetLocationError(unsigned long) + ?SetProtocolError@CRrlpProtocolError@@QAEHABK@Z @ 63 NONAME ; int CRrlpProtocolError::SetProtocolError(unsigned long const &) + ?SlpAddressPresent@CSuplResponse@@QAEHXZ @ 64 NONAME ; int CSuplResponse::SlpAddressPresent(void) + ?NewLC@CRrlpMeasurePositionResponse@@SAPAV1@XZ @ 65 NONAME ; class CRrlpMeasurePositionResponse * CRrlpMeasurePositionResponse::NewLC(void) + ?VelocityPresent@CSuplPos@@QAEHXZ @ 66 NONAME ; int CSuplPos::VelocityPresent(void) + ?GetExternalRequestInfo@CSuplInit@@QAEHAAVTLbsExternalRequestInfo@@@Z @ 67 NONAME ; int CSuplInit::GetExternalRequestInfo(class TLbsExternalRequestInfo &) + ??8CSuplIpAddress@@QBEHABV0@@Z @ 68 NONAME ; int CSuplIpAddress::operator==(class CSuplIpAddress const &) const + ?GetSlpAddress@CSuplResponse@@QAEHAAVCSuplSlpAddress@@@Z @ 69 NONAME ; int CSuplResponse::GetSlpAddress(class CSuplSlpAddress &) + ?NewL@CSuplStart@@SAPAV1@XZ @ 70 NONAME ; class CSuplStart * CSuplStart::NewL(void) + ?NewL@CSuplIpAddress@@SAPAV1@XZ @ 71 NONAME ; class CSuplIpAddress * CSuplIpAddress::NewL(void) + ?SetRequestedAssistanceData@CSuplPosInit@@QAEHABK@Z @ 72 NONAME ; int CSuplPosInit::SetRequestedAssistanceData(unsigned long const &) + ?GetPosMethod@CSuplInit@@QAEHAAVTLbsNetPosRequestMethod@@@Z @ 73 NONAME ; int CSuplInit::GetPosMethod(class TLbsNetPosRequestMethod &) + ?GetNotificationType@CSuplInit@@QAEHAAVTLbsNetPosRequestPrivacy@@@Z @ 74 NONAME ; int CSuplInit::GetNotificationType(class TLbsNetPosRequestPrivacy &) + ?GetProtocolError@CRrlpProtocolError@@QAEHAAK@Z @ 75 NONAME ; int CRrlpProtocolError::GetProtocolError(unsigned long &) + ?NewL@CRrlpMeasurePositionResponse@@SAPAV1@XZ @ 76 NONAME ; class CRrlpMeasurePositionResponse * CRrlpMeasurePositionResponse::NewL(void) + ?SetStatusCode@CSuplEnd@@QAEHAAK@Z @ 77 NONAME ; int CSuplEnd::SetStatusCode(unsigned long &) + ?MessageType@CSuplMessageBase@@QAEKXZ @ 78 NONAME ; unsigned long CSuplMessageBase::MessageType(void) + ?NewL@CRrlpMeasurePositionRequest@@SAPAV1@XZ @ 79 NONAME ; class CRrlpMeasurePositionRequest * CRrlpMeasurePositionRequest::NewL(void) + ?NotificationPresent@CSuplInit@@QAEHXZ @ 80 NONAME ; int CSuplInit::NotificationPresent(void) + ??8CSuplVersion@@QBEHABV0@@Z @ 81 NONAME ; int CSuplVersion::operator==(class CSuplVersion const &) const + ?SetMeasurementInformation@CRrlpMeasurePositionResponse@@QAEHABVTPositionInfoBase@@@Z @ 82 NONAME ; int CRrlpMeasurePositionResponse::SetMeasurementInformation(class TPositionInfoBase const &) + ??1CSuplSetId@@UAE@XZ @ 83 NONAME ; CSuplSetId::~CSuplSetId(void) + ?MoreAssDataToBeSent@CRrlpAssistanceData@@QAEHXZ @ 84 NONAME ; int CRrlpAssistanceData::MoreAssDataToBeSent(void) + ??1CSuplLocationId@@UAE@XZ @ 85 NONAME ; CSuplLocationId::~CSuplLocationId(void) + ?NewL@CSuplGsmCellInfo@@SAPAV1@XZ @ 86 NONAME ; class CSuplGsmCellInfo * CSuplGsmCellInfo::NewL(void) + ?NewL@CSuplSlpSessionId@@SAPAV1@XZ @ 87 NONAME ; class CSuplSlpSessionId * CSuplSlpSessionId::NewL(void) + ?PositionPresent@CSuplEnd@@QAEHXZ @ 88 NONAME ; int CSuplEnd::PositionPresent(void) + ?SetVer@CSuplPosInit@@QAEHABVTDesC8@@@Z @ 89 NONAME ; int CSuplPosInit::SetVer(class TDesC8 const &) + ?GetPosMethod@CSuplResponse@@QAEHAAVTLbsNetPosRequestMethod@@@Z @ 90 NONAME ; int CSuplResponse::GetPosMethod(class TLbsNetPosRequestMethod &) + ?QopPresent@CSuplInit@@QAEHXZ @ 91 NONAME ; int CSuplInit::QopPresent(void) + ?GetVersion@CSuplMessageBase@@QAEHAAVCSuplVersion@@@Z @ 92 NONAME ; int CSuplMessageBase::GetVersion(class CSuplVersion &) + ?NewL@CSuplLocationId@@SAPAV1@K@Z @ 93 NONAME ; class CSuplLocationId * CSuplLocationId::NewL(unsigned long) + ?SetPosPayload@CSuplPos@@QAEXPAVCSuplPosPayload@@@Z @ 94 NONAME ; void CSuplPos::SetPosPayload(class CSuplPosPayload *) + ?GetVelocity@CSuplPos@@QAEHAAVTPositionInfoBase@@@Z @ 95 NONAME ; int CSuplPos::GetVelocity(class TPositionInfoBase &) + ?EncodeToL@CRrlpMessageBase@@UAEHAAVTPtr8@@@Z @ 96 NONAME ; int CRrlpMessageBase::EncodeToL(class TPtr8 &) + ?StatusCode@CSuplEnd@@QAEKXZ @ 97 NONAME ; unsigned long CSuplEnd::StatusCode(void) + ?AssistanceDataPresent@CRrlpMeasurePositionRequest@@QAEHXZ @ 98 NONAME ; int CRrlpMeasurePositionRequest::AssistanceDataPresent(void) + ?NewL@CSuplResponse@@SAPAV1@XZ @ 99 NONAME ; class CSuplResponse * CSuplResponse::NewL(void) + ?NewL@CSuplSessionId@@SAPAV1@XZ @ 100 NONAME ; class CSuplSessionId * CSuplSessionId::NewL(void) + ?GetVerL@CSuplInit@@QAE?AVTPtrC8@@ABVTDesC8@@@Z @ 101 NONAME ; class TPtrC8 CSuplInit::GetVerL(class TDesC8 const &) + ?NewL@CRrlpAssistanceDataAck@@SAPAV1@XZ @ 102 NONAME ; class CRrlpAssistanceDataAck * CRrlpAssistanceDataAck::NewL(void) + ?NewL@CSuplPos@@SAPAV1@H@Z @ 103 NONAME ; class CSuplPos * CSuplPos::NewL(int) + ?SlpMode@CSuplInit@@QAEKXZ @ 104 NONAME ; unsigned long CSuplInit::SlpMode(void) + ?NewLC@CSuplIpAddress@@SAPAV1@XZ @ 105 NONAME ; class CSuplIpAddress * CSuplIpAddress::NewLC(void) + ?SetVelocity@CSuplPos@@QAEHABVTPositionInfoBase@@@Z @ 106 NONAME ; int CSuplPos::SetVelocity(class TPositionInfoBase const &) + ?NewL@CSuplWcdmaCellInfo@@SAPAV1@XZ @ 107 NONAME ; class CSuplWcdmaCellInfo * CSuplWcdmaCellInfo::NewL(void) + ?SetCapabilities@CSuplStart@@QAEHAAVTLbsNetPosCapabilities@@@Z @ 108 NONAME ; int CSuplStart::SetCapabilities(class TLbsNetPosCapabilities &) + ?NewL@CSuplSetSessionId@@SAPAV1@XZ @ 109 NONAME ; class CSuplSetSessionId * CSuplSetSessionId::NewL(void) + ?MessageType@CSuplPosPayload@@QAEKXZ @ 110 NONAME ; unsigned long CSuplPosPayload::MessageType(void) + ??1CSuplSlpSessionId@@UAE@XZ @ 111 NONAME ; CSuplSlpSessionId::~CSuplSlpSessionId(void) + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/EABI/suplrrlpasn1u.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/EABI/suplrrlpasn1u.def Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,137 @@ +EXPORTS + _ZN10CSuplSetId4NewLEv @ 1 NONAME + _ZN10CSuplSetIdD0Ev @ 2 NONAME + _ZN10CSuplSetIdD1Ev @ 3 NONAME + _ZN10CSuplSetIdD2Ev @ 4 NONAME + _ZN10CSuplStart13SetLocationIdERK15CSuplLocationId @ 5 NONAME + _ZN10CSuplStart15SetCapabilitiesER22TLbsNetPosCapabilities @ 6 NONAME + _ZN10CSuplStart4NewLEv @ 7 NONAME + _ZN10CSuplStart5NewLCEv @ 8 NONAME + _ZN10CSuplStart6SetQoPER24TLbsNetPosRequestQuality @ 9 NONAME + _ZN12CSuplPosInit11SetPositionERK17TPositionInfoBase @ 10 NONAME + _ZN12CSuplPosInit13SetLocationIdERK15CSuplLocationId @ 11 NONAME + _ZN12CSuplPosInit15SetCapabilitiesERK22TLbsNetPosCapabilities @ 12 NONAME + _ZN12CSuplPosInit26SetRequestedAssistanceDataERKm @ 13 NONAME + _ZN12CSuplPosInit4NewLEv @ 14 NONAME + _ZN12CSuplPosInit6SetVerERK6TDesC8 @ 15 NONAME + _ZN12CSuplVersion4NewLEv @ 16 NONAME + _ZN12CSuplVersionD0Ev @ 17 NONAME + _ZN12CSuplVersionD1Ev @ 18 NONAME + _ZN12CSuplVersionD2Ev @ 19 NONAME + _ZN13CSuplResponse12GetPosMethodER23TLbsNetPosRequestMethod @ 20 NONAME + _ZN13CSuplResponse13GetSlpAddressER15CSuplSlpAddress @ 21 NONAME + _ZN13CSuplResponse17SlpAddressPresentEv @ 22 NONAME + _ZN13CSuplResponse4NewLEv @ 23 NONAME + _ZN14CSuplIpAddress4NewLEv @ 24 NONAME + _ZN14CSuplIpAddress5NewLCEv @ 25 NONAME + _ZN14CSuplIpAddressD0Ev @ 26 NONAME + _ZN14CSuplIpAddressD1Ev @ 27 NONAME + _ZN14CSuplIpAddressD2Ev @ 28 NONAME + _ZN14CSuplSessionId4NewLEv @ 29 NONAME + _ZN14CSuplSessionId5NewLCEv @ 30 NONAME + _ZN14CSuplSessionIdD0Ev @ 31 NONAME + _ZN14CSuplSessionIdD1Ev @ 32 NONAME + _ZN14CSuplSessionIdD2Ev @ 33 NONAME + _ZN15CSuplLocationId4NewLEm @ 34 NONAME + _ZN15CSuplLocationIdD0Ev @ 35 NONAME + _ZN15CSuplLocationIdD1Ev @ 36 NONAME + _ZN15CSuplLocationIdD2Ev @ 37 NONAME + _ZN15CSuplPosPayload11MessageTypeEv @ 38 NONAME + _ZN15CSuplPosPayload17DecodePosPayloadLEPK6HBufC8Ri @ 39 NONAME + _ZN15CSuplSlpAddress4NewLEv @ 40 NONAME + _ZN15CSuplSlpAddressD0Ev @ 41 NONAME + _ZN15CSuplSlpAddressD1Ev @ 42 NONAME + _ZN15CSuplSlpAddressD2Ev @ 43 NONAME + _ZN16CRrlpMessageBase12GetReferenceER14TRrlpReference @ 44 NONAME + _ZN16CRrlpMessageBase12SetReferenceERK14TRrlpReference @ 45 NONAME + _ZN16CRrlpMessageBase9EncodeToLER5TPtr8 @ 46 NONAME + _ZN16CSuplAsn1Decoder4NewLEv @ 47 NONAME + _ZN16CSuplAsn1Decoder7DecodeLEPK6TPtrC8Ri @ 48 NONAME + _ZN16CSuplGsmCellInfo4NewLEv @ 49 NONAME + _ZN16CSuplGsmCellInfoD0Ev @ 50 NONAME + _ZN16CSuplGsmCellInfoD1Ev @ 51 NONAME + _ZN16CSuplGsmCellInfoD2Ev @ 52 NONAME + _ZN16CSuplMessageBase10GetVersionER12CSuplVersion @ 53 NONAME + _ZN16CSuplMessageBase10SetVersionER12CSuplVersion @ 54 NONAME + _ZN16CSuplMessageBase11MessageTypeEv @ 55 NONAME + _ZN16CSuplMessageBase12GetSessionIdER14CSuplSessionId @ 56 NONAME + _ZN16CSuplMessageBase12SetSessionIdER14CSuplSessionId @ 57 NONAME + _ZN16CSuplMessageBase17LogMessageContentEv @ 58 NONAME + _ZN16CSuplMessageBase9EncodeToLER5TPtr8 @ 59 NONAME + _ZN17CSuplCdmaCellInfo4NewLEv @ 60 NONAME + _ZN17CSuplCdmaCellInfoD0Ev @ 61 NONAME + _ZN17CSuplCdmaCellInfoD1Ev @ 62 NONAME + _ZN17CSuplCdmaCellInfoD2Ev @ 63 NONAME + _ZN17CSuplSetSessionId4NewLEv @ 64 NONAME + _ZN17CSuplSetSessionIdD0Ev @ 65 NONAME + _ZN17CSuplSetSessionIdD1Ev @ 66 NONAME + _ZN17CSuplSetSessionIdD2Ev @ 67 NONAME + _ZN17CSuplSlpSessionId4NewLEv @ 68 NONAME + _ZN17CSuplSlpSessionIdD0Ev @ 69 NONAME + _ZN17CSuplSlpSessionIdD1Ev @ 70 NONAME + _ZN17CSuplSlpSessionIdD2Ev @ 71 NONAME + _ZN18CRrlpProtocolError16GetProtocolErrorERm @ 72 NONAME + _ZN18CRrlpProtocolError16SetProtocolErrorERKm @ 73 NONAME + _ZN18CRrlpProtocolError4NewLEi @ 74 NONAME + _ZN18CSuplWcdmaCellInfo4NewLEv @ 75 NONAME + _ZN18CSuplWcdmaCellInfoD0Ev @ 76 NONAME + _ZN18CSuplWcdmaCellInfoD1Ev @ 77 NONAME + _ZN18CSuplWcdmaCellInfoD2Ev @ 78 NONAME + _ZN19CRrlpAssistanceData19BuildAssistanceDataERmR28RLbsAssistanceDataBuilderSet @ 79 NONAME + _ZN19CRrlpAssistanceData19MoreAssDataToBeSentEv @ 80 NONAME + _ZN19CRrlpAssistanceData21AssistanceDataPresentEv @ 81 NONAME + _ZN19CRrlpAssistanceData4NewLEv @ 82 NONAME + _ZN20CSuplAsn1DecoderImpl4NewLEv @ 83 NONAME + _ZN20CSuplAsn1DecoderImpl7DecodeLEPK6TPtrC8Ri @ 84 NONAME + _ZN22CRrlpAssistanceDataAck4NewLEv @ 85 NONAME + _ZN27CRrlpMeasurePositionRequest19BuildAssistanceDataERmR28RLbsAssistanceDataBuilderSet @ 86 NONAME + _ZN27CRrlpMeasurePositionRequest19GetPositionInstructER24TLbsNetPosRequestQualityR23TLbsNetPosRequestMethod @ 87 NONAME + _ZN27CRrlpMeasurePositionRequest21AssistanceDataPresentEv @ 88 NONAME + _ZN27CRrlpMeasurePositionRequest4NewLEv @ 89 NONAME + _ZN28CRrlpMeasurePositionResponse16SetLocationErrorEm @ 90 NONAME + _ZN28CRrlpMeasurePositionResponse16SetLocationErrorEmRKm @ 91 NONAME + _ZN28CRrlpMeasurePositionResponse22SetLocationInformationER17TPositionInfoBase @ 92 NONAME + _ZN28CRrlpMeasurePositionResponse25SetMeasurementInformationERK17TPositionInfoBase @ 93 NONAME + _ZN28CRrlpMeasurePositionResponse4NewLEv @ 94 NONAME + _ZN28CRrlpMeasurePositionResponse5NewLCEv @ 95 NONAME + _ZN8CSuplEnd10StatusCodeEv @ 96 NONAME + _ZN8CSuplEnd11GetPositionER9TPosition @ 97 NONAME + _ZN8CSuplEnd11SetPositionERK17TPositionInfoBase @ 98 NONAME + _ZN8CSuplEnd13SetStatusCodeERm @ 99 NONAME + _ZN8CSuplEnd15PositionPresentEv @ 100 NONAME + _ZN8CSuplEnd17StatusCodePresentEv @ 101 NONAME + _ZN8CSuplEnd4NewLEi @ 102 NONAME + _ZN8CSuplEnd5NewLCEi @ 103 NONAME + _ZN8CSuplEnd6SetVerERK6TDesC8 @ 104 NONAME + _ZN8CSuplPos10PosPayloadEv @ 105 NONAME + _ZN8CSuplPos11GetVelocityER17TPositionInfoBase @ 106 NONAME + _ZN8CSuplPos11SetVelocityERK17TPositionInfoBase @ 107 NONAME + _ZN8CSuplPos13SetPosPayloadEP15CSuplPosPayload @ 108 NONAME + _ZN8CSuplPos15VelocityPresentEv @ 109 NONAME + _ZN8CSuplPos4NewLEi @ 110 NONAME + _ZN8CSuplPos5NewLCEi @ 111 NONAME + _ZN9CSuplFqdn4NewLEv @ 112 NONAME + _ZN9CSuplFqdnD0Ev @ 113 NONAME + _ZN9CSuplFqdnD1Ev @ 114 NONAME + _ZN9CSuplFqdnD2Ev @ 115 NONAME + _ZN9CSuplInit10QopPresentEv @ 116 NONAME + _ZN9CSuplInit12GetPosMethodER23TLbsNetPosRequestMethod @ 117 NONAME + _ZN9CSuplInit13GetSlpAddressER15CSuplSlpAddress @ 118 NONAME + _ZN9CSuplInit17SlpAddressPresentEv @ 119 NONAME + _ZN9CSuplInit19GetNotificationTypeER24TLbsNetPosRequestPrivacy @ 120 NONAME + _ZN9CSuplInit19NotificationPresentEv @ 121 NONAME + _ZN9CSuplInit22GetExternalRequestInfoER23TLbsExternalRequestInfo @ 122 NONAME + _ZN9CSuplInit26ExternalRequestInfoPresentEv @ 123 NONAME + _ZN9CSuplInit4NewLEv @ 124 NONAME + _ZN9CSuplInit6GetQopER24TLbsNetPosRequestQuality @ 125 NONAME + _ZN9CSuplInit7GetVerLERK6TDesC8 @ 126 NONAME + _ZN9CSuplInit7SlpModeEv @ 127 NONAME + _ZNK10CSuplSetIdeqERKS_ @ 128 NONAME + _ZNK12CSuplVersioneqERKS_ @ 129 NONAME + _ZNK14CSuplIpAddresseqERKS_ @ 130 NONAME + _ZNK14CSuplSessionIdeqERKS_ @ 131 NONAME + _ZNK15CSuplSlpAddresseqERKS_ @ 132 NONAME + _ZNK17CSuplSetSessionIdeqERKS_ @ 133 NONAME + _ZNK17CSuplSlpSessionIdeqERKS_ @ 134 NONAME + _ZNK9CSuplFqdneqERKS_ @ 135 NONAME + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,25 @@ +// 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: +// + + +PRJ_EXPORTS +suplrrlpasn1.iby /epoc32/rom/include/suplrrlpasn1.iby + +// Main projects, in build order +PRJ_MMPFILES +suplrrlpasn1.mmp + + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/group/compileAsn1.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/group/compileAsn1.bat Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,31 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + + + +mkdir ..\supl_old +mkdir ..\rrlp_old + +xcopy /s /y ..\supl ..\supl_old +xcopy /s /y ..\rrlp ..\rrlp_old + +mkdir ..\supl\inc +mkdir ..\supl\src +mkdir ..\rrlp\inc +mkdir ..\rrlp\src + +call asn1c supl_asn1.txt -noInit -noOpenExt -compact -nodatestamp -cpp -per -symbian dll -o ..\supl\src -oh ..\supl\inc +call asn1c rrlp_asn1_RJS.txt -noInit -noOpenExt -compact -nodatestamp -cpp -per -symbian dll -o ..\rrlp\src -oh ..\rrlp\inc \ No newline at end of file diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/group/rrlp_asn1_RJS.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/group/rrlp_asn1_RJS.txt Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,1279 @@ +-- This ASN.1 file contains RRLP definitions according to 3GPP TS 44.031 V5.12.0 (2005-01), +-- as required by SUPL 1.0 OMA-TS-ULP-V1_0-20070615-A. + +-- Imported components Ext-GeographicalInformation and Ext-GeographicalInformation have +-- been added to this definition to simplify the compilation process. These have been +-- exctracted from 3GPP TS 29.002 V6.8.0 (2004-12). I have compared to v3.e.0, and can +-- see no changes (although this is not the versions actually specified in RRLP doc, they +-- are just one revision later). + + + +RRLP-Messages +-- { RRLP-messages } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + MsrPosition-Req, MsrPosition-Rsp, AssistanceData, + ProtocolError +FROM + RRLP-Components -- { RRLP-Components } +; + +PDU ::= SEQUENCE { + referenceNumber INTEGER (0..7), + component RRLP-Component +} + +RRLP-Component ::= CHOICE { + msrPositionReq MsrPosition-Req, + msrPositionRsp MsrPosition-Rsp, + assistanceData AssistanceData, + assistanceDataAck NULL, + protocolError ProtocolError, + ... + +} + +END + + +RRLP-Components +-- { RRLP-Components } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- commented out from original RRLP specification ----------------- + +-- Ext-GeographicalInformation +-- IMPORTS +-- FROM +-- MAP-LCS-DataTypes { +-- ccitt identified-organization (4) etsi (0) mobileDomain (0) +-- gsm-Network (1) modules (3) map-LCS-DataTypes (25) version5 (5)} + +-- ExtensionContainer +-- FROM MAP-ExtensionDataTypes { +-- ccitt identified-organization (4) etsi (0) mobileDomain (0) +-- gsm-Network (1) modules (3) map-ExtensionDataTypes (21) version4 (4)} +-- ; + + +-- ------------------------------------------ + +-- Add here other ASN.1 definitions presented below +-- in chapters 4 and 5. + + +-- add this definition to RRLP-Components module + +-- Measurement Position request component +MsrPosition-Req ::= SEQUENCE { + positionInstruct PositionInstruct, + referenceAssistData ReferenceAssistData OPTIONAL, + msrAssistData MsrAssistData OPTIONAL, + systemInfoAssistData SystemInfoAssistData OPTIONAL, + gps-AssistData GPS-AssistData OPTIONAL, + extensionContainer ExtensionContainer OPTIONAL, + ..., + -- Release 98 extension element +rel98-MsrPosition-Req-extension Rel98-MsrPosition-Req-Extension OPTIONAL, + -- Release 5 extension element +rel5-MsrPosition-Req-extension Rel5-MsrPosition-Req-Extension OPTIONAL +} + + +-- add this defintion to RRLP-Components module + +-- Measurement Position response component +MsrPosition-Rsp ::= SEQUENCE { + multipleSets MultipleSets OPTIONAL, + referenceIdentity ReferenceIdentity OPTIONAL, + otd-MeasureInfo OTD-MeasureInfo OPTIONAL, + locationInfo LocationInfo OPTIONAL, + gps-MeasureInfo GPS-MeasureInfo OPTIONAL, + locationError LocationError OPTIONAL, + extensionContainer ExtensionContainer OPTIONAL, + ..., + -- Release extension here + rel-98-MsrPosition-Rsp-Extension + Rel-98-MsrPosition-Rsp-Extension OPTIONAL, + rel-5-MsrPosition-Rsp-Extension + Rel-5-MsrPosition-Rsp-Extension OPTIONAL + -- rel-5-MsrPosition-Rsp-Extension and other possible future extensions + -- are the only information elements that may be included in the 2nd + -- MsrPosition-Rsp component when RRLP pseudo-segmentation is used +} + + +-- add this defintion to RRLP-Components module + +-- Assistance Data component +AssistanceData ::= SEQUENCE { + referenceAssistData ReferenceAssistData OPTIONAL, + msrAssistData MsrAssistData OPTIONAL, + systemInfoAssistData SystemInfoAssistData OPTIONAL, + gps-AssistData GPS-AssistData OPTIONAL, + moreAssDataToBeSent MoreAssDataToBeSent OPTIONAL, -- If not present, interpret as only + -- Assistance Data component used to + -- deliver entire set of assistance + -- data. + extensionContainer ExtensionContainer OPTIONAL, + ..., + -- Release extension here + rel98-AssistanceData-Extension Rel98-AssistanceData-Extension OPTIONAL, + rel5-AssistanceData-Extension Rel5-AssistanceData-Extension OPTIONAL + +} + + +-- add this defintion to RRLP-Components module + +-- Protocol Error component +ProtocolError ::= SEQUENCE { + errorCause ErrorCodes, + extensionContainer ExtensionContainer OPTIONAL, + ..., + -- Release extensions here + rel-5-ProtocolError-Extension Rel-5-ProtocolError-Extension OPTIONAL +} + + +-- add these defintions to RRLP-Components module +-- Position instructions +PositionInstruct ::= SEQUENCE { + -- Method type + methodType MethodType, + positionMethod PositionMethod, + measureResponseTime MeasureResponseTime, + useMultipleSets UseMultipleSets, + environmentCharacter EnvironmentCharacter OPTIONAL +} + + +-- +MethodType ::= CHOICE { + msAssisted AccuracyOpt, -- accuracy is optional + msBased Accuracy, -- accuracy is mandatory + msBasedPref Accuracy, -- accuracy is mandatory + msAssistedPref Accuracy –- accuracy is mandatory +} + + +-- Accuracy of the location estimation +AccuracyOpt ::= SEQUENCE { + accuracy Accuracy OPTIONAL +} + + +-- The values of this field are defined in 3GPP TS 23.032 (Uncertainty code) +Accuracy ::= INTEGER (0..127) + + + +-- Position Method +PositionMethod ::= ENUMERATED { + eotd (0), + gps (1), + gpsOrEOTD (2) +} + + +-- Measurement request response time +MeasureResponseTime ::= INTEGER (0..7) + + +-- useMultiple Sets +UseMultipleSets ::= ENUMERATED { + multipleSets (0), -- multiple sets are allowed + oneSet (1) -- sending of multiple is not allowed +} + + +-- Environment characterization +EnvironmentCharacter ::= ENUMERATED { + badArea (0), -- bad urban or suburban, heavy multipath and NLOS + notBadArea (1), -- light multipath and NLOS + mixedArea (2), -- not defined or mixed environment + ... +} + + +-- E-OTD reference BTS for Assitance data IE +ReferenceAssistData ::= SEQUENCE { + bcchCarrier BCCHCarrier, -- BCCH carrier + bsic BSIC, -- BSIC + timeSlotScheme TimeSlotScheme, -- Timeslot scheme + btsPosition BTSPosition OPTIONAL +} + + +-- ellipsoid point and +-- ellipsoid point with altitude and uncertainty ellipsoid shapes are supported +BTSPosition ::= Ext-GeographicalInformation + + +-- RF channel number of BCCH +BCCHCarrier ::= INTEGER (0..1023) + + +-- Base station Identity Code +BSIC ::= INTEGER (0..63) + + +-- Timeslot scheme +TimeSlotScheme ::= ENUMERATED { + equalLength (0), + variousLength (1) +} + + +-- Time slot (modulo) +ModuloTimeSlot ::= INTEGER (0..3) + + +-- E-OTD measurement assistance data IE +-- The total number of neighbors in this element (MsrAssistData) +-- and in SystemInfoAssistData element (presented neighbors +-- can be at a maximum 15!) +MsrAssistData ::= SEQUENCE { + msrAssistList SeqOfMsrAssistBTS +} +SeqOfMsrAssistBTS ::= SEQUENCE (SIZE(1..15)) OF MsrAssistBTS + + +MsrAssistBTS ::= SEQUENCE { + bcchCarrier BCCHCarrier, -- BCCH carrier + bsic BSIC, -- BSIC + multiFrameOffset MultiFrameOffset, -- multiframe offset + timeSlotScheme TimeSlotScheme, -- Timeslot scheme + roughRTD RoughRTD, -- rough RTD value + + -- Location Calculation Assistance data is moved here + calcAssistanceBTS CalcAssistanceBTS OPTIONAL + +} + + +-- Multiframe offset +MultiFrameOffset ::= INTEGER (0..51) +-- The Multiframe Offset value 51 shall not be encoded by the transmitting entity and +-- shall be treated by the receiving entity as 0. + +-- Rough RTD value between one base station and reference BTS +RoughRTD ::= INTEGER (0..1250) +-- The RoughRTD value 1250 shall not be encoded by the transmitting entity and shall +-- be treated by the receiving entity as 0. + +-- E-OTD Measurement assistance data for system information List IE +-- The total number of base stations in this element (SystemInfoAssistData +-- presented neighbors) and in MsrAssistData element can be at a maximum 15. +SystemInfoAssistData ::= SEQUENCE { + systemInfoAssistList SeqOfSystemInfoAssistBTS +} +SeqOfSystemInfoAssistBTS::= SEQUENCE (SIZE(1..32)) OF SystemInfoAssistBTS + + +-- whether n.th is present or not ? +SystemInfoAssistBTS ::= CHOICE { + notPresent NULL, + present AssistBTSData +} + + +-- Actual assistance data for system information base station +AssistBTSData ::= SEQUENCE { + bsic BSIC, -- BSIC + multiFrameOffset MultiFrameOffset, -- multiframe offset + timeSlotScheme TimeSlotScheme, -- Timeslot scheme + roughRTD RoughRTD, -- rough RTD value + + -- Location Calculation Assistance data + calcAssistanceBTS CalcAssistanceBTS OPTIONAL +} + + +-- E-OTD Location calculation assistance data, +-- CalcAssistanceBTS element is optional not subfields +CalcAssistanceBTS ::= SEQUENCE { + fineRTD FineRTD, -- fine RTD value between base stations + referenceWGS84 ReferenceWGS84 -- reference coordinates +} + + +-- Coordinates of neighbour BTS, WGS-84 ellipsoid +ReferenceWGS84 ::= SEQUENCE { + relativeNorth RelDistance, -- relative distance (south negative) + relativeEast RelDistance, -- relative distance (west negative) + -- Relative Altitude is not always known + relativeAlt RelativeAlt OPTIONAL -- relative altitude +} + + +-- Fine RTD value between this BTS and the reference BTS +FineRTD ::= INTEGER (0..255) + + +-- Relative north/east distance +RelDistance ::= INTEGER (-200000..200000) + + +-- Relative altitude +RelativeAlt ::= INTEGER (-4000..4000) + + + +-- Measure position response IEs +-- Reference Identity +-- Multiple sets +MultipleSets ::= SEQUENCE { + -- number of reference sets + nbrOfSets INTEGER (2..3), + + -- This field actually tells the number of reference BTSs + nbrOfReferenceBTSs INTEGER (1..3), + + -- This field is conditional and included optionally only if + -- nbrOfSets is 3 and number of reference BTSs is 2. + referenceRelation ReferenceRelation OPTIONAL +} + + +-- Relation between refence BTSs and sets +ReferenceRelation ::= ENUMERATED { + secondBTSThirdSet (0), -- 1st BTS related to 1st and 2nd sets + secondBTSSecondSet (1), -- 1st BTS related to 1st and 3rd sets + firstBTSFirstSet (2) -- 1st BTS related to 1st set +} + + +-- Reference BTS Identity, this element contains number of +-- BTSs told nbrOfReferenceBTSs field in Multiple sets element) +ReferenceIdentity ::= SEQUENCE { + -- Reference BTS list + refBTSList SeqOfReferenceIdentityType +} +SeqOfReferenceIdentityType ::= SEQUENCE (SIZE(1..3)) OF ReferenceIdentityType + + +-- Cell identity +ReferenceIdentityType ::= CHOICE { + bsicAndCarrier BSICAndCarrier, -- BSIC and Carrier + ci CellID, -- Cell ID, LAC not needed + requestIndex RequestIndex, -- Index to Requested Neighbor List + systemInfoIndex SystemInfoIndex, -- Index to System info list, this type of ref. identity + -- shall not be used by the MS unless it has received + -- the SystemInfoAssistData from the SMLC for this cell. + ciAndLAC CellIDAndLAC -- CI and LAC +} + +BSICAndCarrier ::= SEQUENCE { + carrier BCCHCarrier, + bsic BSIC +} + +RequestIndex ::= INTEGER (1..16) + +SystemInfoIndex ::= INTEGER (1..32) + +CellIDAndLAC ::= SEQUENCE { + referenceLAC LAC, -- Location area code + referenceCI CellID -- Cell identity +} + +CellID ::= INTEGER (0..65535) +LAC ::= INTEGER (0..65535) + + +-- OTD-MeasureInfo +OTD-MeasureInfo ::= SEQUENCE { + -- Measurement info elements, OTD-MsrElement is repeated number of times + -- told in nbrOfReferenceBTSs in MultipleSets, default value is 1 + otdMsrFirstSets OTD-MsrElementFirst, + + -- if more than one sets are present this element is repeated + -- NumberOfSets - 1 (-1 = first set) + otdMsrRestSets SeqOfOTD-MsrElementRest OPTIONAL + +} + +SeqOfOTD-MsrElementRest ::= SEQUENCE (SIZE(1..2)) OF OTD-MsrElementRest + + +-- OTD measurent information for 1 set +OTD-MsrElementFirst ::= SEQUENCE { + refFrameNumber INTEGER (0..42431), -- Frame number modulo 42432 + referenceTimeSlot ModuloTimeSlot, + toaMeasurementsOfRef TOA-MeasurementsOfRef OPTIONAL, + stdResolution StdResolution, + taCorrection INTEGER (0..960) OPTIONAL, -- TA correction + + -- measured neighbors in OTD measurements + otd-FirstSetMsrs SeqOfOTD-FirstSetMsrs OPTIONAL +} +SeqOfOTD-FirstSetMsrs ::= SEQUENCE (SIZE(1..10)) OF OTD-FirstSetMsrs + + +-- OTD measurent information 2 and 3 sets if exist +OTD-MsrElementRest ::= SEQUENCE { + refFrameNumber INTEGER (0..42431), -- Frame number modulo 42432 + referenceTimeSlot ModuloTimeSlot, + toaMeasurementsOfRef TOA-MeasurementsOfRef OPTIONAL, + stdResolution StdResolution, + taCorrection INTEGER (0..960) OPTIONAL, -- TA correction + + -- measured neighbors in OTD measurements + otd-MsrsOfOtherSets SeqOfOTD-MsrsOfOtherSets OPTIONAL + +} +SeqOfOTD-MsrsOfOtherSets ::= SEQUENCE (SIZE(1..10)) OF OTD-MsrsOfOtherSets + + +-- Standard deviation of the TOA measurements from the reference BTS +TOA-MeasurementsOfRef ::= SEQUENCE { + refQuality RefQuality, + numOfMeasurements NumOfMeasurements +} + +RefQuality ::= INTEGER (0..31) -- St Dev of TOA of reference as defined in annex +NumOfMeasurements ::= INTEGER (0..7) -- No. of measurements for RefQuality as defined in annex +StdResolution ::= INTEGER (0..3) -- Values of resolution are defined in annex + +OTD-FirstSetMsrs ::= OTD-MeasurementWithID + + +-- Neighbour info in OTD measurements 0-10 times in TD measurement info +OTD-MsrsOfOtherSets ::= CHOICE { + identityNotPresent OTD-Measurement, + identityPresent OTD-MeasurementWithID + +} + + +-- For this OTD measurement identity is same as the identity of BTS +-- in the first set with same sequence number +OTD-Measurement ::= SEQUENCE { + nborTimeSlot ModuloTimeSlot, + eotdQuality EOTDQuality, + otdValue OTDValue + +} + + +-- This measurement contains the BTS identity and measurement +OTD-MeasurementWithID ::=SEQUENCE { + neighborIdentity NeighborIdentity, + nborTimeSlot ModuloTimeSlot, + eotdQuality EOTDQuality, + otdValue OTDValue +} + +EOTDQuality ::= SEQUENCE { + nbrOfMeasurements INTEGER (0..7), + stdOfEOTD INTEGER (0..31) +} + +NeighborIdentity ::= CHOICE { + bsicAndCarrier BSICAndCarrier, -- BSIC and Carrier + ci CellID, -- Cell ID, LAC not needed + multiFrameCarrier MultiFrameCarrier, -- MultiFrameOffest and BSIC + requestIndex RequestIndex, -- Index to Requested Neighbor List + systemInfoIndex SystemInfoIndex, -- Index to System info list, this type of neighbour + -- identity shall not be used by the MS unless it has + -- received the SystemInfoAssistData from the SMLC for + -- this cell. + ciAndLAC CellIDAndLAC -- CI and LAC +} + + + +-- Multiframe and carrier +MultiFrameCarrier ::= SEQUENCE { + bcchCarrier BCCHCarrier, + multiFrameOffset MultiFrameOffset +} + + +-- OTD measurement value for neighbour +OTDValue ::= INTEGER (0..39999) + + +-- Location information IE +LocationInfo ::= SEQUENCE { + refFrame INTEGER (0..65535), -- Reference Frame number + -- If refFrame is within (42432..65535), it shall be ignored by the receiver + -- in that case the MS should provide GPS TOW if available + gpsTOW INTEGER (0..14399999) OPTIONAL, -- GPS TOW + fixType FixType, + -- Note that applicable range for refFrame is 0 - 42431 + -- Possible shapes carried in posEstimate are + -- ellipsoid point, + -- ellipsoid point with uncertainty circle + -- ellipsoid point with uncertainty ellipse + -- ellipsoid point with altitude and uncertainty ellipsoid + posEstimate Ext-GeographicalInformation + +} + +FixType ::= INTEGER { + twoDFix (0), + threeDFix (1) +} (0..1) + + +-- GPS-Measurement information +GPS-MeasureInfo ::= SEQUENCE { + -- Measurement info elements + -- user has to make sure that in this element is number of elements + -- defined in reference BTS identity + gpsMsrSetList SeqOfGPS-MsrSetElement +} +SeqOfGPS-MsrSetElement ::= SEQUENCE (SIZE(1..3)) OF GPS-MsrSetElement + + +-- OTD measurent information 1-3 times in message +GPS-MsrSetElement ::= SEQUENCE { + refFrame INTEGER (0..65535) OPTIONAL, -- Reference Frame number + gpsTOW GPSTOW24b, -- GPS TOW + -- Note that applicable range for refFrame is 0 - 42431 + +--N_SAT can be read from number of elements of gps-msrList + + gps-msrList SeqOfGPS-MsrElement + +} + + +-- 24 bit presentation for GPSTOW +GPSTOW24b ::= INTEGER (0..14399999) + + +-- measured elements in measurement parameters field +SeqOfGPS-MsrElement ::= SEQUENCE (SIZE(1..16)) OF GPS-MsrElement + +GPS-MsrElement ::= SEQUENCE { + satelliteID SatelliteID, -- Satellite identifier + cNo INTEGER (0..63), -- carrier noise ratio + doppler INTEGER (-32768..32767), -- doppler, mulltiply by 0.2 + wholeChips INTEGER (0..1022), -- whole value of the code phase measurement + fracChips INTEGER (0..1024), -- fractional value of the code phase measurement + -- a value of 1024 shall not be encoded by the sender + -- the receiver shall consider a value of 1024 to be + -- invalid data + mpathIndic MpathIndic, -- multipath indicator + pseuRangeRMSErr INTEGER (0..63) -- index +} + + +-- Multipath indicator +MpathIndic ::= ENUMERATED { + notMeasured (0), + low (1), + medium (2), + high (3) +} + + +-- Location error IE +LocationError ::= SEQUENCE { + locErrorReason LocErrorReason, + additionalAssistanceData AdditionalAssistanceData OPTIONAL, + ... +} + +LocErrorReason ::= ENUMERATED { + unDefined (0), + notEnoughBTSs (1), + notEnoughSats (2), + eotdLocCalAssDataMissing (3), + eotdAssDataMissing (4), + gpsLocCalAssDataMissing (5), + gpsAssDataMissing (6), + methodNotSupported (7), + notProcessed (8), + refBTSForGPSNotServingBTS (9), + refBTSForEOTDNotServingBTS (10), + ... +} + +-- exception handling: +-- an unrecognized value shall be treated the same as value 0 + + +-- defines additional assistance data needed for any new location attempt +-- MS shall retain any assistance data already received +AdditionalAssistanceData ::= SEQUENCE { + gpsAssistanceData GPSAssistanceData OPTIONAL, + extensionContainer ExtensionContainer OPTIONAL, + ... +} + +GPSAssistanceData ::= OCTET STRING (SIZE (1..maxGPSAssistanceData)) +-- GPSAssistanceData has identical structure and encoding to octets 3 to n of the +-- GPS Assistance Data IE in 3GPP TS 49.031 + +maxGPSAssistanceData INTEGER ::= 40 + + + +-- Protocol Error Causes +ErrorCodes ::= ENUMERATED { + unDefined (0), +missingComponet (1), +incorrectData (2), +missingIEorComponentElement (3), +messageTooShort (4), +unknowReferenceNumber (5), +... +} + +-- exception handling: +-- an unrecognized value shall be treated the same as value 0 + + + +-- GPS assistance data IE +GPS-AssistData ::= SEQUENCE { + controlHeader ControlHeader +} + + +-- More Assistance Data To Be Sent IE +-- More Assistance Data Components On the Way indication for delivery of an entire set of assistance +-- data in multiple Assistance Data components. + +MoreAssDataToBeSent ::= ENUMERATED { + noMoreMessages (0), -- This is the only or last Assistance Data message used to deliver + -- the entire set of assistance data. + moreMessagesOnTheWay (1) -- The SMLC will send more Assistance Data messages or a final RRLP + -- Measure Position Request message to deliver the + -- the entire set of assistance data. +} + +-- Control header of the GPS assistance data +ControlHeader ::= SEQUENCE { + + -- Field type Present information + referenceTime ReferenceTime OPTIONAL, + refLocation RefLocation OPTIONAL, + dgpsCorrections DGPSCorrections OPTIONAL, + navigationModel NavigationModelRrlp OPTIONAL, + ionosphericModel IonosphericModel OPTIONAL, + utcModel UTCModel OPTIONAL, + almanac Almanac OPTIONAL, + acquisAssist AcquisAssist OPTIONAL, + realTimeIntegrity SeqOf-BadSatelliteSet OPTIONAL +} + + +ReferenceTime ::= SEQUENCE { + gpsTime GPSTime, + gsmTime GSMTime OPTIONAL, + gpsTowAssist GPSTOWAssist OPTIONAL +} + + + +-- GPS Time includes week number and time-of-week (TOW) +GPSTime ::= SEQUENCE { + gpsTOW23b GPSTOW23b, + gpsWeek GPSWeek +} + + +-- GPSTOW, range 0-604799.92, resolution 0.08 sec, 23-bit presentation +GPSTOW23b ::= INTEGER (0..7559999) + + +-- GPS week number +GPSWeek ::= INTEGER (0..1023) + + +-- GPSTOWAssist consists of TLM message, Anti-spoof flag, Alert flag, and 2 reserved bits in TLM Word +-- for each visible satellite. +-- N_SAT can be read from number of elements in GPSTOWAssist +GPSTOWAssist ::= SEQUENCE (SIZE(1..12)) OF GPSTOWAssistElement + +GPSTOWAssistElement ::= SEQUENCE { + satelliteID SatelliteID, + tlmWord TLMWord, + antiSpoof AntiSpoofFlag, + alert AlertFlag, + tlmRsvdBits TLMReservedBits +} + +-- TLM Word, 14 bits +TLMWord ::= INTEGER (0..16383) + +-- Anti-Spoof flag +AntiSpoofFlag ::= INTEGER (0..1) + +-- Alert flag +AlertFlag ::= INTEGER (0..1) + +-- Reserved bits in TLM word, MSB occurs earlier in TLM Word transmitted by satellite +TLMReservedBits ::= INTEGER (0..3) + +GSMTime ::= SEQUENCE { + bcchCarrier BCCHCarrier, -- BCCH carrier + bsic BSIC, -- BSIC + frameNumber FrameNumber, + timeSlot TimeSlot, + bitNumber BitNumber +} + + +-- Frame number +FrameNumber ::= INTEGER (0..2097151) + + +-- Time slot number +TimeSlot ::= INTEGER (0..7) + +-- Bit number +BitNumber ::= INTEGER (0..156) + + +-- Reference Location IE +RefLocation ::= SEQUENCE { + threeDLocation Ext-GeographicalInformation +} + + + +-- DGPS Corrections IE +DGPSCorrections ::= SEQUENCE { + + gpsTOW INTEGER (0..604799), -- DGPS reference time + + status INTEGER (0..7), + + -- N_SAT can be read from number of elements of satList + + satList SeqOfSatElement +} +SeqOfSatElement ::= SEQUENCE (SIZE (1..16)) OF SatElement + + +-- number of correction for satellites +SatElement ::= SEQUENCE { + satelliteID SatelliteID, + + +--- Sequence number for ephemeris + iode INTEGER (0..239), + -- User Differential Range Error + udre INTEGER (0..3), + + -- Pseudo Range Correction, range is + -- -655.04 - +655.04, + pseudoRangeCor INTEGER (-2047..2047), + + -- Pseudo Range Rate Correction, range is + -- -4.064 - +4.064, + rangeRateCor INTEGER (-127..127), + + +-- Delta Pseudo Range Correction 2 + deltaPseudoRangeCor2 INTEGER (-127..127), -- This IE shall be ignored by the receiver and + -- set to zero by the sender + -- Delta Pseudo Range Correction 2 + deltaRangeRateCor2 INTEGER (-7..7), -- This IE shall be ignored by the receiver and + -- set to zero by the sender + -- Delta Pseudo Range Correction 3 + deltaPseudoRangeCor3 INTEGER (-127..127), -- This IE shall be ignored by the receiver and + -- set to zero by the sender + -- Delta Pseudo Range Correction 3 + deltaRangeRateCor3 INTEGER (-7..7) -- This IE shall be ignored by the receiver and + -- set to zero by the sender +} + +SatelliteID ::= INTEGER (0..63) -- identifies satellite + + +-- Navigation Model IE +NavigationModelRrlp ::= SEQUENCE { + navModelList SeqOfNavModelElement +} + +-- navigation model satellite list +SeqOfNavModelElement ::= SEQUENCE (SIZE(1..16)) OF NavModelElement + +NavModelElement ::= SEQUENCE { + satelliteID SatelliteID, + satStatus SatStatus -- satellite status +} + + +-- the Status of the navigation model +SatStatus ::= CHOICE { + -- New satellite, new Navigation Model + newSatelliteAndModelUC UncompressedEphemeris, + + -- Existing satellite, Existing Navigation Model + oldSatelliteAndModel NULL, + + -- Existing satellite, new Navigation Model + newNaviModelUC UncompressedEphemeris, + ... +} + + +-- Uncompressed satellite emhemeris and clock corrections +UncompressedEphemeris ::= SEQUENCE { + ephemCodeOnL2 INTEGER (0..3), + ephemURA INTEGER (0..15), + ephemSVhealth INTEGER (0..63), + ephemIODC INTEGER (0..1023), + ephemL2Pflag INTEGER (0..1), + ephemSF1Rsvd EphemerisSubframe1Reserved, + ephemTgd INTEGER (-128..127), + ephemToc INTEGER (0..37799), + ephemAF2 INTEGER (-128..127), + ephemAF1 INTEGER (-32768..32767), + ephemAF0 INTEGER (-2097152..2097151), + ephemCrs INTEGER (-32768..32767), + ephemDeltaN INTEGER (-32768..32767), + ephemM0 INTEGER (-2147483648..2147483647), + ephemCuc INTEGER (-32768..32767), + ephemE INTEGER (0..4294967295), + ephemCus INTEGER (-32768..32767), + ephemAPowerHalf INTEGER (0..4294967295), + ephemToe INTEGER (0..37799), + ephemFitFlag INTEGER (0..1), + ephemAODA INTEGER (0..31), + ephemCic INTEGER (-32768..32767), + ephemOmegaA0 INTEGER (-2147483648..2147483647), + ephemCis INTEGER (-32768..32767), + ephemI0 INTEGER (-2147483648..2147483647), + ephemCrc INTEGER (-32768..32767), + ephemW INTEGER (-2147483648..2147483647), + ephemOmegaADot INTEGER (-8388608..8388607), + ephemIDot INTEGER (-8192..8191) +} + + +-- Reserved bits in subframe 1 of navigation message +EphemerisSubframe1Reserved ::= SEQUENCE { + reserved1 INTEGER (0..8388607), -- 23-bit field + reserved2 INTEGER (0..16777215), -- 24-bit field + reserved3 INTEGER (0..16777215), -- 24-bit field + reserved4 INTEGER (0..65535) -- 16-bit field +} + + + +-- Ionospheric Model IE +IonosphericModel ::= SEQUENCE { + alfa0 INTEGER (-128..127), + alfa1 INTEGER (-128..127), + alfa2 INTEGER (-128..127), + alfa3 INTEGER (-128..127), + beta0 INTEGER (-128..127), + beta1 INTEGER (-128..127), + beta2 INTEGER (-128..127), + beta3 INTEGER (-128..127) +} + + +-- Universal Time Coordinate Model +UTCModel ::= SEQUENCE { + utcA1 INTEGER (-8388608..8388607), + utcA0 INTEGER (-2147483648..2147483647), + utcTot INTEGER (0..255), + utcWNt INTEGER (0..255), + utcDeltaTls INTEGER (-128..127), + utcWNlsf INTEGER (0..255), + utcDN INTEGER (-128..127), + utcDeltaTlsf INTEGER (-128..127) +} + + +-- Almanac, Long term model +-- NOTE: These are parameters are subset of the ephemeris +-- NOTE: But with reduced resolution and accuracy +Almanac ::= SEQUENCE { + alamanacWNa INTEGER (0..255), -- Once per message + + -- navigation model satellite list. + -- The size of almanacList is actually Nums_Sats_Total field + almanacList SeqOfAlmanacElement +} +SeqOfAlmanacElement ::= SEQUENCE (SIZE(1..64)) OF AlmanacElement + + +-- Almanac info once per satellite +AlmanacElement ::= SEQUENCE { + satelliteID SatelliteID, + almanacE INTEGER (0..65535), + alamanacToa INTEGER (0..255), + almanacKsii INTEGER (-32768..32767), + almanacOmegaDot INTEGER (-32768..32767), + almanacSVhealth INTEGER (0..255), + almanacAPowerHalf INTEGER (0..16777215), + almanacOmega0 INTEGER (-8388608..8388607), + almanacW INTEGER (-8388608..8388607), + almanacM0 INTEGER (-8388608..8388607), + almanacAF0 INTEGER (-1024..1023), + almanacAF1 INTEGER (-1024..1023) +} + + +-- Acquisition Assistance +AcquisAssist ::= SEQUENCE { + + -- Number of Satellites can be read from acquistList + timeRelation TimeRelation, + + -- Acquisition assistance list + -- The size of Number of Satellites is actually Number of Satellites field + acquisList SeqOfAcquisElement +} +SeqOfAcquisElement ::= SEQUENCE (SIZE(1..16)) OF AcquisElement + + +-- the relationship between GPS time and air-interface timing +TimeRelation ::= SEQUENCE { + -- + gpsTOW GPSTOW23b, -- 23b presentation + + + gsmTime GSMTime OPTIONAL +} + + +-- data occuring per number of satellites +AcquisElement ::= SEQUENCE { + svid SatelliteID, + + -- Doppler 0th order term, + -- -5120.0 - 5117.5 Hz (= -2048 - 2047 with 2.5 Hz resolution) + doppler0 INTEGER (-2048..2047), + + addionalDoppler AddionalDopplerFields OPTIONAL, + codePhase INTEGER (0..1022), -- Code Phase + intCodePhase INTEGER (0..19), -- Integer Code Phase + gpsBitNumber INTEGER (0..3), -- GPS bit number + codePhaseSearchWindow INTEGER (0..15), -- Code Phase Search Window + + addionalAngle AddionalAngleFields OPTIONAL + +} + +AddionalDopplerFields ::= SEQUENCE { + -- Doppler 1st order term, -1.0 - +0.5 Hz/sec + -- (= -42 + (0 to 63) with 1/42 Hz/sec. resolution) + doppler1 INTEGER (0..63), + dopplerUncertainty INTEGER (0..7) +} + +AddionalAngleFields ::= SEQUENCE { + -- azimuth angle, 0 - 348.75 deg (= 0 - 31 with 11.25 deg resolution) + azimuth INTEGER (0..31), + -- elevation angle, 0 - 78.75 deg (= 0 - 7 with 11.25 deg resolution) + elevation INTEGER (0..7) +} + +-- Real-Time Integrity +-- number of bad satellites can be read from this element +SeqOf-BadSatelliteSet ::= SEQUENCE (SIZE(1..16)) OF SatelliteID + + +-- Extension Elements + +-- Release 98 Extensions here +Rel98-MsrPosition-Req-Extension ::= SEQUENCE { + rel98-Ext-ExpOTD Rel98-Ext-ExpOTD OPTIONAL, -- ExpectedOTD extension + ..., + gpsTimeAssistanceMeasurementRequest NULL OPTIONAL, + gpsReferenceTimeUncertainty GPSReferenceTimeUncertainty OPTIONAL +-- Further R98 extensions here +} +Rel98-AssistanceData-Extension ::= SEQUENCE { + rel98-Ext-ExpOTD Rel98-Ext-ExpOTD OPTIONAL, -- ExpectedOTD extension + ..., + gpsTimeAssistanceMeasurementRequest NULL OPTIONAL, + gpsReferenceTimeUncertainty GPSReferenceTimeUncertainty OPTIONAL + +-- Further R98 extensions here +} +-- Release 98 ExpOTD extension +Rel98-Ext-ExpOTD ::= SEQUENCE { +-- If MsrAssistBTS is included in message, msrAssistData-R98-ExpOTD shall be included. + msrAssistData-R98-ExpOTD MsrAssistData-R98-ExpOTD OPTIONAL, + +-- If SystemInfoAssistaData is included in message, systemInfoAssistData-R98-ExpOTD shall be +-- included. + systemInfoAssistData-R98-ExpOTD SystemInfoAssistData-R98-ExpOTD OPTIONAL +} + +-- MsrAssistData R98 extension +MsrAssistData-R98-ExpOTD ::= SEQUENCE { + msrAssistList-R98-ExpOTD SeqOfMsrAssistBTS-R98-ExpOTD +} + +-- Indexes in SeqOfMsrAssistBTS-R98-ExpOTD refer to SeqOfMsrAssistBTS +-- If the index exceeds the SegOfMsrAssistBTS range or if there is other +-- inconsistencies between the BTS indices, the MS shall apply protocol +-- error cause incorrectData +SeqOfMsrAssistBTS-R98-ExpOTD ::= SEQUENCE (SIZE(1..15)) OF MsrAssistBTS-R98-ExpOTD + +-- This element completes MsrAssistBTS IE +MsrAssistBTS-R98-ExpOTD ::= SEQUENCE { + expectedOTD ExpectedOTD, + expOTDUncertainty ExpOTDUncertainty +} + +-- SystemInfoAssistData R98 extension +SystemInfoAssistData-R98-ExpOTD ::= SEQUENCE { + systemInfoAssistListR98-ExpOTD SeqOfSystemInfoAssistBTS-R98-ExpOTD +} + +-- SeqOfSystemInfoAssistBTS-R98-ExpOTD index refer to SeqOfSystemInfoAssistBTS +-- If the index exceeds the SegOfSystemInfoAssistBTS range or if there is other +-- inconsistencies between the BTS indices, the MS shall apply protocol +-- error cause incorrectData +SeqOfSystemInfoAssistBTS-R98-ExpOTD ::= SEQUENCE (SIZE(1..32)) OF SystemInfoAssistBTS-R98-ExpOTD + +-- whether n.th is present or not ? +SystemInfoAssistBTS-R98-ExpOTD ::= CHOICE { + notPresent NULL, + present AssistBTSData-R98-ExpOTD +} + +-- This element completes AssistBTSData IE +AssistBTSData-R98-ExpOTD ::= SEQUENCE { + expectedOTD ExpectedOTD, + expOTDuncertainty ExpOTDUncertainty -- Uncertainty of expected OTD + +} + +-- Expected OTD value between nbor base station and reference BTS +-- at MS's current estimated location. +ExpectedOTD ::= INTEGER (0..1250) +-- The ExpectedOTD value 1250 shall not be encoded by the transmitting entity and +-- shall be treated by the receiving entity as 0. +-- Uncertainty of Exptected OTD in bits +ExpOTDUncertainty ::= INTEGER(0..7) + +-- Release 98 extensions + +GPSReferenceTimeUncertainty ::= INTEGER (0 .. 127) -- Coding according to Annex + +GPSTimeAssistanceMeasurements ::= SEQUENCE { + referenceFrameMSB INTEGER (0 .. 63), -- MSB of frame number + gpsTowSubms INTEGER (0 .. 9999) OPTIONAL, -- in units of 100ns, for MS based AGPS + deltaTow INTEGER (0 .. 127) OPTIONAL, -- for MS assisted AGPS + gpsReferenceTimeUncertainty GPSReferenceTimeUncertainty OPTIONAL +} + +Rel-98-MsrPosition-Rsp-Extension ::= SEQUENCE { + + -- First extension to Release 98 + rel-98-Ext-MeasureInfo SEQUENCE { + otd-MeasureInfo-R98-Ext OTD-MeasureInfo-R98-Ext OPTIONAL + }, + ..., + timeAssistanceMeasurements GPSTimeAssistanceMeasurements OPTIONAL + -- Further R98 extensions here +} +-- This is an addition to OTD-MeasureInfo element defined in original message, +-- If OTD-MeasureInfo is absent, or if one or more OTD-MsrElementRest are present +-- OTD-MeasureInfo-R98-Ext shall be absent. +-- OTD-MeasureInfo-R98-Ext +OTD-MeasureInfo-R98-Ext ::= SEQUENCE { + -- Measurement info elements + otdMsrFirstSets-R98-Ext OTD-MsrElementFirst-R98-Ext +} + +-- OTD measurement information Ext for the first set only +OTD-MsrElementFirst-R98-Ext ::= SEQUENCE { + -- additional measured neighbors in OTD measurements + otd-FirstSetMsrs-R98-Ext SeqOfOTD-FirstSetMsrs-R98-Ext OPTIONAL +} +SeqOfOTD-FirstSetMsrs-R98-Ext ::= SEQUENCE (SIZE(1..5)) OF OTD-FirstSetMsrs + +Rel-5-MsrPosition-Rsp-Extension ::= SEQUENCE { + + extended-reference Extended-reference OPTIONAL, + -- The extended-reference shall be included by the MS if and only if previously + -- received from the SMLC in a Measure Position Request. When included, the value sent + -- by the MS shall equal the value received from the SMLC. + + -- extension to Release 5, for RRLP pseudo-segmentation here + otd-MeasureInfo-5-Ext OTD-MeasureInfo-5-Ext OPTIONAL, + ulPseudoSegInd UlPseudoSegInd OPTIONAL, -- Included when uplink RRLP + -- Pseudo-segmentation is used, not included when no uplink pseudo-segmentation is used + ... + -- Possibly more extensions for Release 5 here later +} + +Extended-reference ::= SEQUENCE { + smlc-code INTEGER (0..63), + transaction-ID INTEGER (0..262143) +} + +OTD-MeasureInfo-5-Ext ::= SeqOfOTD-MsrElementRest + -- if more than one measurement sets are present this element is repeated + -- NumberOfSets - 1 (-1 = first set) combined in OTD-MeasureInfo-5-Ext and + -- OTD-MeasureInfo (e.g. if NumberOfSets is 3, then one otdMsrRestSets may + -- be sent in OTD-MeasureInfo-5-Ext and one in OTD-MeasureInfo) + +-- First part of Uplink RRLP Pseudo-segmentation indication, possibly more may be defined +-- in the future for segmentation with more than two segments. +UlPseudoSegInd ::= ENUMERATED { + firstOfMany (0), + secondOfMany(1) +} + +Rel5-MsrPosition-Req-Extension ::= SEQUENCE { + extended-reference Extended-reference, + ... + -- Possibly more extensions for Release 5 here later +} + +Rel5-AssistanceData-Extension ::= SEQUENCE { + extended-reference Extended-reference, + ... + +-- Possibly more extensions for Release 5 here later +} + +Rel-5-ProtocolError-Extension::= SEQUENCE { + extended-reference Extended-reference OPTIONAL, + -- The extended-reference shall be included by the MS if and only if previously + -- received from the SMLC. + -- When included, the value sent by the MS shall equal the value received from the SMLC. + ... + + -- Possibly more extensions for Release 5 here later +} + + + + +-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +-- The following components have been added to the RRLP spec, extracted from the +-- specifications from which RRLP includes. + + +Ext-GeographicalInformation ::= OCTET STRING (SIZE (1..maxExt-GeographicalInformation)) + -- Refers to geographical Information defined in 3GPP TS 23.032. + -- This is composed of 1 or more octets with an internal structure according to + -- 3GPP TS 23.032 + -- Octet 1: Type of shape, only the following shapes in 3GPP TS 23.032 are allowed: + -- (a) Ellipsoid point with uncertainty circle + -- (b) Ellipsoid point with uncertainty ellipse + -- (c) Ellipsoid point with altitude and uncertainty ellipsoid + -- (d) Ellipsoid Arc + -- (e) Ellipsoid Point + -- Any other value in octet 1 shall be treated as invalid + -- Octets 2 to 8 for case (a) – Ellipsoid point with uncertainty circle + -- Degrees of Latitude 3 octets + -- Degrees of Longitude 3 octets + -- Uncertainty code 1 octet + -- Octets 2 to 11 for case (b) – Ellipsoid point with uncertainty ellipse: + -- Degrees of Latitude 3 octets + -- Degrees of Longitude 3 octets + -- Uncertainty semi-major axis 1 octet + -- Uncertainty semi-minor axis 1 octet + -- Angle of major axis 1 octet + -- Confidence 1 octet + -- Octets 2 to 14 for case (c) – Ellipsoid point with altitude and uncertainty ellipsoid + -- Degrees of Latitude 3 octets + -- Degrees of Longitude 3 octets + -- Altitude 2 octets + -- Uncertainty semi-major axis 1 octet + -- Uncertainty semi-minor axis 1 octet + -- Angle of major axis 1 octet + -- Uncertainty altitude 1 octet + -- Confidence 1 octet + -- Octets 2 to 13 for case (d) – Ellipsoid Arc + -- Degrees of Latitude 3 octets + -- Degrees of Longitude 3 octets + -- Inner radius 2 octets + -- Uncertainty radius 1 octet + -- Offset angle 1 octet + -- Included angle 1 octet + -- Confidence 1 octet + -- Octets 2 to 7 for case (e) – Ellipsoid Point + -- Degrees of Latitude 3 octets + -- Degrees of Longitude 3 octets + + -- + -- An Ext-GeographicalInformation parameter comprising more than one octet and + -- containing any other shape or an incorrect number of octets or coding according + -- to 3GPP TS 23.032 shall be treated as invalid data by a receiver. + -- + -- An Ext-GeographicalInformation parameter comprising one octet shall be discarded + -- by the receiver if an Add-GeographicalInformation parameter is received + -- in the same message. + -- + -- An Ext-GeographicalInformation parameter comprising one octet shall be treated as + -- invalid data by the receiver if an Add-GeographicalInformation parameter is not + -- received in the same message. + +maxExt-GeographicalInformation INTEGER ::= 20 + -- the maximum length allows for further shapes in 3GPP TS 23.032 to be included in later + -- versions of 3GPP TS 29.002 + + + + +MAP-EXTENSION ::= CLASS { + &ExtensionType OPTIONAL, + &extensionId OBJECT IDENTIFIER } + -- The length of the Object Identifier shall not exceed 16 octets and the + -- number of components of the Object Identifier shall not exceed 16 + +-- data types + + + + +ExtensionContainer ::= SEQUENCE { + privateExtensionList [0]PrivateExtensionList OPTIONAL, + pcs-Extensions [1]PCS-Extensions OPTIONAL, + ...} + +SLR-ArgExtensionContainer ::= SEQUENCE { + privateExtensionList [0]PrivateExtensionList OPTIONAL, + slr-Arg-PCS-Extensions [1]SLR-Arg-PCS-Extensions OPTIONAL, + ...} + +PrivateExtensionList ::= SEQUENCE SIZE (1..maxNumOfPrivateExtensions) OF + PrivateExtension + +PrivateExtension ::= SEQUENCE { + extId MAP-EXTENSION.&extensionId + ({ExtensionSet}), + extType MAP-EXTENSION.&ExtensionType + ({ExtensionSet}{@extId}) OPTIONAL} + +maxNumOfPrivateExtensions INTEGER ::= 10 + +ExtensionSet MAP-EXTENSION ::= + {... + -- ExtensionSet is the set of all defined private extensions + } + -- Unsupported private extensions shall be discarded if received. + +PCS-Extensions ::= SEQUENCE { + ...} + +SLR-Arg-PCS-Extensions ::= SEQUENCE { + ..., + na-ESRK-Request [0] NULL OPTIONAL } + + + + +-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + +END diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/group/supl_asn1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/group/supl_asn1.txt Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,573 @@ +ULP DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +IMPORTS + Version, SessionID + FROM ULP-Components + SUPLINIT + FROM SUPL-INIT + SUPLSTART + FROM SUPL-START + SUPLRESPONSE + FROM SUPL-RESPONSE + SUPLPOSINIT + FROM SUPL-POS-INIT + SUPLPOS + FROM SUPL-POS + SUPLEND + FROM SUPL-END + SUPLAUTHREQ + FROM SUPL-AUTH-REQ + SUPLAUTHRESP + FROM SUPL-AUTH-RESP; + +-- general ULP PDU layout; +ULP-PDU ::= SEQUENCE { + length INTEGER(0..65535), + version Version, + sessionID SessionID, + message UlpMessage} + +UlpMessage ::= CHOICE { + msSUPLINIT SUPLINIT, + msSUPLSTART SUPLSTART, + msSUPLRESPONSE SUPLRESPONSE, + msSUPLPOSINIT SUPLPOSINIT, + msSUPLPOS SUPLPOS, + msSUPLEND SUPLEND, + msSUPLAUTHREQ SUPLAUTHREQ, + msSUPLAUTHRESP SUPLAUTHRESP, + ...} + +END + + + + +SUPL-INIT DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLINIT; + +IMPORTS SLPAddress, QoP, PosMethod + FROM ULP-Components; + +SUPLINIT ::= SEQUENCE { + posMethod PosMethod, + notification Notification OPTIONAL, + sLPAddress SLPAddress OPTIONAL, + qoP QoP OPTIONAL, + sLPMode SLPMode, + mAC MAC OPTIONAL, + keyIdentity KeyIdentity OPTIONAL, + ...} + +Notification ::= SEQUENCE { + notificationType NotificationType, + encodingType EncodingType OPTIONAL, + requestorId OCTET STRING(SIZE (1..maxReqLength)) OPTIONAL, + requestorIdType FormatIndicator OPTIONAL, + clientName OCTET STRING(SIZE (1..maxClientLength)) OPTIONAL, + clientNameType FormatIndicator OPTIONAL, + ...} + +NotificationType ::= ENUMERATED { + noNotificationNoVerification(0), notificationOnly(1), + notificationAndVerficationAllowedNA(2), + notificationAndVerficationDeniedNA(3), privacyOverride(4), ... + } + +EncodingType ::= ENUMERATED {ucs2(0), gsmDefault(1), utf8(2), ... + } + +maxReqLength INTEGER ::= 50 + +maxClientLength INTEGER ::= 50 + +FormatIndicator ::= ENUMERATED { + logicalName(0), e-mailAddress(1), msisdn(2), url(3), sipUrl(4), min(5), + mdn(6), ... + } + +SLPMode ::= ENUMERATED {proxy(0), nonProxy(1)} + +MAC ::= BIT STRING(SIZE (64)) + +KeyIdentity ::= BIT STRING(SIZE (128)) + +END + + + +SUPL-START DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLSTART, SETCapabilities; + +IMPORTS LocationId, QoP + FROM ULP-Components; + +SUPLSTART ::= SEQUENCE { + sETCapabilities SETCapabilities, + locationId LocationId, + qoP QoP OPTIONAL, + ...} + +SETCapabilities ::= SEQUENCE { + posTechnology PosTechnology, + prefMethod PrefMethod, + posProtocol PosProtocol, + ...} + +PosTechnology ::= SEQUENCE { + agpsSETassisted BOOLEAN, + agpsSETBased BOOLEAN, + autonomousGPS BOOLEAN, + aFLT BOOLEAN, + eCID BOOLEAN, + eOTD BOOLEAN, + oTDOA BOOLEAN, + ...} + +PrefMethod ::= ENUMERATED { + agpsSETassistedPreferred, agpsSETBasedPreferred, noPreference} + +PosProtocol ::= SEQUENCE { + tia801 BOOLEAN, + rrlp BOOLEAN, + rrc BOOLEAN, + ...} + +END + + + +SUPL-RESPONSE DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLRESPONSE; + +IMPORTS PosMethod, SLPAddress + FROM ULP-Components; + +SUPLRESPONSE ::= SEQUENCE { + posMethod PosMethod, + sLPAddress SLPAddress OPTIONAL, + sETAuthKey SETAuthKey OPTIONAL, + keyIdentity4 KeyIdentity4 OPTIONAL, + ...} + +SETAuthKey ::= CHOICE { + shortKey BIT STRING(SIZE (128)), + longKey BIT STRING(SIZE (256)), + ...} + +KeyIdentity4 ::= BIT STRING(SIZE (128)) + +END + + + +SUPL-POS-INIT DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLPOSINIT; + +IMPORTS + SUPLPOS + FROM SUPL-POS + SETCapabilities + FROM SUPL-START + LocationId, Position, Ver + FROM ULP-Components; + +SUPLPOSINIT ::= SEQUENCE { + sETCapabilities SETCapabilities, + requestedAssistData RequestedAssistData OPTIONAL, + locationId LocationId, + position Position OPTIONAL, + sUPLPOS SUPLPOS OPTIONAL, + ver Ver OPTIONAL, + ...} + +RequestedAssistData ::= SEQUENCE { + almanacRequested BOOLEAN, + utcModelRequested BOOLEAN, + ionosphericModelRequested BOOLEAN, + dgpsCorrectionsRequested BOOLEAN, + referenceLocationRequested BOOLEAN, + referenceTimeRequested BOOLEAN, + acquisitionAssistanceRequested BOOLEAN, + realTimeIntegrityRequested BOOLEAN, + navigationModelRequested BOOLEAN, + navigationModelData NavigationModel OPTIONAL, + ...} + +NavigationModel ::= SEQUENCE { + gpsWeek INTEGER(0..1023), + gpsToe INTEGER(0..167), + nSAT INTEGER(0..31), + toeLimit INTEGER(0..10), + satInfo SatelliteInfo OPTIONAL, + ...} + +-- Further information on this fields can be found +-- in 3GPP TS 44.031 and 49.031 +SatelliteInfo ::= SEQUENCE (SIZE (1..31)) OF SatelliteInfoElement + +SatelliteInfoElement ::= SEQUENCE { + satId INTEGER(0..63), + iODE INTEGER(0..255), + ...} + +END + + + +SUPL-POS DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLPOS; + +IMPORTS Velocity + FROM ULP-Components; + +SUPLPOS ::= SEQUENCE { + posPayLoad PosPayLoad, + velocity Velocity OPTIONAL, + ...} + +PosPayLoad ::= CHOICE { + tia801payload OCTET STRING(SIZE (1..8192)), + rrcPayload OCTET STRING(SIZE (1..8192)), + rrlpPayload OCTET STRING(SIZE (1..8192)), + ...} + +END + + + +SUPL-END DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLEND; + +IMPORTS StatusCode, Position, Ver + FROM ULP-Components; + +SUPLEND ::= SEQUENCE { + position Position OPTIONAL, + statusCode StatusCode OPTIONAL, + ver Ver OPTIONAL, + ...} + +END + + + +SUPL-AUTH-REQ DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLAUTHREQ; + +SUPLAUTHREQ ::= SEQUENCE { + sETNonce SETNonce, + keyIdentity2 KeyIdentity2, + ...} + +SETNonce ::= BIT STRING(SIZE (128)) + +KeyIdentity2 ::= BIT STRING(SIZE (128)) + +END + + + +SUPL-AUTH-RESP DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS SUPLAUTHRESP; + +IMPORTS StatusCode + FROM ULP-Components; + +SUPLAUTHRESP ::= SEQUENCE { + sPCAuthKey SPCAuthKey OPTIONAL, + keyIdentity3 KeyIdentity3 OPTIONAL, + statusCode StatusCode OPTIONAL, + ...} + +SPCAuthKey ::= CHOICE { + shortKey BIT STRING(SIZE (128)), + longKey BIT STRING(SIZE (256)), + ...} + +KeyIdentity3 ::= BIT STRING(SIZE (128)) + +END + + + +ULP-Components DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +EXPORTS + Version, SessionID, IPAddress, SLPAddress, LocationId, Position, StatusCode, + Velocity, QoP, PosMethod, Ver; + +-- protocol version expressed as x.y.z (e.g., 5.1.0) +Version ::= SEQUENCE { + maj INTEGER(0..255), + min INTEGER(0..255), + servind INTEGER(0..255)} + +SessionID ::= SEQUENCE { + setSessionID SetSessionID OPTIONAL, -- the semantics of OPTIONAL applies to the encoding only. The parameter itself is MANDATORY. This is introduced only to minimize bandwidth for the SUPL INIT message. Since the setSessionID is allocated by the SET, there is no setSessionID to be transmitted in the SUPL INIT message. + slpSessionID SlpSessionID OPTIONAL -- the semantics of OPTIONAL applies to the encoding only. The parameter itself is MANDATORY. This is introduced only to minimize bandwidth for the SUPL START message. Since the slpSessionID is allocated by the SLP, there is no slpSessionID to be transmitted in the SUPL START message. +} + +SetSessionID ::= SEQUENCE {sessionId INTEGER(0..65535), + setId SETId} + +SETId ::= CHOICE { + msisdn OCTET STRING(SIZE (8)), + mdn OCTET STRING(SIZE (8)), + min BIT STRING(SIZE (34)), -- coded according to TIA-553 + imsi OCTET STRING(SIZE (8)), + nai IA5String(SIZE (1..1000)), + iPAddress IPAddress, + ...} + +-- msisdn, mdn and imsi are a BCD (Binary Coded Decimal) string +-- represent digits from 0 through 9, +-- two digits per octet, each digit encoded 0000 to 1001 (0 to 9) +-- bits 8765 of octet n encoding digit 2n +-- bits 4321 of octet n encoding digit 2(n-1) +1 +-- not used digits in the string shall be filled with 1111 +SlpSessionID ::= SEQUENCE { + sessionID OCTET STRING(SIZE (4)), + slpId SLPAddress} + +IPAddress ::= CHOICE { + ipv4Address OCTET STRING(SIZE (4)), + ipv6Address OCTET STRING(SIZE (16))} + +SLPAddress ::= CHOICE {iPAddress IPAddress, + fQDN FQDN, + ...} + +FQDN ::= + VisibleString(FROM ("a".."z" | "A".."Z" | "0".."9" | ".-"))(SIZE (1..255)) + +Ver ::= BIT STRING(SIZE (64)) + +LocationId ::= SEQUENCE {cellInfo CellInfo, + status Status, + ...} + +Status ::= ENUMERATED {stale(0), current(1), unknown(2), ... + } + +CellInfo ::= CHOICE { + gsmCell GsmCellInformation, + wcdmaCell WcdmaCellInformation, + cdmaCell CdmaCellInformation, + ...} + +Position ::= SEQUENCE { + timestamp UTCTime, -- shall include seconds and shall use UTC time. + positionEstimate PositionEstimate, + velocity Velocity OPTIONAL, + ...} + +PositionEstimate ::= SEQUENCE { + latitudeSign ENUMERATED {north, south}, + latitude INTEGER(0..8388607), + longitude INTEGER(-8388608..8388607), + uncertainty + SEQUENCE {uncertaintySemiMajor INTEGER(0..127), + uncertaintySemiMinor INTEGER(0..127), + orientationMajorAxis INTEGER(0..180)} OPTIONAL, + -- angle in degree between major axis and North + confidence INTEGER(0..100) OPTIONAL, + altitudeInfo AltitudeInfo OPTIONAL, + ...} + +AltitudeInfo ::= SEQUENCE { + altitudeDirection ENUMERATED {height, depth}, + altitude INTEGER(0..32767), + altUncertainty INTEGER(0..127), + ...} -- based on 3GPP TS 23.032 + +CdmaCellInformation ::= SEQUENCE { + refNID INTEGER(0..65535), -- Network Id + refSID INTEGER(0..32767), -- System Id + refBASEID INTEGER(0..65535), -- Base Station Id + refBASELAT INTEGER(0..4194303), -- Base Station Latitude + reBASELONG INTEGER(0..8388607), -- Base Station Longitude + refREFPN INTEGER(0..511), -- Base Station PN Code + refWeekNumber INTEGER(0..65535), -- GPS Week Number + refSeconds INTEGER(0..4194303)-- GPS Seconds -- , + ...} + +GsmCellInformation ::= SEQUENCE { + refMCC INTEGER(0..999), -- Mobile Country Code + refMNC INTEGER(0..999), -- Mobile Network Code + refLAC INTEGER(0..65535), -- Location area code + refCI INTEGER(0..65535), -- Cell identity + nMR NMR OPTIONAL, + tA INTEGER(0..255) OPTIONAL, --Timing Advance + ...} + +WcdmaCellInformation ::= SEQUENCE { + refMCC INTEGER(0..999), -- Mobile Country Code + refMNC INTEGER(0..999), -- Mobile Network Code + refUC INTEGER(0..268435455), -- Cell identity + frequencyInfo FrequencyInfo OPTIONAL, + primaryScramblingCode INTEGER(0..511) OPTIONAL, + measuredResultsList MeasuredResultsList OPTIONAL, + ...} + +FrequencyInfo ::= SEQUENCE { + modeSpecificInfo CHOICE {fdd FrequencyInfoFDD, + tdd FrequencyInfoTDD, + ...}, + ...} + +FrequencyInfoFDD ::= SEQUENCE { + uarfcn-UL UARFCN OPTIONAL, + uarfcn-DL UARFCN, + ...} + +FrequencyInfoTDD ::= SEQUENCE {uarfcn-Nt UARFCN, + ...} + +UARFCN ::= INTEGER(0..16383) + +NMR ::= SEQUENCE (SIZE (1..15)) OF NMRelement + +NMRelement ::= SEQUENCE { + aRFCN INTEGER(0..1023), + bSIC INTEGER(0..63), + rxLev INTEGER(0..63), + ...} + +MeasuredResultsList ::= SEQUENCE (SIZE (1..maxFreq)) OF MeasuredResults + +MeasuredResults ::= SEQUENCE { + frequencyInfo FrequencyInfo OPTIONAL, + utra-CarrierRSSI UTRA-CarrierRSSI OPTIONAL, + cellMeasuredResultsList CellMeasuredResultsList OPTIONAL} + +CellMeasuredResultsList ::= + SEQUENCE (SIZE (1..maxCellMeas)) OF CellMeasuredResults + +-- SPARE: UTRA-CarrierRSSI, Max = 76 +-- Values above Max are spare +UTRA-CarrierRSSI ::= INTEGER(0..127) + +CellMeasuredResults ::= SEQUENCE { + cellIdentity INTEGER(0..268435455) OPTIONAL, + modeSpecificInfo + CHOICE {fdd + SEQUENCE {primaryCPICH-Info PrimaryCPICH-Info, + cpich-Ec-N0 CPICH-Ec-N0 OPTIONAL, + cpich-RSCP CPICH-RSCP OPTIONAL, + pathloss Pathloss OPTIONAL}, + tdd + SEQUENCE {cellParametersID CellParametersID, + proposedTGSN TGSN OPTIONAL, + primaryCCPCH-RSCP PrimaryCCPCH-RSCP OPTIONAL, + pathloss Pathloss OPTIONAL, + timeslotISCP-List TimeslotISCP-List OPTIONAL}}} + +CellParametersID ::= INTEGER(0..127) + +TGSN ::= INTEGER(0..14) + +PrimaryCCPCH-RSCP ::= INTEGER(0..127) + +-- SPARE: TimeslotISCP, Max = 91 +-- Values above Max are spare +TimeslotISCP ::= INTEGER(0..127) + +TimeslotISCP-List ::= SEQUENCE (SIZE (1..maxTS)) OF TimeslotISCP + +PrimaryCPICH-Info ::= SEQUENCE {primaryScramblingCode INTEGER(0..511)} + +-- SPARE: CPICH-Ec-No, Max = 49 +-- Values above Max are spare +CPICH-Ec-N0 ::= INTEGER(0..63) + +-- SPARE: CPICH- RSCP, Max = 91 +-- Values above Max are spare +CPICH-RSCP ::= INTEGER(0..127) + +-- SPARE: Pathloss, Max = 158 +-- Values above Max are spare +Pathloss ::= INTEGER(46..173) + +maxCellMeas INTEGER ::= 32 + +maxFreq INTEGER ::= 8 + +maxTS INTEGER ::= 14 + +StatusCode ::= ENUMERATED { + unspecified(0), systemFailure(1), unexpectedMessage(2), protocolError(3), + dataMissing(4), unexpectedDataValue(5), posMethodFailure(6), + posMethodMismatch(7), posProtocolMismatch(8), targetSETnotReachable(9), + versionNotSupported(10), resourceShortage(11), invalidSessionId(12), + nonProxyModeNotSupported(13), proxyModeNotSupported(14), + positioningNotPermitted(15), authNetFailure(16), authSuplinitFailure(17), consentDeniedByUser(100), + consentGrantedByUser(101), ... + } + +QoP ::= SEQUENCE { + horacc INTEGER(0..127), + veracc INTEGER(0..127) OPTIONAL, -- as defined in 3GPP TS 23.032 "uncertainty altitude" + maxLocAge INTEGER(0..65535) OPTIONAL, + delay INTEGER(0..7) OPTIONAL, -- as defined in 3GPP TS 44.031 + ...} + +Velocity ::= CHOICE { -- velocity definition as per 23.032 + horvel Horvel, + horandvervel Horandvervel, + horveluncert Horveluncert, + horandveruncert Horandveruncert, + ...} + +Horvel ::= SEQUENCE { + bearing BIT STRING(SIZE (9)), + horspeed BIT STRING(SIZE (16)), + ...} + +Horandvervel ::= SEQUENCE { + verdirect BIT STRING(SIZE (1)), + bearing BIT STRING(SIZE (9)), + horspeed BIT STRING(SIZE (16)), + verspeed BIT STRING(SIZE (8)), + ...} + +Horveluncert ::= SEQUENCE { + bearing BIT STRING(SIZE (9)), + horspeed BIT STRING(SIZE (16)), + uncertspeed BIT STRING(SIZE (8)), + ...} + +Horandveruncert ::= SEQUENCE { + verdirect BIT STRING(SIZE (1)), + bearing BIT STRING(SIZE (9)), + horspeed BIT STRING(SIZE (16)), + verspeed BIT STRING(SIZE (8)), + horuncertspeed BIT STRING(SIZE (8)), + veruncertspeed BIT STRING(SIZE (8)), + ...} + +PosMethod ::= ENUMERATED { + agpsSETassisted(0), agpsSETbased(1), agpsSETassistedpref(2), + agpsSETbasedpref(3), autonomousGPS(4), aFLT(5), eCID(6), eOTD(7), oTDOA(8), + noPosition(9), + ...} + +END diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/group/suplrrlpasn1.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/group/suplrrlpasn1.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,31 @@ +// 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: +// An iby file for the SUPL/RRLP ASN1 component +// +// + +#ifndef __LBS_SUPL_RRLP_ASN1_IBY__ +#define __LBS_SUPL_RRLP_ASN1_IBY__ + + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) +#if defined(SYMBIAN_INCLUDE_LOCATION_SUPLv10) || defined(SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY) + +file=ABI_DIR\DEBUG_DIR\suplrrlpasn1.dll System\libs\suplrrlpasn1.dll + +#endif // SYMBIAN_INCLUDE_LOCATION_SUPLv10 || SYMBIAN_INCLUDE_LOCATION_SUPL_PROXY +#endif // SYMBIAN_EXCLUDE_LOCATION + + +#endif // __LBS_SUPL_RRLP_ASN1_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/group/suplrrlpasn1.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/group/suplrrlpasn1.mmp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,86 @@ +// 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: +// + +TARGET suplrrlpasn1.dll +TARGETTYPE dll +UID 0x1000008d 0x10285aa5 + +// capabilities +CAPABILITY ALL -Tcb + +// macro definition enables developer logging +MACRO ENABLE_SUPL_DEV_LOGGER + +// user include paths +USERINCLUDE ../inc +USERINCLUDE ../../../networkpmutils/supldevlogger/inc +USERINCLUDE ../../../networkpmasn1_pub/asn1supl/inc +USERINCLUDE ../../../networkpmasn1_pub/asn1rrlp/inc +USERINCLUDE ../../../networkpmasn1_pub/asn1runtime +USERINCLUDE ../../../networkpmasn1_pub/asn1runtime/rtpersrc +USERINCLUDE ../../../networkpmasn1_pub/asn1runtime/rtsrc +USERINCLUDE ../../../networkpmasn1_pub/asn1runtime/rtxsrc + +// system include paths +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE +OS_LAYER_LIBC_SYSTEMINCLUDE + +SOURCEPATH ../src +// wrapper classes definitions +SOURCE suplmessagebase.cpp +SOURCE suplmessagecommon.cpp +SOURCE suplinit.cpp +SOURCE suplstart.cpp +SOURCE suplresponse.cpp +SOURCE suplposinit.cpp +SOURCE suplend.cpp +SOURCE suplpos.cpp +SOURCE suplpospayload.cpp +SOURCE rrlpmessagebase.cpp +SOURCE rrlpmeasureposrequest.cpp +SOURCE rrlpmeasureposresponse.cpp +SOURCE rrlpassistancedata.cpp +SOURCE rrlpassistancedataack.cpp +SOURCE rrlpprotocolerror.cpp +SOURCE suplasn1decoder.cpp +SOURCE suplasn1decoderimpl.cpp +SOURCE rrlputils.cpp + +// Standard Libraries +LIBRARY euser.lib +LIBRARY estlib.lib +LIBRARY hash.lib + +// ASN1 Runtime Libraries +LIBRARY asn1rt.lib +LIBRARY asn1per.lib + +// SUPL/RRLP Specific ASN1 Encode/Decode Libraries +LIBRARY asn1supl.lib +LIBRARY asn1rrlp.lib + +// LBS Libraries +LIBRARY lbsloccommon.lib +LIBRARY lbsnetprotocol.lib +LIBRARY lbs.lib +LIBRARY lbsassistancedata.lib +LIBRARY supldevlogger.lib + +// macro definitions for generated ASN1 code +macro USEASN1RTDLL USEASN1PERDLL _NO_LICENSE_CHECK _NO_INT64_SUPPORT _COMPACT +// macro definition to exclude unused components of generated SUPL/RRLP code +macro _ASN1_EXCLUDE +SMPSAFE diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpassistancedata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpassistancedata.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,76 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef RRLP_ASSISTANCE_DATA_H +#define RRLP_ASSISTANCE_DATA_H + +#include "rrlpmessagebase.h" +#include +#include +#include "lbspositioninfo.h" + +/** +Encapsulation for received RRLP Assistance Data message + +@internalTechnology +*/ +NONSHARABLE_CLASS(CRrlpAssistanceData) : public CRrlpMessageBase + { +public: + /** static factory constructor */ + IMPORT_C static CRrlpAssistanceData* NewL(); + + virtual ~CRrlpAssistanceData(); + +public: + + /** Returns ETrue if valid assistance data is present in the received message */ + IMPORT_C TBool AssistanceDataPresent(); + + /** Populates aData with received assistance data, and aDataMask to + indicate the assistance data parts present */ + IMPORT_C TInt BuildAssistanceData(TLbsAsistanceDataGroup& aDataMask, + RLbsAssistanceDataBuilderSet& aAssistanceDataBuilderSet); + + /** Returns ETrue if another RRLP Assitance Data message to be delivered */ + IMPORT_C TBool MoreAssDataToBeSent(); + +protected: + + /** gets the extended reference elements */ + TInt GetExtendedReference(TRrlpReference& aRrlpRef); + +private: + /** default constructor */ + CRrlpAssistanceData(); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CRrlpAssistanceData(const CRrlpAssistanceData&); + + /** Prohibit assigment operator */ + CRrlpAssistanceData& operator= (const CRrlpAssistanceData&); + }; + +#endif // RRLP_ASSISTANCE_DATA_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpassistancedataack.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpassistancedataack.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,56 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef RRLP_ASSISTANCE_DATA_ACK_H +#define RRLP_ASSISTANCE_DATA_ACK_H + +#include "rrlpmessagebase.h" + + +/** +Encapsulation of outgoing RRLP Assistance Data Ack message + +@internalTechnology +*/ +NONSHARABLE_CLASS(CRrlpAssistanceDataAck) : public CRrlpMessageBase + { +public: + IMPORT_C static CRrlpAssistanceDataAck* NewL(); + +public: + virtual ~CRrlpAssistanceDataAck(); + +private: + /** default constructor */ + CRrlpAssistanceDataAck(); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CRrlpAssistanceDataAck(const CRrlpAssistanceDataAck&); + + /** Prohibit assigment operator */ + CRrlpAssistanceDataAck& operator= (const CRrlpAssistanceDataAck&); + }; + +#endif // RRLP_ASSISTANCE_DATA_ACK_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpmeasureposrequest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpmeasureposrequest.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,82 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef RRLP_MEASURE_POSITION_REQUEST_H +#define RRLP_MEASURE_POSITION_REQUEST_H + +#include "rrlpmessagebase.h" +#include +#include + + +/** +Encapsulation for received CRrlpMeasurePositionRequest messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CRrlpMeasurePositionRequest) : public CRrlpMessageBase + { +public: + IMPORT_C static CRrlpMeasurePositionRequest* NewL(); + +public: + virtual ~CRrlpMeasurePositionRequest(); + +public: + + /** Populates aQuality and aMethod according to received PositionInstruction parameters. */ + IMPORT_C TInt GetPositionInstruct(TLbsNetPosRequestQuality& aQuality, + TLbsNetPosRequestMethod& aMethod); + + /** Returns ETrue if valid GPS Assistance Data is present in the received message */ + IMPORT_C TBool AssistanceDataPresent(); + + /** Populates aData with received assistance data, and aDataMask to + indicate the assistance data parts present */ + IMPORT_C TInt BuildAssistanceData(TLbsAsistanceDataGroup& aDataMask, + RLbsAssistanceDataBuilderSet& aAssistanceDataBuilderSet); + +protected: + + /** gets the extended reference elements */ + TInt GetExtendedReference(TRrlpReference& aRrlpRef); + +private: + + /** Constructor */ + CRrlpMeasurePositionRequest(); + + /** second stage constructor */ + void ConstructL(); + + /** converts uncertainty constants to uncertainty in meters */ + TReal32 UncertaintyToMeters(TInt aUncertainty); + + /** Prohibit copy constructor */ + CRrlpMeasurePositionRequest(const CRrlpMeasurePositionRequest&); + + /** Prohibit assigment operator */ + CRrlpMeasurePositionRequest& operator= (const CRrlpMeasurePositionRequest&); + + }; + +#endif // RRLP_MEASURE_POSITION_REQUEST_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpmeasureposresponse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpmeasureposresponse.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,142 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#ifndef RRLP_MEASURE_POSITION_RESPONSE_H +#define RRLP_MEASURE_POSITION_RESPONSE_H + +#include "rrlpmessagebase.h" +#include +#include +#include +#include + +/** TRrlpLocError typedef. +@internalTechnology +*/ +typedef TUint32 TRrlpLocError; + +/** +Enumeration for location error Code parameter. + +@internalTechnology +*/ +enum _TRrlpLocError + { + ERrlpLocErrorUnDefined = 0, + ERrlpLocErrorNotEnoughBTSs = 1, + ERrlpLocErrorNotEnoughSats = 2, + ERrlpLocErrorEotdLocCalAssDataMissing = 3, + ERrlpLocErrorEotdAssDataMissing = 4, + ERrlpLocErrorGpsLocCalAssDataMissing = 5, + ERrlpLocErrorGpsAssDataMissing = 6, + ERrlpLocErrorMethodNotSupported = 7, + ERrlpLocErrorNotProcessed = 8, + ERrlpLocErrorRefBTSForGPSNotServingBTS = 9, + ERrlpLocErrorRefBTSForEOTDNotServingBTS = 10 + }; + +/** TGeoInfo typedef. +@internalTechnology +*/ +typedef TUint32 TGeoInfo; + +/** +Enumeration for location estimate type + +@internalTechnology + +*/ +enum _TGeoInfo + { + EGeoInfoEllipsoidPoint = 0, + EGeoInfoEllipsoidPointWithUncertaintyCircle = 1, + EGeoInfoEllipsoidPointWithUncertaintyEllipse = 3, + EGeoInfoPolygon = 5, // not supported by RRLP + EGeoInfoEllipsoidPointWithAltitude = 8, // not supported by RRLP + EGeoInfoEllipsoidPointWithAltitudeAndUncertaintyEllipsoid = 9, + EGeoInfoEllipsoidArc = 10 // not supported by RRLP + }; + + +/** +Encapsulation for received CRrlpMeasurePositionResponse messages. + +@internalTechnology + +*/ +NONSHARABLE_CLASS(CRrlpMeasurePositionResponse) : public CRrlpMessageBase + { +public: + IMPORT_C static CRrlpMeasurePositionResponse* NewL(); + IMPORT_C static CRrlpMeasurePositionResponse* NewLC(); + +public: + virtual ~CRrlpMeasurePositionResponse(); + +public: + + /** Sets location information parameters */ + IMPORT_C TInt SetLocationInformation(TPositionInfoBase& aPosInfo); + + /** Sets measurement information parameters */ + IMPORT_C TInt SetMeasurementInformation(const TPositionInfoBase& aPosInfo); + + /** Sets Location Error Parameters */ + IMPORT_C TInt SetLocationError(TRrlpLocError aLocError); + + /** Sets Location Error Parameters with request for additional assistance data */ + IMPORT_C TInt SetLocationError(TRrlpLocError aLocError, const TLbsAsistanceDataGroup& aDataReqMask); + +protected: + + /** Sets the extended reference parameters */ + TInt SetExtendedReference(const TRrlpReference& aRrlpRef); + + /** Sets GPS Fine Timing Data */ + void SetGpsTimingData(const TGpsTimingMeasurementData& aTimingData); + +private: + + /** Constructor */ + CRrlpMeasurePositionResponse(); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CRrlpMeasurePositionResponse(const CRrlpMeasurePositionResponse&); + + /** Prohibit assigment operator */ + CRrlpMeasurePositionResponse& operator= (const CRrlpMeasurePositionResponse&); + +private: + + /** Calculates horizontal uncertainty constant from value in meters */ + TInt MetersToHorizontalUncertainty(const TReal32& aDistance); + + /** Calculates vertical uncertainty constant from value in meters */ + TInt MetersToVerticalUncertainty(const TReal32& aDistance); + + }; + + +#endif // RRLP_MEASURE_POSITION_RESPONSE_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpmessagebase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpmessagebase.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,165 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef RRLP_MESSAGE_BASE_H +#define RRLP_MESSAGE_BASE_H + +#include "suplpospayload.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// forward declarations +class ASN1T_PDU; +class ASN1C_PDU; +class ASN1PEREncodeBuffer; +class ASN1T_ControlHeader; +class ASN1T_NavModelElement; +class ASN1T_UncompressedEphemeris; +class ASN1T_AlmanacElement; +class ASN1T_AcquisElement; + +/** +Highest valid value for RRLP Reference Number session identifier + +@internalTechnology +*/ +const TInt KMaxRrlpReferenceNumber = 7; + + +/** +Constant for adjustment for zero offset differences. + +For ASN1 "CHOICE" types, the ASN1 compiler generates type defines with a +1 +offset to more easily access union elements describing the choice content. +This is not an issue programatically, however must be adjusted when the CHOICE +type is directly stored as a datum, for example SatStatus in the Navigation +Model assistance data element. + +@internalTechnology +*/ +const TInt EZeroOffsetAdjust = 1; + +/** +RRLP Session Reference. + +Extended in RRLP Release 5 to contain optional extension parameters. +These are populated if and only if the initial message sent by the SLP +contains the extension parameters. + +@internalTechnology +*/ +NONSHARABLE_CLASS(TRrlpReference) + { + public: + TInt aRefNum; // 0..7 + TBool aRel5EntendedRefPresent; + TInt aRel5SmlcCode; // 0..63 + TInt aRel5TransactionId; // 0..262143 + }; + + +/** +RRLP Message Base Class + +@internalTechnology + +*/ +NONSHARABLE_CLASS(CRrlpMessageBase) : public CSuplPosPayload + { +protected: + CRrlpMessageBase(TSuplPosPayloadType aType, TBool aIsOutgoingMsg); + void ConstructL(); + +public: + virtual ~CRrlpMessageBase(); + +public: + /** Set the reference component (for outgoing messages) */ + IMPORT_C TInt SetReference(const TRrlpReference& aRrlpRef); + + /** Populates aRrlpRef with the received reference component (for received messages) */ + IMPORT_C TInt GetReference(TRrlpReference& aRrlpRef); + + /** Encode a populated (outgoing) RRLP message */ + IMPORT_C TInt EncodeToL(TPtr8& aBuf); + +public: + /** Assign decoded ASN1 data, for received messages. + Not intended for DLL export */ + void SetDecodedData(ASN1T_PDU* aData, ASN1C_PDU* aControl); + + /** Prints the content payload data structure to the logger */ + void LogMessageContent(); + +private: + /** Prohibit copy constructor */ + CRrlpMessageBase(const CRrlpMessageBase&); + + /** Prohibit assigment operator */ + CRrlpMessageBase& operator= (const CRrlpMessageBase&); + +protected: + /** Methods for delivering received assistance data */ + TInt BuildAssistanceData(TLbsAsistanceDataGroup& aDataMask, RLbsAssistanceDataBuilderSet& aAssistanceDataBuilderSet, ASN1T_ControlHeader& aGpsData); + void WriteReferenceLocationData(RReferenceLocationBuilder* aReferenceLocationBuilder, ASN1T_ControlHeader& aGpsData); + void WriteReferenceTimeData(RUEPositioningGpsReferenceTimeBuilder* aReferenceTimeBuilder, ASN1T_ControlHeader& aGpsData); + void WriteNavigationModelData(RUEPositioningGpsNavigationModelBuilder* aGpsNavigationModelBuilder, ASN1T_ControlHeader& aGpsData); + void WriteNavigationModelSatInfo(RNavigationModelSatInfoBuilder* aNavigationModelSatInfoBuilder, ASN1T_NavModelElement& aSatInfo); + void WriteSatInfoEphemeris(RNavigationModelSatInfoBuilder* aNavigationModelSatInfoBuilder, ASN1T_UncompressedEphemeris& aSatEphemeris); + void WriteIonosphericModelData(RUEPositioningGpsIonosphericModelBuilder* aGpsIonosphericModelBuilder, ASN1T_ControlHeader& aGpsData); + void WriteUtcModelData(RUEPositioningGpsUtcModelBuilder* aGpsUtcModelBuilder, ASN1T_ControlHeader& aGpsData); + void WriteAlmanacData(RUEPositioningGpsAlmanacBuilder* aGpsAlmanacBuilder, ASN1T_ControlHeader& aGpsData); + void WriteAlmanacSatInfo(RAlmanacSatInfoBuilder* aAlmanacSatInfoBuilder, ASN1T_AlmanacElement& aAlmanacElement); + void WriteAcquisitionAssistanceData(RUEPositioningGpsAcquisitionAssistanceBuilder* aGpsAcquisitionAssistanceBuilder, ASN1T_ControlHeader& aGpsData); + void WriteAcquisAssistSatInfo(RAcquisitionSatInfoBuilder* aAcquisitionSatInfoBuilder, ASN1T_AcquisElement& aAcquisAssistElement); + void WriteRealTimeIntegrityData(RBadSatListBuilder* aBadSatListBuilder, ASN1T_ControlHeader& aGpsData); + + /** virtual methods for setting/getting extended reference fields + Default implementation is empty */ + virtual TInt SetExtendedReference(const TRrlpReference& aRrlpRef); + virtual TInt GetExtendedReference(TRrlpReference& aRrlpRef); + + /** Checks control structure for error, and leaves if one has occurred */ + void LeaveIfAllocErrorL(); + + /** Translates errors returned by the ASN1 runtime library */ + TInt ProcessAsn1Error(TInt aError); + +protected: + + /** Message data content */ + ASN1T_PDU* iData; + ASN1C_PDU* iControl; + + // Buffer management object for encoding ASN.1 PER data stream + ASN1PEREncodeBuffer* iEncodeBuffer; + + }; + +#endif //RRLP_MESSAGE_BASE_H + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpprotocolerror.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlpprotocolerror.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,89 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef RRLP_POROTOCOL_ERROR_H +#define RRLP_POROTOCOL_ERROR_H + +#include "rrlpmessagebase.h" + +/** TRrlpErrorCode typedef. +@internalTechnology +*/ +typedef TUint32 TRrlpErrorCode; + +/** +Enumeration for RRLP Error Code + +@internalTechnology +*/ +enum _TRrlpErrorCode + { + ERrlpErrorUnDefined = 0, + ERrlpErrorMissingComponet = 1, + ERrlpErrorIncorrectData = 2, + ERrlpErrorMissingIEorComponentElement = 3, + ERrlpErrorMessageTooShort = 4, + ERrlpErrorUnknowReferenceNumber = 5 + }; + + +/** +Encapsulation for outgoing/received RRLP Protocol Error messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CRrlpProtocolError) : public CRrlpMessageBase + { +public: + IMPORT_C static CRrlpProtocolError* NewL(TBool aIsOutgoing); + +protected: + CRrlpProtocolError(TBool aIsOutgoing); + +public: + virtual ~CRrlpProtocolError(); + +public: + + /** Populates outgoing error code according to aErrorCode (for outgoing messages) */ + IMPORT_C TInt SetProtocolError(const TRrlpErrorCode& aErrorCode); + + /** Populates aErrorCode with the received error code (for received messages) */ + IMPORT_C TInt GetProtocolError(TRrlpErrorCode& aErrorCode); + +protected: + + /** set/get extended reference fields */ + TInt SetExtendedReference(const TRrlpReference& aRrlpRef); + TInt GetExtendedReference(TRrlpReference& aRrlpRef); + +private: + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CRrlpProtocolError(const CRrlpProtocolError&); + + /** Prohibit assigment operator */ + CRrlpProtocolError& operator= (const CRrlpProtocolError&); + }; + +#endif // RRLP_POROTOCOL_ERROR_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlputils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/rrlputils.h Tue Jul 13 12:25:28 2010 +0100 @@ -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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef RRLP_UTILSE_H +#define RRLP_UTILSE_H + + +/** +RRLP Utilities class + +@internalTechnology + +*/ +class RrlpUtils + { +public: + /** Translates errors returned by the ASN1 runtime library */ + static TInt ProcessAsn1Error(TInt aError); + }; + +#endif //RRLP_UTILSE_H + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplasn1decoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplasn1decoder.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,71 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef SUPL_ASN1_DECODER_H +#define SUPL_ASN1_DECODER_H + +#include + +// forward declarations +class CSuplMessageBase; +class CSuplAsn1DecoderImpl; + +/** +The CSuplAsn1Decoder class provides an interface to the SUPL Protocol Module +enabling the decoding of ASN1 encoded SUPL messages. Such messages arrive through +either via SMS or WAP push protocols in the case of SUPL INIT messages, or via +a TCP/IP connection once a SUPL session has been established. + +The decoder provides synchronous methods for decoding received messages. Once +Decode() has been called passing the input buffer, the buffer may be re-used as +the decoded data is fully extracted to objects owned by the CSuplMessageBase +derived classes. + +On completion of the Decode() operation, the appropriate CSuplMessageBase object +is constructed, encapsulating the decoded message. Ownership of this object is +passed to the calling function. + +@internalTechnology +@see CSuplMessageBase +*/ +NONSHARABLE_CLASS(CSuplAsn1Decoder) : public CBase + { +public: + IMPORT_C static CSuplAsn1Decoder* NewL(); + virtual ~CSuplAsn1Decoder(); + +public: + IMPORT_C CSuplMessageBase* DecodeL(const TPtrC8* aBuf, TInt& aError); + +private: + CSuplAsn1Decoder(); + void ConstructL(); + + /** Prohibit copy constructor */ + CSuplAsn1Decoder(const CSuplAsn1Decoder&); + /** Prohibit assigment operator */ + CSuplAsn1Decoder& operator= (const CSuplAsn1Decoder&); + +private: + /** Handle to the Implementation */ + CSuplAsn1DecoderImpl* iImpl; + }; + +#endif // SUPL_ASN1_DECODER_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplasn1decoderimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplasn1decoderimpl.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,75 @@ +// 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: +// Internal implementation of the SUPL ASN1 Decoder +// +// + +/** + @file + @internalComponent + +*/ +#ifndef SUPL_ASN1_DECODER_IMPL_H +#define SUPL_ASN1_DECODER_IMPL_H + +#include +#include "suplasn1decoder.h" + +// forward declarations +class CSuplMessageBase; +class ASN1PERDecodeBuffer; +class ASN1T_ULP_PDU; +class ASN1C_ULP_PDU; + +/** +The class provides an internal implementation of the functionality exposed +by the CSuplAsn1Decoder interface. + +@see CSuplAsn1Decoder +@see CSuplMessageBase + +@internalComponent +*/ +NONSHARABLE_CLASS(CSuplAsn1DecoderImpl) : public CBase + { +public: + IMPORT_C static CSuplAsn1DecoderImpl* NewL(); + virtual ~CSuplAsn1DecoderImpl(); + +public: + IMPORT_C CSuplMessageBase* DecodeL(const TPtrC8* aBuf, TInt& aError); + +private: + CSuplAsn1DecoderImpl(); + void ConstructL(); + + TInt ProcessAsn1Error(TInt aError); + TInt AdditionalMessageValidation(); +private: + // Objective Systems compiled object types. + // Note that these data members object names do not meet Symbian's coding + // standards as they are created using a third party ASN1 compilation tool. + + // ASN1 Decode Buffer Management + ASN1PERDecodeBuffer* iDecodeBuffer; + + // SUPL message data structure and C++ management class for the data. + // These objects are owned during the decode process. Ownership is passed + // to a constructed CSuplMessageBase derived wrapper class, which is + // returned to the calling function on completion of the decode operation. + ASN1T_ULP_PDU* iData; + ASN1C_ULP_PDU* iControl; + }; + +#endif //SUPL_ASN1_DECODER_IMPL_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplasn1error.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplasn1error.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,60 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef SUPL_ASN1_ERROR_H +#define SUPL_ASN1_ERROR_H + +/** TSuplAsn1Error typedef. +@internalTechnology +*/ +typedef TUint32 TSuplAsn1Error; + +/** +Error codes that may be returned during ASN1 operations + +Note that positive error codes in the region 0 < err < KLbsAsn1ErrorBase +are errors returned by calls to the encode/decode operations, and represent +failure to encode/decode the ASN1 stream as indicated by the error codes +described in rtxErrCodes.h and asn1ErrCodes.h. Note that these error codes +are negated (made positive) before return to calling code to differentiate +them from standard Symbian error codes. + +The exception to the above is when a memory allocation has failed, in this +case the standard Symbian error code KErrNoMemory is returned. + +@see rtxErrCodes.h +@see asn1ErrCodes.h + +@internalTechnology +*/ +enum _TSuplAsn1Error + { + /** Not used */ + ESuplAsn1ErrBase = 1000, + /** A SUPL message that is not supported by this implementation */ + ESuplAsn1ErrUnsupportedSuplMessage = 1001, + /** A pos payload of a protocol that is not supported by this implementation */ + ESuplAsn1ErrUnsupportedPosProtocol = 1002, + /** A pos payload message type that is not supported by this implementation */ + ESuplAsn1ErrUnsupportedPosMessageType = 1003 + }; + +#endif // SUPL_ASN1_ERROR_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplend.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplend.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,80 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_END_H +#define LBS_SUPL_END_H + +#include "suplmessagebase.h" +#include + + +/** +Encapsulation for outgoing/received SUPL END messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplEnd) : public CSuplMessageBase + { +public: + IMPORT_C static CSuplEnd* NewL(TBool aIsOutgoingMessage); + IMPORT_C static CSuplEnd* NewLC(TBool aIsOutgoingMessage); + virtual ~CSuplEnd(); + +public: + + /** Set the positon parameter (for outgoing messages) */ + IMPORT_C TInt SetPosition(const TPositionInfoBase& aPosInfo); + + /** Set the SUPL Status Code (for outgoing messages) */ + IMPORT_C TInt SetStatusCode(TSuplStatusCode& aStatusCode); + + /** Set the hash of the received SUPL INIT (for outgoing messages) */ + IMPORT_C TInt SetVer(const TDesC8& aVer); + + /** Returns ETrue if the position parameter is present (for received messages) */ + IMPORT_C TBool PositionPresent(); + + /** Populates aPosInfo with the received position information (for received messages) */ + IMPORT_C TInt GetPosition(TPosition& aPosInfo); + + /** Returns ETrue if the status code parameter is present (for received messages) */ + IMPORT_C TBool StatusCodePresent(); + + /** Returns the status code parameter (for received messages) */ + IMPORT_C TSuplStatusCode StatusCode(); + +private: + + /** Constructor */ + CSuplEnd(TBool aIsOutgoingMessage); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CSuplEnd(const CSuplEnd&); + + /** Prohibit assigment operator */ + CSuplEnd& operator= (const CSuplEnd&); + + TInt DecodeTime(const TUint8* aTimeString, TTime& aTimeOut); + }; + +#endif // LBS_SUPL_END_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplinit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplinit.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,113 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_INIT_H +#define LBS_SUPL_INIT_H + +#include "suplmessagebase.h" +#include +#include + +/** +Encapsulation for received SUPL INIT messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplInit) : public CSuplMessageBase + { +public: + + /** SLP Mode define */ + typedef TUint32 TSuplSlpMode; + + /** SLP Mode enumeration */ + enum _TSuplSlpMode + { + ESuplSlpModeProxy = 0, + ESuplSlpModeNonProxy = 1 + }; + +public: + IMPORT_C static CSuplInit* NewL(); + virtual ~CSuplInit(); + +public: + + /** Populates aMethod according to SUPL INIT posMethod parameter */ + IMPORT_C TInt GetPosMethod(TLbsNetPosRequestMethod& aMethod); + + /** Returns ETrue if optional notification parameter is present */ + IMPORT_C TBool NotificationPresent(); + + /** Populates aPrivacy according to SUPL INIT notification parameter */ + IMPORT_C TInt GetNotificationType (TLbsNetPosRequestPrivacy& aPrivacy); + + /** Returns true if either optional requestor id or client name parameters are present */ + IMPORT_C TBool ExternalRequestInfoPresent(); + + /** Populates aRequestInfo according to SUPL INIT requestor id parameter */ + IMPORT_C TInt GetExternalRequestInfo (TLbsExternalRequestInfo& aRequestInfo); + + /** Returns true if optional SLP address parameter is present */ + IMPORT_C TBool SlpAddressPresent(); + + /** Populates aAddress according to SUPL INIT SLP address parameter */ + IMPORT_C TInt GetSlpAddress(CSuplSlpAddress& aAddress); + + /** Returns true if optional QoP parameter is present */ + IMPORT_C TBool QopPresent(); + + /** Populates aAddress according to SUPL INIT QoP parameter */ + IMPORT_C TInt GetQop (TLbsNetPosRequestQuality& aQuality); + + /** returns the SLP mode specified*/ + IMPORT_C TSuplSlpMode SlpMode(); + + /** returns the encoded hash of the received SUPL INIT message */ + IMPORT_C TPtrC8 GetVerL(const TDesC8 &aHSlp); + + /** Stores a copy of the unencoded received message data */ + void SetReceivedMessageL(const TDesC8& aData); + +private: + + /** Constructor */ + CSuplInit(); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CSuplInit(const CSuplInit&); + + /** Prohibit assigment operator */ + CSuplInit& operator= (const CSuplInit&); + +private: + + // storage for the un-decoded received message. + HBufC8* iMessage; + + // storage for the hash of the received SUPL INIT message + TBuf8<8> iVer; + }; + +#endif // LBS_SUPL_INIT_H + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplmessagebase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplmessagebase.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,163 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_MESSAGE_BASE_H +#define LBS_SUPL_MESSAGE_BASE_H + +#include "suplmessagecommon.h" + +// forward declarations +class TLbsNetPosCapabilities; +class TPositionInfoBase; +class TCourse; +class ASN1T_ULP_PDU; +class ASN1C_ULP_PDU; +class ASN1PEREncodeBuffer; +class ASN1T_SETCapabilities; +class ASN1T_Position; +class ASN1T_LocationId; +class ASN1T_Velocity; + + +/** +CSuplMessageBase is an abstract class providing a base definition for SUPL +messages either received or constructed for sending. Concrete classes derived +from this class represent each of the supported SUPL message types, and provide +methods for accessing and setting their member parameters. + +When building outgoing messages, the constructor must be called with +aIsOutgoingMessage set to ETrue. This results in the internal data members +necessary for building and encoding an outgoing message. + +For received messages, the SUPL ASN1 Decoder object (see csuplasn1decoder.h) +calls SetDecodedData(), passing the decoded data structures (ownership is passed +immediately on entrance to this method). Note that these data structures are +defined by compilation of the SUPL definition using a third party ASN1 compiler +and therefore do not conform to standard Symbian naming conventions. + +Types encapsulating common parts for operation within the SUPL Protocol Module +are described in file suplmessagecommon.h + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplMessageBase) : public CBase + { +public: + + /** TSuplMessageType typedef */ + typedef TUint32 TSuplMessageType; + + enum _TSuplMessageType + { + ESuplInit = 0, + ESuplStart, + ESuplResponse, + ESuplPosInit, + ESuplPos, + ESuplEnd, + ESuplAuthReq, + ESuplAuthResp, + + ESuplMessageLimit + }; + +protected: + CSuplMessageBase(TSuplMessageType aType, TBool aIsOutgoingMessage); + +public: + virtual ~CSuplMessageBase(); + +public: + /** Encode a populated outgoing message */ + IMPORT_C TInt EncodeToL(TPtr8& aBuf); + + /** Methods for populating common parameters for outgoing messages */ + + /** Set the SUPL version used (for outgoing messages) */ + IMPORT_C void SetVersion(CSuplVersion& aVersion); + + /** Set the SUPL Session ID (for outgoing messages) */ + IMPORT_C TInt SetSessionId(CSuplSessionId& aSessionId); + + /** Methods for accessing content of decoded received messages */ + + /** Returns the message type */ + IMPORT_C CSuplMessageBase::TSuplMessageType MessageType(); + + /** Populates aVersion with the SUPL version (for received messages) */ + IMPORT_C TInt GetVersion(CSuplVersion& aVersion); + + /** Populates aSessionId with the SUPL Session ID (for received messages) */ + IMPORT_C TInt GetSessionId(CSuplSessionId& aSessionId); + + /** Prints the content of the data structure to the logger */ + IMPORT_C void LogMessageContent(); + +public: + /** Assign decoded ASN1 data. (for received messages) + Not intended for DLL export */ + void SetDecodedData(ASN1T_ULP_PDU* aData, ASN1C_ULP_PDU* aControl); + +private: + /** Prohibit copy constructor */ + CSuplMessageBase(const CSuplMessageBase&); + + /** Prohibit assigment operator */ + CSuplMessageBase& operator= (const CSuplMessageBase&); + +protected: + /** second stage constructor */ + void ConstructL(); + + /** checks for memory allocation failure and leaves */ + void LeaveIfAllocErrorL(); + + /** translates ASN1 run-time errors */ + TInt ProcessAsn1Error(TInt aError); + + /** methods for outgoing SUPL parameters common to multiple messages */ + TInt PopulateSetCapabilities(const TLbsNetPosCapabilities& aCapsSource, ASN1T_SETCapabilities& aCapsTarget); + TInt PopulateLocationId(const CSuplLocationId& aLocSource, ASN1T_LocationId& aLocTarget); + TInt PopulatePosition(const TPositionInfoBase& aPosSource, ASN1T_Position& aPosTarget); + TInt PopulateVelocity(const TCourse& aCourse, ASN1T_Velocity& aVelTarget); + + /** common calculation methods */ + TInt Uncertainty(const TReal32& aDistance); + TInt UncertaintyAltitude(const TReal32& aDistance); + TInt EncodeAltitude(const TReal32& aAltitude); + +protected: + // Message type identifier + TSuplMessageType iSuplMessageType; + + TBool iIsOutgoingMessage; + + // SUPL message data structure and C++ management class for the data. + ASN1T_ULP_PDU* iData; + ASN1C_ULP_PDU* iControl; + + // Buffer management object for encoding ASN.1 PER data stream + ASN1PEREncodeBuffer* iEncodeBuffer; + + // Buffer for storing timestamp translated to UTC format YYMMDDhhmmssZ + TBuf8<13> iUtcTime; + }; + +#endif // LBS_SUPL_MESSAGE_BASE_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplmessagecommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplmessagecommon.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,381 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_MESSAGE_COMMON_H +#define LBS_SUPL_MESSAGE_COMMON_H + +#include + +/** +Enumeration for Status Code parameter. +This is used to report errors in the SUPL END message status code parameter. + +@internalTechnology +*/ +typedef TUint32 TSuplStatusCode; + +enum _TSuplStatusCode + { + ESuplStatusUnspecified = 0, + ESuplStatusSystemFailure = 1, + ESuplStatusUnexpectedMessage = 2, + ESuplStatusProtocolError = 3, + ESuplStatusDataMissing = 4, + ESuplStatusUnexpectedDataValue = 5, + ESuplStatusPosMethodFailure = 6, + ESuplStatusPosMethodMismatch = 7, + ESuplStatusPosProtocolMismatch = 8, + ESuplStatusTargetSETnotReachable = 9, + ESuplStatusVersionNotSupported = 10, + ESuplStatusResourceShortage = 11, + ESuplStatusInvalidSessionId = 12, + ESuplStatusNonProxyModeNotSupported = 13, + ESuplStatusProxyModeNotSupported = 14, + ESuplStatusPositioningNotPermitted = 15, + ESuplStatusAuthNetFailure = 16, + ESuplStatusAuthSuplinitFailure = 17, + ESuplStatusConsentDeniedByUser = 100, + ESuplStatusConsentGrantedByUser = 101 + }; + + +typedef TUint32 TSuplSlpAddressType; +enum _TSuplSlpAddressType + { + ESuplSlpAddressTypeIp = 0, + ESuplSlpAddressTypeFqdn, + + ESuplSlpAddressTypeLimit + }; + +typedef TUint32 TSuplIpAddressType; +enum _TSuplIpAddressType + { + ESuplIpAddressTypeV4 = 0, + ESuplIpAddressTypeV6, + + ESuplIpAddressTypeLimit + }; + +typedef TUint32 TSuplSetIdType; +enum _TSuplSetIdType + { + ESuplSetIdTypeMsisdn, + ESuplSetIdTypeMdn, + ESuplSetIdTypeMin, + ESuplSetIdTypeImsi, + ESuplSetIdTypeNai, + ESuplSetIdTypeIPAddress + }; + + +/** + * Supl Message IPAddress + */ +NONSHARABLE_CLASS(CSuplIpAddress) : public CBase + { +public: + IMPORT_C static CSuplIpAddress* NewL(); + IMPORT_C static CSuplIpAddress* NewLC(); + IMPORT_C ~CSuplIpAddress(); + IMPORT_C TBool operator==(const CSuplIpAddress& other) const; + +private: + CSuplIpAddress(); + void ConstructL(); + +public: + TSuplIpAddressType iIpAddressType; + TBuf8<16> iIpAddress; + }; + +/** + * Supl Message FQDN + */ +NONSHARABLE_CLASS(CSuplFqdn) : public CBase + { +public: + IMPORT_C static CSuplFqdn* NewL(); + IMPORT_C ~CSuplFqdn(); + IMPORT_C TBool operator==(const CSuplFqdn& other) const; + +private: + CSuplFqdn(); + void ConstructL(); + +public: + TBuf8<256> iFqdn; + }; + + +/** + * Supl Message Slp address + */ +NONSHARABLE_CLASS(CSuplSlpAddress) : public CBase + { +public: + IMPORT_C static CSuplSlpAddress* NewL(); + IMPORT_C ~CSuplSlpAddress(); + IMPORT_C TBool operator==(const CSuplSlpAddress& other) const; + +private: + CSuplSlpAddress(); + void ConstructL(); + +public: + TSuplSlpAddressType iSlpAddressType; + CSuplIpAddress* iIpAddress; + CSuplFqdn* iFqdn; + }; + +/** + * Supl Message SessionId + */ +NONSHARABLE_CLASS(CSuplSlpSessionId) : public CBase + { +public: + IMPORT_C static CSuplSlpSessionId* NewL(); + IMPORT_C ~CSuplSlpSessionId(); + IMPORT_C TBool operator==(const CSuplSlpSessionId& other) const; + +private: + void ConstructL(); + void ConstructL(const CSuplSlpSessionId* aSlpSessionId); + +public: + TBuf8<4> iSessionId; + CSuplSlpAddress* iSlpAddress; + }; + + +/** + * Supl Message SetId + */ +NONSHARABLE_CLASS(CSuplSetId) : public CBase + { +public: + IMPORT_C static CSuplSetId* NewL(); + IMPORT_C ~CSuplSetId(); + IMPORT_C TBool operator==(const CSuplSetId& other) const; + +private: + CSuplSetId(); + void ConstructL(); + +public: + TSuplSetIdType iSetIdType; + CSuplIpAddress* iIpAddress; + TBuf8<16> iSetId; + }; + +/** + * Supl Message SessionId + */ +NONSHARABLE_CLASS(CSuplSetSessionId) : public CBase + { +public: + IMPORT_C static CSuplSetSessionId* NewL(); + IMPORT_C ~CSuplSetSessionId(); + IMPORT_C TBool operator==(const CSuplSetSessionId& other) const; + +private: + CSuplSetSessionId(); + void ConstructL(); + +public: + TUint16 iSessionId; + CSuplSetId* iSetId; + }; + +/** + * Supl Message SessionId + */ +NONSHARABLE_CLASS(CSuplSessionId) : public CBase + { +public: + IMPORT_C static CSuplSessionId* NewL(); + IMPORT_C static CSuplSessionId* NewLC(); + IMPORT_C ~CSuplSessionId(); + IMPORT_C TBool operator==(const CSuplSessionId& other) const; + +private: + CSuplSessionId(); + void ConstructL(); + +public: + TBool iSetSessionIdPresent; + TBool iSlpSessionIdPresent; + CSuplSetSessionId* iSetSessionId; + CSuplSlpSessionId* iSlpSessionId; + }; + + +/** + * Supl Message Version + */ +NONSHARABLE_CLASS(CSuplVersion) : public CBase + { +public: + IMPORT_C static CSuplVersion* NewL(); + IMPORT_C ~CSuplVersion(); + IMPORT_C TBool operator==(const CSuplVersion& other) const; + +private: + CSuplVersion(); + void ConstructL(); + +public: + TInt iMaj; + TInt iMin; + TInt iServind; + }; + +/** + * NMR Element for GSM Cell Info + */ +NONSHARABLE_CLASS(TSuplGsmNmrElement) + { +public: + TInt iARFCN; // (0..1023) + TInt iBSIC; // (0..63) + TInt iRxLev; // (0..63) + }; + + +/** + * Supl GSM Cell Info + */ +NONSHARABLE_CLASS(CSuplGsmCellInfo) : public CBase + { +public: + IMPORT_C static CSuplGsmCellInfo* NewL(); + IMPORT_C ~CSuplGsmCellInfo(); + +private: + CSuplGsmCellInfo(); + void ConstructL(); + +public: + TInt iRefMCC; // (0..999), -- Mobile Country Code + TInt iRefMNC; // (0..999), -- Mobile Network Code + TInt iRefLAC; // (0..65535), -- Location area code + TInt iRefCI; // (0..65535), -- Cell identity + TInt iNMR; // indicates number of NMR elements (0..15) + TSuplGsmNmrElement iNmrElements[15]; // optional + TInt iTA; // (0..255) OPTIONAL, --Timing Advance + }; + + +/** + * Supl CDMA Cell Info + */ +NONSHARABLE_CLASS(CSuplCdmaCellInfo) : public CBase + { +public: + IMPORT_C static CSuplCdmaCellInfo* NewL(); + IMPORT_C ~CSuplCdmaCellInfo(); + +private: + CSuplCdmaCellInfo(); + void ConstructL(); + +public: + TInt iRefNID; // (0..65535), -- Network Id + TInt iRefSID; // (0..32767), -- System Id + TInt iRefBASEID; // (0..65535), -- Base Station Id + TInt iRefBASELAT; // (0..4194303),-- Base Station Latitude + TInt iReBASELONG; // (0..8388607),-- Base Station Longitude + TInt iRefREFPN; // (0..511), -- Base Station PN Code + TInt iRefWeekNumber; // (0..65535), -- GPS Week Number + TInt iRefSeconds; // (0..4194303) -- GPS Seconds + }; + +/** + * Supl WCDMA Cell Info + */ +NONSHARABLE_CLASS(CSuplWcdmaCellInfo) : public CBase + { +public: + IMPORT_C static CSuplWcdmaCellInfo* NewL(); + IMPORT_C ~CSuplWcdmaCellInfo(); + +private: + CSuplWcdmaCellInfo(); + void ConstructL(); + +public: + TInt iRefMCC; // (0..999), -- Mobile Country Code + TInt iRefMNC; // (0..999), -- Mobile Network Code + TInt iRefUC; // (0..268435455), -- Cell identity + // iRrequencyInfo FrequencyInfo OPTIONAL, + // TUint16 iPrimaryScramblingCode // (0..511) OPTIONAL, + // CSuplMeasureResultsList iMeasuredResultsList // OPTIONAL, + }; + +/** + * Supl Location Type + */ +typedef TUint32 TSuplLocationType; +enum _TSuplLocationType + { + ESuplLocationTypeGsm, + ESuplLocationTypeCdma, + ESuplLocationTypeWcdma, + ESuplLocationTypeLimit + }; + +/** + * Supl Location Status + */ +typedef TUint32 TSuplLocationStatus; +enum _TSuplLocationStatus + { + ESuplLocStatusStale, + ESuplLocStatusCurrent, + ESuplLocStatusUnknown + }; + +/** + * Supl Location ID + */ +NONSHARABLE_CLASS(CSuplLocationId) : public CBase + { +public: + IMPORT_C static CSuplLocationId* NewL(TSuplLocationType aType); + IMPORT_C ~CSuplLocationId(); + +private: + CSuplLocationId(TSuplLocationType aType); + void ConstructL(); + +public: + TSuplLocationType iType; + TSuplLocationStatus iStatus; + + CSuplGsmCellInfo* iGsmCellInfo; + CSuplCdmaCellInfo* iCdmaCellInfo; + CSuplWcdmaCellInfo* iWcdmaCellInfo; + }; + + +#endif // LBS_SUPL_MESSAGE_COMMON_H + + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplpos.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplpos.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,110 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_POS_H +#define LBS_SUPL_POS_H + +#include "suplmessagebase.h" +#include "suplpospayload.h" +#include + +// forward declarations +class ASN1PERDecodeBuffer; +class ASN1T_PDU; +class ASN1C_PDU; + + +/** +Encapsulation for outgoing/received SUPL POS messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplPos) : public CSuplMessageBase + { +public: + IMPORT_C static CSuplPos* NewL(TBool aIsOutgoingMessage); + IMPORT_C static CSuplPos* NewLC(TBool aIsOutgoingMessage); + +public: + virtual ~CSuplPos(); + +public: + + /** Set the velocity parameter (for outgoing messages) */ + IMPORT_C TInt SetVelocity(const TPositionInfoBase& aPosInfo); + + /** Assigns the payload RRLP message (for outgoing messages) */ + IMPORT_C void SetPosPayload(CSuplPosPayload* aPayload); + + /** Returns ETrue if the position parameter is present (for received messages) */ + IMPORT_C TBool VelocityPresent(); + + /** Populates aPosInfo according to the velocity parameter (for received messages) */ + IMPORT_C TInt GetVelocity(TPositionInfoBase& aPosInfo); + + /** Returns the positioning payload (for received messages). + The calling method becomes responsible for destruction of the pos payload. */ + IMPORT_C CSuplPosPayload* PosPayload(); + +public: + + /** Encodes the SUPL POS message to the passed buffer + Called by CSuplMessageBase::EncodeToL() and not intended for DLL export */ + TInt EncodePosPayloadL(); + + /** Decodes the content of the positioning payload (for received messages) + Called by CSuplAsn1DecoderImpl::DecodeL() and not intended for DLL export */ + void DecodePosPayloadL(TInt& aError); + + void LogPayload(); + +private: + /** Constructor */ + CSuplPos(TBool aIsOutgoingMessage); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CSuplPos(const CSuplPos&); + + /** Prohibit assigment operator */ + CSuplPos& operator= (const CSuplPos&); + +private: + + // converts speed from encoded value N to meters per second. + TReal32 ConvertHorSpeedToMetersPerSecond(TUint aSpeed); + + // converts speed accuracy from encoded value N to meters per second. + TReal32 ConvertHorSpeedAccuracyToMetersPerSecond(TUint aSpeedAccuracy); + +private: + + /** The positioning payload */ + CSuplPosPayload* iPosPayload; + + /** Objects used in decoding of the positioning payload */ + ASN1PERDecodeBuffer* iDecodeBuffer; + ASN1T_PDU* iPayloadData; + ASN1C_PDU* iPayloadPdu; + }; + +#endif // LBS_SUPL_POS_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplposinit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplposinit.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,73 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_POS_INIT_H +#define LBS_SUPL_POS_INIT_H + +#include "suplmessagebase.h" +#include +#include + + +/** +Encapsulation for received SUPL POS INIT messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplPosInit) : public CSuplMessageBase + { +public: + IMPORT_C static CSuplPosInit* NewL(); + +public: + virtual ~CSuplPosInit(); + +public: + + /** Set the capabilities parameter */ + IMPORT_C TInt SetCapabilities(const TLbsNetPosCapabilities& aCapabilities); + + /** Set the requested assistance data parameter */ + IMPORT_C TInt SetRequestedAssistanceData(const TLbsAsistanceDataGroup& aDataReqMask); + + /** Set the location ID parameter */ + IMPORT_C TInt SetLocationId(const CSuplLocationId& aLocationId); + + /** Set the Position parameter */ + IMPORT_C TInt SetPosition(const TPositionInfoBase& aPosInfo); + + /** Set the hash of the received SUPL INIT */ + IMPORT_C TInt SetVer(const TDesC8& aVer); + +private: + /** Constructor */ + CSuplPosInit(); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CSuplPosInit(const CSuplPosInit&); + + /** Prohibit assigment operator */ + CSuplPosInit& operator= (const CSuplPosInit&); + }; + +#endif // LBS_SUPL_POS_INIT_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplpospayload.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplpospayload.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,91 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_POS_PAYLOAD_H +#define LBS_SUPL_POS_PAYLOAD_H + +#include + + +/** +CSuplPosPayload is an abstract class providing a base definition for SUPL positioning +payload messages either received or under construction for sending. SUPL supports +positioning using the RRLP, TIA-801 and RRC protocols. This reference SUPL +Protocol Manager implementation supports only the RRLP positioning protocol. + +Concrete classes derived from this class represent each of the supported +positioning protocol message types, and provide methods for accessing and setting +their parameters. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplPosPayload) : public CBase + { +public: + + /** Pos Payload identifiers */ + typedef TUint32 TSuplPosPayloadType; + enum _TSuplPosPayloadType + { + ERrlpAssistanceData = 0, + ERrlpAssistanceDataAck, + ERrlpMeasurePositionReq, + ERrlpMeasurePositionResp, + ERrlpProtocolError, + + EPosPayloadMessageTypeLimit + }; + +protected: + CSuplPosPayload(TSuplPosPayloadType aType, TBool aIsOutgoingMsg); + +public: + virtual ~CSuplPosPayload(); + +public: + + /** Returns the message type */ + IMPORT_C CSuplPosPayload::TSuplPosPayloadType MessageType(); + + /** Decodes a pos payload and returns a CSuplPosPayload object containing the decoded payload */ + IMPORT_C static CSuplPosPayload* DecodePosPayloadL(const HBufC8* aPosPayload, TInt& aError); + + /** Encode a populated outgoing message */ + virtual TInt EncodeToL(TPtr8& aBuf); + + /** Prints the content of the data structure to the logger */ + virtual void LogMessageContent(); + +private: + + /** Prohibit copy constructor */ + CSuplPosPayload(const CSuplPosPayload&); + + /** Prohibit assigment operator */ + CSuplPosPayload& operator= (const CSuplPosPayload&); + +protected: + + /** Message type identifiers */ + TSuplPosPayloadType iMessageType; + TBool iIsOutgoingMessage; + }; + +#endif // LBS_SUPL_POS_PAYLOAD_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplresponse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplresponse.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,66 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_RESPONSE_H +#define LBS_SUPL_RESPONSE_H + +#include "suplmessagebase.h" +#include + + +/** +Encapsulation for received SUPL RESPONSE messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplResponse) : public CSuplMessageBase + { +public: + IMPORT_C static CSuplResponse* NewL(); + +public: + virtual ~CSuplResponse(); + +public: + + /** Populates aMethod according to the INIT message */ + IMPORT_C TInt GetPosMethod(TLbsNetPosRequestMethod& aMethod); + + /** Returns ETrue if the SlpAddress parameter is present */ + IMPORT_C TBool SlpAddressPresent(); + + /** Populates aAddress with the SLP address */ + IMPORT_C TInt GetSlpAddress(CSuplSlpAddress& aAddress); + +private: + /** Constructor */ + CSuplResponse(); + + /** second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CSuplResponse(const CSuplResponse&); + + /** Prohibit assigment operator */ + CSuplResponse& operator= (const CSuplResponse&); + }; + +#endif // LBS_SUPL_RESPONSE_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplrrlpasn1common.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplrrlpasn1common.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,59 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef SUPL_RRLP_ASN1_COMMON +#define SUPL_RRLP_ASN1_COMMON + +/** +Constants used in the encoding of position values. + +@see CSuplMessageBase::PopulatePosition() +*/ +const TReal KLbsLatitudeConst = 93206.7555555556; // 2^23 / 90 +const TReal KLbsLongitudeConst = 46603.3777777778; // 2^24 / 360 +const TInt KLbsMaxAltitude = 32767; // 2^15 - 1 + +/** +Constants used in velocity conversion +1 meter per second = 3.6 kilometers per hour + +@see CSuplMessageBase::PopulatePosition() +*/ +const TReal KLbsMpsKmphConstant = 3.6; + +/** +Constants used in encoding of uncertainty data + +@see CSuplStart::Uncertainty() +@see CSuplStart::UncertaintyAltitude() +*/ +const TReal KLbsLogOnePointOne = 0.095310179804324860043952123280765; +const TReal KLbsLogOnePointZeroTwoFive = 0.02469261259037150101430767543669; +const TInt KLbsMaxUncert = 127; + +/** +Number of milliseconds in a second + +@see CSuplStart::SetQoP +*/ +const TInt KLbsMilliSeconds = 1000000; + + +#endif // SUPL_RRLP_ASN1_COMMON diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplstart.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/inc/suplstart.h Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,65 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ +#ifndef LBS_SUPL_START_H +#define LBS_SUPL_START_H + +#include "suplmessagebase.h" +#include + + +/** +Encapsulation for received SUPL START messages. + +@internalTechnology +*/ +NONSHARABLE_CLASS(CSuplStart) : public CSuplMessageBase + { +public: + IMPORT_C static CSuplStart* NewL(); + IMPORT_C static CSuplStart* NewLC(); + virtual ~CSuplStart(); + +public: + + /** Set the capabilities parameter */ + IMPORT_C TInt SetCapabilities(TLbsNetPosCapabilities& aCapabilities); + + /** Set the location ID parameter */ + IMPORT_C TInt SetLocationId(const CSuplLocationId& aLocationId); + + /** Set the QoP parameter */ + IMPORT_C TInt SetQoP(TLbsNetPosRequestQuality& aQuality); + +private: + /** Constructor */ + CSuplStart(); + + /** Second stage constructor */ + void ConstructL(); + + /** Prohibit copy constructor */ + CSuplStart(const CSuplStart&); + + /** Prohibit assigment operator */ + CSuplStart& operator= (const CSuplStart&); + }; + +#endif // LBS_SUPL_START_H diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpassistancedata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpassistancedata.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,182 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "rrlpassistancedata.h" +#include +#include +#include "supldevloggermacros.h" + + +/** +Static Factory Constructor +*/ +EXPORT_C CRrlpAssistanceData* CRrlpAssistanceData::NewL() + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::NewL() Begin\n"); + CRrlpAssistanceData* self = new (ELeave) CRrlpAssistanceData(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CRrlpAssistanceData::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + + +/** +Private default constructor +*/ +CRrlpAssistanceData::CRrlpAssistanceData() + : CRrlpMessageBase(ERrlpAssistanceData, EFalse) + { + } + + +/** +Second stage constructor +*/ +void CRrlpAssistanceData::ConstructL() + { + } + + +/** +Destructor +*/ +CRrlpAssistanceData::~CRrlpAssistanceData() + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::~CRrlpAssistanceData() Begin\n"); + SUPLLOG(ELogP1, "CRrlpAssistanceData::~CRrlpAssistanceData() End\n"); + } + + +/** +AssistanceDataPresent() + +Indicates whether supported assistance data is present in the received message. +This implementation supports only receipt of GPS assistance data, hence this +method returns ETrue if GPS assistance data is present in the received content. + +@return ETrue if valid assistance data is present in the received message +*/ +EXPORT_C TBool CRrlpAssistanceData::AssistanceDataPresent() + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::AssistanceDataPresent() Begin\n"); + __ASSERT_DEBUG(iData != NULL, User::Invariant()); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->component.u.assistanceData != NULL, User::Invariant()); + + if (iData->component.u.assistanceData->m.gps_AssistDataPresent == 0) + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::AssistanceDataPresent(EFalse) End\n"); + return EFalse; + } + SUPLLOG(ELogP1, "CRrlpAssistanceData::AssistanceDataPresent(ETrue) End\n"); + return ETrue; + } + + +/** +BuildAssistanceData() + +@param aDataMask populated to indicate what assistance data exists +@param aData reference to assistance data builder object to populate with + received assistance data +@return KErrNotFound if gps assistance data is not present in the received message, + KErrNone otherwise +*/ +EXPORT_C TInt CRrlpAssistanceData::BuildAssistanceData(TLbsAsistanceDataGroup& aDataMask, RLbsAssistanceDataBuilderSet& aAssistanceDataBuilderSet) + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::BuildAssistanceData() Begin\n"); + __ASSERT_DEBUG(iData != NULL, User::Invariant()); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->component.u.assistanceData != NULL, User::Invariant()); + + + // return immediately if no gps assistance data present + if (iData->component.u.assistanceData->m.gps_AssistDataPresent == 0) + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::BuildAssistanceData() End (no assistance data available)\n"); + return KErrNotFound; + } + + // pointer to the received/decoded GPS Assistance Data element + ASN1T_ControlHeader& gpsData = iData->component.u.assistanceData->gps_AssistData.controlHeader; + + SUPLLOG(ELogP1, "CRrlpAssistanceData::BuildAssistanceData() End\n"); + return CRrlpMessageBase::BuildAssistanceData(aDataMask, aAssistanceDataBuilderSet, gpsData); + } + + +/** +MoreAssDataToBeSent() + +@return ETrue if another RRLP Assistance Data Message is pending +*/ +EXPORT_C TBool CRrlpAssistanceData::MoreAssDataToBeSent() + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::MoreAssDataToBeSent() Begin\n"); + __ASSERT_DEBUG(iData != NULL, User::Invariant()); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->component.u.assistanceData != NULL, User::Invariant()); + + // check the optional field is present + if (iData->component.u.assistanceData->m.moreAssDataToBeSentPresent != 0) + { + // check the content of the field. + if (iData->component.u.assistanceData->moreAssDataToBeSent == 1) + { + SUPLLOG(ELogP1, "CRrlpAssistanceData::MoreAssDataToBeSent(ETrue) End\n"); + return ETrue; + } + } + + SUPLLOG(ELogP1, "CRrlpAssistanceData::MoreAssDataToBeSent(EFalse) End\n"); + return EFalse; + } + + +/** +GetExtendedReference() + +Populates aRrlpRef if Rel-5 Extended Reference is present in the received message + +@param aRrlpRef local copy of the session reference details +@return KErrNotFound if the extended reference parameters are not present, + KErrNone otherwise +*/ +TInt CRrlpAssistanceData::GetExtendedReference(TRrlpReference& aRrlpRef) + { + __ASSERT_DEBUG(iData->component.u.assistanceData != NULL, User::Invariant()); + + if (iData->component.u.assistanceData->m.rel5_AssistanceData_ExtensionPresent != 0) + { + aRrlpRef.aRel5EntendedRefPresent = ETrue; + aRrlpRef.aRel5SmlcCode = iData->component.u.assistanceData->rel5_AssistanceData_Extension.extended_reference.smlc_code; + aRrlpRef.aRel5TransactionId = iData->component.u.assistanceData->rel5_AssistanceData_Extension.extended_reference.transaction_ID; + } + else + { + return KErrNotFound; + } + return KErrNone; + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpassistancedataack.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpassistancedataack.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,73 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "rrlpassistancedataack.h" +#include "supldevloggermacros.h" + + +/** +Static factory constructor +*/ +EXPORT_C CRrlpAssistanceDataAck* CRrlpAssistanceDataAck::NewL() + { + SUPLLOG(ELogP1, "CRrlpAssistanceDataAck::NewL() Begin\n"); + CRrlpAssistanceDataAck* self = new (ELeave) CRrlpAssistanceDataAck(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CRrlpAssistanceDataAck::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + + +/** +Default constructor +*/ +CRrlpAssistanceDataAck::CRrlpAssistanceDataAck() + : CRrlpMessageBase(ERrlpAssistanceDataAck, ETrue) + { + } + + +/** +Second stage constructor +*/ +void CRrlpAssistanceDataAck::ConstructL() + { + // call the base class constructor to initialise content container + // and control objects + CRrlpMessageBase::ConstructL(); + + iData->component.t = T_RRLP_Component_assistanceDataAck; + } + + +/** +Destructor +*/ +CRrlpAssistanceDataAck::~CRrlpAssistanceDataAck() + { + SUPLLOG(ELogP1, "CRrlpAssistanceDataAck::~CRrlpAssistanceDataAck() Begin\n"); + SUPLLOG(ELogP1, "CRrlpAssistanceDataAck::~CRrlpAssistanceDataAck() End\n"); + } + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpmeasureposrequest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpmeasureposrequest.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,331 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "rrlpmeasureposrequest.h" +#include "supldevloggermacros.h" +#include "suplrrlpasn1common.h" +#include + +/** +Static factory constructor +*/ +EXPORT_C CRrlpMeasurePositionRequest* CRrlpMeasurePositionRequest::NewL() + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::NewL() Begin\n"); + CRrlpMeasurePositionRequest* self = new (ELeave) CRrlpMeasurePositionRequest(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +/** +Default constructor +*/ +CRrlpMeasurePositionRequest::CRrlpMeasurePositionRequest() + : CRrlpMessageBase(ERrlpMeasurePositionReq, EFalse) + { + } + +/** +Second stage constructor +*/ +void CRrlpMeasurePositionRequest::ConstructL() + { + } + +/** +Destructor +*/ +CRrlpMeasurePositionRequest::~CRrlpMeasurePositionRequest() + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::~CRrlpMeasurePositionRequest() Begin\n"); + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::~CRrlpMeasurePositionRequest() End\n"); + } + +/** +PositionInstruct() + +Populates the Requested Positioning Methods and Quality according to the +Positioning Instructions component of the Measure Position Request message. + +Note that the field Multiple Sets is ignored (indicates if multiple +information sets may be sent if the device supports this GaNSS feature. + +Note also that Environment Characterization component is also ignored. This +relates to expected multipath and NLOS in the current area. + +@param aQuality QoP, populated as per received PositionInstruction parameters +@param aMethod Request method, populated according to received PositionInstruction parameters +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMeasurePositionRequest::GetPositionInstruct(TLbsNetPosRequestQuality& aQuality, TLbsNetPosRequestMethod& aMethod) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::PositionInstruct() Begin\n"); + __ASSERT_DEBUG(iData->component.u.msrPositionReq != NULL, User::Invariant()); + + ASN1T_MsrPosition_Req* msgBody = iData->component.u.msrPositionReq; + + TInt index = 0; + TInt uncertainty = 0; + TBool uncertaintySpecified = ETrue; + TLbsNetPosMethod posMethods[4]; + + // populate aMethod according to requested positioning methods + TBool gpsSupported = (msgBody->positionInstruct.positionMethod != PositionMethod::eotd); + TBool eotdSupported = (msgBody->positionInstruct.positionMethod != PositionMethod::gps); + + // build an array of requested pos methods, and set the uncertainty value + switch (msgBody->positionInstruct.methodType.t) + { + case T_MethodType_msAssisted: + if (gpsSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + if (eotdSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + //Accuracy is an optional parameter in the case of TA + if (msgBody->positionInstruct.methodType.u.msAssisted->m.accuracyPresent) + { + uncertainty = msgBody->positionInstruct.methodType.u.msAssisted->accuracy; + } + else + { + //if accuracy is not being specified + uncertaintySpecified = EFalse; + } + break; + + case T_MethodType_msBased: + if (gpsSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + if (eotdSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + + uncertainty = msgBody->positionInstruct.methodType.u.msBased; + break; + + case T_MethodType_msBasedPref: + if (gpsSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++index; + posMethods[index].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + if (eotdSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++index; + posMethods[index].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + uncertainty = msgBody->positionInstruct.methodType.u.msBasedPref; + break; + + case T_MethodType_msAssistedPref: + if (gpsSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++index; + posMethods[index].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + if (eotdSupported) + { + posMethods[index].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++index; + posMethods[index].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++index; + } + uncertainty = msgBody->positionInstruct.methodType.u.msAssistedPref; + break; + + default: + __ASSERT_DEBUG(0, User::Invariant()); + return KErrCorrupt; + } + + // populate the return pos method array + // index now indicates number of pos methods in the array + TInt err = aMethod.SetPosMethods(posMethods, index); + if (KErrNone != err) + { + return err; + } + + // set the uncertainty values + if (uncertaintySpecified) + { + TReal32 uncertMeters = UncertaintyToMeters(uncertainty); + aQuality.SetMinHorizontalAccuracy(uncertMeters); + aQuality.SetMinVerticalAccuracy(uncertMeters); + } + else + { + // Set accuracy to NaN to prompt LBS to use accuracies from its pre-configured + // profiles if available. + TRealX nan; + nan.SetNaN(); + aQuality.SetMinHorizontalAccuracy(nan); + aQuality.SetMinVerticalAccuracy(nan); + } + + // set the maximum fix time + TInt fixTimeSec; + fixTimeSec = 1 << msgBody->positionInstruct.measureResponseTime; + TTimeIntervalMicroSeconds timeMs(fixTimeSec * KLbsMilliSeconds); + aQuality.SetMaxFixTime(timeMs); + + // indicate if GPS Timing Of Cell Frames data has been requested + // see ASN1T_Rel98_MsrPosition_Req_Extension + if (msgBody->m.rel98_MsrPosition_Req_extensionPresent != 0 + && msgBody->rel98_MsrPosition_Req_extension.m.gpsTimeAssistanceMeasurementRequestPresent != 0) + { + aMethod.SetGpsTimingOfCellFramesRequested(ETrue); + } + + // no RRLP component to populate the max fix age parameter. + + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::PositionInstruct() End\n"); + return KErrNone; + } + +/** +UncertaintyToMeters() + +Converts from uncertainty code to meters, as defined in 3GPP TS 23.032: +uncertainty r = C( (1+x)^k - 1 ) + +r = uncertainty in meters +C = 10; +x = 0.1 +k = uncertainty code + +@param aUncertainty uncertainty value k, as per the above formula +@return TReal32 uncertainty in meters +*/ +TReal32 CRrlpMeasurePositionRequest::UncertaintyToMeters(TInt aUncertainty) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::UncertaintyToMeters() Begin\n"); + TReal64 r; + TReal64 xPow; + Math::Pow(xPow, 1.1, aUncertainty); + r = (xPow-1)*10; + + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::UncertaintyToMeters() End\n"); + return (TReal32)r; + } + +/** +AssistanceDataPresent() + +Indicates whether supported assistance data is present in the received message. +This implementation supports only receipt of GPS assistance data, hence this +method returns ETrue if GPS assistance data is present in the received content. + +@return ETrue if valid assistance data is present in the received message +*/ +EXPORT_C TBool CRrlpMeasurePositionRequest::AssistanceDataPresent() + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::AssistanceDataPresent() Begin\n"); + __ASSERT_DEBUG(iData != NULL, User::Invariant()); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->component.u.msrPositionReq != NULL, User::Invariant()); + + if (iData->component.u.msrPositionReq->m.gps_AssistDataPresent == 0) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::AssistanceDataPresent(EFalse) End\n"); + return EFalse; + } + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::AssistanceDataPresent(ETrue) End\n"); + return ETrue; + } + +/** +BuildAssistanceData() + +@param aDataMask populated to indicate what assistance data exists +@param aData reference to assistance data builder object to populate with + received assistance data +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMeasurePositionRequest::BuildAssistanceData(TLbsAsistanceDataGroup& aDataMask, RLbsAssistanceDataBuilderSet& aAssistanceDataBuilderSet) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::BuildAssistanceData() Begin\n"); + __ASSERT_DEBUG(iData != NULL, User::Invariant()); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->component.u.msrPositionReq != NULL, User::Invariant()); + + + // return immediately if no gps assistance data present + if (iData->component.u.msrPositionReq->m.gps_AssistDataPresent == 0) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::BuildAssistanceData() End (no GPS data present)\n"); + return KErrNone; + } + + // pointer to the GPS Assistance Data component + ASN1T_ControlHeader& gpsData = iData->component.u.msrPositionReq->gps_AssistData.controlHeader; + + SUPLLOG(ELogP1, "CRrlpMeasurePositionRequest::BuildAssistanceData() End\n"); + return CRrlpMessageBase::BuildAssistanceData(aDataMask, aAssistanceDataBuilderSet, gpsData); + } + + +/** +GetExtendedReference() + +Populates aRrlpRef if Rel-5 Extended Reference is present in the received message + +@param aRrlpRef local copy of the session reference details +@return KErrNotFound if the extended reference parameters are not present, + KErrNone otherwise +*/ +TInt CRrlpMeasurePositionRequest::GetExtendedReference(TRrlpReference& aRrlpRef) + { + __ASSERT_DEBUG(iData->component.u.msrPositionReq != NULL, User::Invariant()); + + if (iData->component.u.msrPositionReq->m.rel5_MsrPosition_Req_extensionPresent != 0) + { + aRrlpRef.aRel5EntendedRefPresent = ETrue; + aRrlpRef.aRel5SmlcCode = iData->component.u.msrPositionReq->rel5_MsrPosition_Req_extension.extended_reference.smlc_code; + aRrlpRef.aRel5TransactionId = iData->component.u.msrPositionReq->rel5_MsrPosition_Req_extension.extended_reference.transaction_ID; + } + else + { + return KErrNotFound; + } + return KErrNone; + } diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpmeasureposresponse.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpmeasureposresponse.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,724 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "rrlpmeasureposresponse.h" +#include "supldevloggermacros.h" +#include "suplrrlpasn1common.h" + +#include +#include +#include + +/* +Modulus used in conversion of GPS TOW in GPS Measurement Information Element. +*/ +const TInt KLbsTowMod = 14400000; + + +/** +CRrlpMeasurePositionResponse + +Class for building an outgoing RRLP Measure Position Response Message +Translates content of passed LBS defined data structures to data encoded as per +the RRLP specification 3GPP 44.031 v5.12 and related documents. +Provides a mechanism to encode the data to a target buffer as an ASN1 PER encoded +data stream + + +The RRLP Measure Position Repsonse message consists of the following components: + +Multiple Sets (optional): + allows the mobile terminal to specify the number of sets of location or + measurement datum included in this message. This is not used by Symbian LBS + and is left absent, indicating a single measurement set is included. + +Reference BTS Identity Element (optional): + Identifies the Base Transceiver Stations used in the calculation of position. + This element is conditional to the number of reference BTSs. It is mandatory, + if there is more than one reference BTS, and optional otherwise. If this + element is not included, the Reference BTS, used in other elements, is the + current serving BTS of MS. If this element is included, the BTSs defined here + are used as Reference BTSs in all other elements. + Currently not included in this implementation. + +E-OTD Measurement Information (optional): + Provides OTD measurements of signals sent from the reference and neighbor base + stations. Mandatory if E-OTD is the agreed positioning method, omitted otherwise. + Symbian LBS currently does not support E-OTD positioning, so this component is + omitted. + +Location Information (optional): + The purpose of Location Information element is to provide the location + estimate from the MS to the network, if the MS is capable of determining its + own position. Optionally, the element may contain the velocity parameters + computed by the MS. + + This element is populated via calls to the SetLocationInformation() API + +GPS Measurement Information (optional): + The purpose of the GPS Measurement Information element is to provide GPS + measurement information from the MS to the SMLC. This information includes + the measurements of code phase and Doppler, which enables the network-based + GPS method where position is computed in the SMLC. + + This element is populated via a call to the SetMeasurementInformation() API + +Location Information Error (optional): + The purpose of Location Information Error element is to provide the indication + of error and the reason for it, when the MS can not perform the required + location or the network can not determine the position estimate. The element + may also indicate what further assistance data may be needed by the target MS + to produce a successful location estimate or location measurements. + + This element is populated via a call to the SetLocationError() APIs + +GPS Time Assistance Measurements (optional): + This IE contains measurements that are used to define an accurate relation + between GSM and GPS time or to provide additional GPS TOW information for MS + Assisted A-GPS. + +Extended Reference (optional): + This IE shall be included in any Measure Position Response if and only if an + Extended Reference IE was received in the corresponding previous Measure + Position Request message. + + This element is populated via a call to the SetReference() API. + + +Uplink RRLP Pseudo Segmentation Indication (optional): + This element is included by the MS when up-link RRLP pseudo-segmentation is used. + In the first segment, 'first of many' is indicated and in the second 'second of + many' is indicated. + This implementation does not use up-link pseudo-segmentation hence this component + is not included. + +*/ + +/** +Static factory constructor +*/ +EXPORT_C CRrlpMeasurePositionResponse* CRrlpMeasurePositionResponse::NewL() + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::NewL() Begin\n"); + CRrlpMeasurePositionResponse* self = CRrlpMeasurePositionResponse::NewLC(); + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +/** +Static factory constructor +*/ +EXPORT_C CRrlpMeasurePositionResponse* CRrlpMeasurePositionResponse::NewLC() + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::NewLC() Begin\n"); + CRrlpMeasurePositionResponse* self = new (ELeave) CRrlpMeasurePositionResponse(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::NewLC() End\n"); + return self; + } + +/** +Default constructor +*/ +CRrlpMeasurePositionResponse::CRrlpMeasurePositionResponse() + : CRrlpMessageBase(ERrlpMeasurePositionResp, ETrue) + { + } + +/** +Second stage constructor +*/ +void CRrlpMeasurePositionResponse::ConstructL() + { + // outgoing message - call base class ConstructL to create data structures. + CRrlpMessageBase::ConstructL(); + + // local reference to context object + OSCTXT* pctxt = iControl->getCtxtPtr(); + + iData->component.t = T_RRLP_Component_msrPositionRsp; + iData->component.u.msrPositionRsp = (ASN1T_MsrPosition_Rsp*)rtxMemAllocZ(pctxt, sizeof(ASN1T_MsrPosition_Rsp)); + LeaveIfAllocErrorL(); + } + +/** +Destructor +*/ +CRrlpMeasurePositionResponse::~CRrlpMeasurePositionResponse() + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::~CRrlpMeasurePositionResponse() Begin\n"); + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::~CRrlpMeasurePositionResponse() End\n"); + } + + +/** +SetLocationInformation() + +Sets the content of the location information component of the RRLP Measure +Position Response Message. + +RRLP Location Information component consists of the following: + +Reference Frame (mandatory): + This field specifies the reference BTS Reference Frame number during which + the location estimate was measured. This information is not available at the + Protocol Module, hence this is set to a value which is ignored by the SMLC. + +GPS TOW (optional): + This field specifies the GPS TOW for which the location estimate is valid, + rounded down to the nearest millisecond unit. This field is optional but + shall be included if GPS Time Assistance Measurements are included. + Currently omitted in this implementation. + +Fix Type (mandatory) + This field contains an indication as to the type of measurements performed + by the MS: 2D or 3D. + Set to 3D if altitude information is available, 2D otherwise. + +Position Estimate (mandatory) + This field contains the calculated position estimate in the format defined + in 3GPP TS 23.032. The allowed shapes are ellipsoid Point, ellipsoid point + with uncertainty circle, ellipsoid point with uncertainty ellipse, ellipsoid + point with altitude and uncertainty ellipsoid. + + +@param aPosInfo reference to the reported position data from LBS +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMeasurePositionResponse::SetLocationInformation(TPositionInfoBase& aPosInfo) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetLocationInformation() Begin\n"); + __ASSERT_DEBUG(iData->component.u.msrPositionRsp != NULL, User::Invariant()); + + ASN1T_MsrPosition_Rsp* msgBody = iData->component.u.msrPositionRsp; + + // handle Position Info class type + if (aPosInfo.PositionClassType() & EPositionInfoClass) + { + TPositionInfo& posInfo = reinterpret_cast (aPosInfo); + + // the position + TPosition position; + posInfo.GetPosition(position); + + // indicate that location information is present + msgBody->m.locationInfoPresent = 1; + + // BTS Reference Frame (mandatory) 0-65535 - however is ignored if + // is in the range 42432..65535 + // In this case GPS TOW should be provided if available. Which it is not. + msgBody->locationInfo.refFrame = 65535; + + // GPS Time Of Week (optional) should be included if GPS Time Assistance + // Measurements are included in the Measure Position Response, or if the + // BTS Reference Frame is in the "ignore" range. Not available. + msgBody->locationInfo.m.gpsTOWPresent = 0; + + // Position Estimate + // ASN1T_Ext_GeographicalInformation is a 20 byte array, populated as + // described in 3GPP 23.032. + + // Latitude/Longitude description is common to all supported position types + // Latitude is 23 bits of value and 1 bit describing direction (0 = north, 1 = south) + TReal64 latitudeDegrees = position.Latitude(); + TInt latitudeEncoded; + TBool isSouth = EFalse; + if (latitudeDegrees < 0) + { + latitudeDegrees *= -1; + isSouth = ETrue; + } + + latitudeEncoded = latitudeDegrees * KLbsLatitudeConst; // * 2^23 / 90 + if (isSouth) + { + // set the 24th bit + latitudeEncoded |= KBit23; + } + + // Longitude is 24 bit 2's complimentary binary + TReal64 longitudeDegrees = position.Longitude(); + TInt longitudeEncoded; + TBool isNegative = EFalse; + if (longitudeDegrees < 0) + { + longitudeDegrees *= -1; + isNegative = ETrue; + } + + longitudeEncoded = longitudeDegrees * 16777216 / 360; // * 2^24 / 360 + if (isNegative) + { + // invert and add 1 for 2's complimentary binary + longitudeEncoded = ~longitudeEncoded; + longitudeEncoded += 1; + } + + // insert into the octet array + const TInt bottom8bits = 255; + msgBody->locationInfo.posEstimate.data[1] = (latitudeEncoded >> 16) & bottom8bits; + msgBody->locationInfo.posEstimate.data[2] = (latitudeEncoded >> 8) & bottom8bits; + msgBody->locationInfo.posEstimate.data[3] = (latitudeEncoded) & bottom8bits; + + msgBody->locationInfo.posEstimate.data[4] = (longitudeEncoded >> 16) & bottom8bits; + msgBody->locationInfo.posEstimate.data[5] = (longitudeEncoded >> 8) & bottom8bits; + msgBody->locationInfo.posEstimate.data[6] = (longitudeEncoded) & bottom8bits; + + // encode the horizontal uncertainty, if present; + TInt horizontalUncertaintyEncoded = 0; + if (position.HorizontalAccuracy() > 0) + { + horizontalUncertaintyEncoded = MetersToHorizontalUncertainty(position.HorizontalAccuracy()); + } + + // encode altitude if present in the position estimate: + TInt altitudeEncoded = 0; + TInt altitudeUncertaintyEncoded = 0; + if(!Math::IsNaN(position.Altitude())) + { + TBool isUp = ETrue; + TReal32 altitude = position.Altitude(); + if (altitude < 0) + { + isUp = EFalse; + altitude *= -1; + } + if (altitude > 32767) // = (2^15)-1 maximum size is 15 bits. + { + altitude = 32767; + } + + altitudeEncoded = altitude; + // 16th bit indicates direction of altitude, 1 indicates below surface + if (!isUp) + { + altitudeEncoded |= KBit15; + } + + // is vertical accuracy defined? + if (position.VerticalAccuracy() != 0) + { + altitudeUncertaintyEncoded = MetersToVerticalUncertainty(position.VerticalAccuracy()); + } + } // end of altitude conversion + + + // clear the first byte and set remaining content according to data available + if (altitudeEncoded) + { + // EEllipsoidPointWithAltitudeAndUncertaintyEllipsoid + msgBody->locationInfo.posEstimate.data[0] = EGeoInfoEllipsoidPointWithAltitudeAndUncertaintyEllipsoid<<4; + msgBody->locationInfo.posEstimate.data[7] = altitudeEncoded>>8; + msgBody->locationInfo.posEstimate.data[8] = altitudeEncoded; + msgBody->locationInfo.posEstimate.data[9] = horizontalUncertaintyEncoded; // semi-major axis + msgBody->locationInfo.posEstimate.data[10] = horizontalUncertaintyEncoded; // semi-major axis + msgBody->locationInfo.posEstimate.data[11] = 0; // orientation + msgBody->locationInfo.posEstimate.data[12] = altitudeUncertaintyEncoded; + msgBody->locationInfo.posEstimate.data[13] = 0; // confidence, 0 == "no information" + msgBody->locationInfo.posEstimate.numocts = 14; + + msgBody->locationInfo.fixType = FixType::threeDFix; + } + else if (horizontalUncertaintyEncoded) + { + // EEllipsoidPointWithUncertaintyCircle + msgBody->locationInfo.posEstimate.data[0] = EGeoInfoEllipsoidPointWithUncertaintyCircle<<4; + msgBody->locationInfo.posEstimate.data[7] = horizontalUncertaintyEncoded; + msgBody->locationInfo.posEstimate.numocts = 8; + + msgBody->locationInfo.fixType = FixType::twoDFix; + } + else + { + // EEllipsoidPoint + msgBody->locationInfo.posEstimate.data[0] = EGeoInfoEllipsoidPoint<<4; + msgBody->locationInfo.posEstimate.numocts = 7; + + msgBody->locationInfo.fixType = FixType::twoDFix; + } + } + else + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetLocationInformation() End (not a EPositionInfoClass)\n"); + return KErrNotSupported; + } + + // additional handling for extended satellite info + if (aPosInfo.PositionClassType() & EPositionExtendedSatelliteInfoClass) + { + TPositionExtendedSatelliteInfo& extSatInfo = reinterpret_cast (aPosInfo); + + // GPS Timing Measurements + TGpsTimingMeasurementData timingData; + if (KErrNone == extSatInfo.GetGpsTimingData(timingData)) + { + SetGpsTimingData(timingData); + } + } + + + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetLocationInformation() End\n"); + return KErrNone; + } + +/** +MetersToHorizontalUncertainty() + +Converts from meters to uncertainty code, as defined in 3GPP TS 23.032: +uncertainty r = C( (1+x)^k - 1 ) + +r = uncertainty in meters +C = 10; +x = 0.1 +k = uncertainty code + +hence k = ln(h/C + 1) / ln(1+x), limited to 7 bits +*/ +TInt CRrlpMeasurePositionResponse::MetersToHorizontalUncertainty(const TReal32& aDistance) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::MetersToHorizontalUncertainty() Begin\n"); + TReal uncert; + Math::Ln(uncert, (aDistance/10) + 1 ); + uncert /= KLbsLogOnePointOne; + if (uncert>KLbsMaxUncert) + { + uncert = KLbsMaxUncert; + } + + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::MetersToHorizontalUncertainty() End\n"); + return (TInt)uncert; + } + +/** +MetersToVerticalUncertainty() + +Converts from meters to uncertainty code, as defined in 3GPP TS 23.032: +uncertainty h = C( (1+x)^k - 1 ) + +h = uncertainty in meters +C = 45; +x = 0.025 +k = uncertainty code + +hence k = ln(h/C + 1) / ln(1+x), limited to 7 bits +*/ +TInt CRrlpMeasurePositionResponse::MetersToVerticalUncertainty(const TReal32& aDistance) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::MetersToVerticalUncertainty() Begin\n"); + TReal uncert; + Math::Ln(uncert, (aDistance/45) + 1 ); + uncert /= KLbsLogOnePointZeroTwoFive; + if (uncert>KLbsMaxUncert) + { + uncert = KLbsMaxUncert; + } + + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::MetersToVerticalUncertainty() End\n"); + return (TInt)uncert; + } + +/** +Sets measurement information + +@param aPosInfo reference to the reported position data from LBS +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMeasurePositionResponse::SetMeasurementInformation(const TPositionInfoBase& aPosInfo) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetMeasurementInformation() Begin\n"); + __ASSERT_DEBUG(iData->component.u.msrPositionRsp != NULL, User::Invariant()); + + ASN1T_MsrPosition_Rsp* msgBody = iData->component.u.msrPositionRsp; + + // handle Position Info class type + if ((aPosInfo.PositionClassType() & EPositionGpsMeasurementInfoClass) != 0) + { + const TPositionGpsMeasurementInfo& measurementInfo = reinterpret_cast (aPosInfo); + msgBody->m.gps_MeasureInfoPresent = 1; + + // only support the sending of a single set of GPS measurements. + ASN1C_SeqOfGPS_MsrSetElement msrSetArray(*iControl, msgBody->gps_MeasureInfo.gpsMsrSetList); + msrSetArray.init(); + ASN1T_GPS_MsrSetElement* gpsMsrSetElement = msrSetArray.NewElement(); + if (gpsMsrSetElement == NULL) + { + return KErrNoMemory; + } + + // LBS API does not provide optional Reference Frame information. + gpsMsrSetElement->m.refFramePresent = 0; + + // GPS Time Of Week - RRLP parameter is described as the least significant + // 24 bits of the GPS TOW. Further study indicates it is in fact the result + // of the TOW within a 4 hour window period (144000000ms). Therefore the + // value is calculated as GPS_TOW_MS mod 144000000. + TReal tow = 0; + Math::Mod(tow, measurementInfo.GpsTimeOfWeek(), KLbsTowMod); + gpsMsrSetElement->gpsTOW = tow; + + // build the array of measurements + ASN1C_SeqOfGPS_MsrElement msrElementArray(*iControl, gpsMsrSetElement->gps_msrList); + msrElementArray.init(); + + for (TInt i = 0; i < measurementInfo.NumMeasurements(); ++i) + { + TPositionGpsMeasurementData data; + if (measurementInfo.GetMeasurementData(i, data) == KErrNone) + { + ASN1T_GPS_MsrElement* gpsMsrElement = msrElementArray.NewElement(); + if (gpsMsrElement == NULL) + { + return KErrNoMemory; + } + + gpsMsrElement->satelliteID = data.SatelliteId(); + gpsMsrElement->cNo = data.CarrierNoiseRatio(); + gpsMsrElement->doppler = data.Doppler(); + gpsMsrElement->wholeChips = data.WholeGpsChips(); + gpsMsrElement->fracChips = data.FractionalGpsChips(); + gpsMsrElement->mpathIndic = data.MultiPathIndicator(); + gpsMsrElement->pseuRangeRMSErr = data.PseudoRangeRmsError(); + + msrElementArray.Append(gpsMsrElement); + } + } + msrSetArray.Append(gpsMsrSetElement); + + // append any GPS Timing Measurement Data + TGpsTimingMeasurementData timingData; + if (KErrNone == measurementInfo.GetGpsTimingData(timingData)) + { + SetGpsTimingData(timingData); + } + } + + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetMeasurementInformation() End\n"); + return KErrNone; + } + + +/** +SetLocationError() + +Sets Location Error element + +@param aLocError - location error +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMeasurePositionResponse::SetLocationError(TRrlpLocError aLocError) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetLocationError() Begin\n"); + SUPLLOG2(ELogP1, " - TRrlpLocError aLocError = %d", aLocError); + + __ASSERT_DEBUG(iData->component.u.msrPositionRsp != NULL, User::Invariant()); + ASN1T_MsrPosition_Rsp* msgBody = iData->component.u.msrPositionRsp; + msgBody->m.locationErrorPresent = 1; + msgBody->locationError.locErrorReason = aLocError; + + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetLocationError() End\n"); + return KErrNone; + } + + +/** +SetLocationError() + +Sets Location Error element with request for additional assistance data + +@see TRrlpLocError +@param aLocError - location error +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMeasurePositionResponse::SetLocationError(TRrlpLocError aLocError, const TLbsAsistanceDataGroup& aDataReqMask) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetLocationError() Begin\n"); + SUPLLOG2(ELogP1, " - TRrlpLocError aLocError = %d", aLocError); + SUPLLOG2(ELogP1, " - TLbsAsistanceDataGroup aDataReqMask = 0x%08X\n", aDataReqMask); + + __ASSERT_DEBUG(iData->component.u.msrPositionRsp != NULL, User::Invariant()); + ASN1T_MsrPosition_Rsp* msgBody = iData->component.u.msrPositionRsp; + msgBody->m.locationErrorPresent = 1; + msgBody->locationError.locErrorReason = aLocError; + + // Additional Assistance Data is encoded according to 3GPP TS 49.031, excluding + // the IEI and length octets. + if (aDataReqMask != EAssistanceDataNone) + { + msgBody->locationError.m.additionalAssistanceDataPresent = 1; + //ASN1T_AdditionalAssistanceData + msgBody->locationError.additionalAssistanceData.m.extensionContainerPresent = 0; + msgBody->locationError.additionalAssistanceData.m.gpsAssistanceDataPresent = 1; + + // short name reference + ASN1T_GPSAssistanceData& requestedData = msgBody->locationError.additionalAssistanceData.gpsAssistanceData; + + // ensure the data masks are clear and set number of octets to be sent + requestedData.data[0] = 0; + requestedData.data[1] = 0; + requestedData.numocts = 2; + + // set requested assistance types + // we do not request Ephemeris Extension or Ephemeris Extension Check or inform + // the SMLC of satellite specific information we already have. + // data is described by bit location, as per the following: + + // | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | + // octet 1 | H | G | F | E | D | C | B | A | + // octet 2 | P | O | N | M | L | K | J | I | + if (EAssistanceDataAquisitionAssistance & aDataReqMask) + { + // bit H + requestedData.data[0] |= 1<<7; + } + if (EAssistanceDataBadSatList & aDataReqMask) + { + // bit I + requestedData.data[1] |= 1; + } + if (EAssistanceDataNavigationModel & aDataReqMask) + { + // bit D + requestedData.data[0] |= 1<<3; + } + if (EAssistanceDataReferenceTime & aDataReqMask) + { + // bit G + requestedData.data[0] |= 1<<6; + } + if (EAssistanceDataIonosphericModel & aDataReqMask) + { + // bit C + requestedData.data[0] |= 1<<2; + } + if (EAssistanceDataDgpsCorrections & aDataReqMask) + { + // bit E + requestedData.data[0] |= 1<<4; + } + if (EAssistanceDataReferenceLocation & aDataReqMask) + { + // bit F + requestedData.data[0] |= 1<<5; + } + if (EAssistanceDataAlmanac & aDataReqMask) + { + // bit A + requestedData.data[0] |= 1; + } + if (EAssistanceDataPositioningGpsUtcModel & aDataReqMask) + { + // bit B + requestedData.data[0] |= 1<<1; + } + } + + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetLocationError() End\n"); + return KErrNone; + } + +/** +SetGpsTimingData() + +Sets GPS Fine Timing Data + +@see TGpsTimingMeasurementData +@param aTimingData - timing data +@return error indication, KErrNone otherwise +*/ +void CRrlpMeasurePositionResponse::SetGpsTimingData(const TGpsTimingMeasurementData& aTimingData) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetGpsTimingData() Begin\n"); + + // check that the timing structure contains GPS data + if (TGpsTimingMeasurementData::EGpsTimingDataTypeGsm != aTimingData.DataType()) + { + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetGpsTimingData() End Unsupported Data Type\n"); + return; + } + + __ASSERT_DEBUG(iData->component.u.msrPositionRsp != NULL, User::Invariant()); + ASN1T_MsrPosition_Rsp* msgBody = iData->component.u.msrPositionRsp; + + // mark r98 extension and timing measurements parameter present + msgBody->m.rel_98_MsrPosition_Rsp_ExtensionPresent = 1; + msgBody->rel_98_MsrPosition_Rsp_Extension.m.timeAssistanceMeasurementsPresent = 1; + + // reference to the data member to be populated + ASN1T_GPSTimeAssistanceMeasurements& measurements = msgBody->rel_98_MsrPosition_Rsp_Extension.timeAssistanceMeasurements; + + // populate the data structure. + measurements.referenceFrameMSB = aTimingData.ReferenceFrameMsb(); + if (aTimingData.GpsTowSubms() >= 0) + { + measurements.m.gpsTowSubmsPresent = 1; + measurements.gpsTowSubms = aTimingData.GpsTowSubms(); + } + if (aTimingData.DeltaTow() >= 0) + { + measurements.m.deltaTowPresent = 1; + measurements.deltaTow = aTimingData.DeltaTow(); + } + if (aTimingData.GpsReferenceTimeUncertainty() >= 0) + { + measurements.m.gpsReferenceTimeUncertaintyPresent = 1; + measurements.gpsReferenceTimeUncertainty = aTimingData.GpsReferenceTimeUncertainty(); + } + + SUPLLOG(ELogP1, "CRrlpMeasurePositionResponse::SetGpsTimingData() End\n"); + return; + } + + +/** +SetExtendedReference() + +Sets the extended reference parameters in the outgoing message, if they are set +in the passed container. + +@param aRrlpRef on return, populated with the session reference details +@return KErrNotFound if no extended reference data is present, + KErrNone otherwise +*/ +TInt CRrlpMeasurePositionResponse::SetExtendedReference(const TRrlpReference& aRrlpRef) + { + __ASSERT_DEBUG(iData->component.u.msrPositionRsp != NULL, User::Invariant()); + + // if present, populate the optional Rel-5 extended reference + if (aRrlpRef.aRel5EntendedRefPresent) + { + // mark the optional component present + iData->component.u.msrPositionRsp->m.rel_5_MsrPosition_Rsp_ExtensionPresent = 1; + iData->component.u.msrPositionRsp->rel_5_MsrPosition_Rsp_Extension.m.extended_referencePresent = 1; + ASN1T_Extended_reference* extendedRef = &iData->component.u.msrPositionRsp->rel_5_MsrPosition_Rsp_Extension.extended_reference; + extendedRef->smlc_code = aRrlpRef.aRel5SmlcCode; + extendedRef->transaction_ID = aRrlpRef.aRel5TransactionId; + } + else + { + return KErrNotFound; + } + + return KErrNone; + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpmessagebase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpmessagebase.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,1000 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "rrlpmessagebase.h" +#include "supldevloggermacros.h" + + +/** +Const definition for the 3D location with uncertainty identifier. +This is the form of location description allowed in RRLP for the +GPS Reference Location element. +*/ +const TUint K3DLocationWithUncertainty = 9; + + +/** +Maximun number of assistance data "elements" (be it almanac, +acquisition, etc) that can be passed on to LBS. If an RRLP +message contains more elements than the maximum, only the +first 32 are considered. +*/ +const TUint8 KAsn1RrlpMaxSatNumber = 32; + +/** +Const definition for multiplier to convert 0.08 second resolution to ms.. +The Reference Time field of the GPS Assistance Data element contains +a GPS Time Of Week (TOW) element, with resolution 0.08seconds. +The LBS Assistance Data object stores the TOW in ms. +*/ +const TUint KGpsTowMultiplier = 80; + +/** +Constructor +*/ +CRrlpMessageBase::CRrlpMessageBase(TSuplPosPayloadType aType, TBool aIsOutgoingMsg) + : CSuplPosPayload(aType, aIsOutgoingMsg) + { + } + + +/** +Second stage constructor + +Outgoing messages: constructs the data encapsulation and control objects. +Incoming message: no action +*/ +void CRrlpMessageBase::ConstructL() + { + if (iIsOutgoingMessage) + { + iData = new (ELeave) ASN1T_PDU(); + ASN1Context* context = new (ELeave) ASN1Context; + CleanupDeletePushL(context); + iControl = new (ELeave) ASN1C_PDU(*context, *iData); + // construction of iControl successful, pop context off the cleanup stack + CleanupStack::Pop(context); + } + } + + +/** +Destructor +*/ +CRrlpMessageBase::~CRrlpMessageBase() + { + SUPLLOG(ELogP1, "CRrlpMessageBase::~CRrlpMessageBase() Begin\n"); + delete iEncodeBuffer; + delete iData; + delete iControl; + // release the STDLIB resources associated with this thread + CloseSTDLIB(); + SUPLLOG(ELogP1, "CRrlpMessageBase::~CRrlpMessageBase() End\n"); + } + + +/** +SetDecodedData() + +Assign decoded ASN1 data, for received messages. +Takes ownership of passed objects. + +@param aData data structure containing decoded message parameters +@param aControl control structure associated with decoded data structure. +*/ +void CRrlpMessageBase::SetDecodedData(ASN1T_PDU* aData, ASN1C_PDU* aControl) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::SetDecodedData() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData == NULL, User::Invariant()); + __ASSERT_DEBUG(iControl == NULL, User::Invariant()); + iData = aData; + iControl = aControl; + SUPLLOG(ELogP1, "CRrlpMessageBase::SetDecodedData() End\n"); + } + + +/** +SetReference() + +Sets the RRLP session reference +Messages that contain the Rel-5 Extended Reference override the method +SetExtendedReference() to populate this content. + +The RRLP Reference, including the Rel-5 extended reference include the +following parameters + TInt aRefNum; // 0..7 + TBool aRel5EntendedRefPresent; + TInt aRel5SmlcCode; // 0..63 + TInt aRel5TransactionId; // 0..262143 + +@param aRrlpRef local copy of the session reference details +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMessageBase::SetReference(const TRrlpReference& aRrlpRef) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::SetReference() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData != NULL, User::Invariant()); + + iData->referenceNumber = aRrlpRef.aRefNum; + + TInt err = KErrNone; + err = SetExtendedReference(aRrlpRef); + if (err == KErrNotFound) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::SetReference() no extended reference present\n"); + } + + + SUPLLOG(ELogP1, "CRrlpMessageBase::SetReference() End\n"); + return KErrNone; + } + + +/** +SetExtendedReference() + +Overridden by derived classes representing messages that include rel-5 +extended reference. + +@param aRrlpRef local copy of the session reference details +@return error indication, KErrNone otherwise +*/ +TInt CRrlpMessageBase::SetExtendedReference(const TRrlpReference& /*aRrlpRef*/) + { + return KErrNone; + } + + +/** +Reference() + +Populates aRrlpRef with the session reference + +@param aRrlpRef on return, populated with the session reference details +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMessageBase::GetReference(TRrlpReference& aRrlpRef) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::Reference() Begin\n"); + __ASSERT_DEBUG(iData != NULL, User::Invariant()); + aRrlpRef.aRefNum = iData->referenceNumber; + + TInt err = KErrNone; + err = GetExtendedReference(aRrlpRef); + if (err == KErrNotFound) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::Reference() no extended reference present\n"); + } + + SUPLLOG(ELogP1, "CRrlpMessageBase::Reference() End\n"); + return KErrNone; + } + + +/** +GetExtendedReference() + +Overridden by derived classes representing messages that include rel-5 +extended reference. + +@param aRrlpRef local copy of the session reference details +@return KErrNotFound if the extended reference parameters are not present, + KErrNone otherwise +*/ +TInt CRrlpMessageBase::GetExtendedReference(TRrlpReference& /*aRrlpRef*/) + { + return KErrNotFound; + } + + +/** +EncodeToL() + +Encode a populated outgoing message to the specified buffer. + +@param aBuf buffer pointer +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpMessageBase::EncodeToL(TPtr8& aBuf) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::EncodeToL() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + + // buffer pointer, fixed max length + TUint8* msgBuf = (TUint8*)aBuf.Ptr(); + TInt maxLength = aBuf.MaxLength(); + + // construct the encode buffer control object + iEncodeBuffer = new (ELeave) ASN1PEREncodeBuffer (msgBuf, (unsigned int)maxLength, FALSE, (OSRTContext*)iControl->getContext()); + + // Encode the message to the buffer + TInt stat = KErrNone; + stat = iControl->EncodeTo(*iEncodeBuffer); + + TInt retval = KErrNone; + if (stat == 0) + { + // Set the length according to reported buffer length + TInt len = iEncodeBuffer->getMsgLen(); + aBuf.SetLength(len); + } + else + { + retval = ProcessAsn1Error(stat); + } + + delete iEncodeBuffer; + iEncodeBuffer = NULL; + + SUPLLOG(ELogP1, "CRrlpMessageBase::EncodeToL() End\n"); + return retval; + } + + +/** +BuildAssistanceData() + +@param aDataMask populated to indicate what assistance data has been received +@param aData reference to assistance data builder object to populate with + received assistance data +@param aGpsData the received/decoded gps assistance data RRLP element +@return error indication, KErrNone otherwise +*/ +TInt CRrlpMessageBase::BuildAssistanceData(TLbsAsistanceDataGroup& aDataMask, RLbsAssistanceDataBuilderSet& aAssistanceDataBuilderSet, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::BuildAssistanceData() Begin\n"); + // clear the data mask + aDataMask = EAssistanceDataNone; + + // Reference Time + if (aGpsData.m.referenceTimePresent) + { + SUPLLOG(ELogP1, " Reference Time received...\n"); + aDataMask |= EAssistanceDataReferenceTime; + + // Fetch a GpsReferenceTime data item. + RUEPositioningGpsReferenceTimeBuilder* gpsReferenceTimeBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(gpsReferenceTimeBuilder); + + WriteReferenceTimeData(gpsReferenceTimeBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + gpsReferenceTimeBuilder->SetTimeStamp(timeNow); + } + + // Reference Location + if (aGpsData.m.refLocationPresent) + { + SUPLLOG(ELogP1, " Reference Location received...\n"); + aDataMask |= EAssistanceDataReferenceLocation; + + // Fetch a ReferenceLocation data item. + RReferenceLocationBuilder* gpsReferenceLocationBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(gpsReferenceLocationBuilder); + + WriteReferenceLocationData(gpsReferenceLocationBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + gpsReferenceLocationBuilder->SetTimeStamp(timeNow); + } + + // DGPS Corrections + if (aGpsData.m.dgpsCorrectionsPresent) + { + SUPLLOG(ELogP1, " DGPS Corrections received, ignoring...\n"); + // never requested by LBS, no data builder available. Ignore. + } + + // Navigation Model + if (aGpsData.m.navigationModelPresent) + { + SUPLLOG(ELogP1, " Navigation Model received...\n"); + aDataMask |= EAssistanceDataNavigationModel; + + // Fetch a GpsNavigationModel data item. + RUEPositioningGpsNavigationModelBuilder* gpsNavigationModelBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(gpsNavigationModelBuilder); + + WriteNavigationModelData(gpsNavigationModelBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + gpsNavigationModelBuilder->SetTimeStamp(timeNow); + } + + // Ionospheric Model + if (aGpsData.m.ionosphericModelPresent) + { + SUPLLOG(ELogP1, " Ionospheric Model received...\n"); + aDataMask |= EAssistanceDataIonosphericModel; + + //Fetch a GpsIonosphericModel data item. + RUEPositioningGpsIonosphericModelBuilder* gpsIonosphericModelBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(gpsIonosphericModelBuilder); + + WriteIonosphericModelData(gpsIonosphericModelBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + gpsIonosphericModelBuilder->SetTimeStamp(timeNow); + } + + // UTC Model + if (aGpsData.m.utcModelPresent) + { + SUPLLOG(ELogP1, " UTC Model received...\n"); + aDataMask |= EAssistanceDataPositioningGpsUtcModel; + + //Fetch a GpsUTCModel data item. + RUEPositioningGpsUtcModelBuilder* gpsUtcModelBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(gpsUtcModelBuilder); + + WriteUtcModelData(gpsUtcModelBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + gpsUtcModelBuilder->SetTimeStamp(timeNow); + } + + // Almanac + if (aGpsData.m.almanacPresent) + { + SUPLLOG(ELogP1, " Almanac received...\n"); + aDataMask |= EAssistanceDataAlmanac; + + //Fetch a GpsAlmanacBuilder data builder. + RUEPositioningGpsAlmanacBuilder* gpsAlmanacBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(gpsAlmanacBuilder); + + WriteAlmanacData(gpsAlmanacBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + gpsAlmanacBuilder->SetTimeStamp(timeNow); + } + + // Acquisition Assistance + if (aGpsData.m.acquisAssistPresent) + { + SUPLLOG(ELogP1, " Aquisition Assistance received...\n"); + aDataMask |= EAssistanceDataAquisitionAssistance; + + //Fetch a GpsAcquisitionAssistance data builder. + RUEPositioningGpsAcquisitionAssistanceBuilder* gpsAcquisitionAssistanceBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(gpsAcquisitionAssistanceBuilder); + + WriteAcquisitionAssistanceData(gpsAcquisitionAssistanceBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + gpsAcquisitionAssistanceBuilder->SetTimeStamp(timeNow); + } + + // Real Time Integrity + if (aGpsData.m.realTimeIntegrityPresent) + { + SUPLLOG(ELogP1, " Real Time Integrity received...\n"); + aDataMask |= EAssistanceDataBadSatList; + + //Fetch a GpsBadSatList data item. + RBadSatListBuilder* badSatListBuilder; + aAssistanceDataBuilderSet.GetDataBuilder(badSatListBuilder); + + WriteRealTimeIntegrityData(badSatListBuilder, aGpsData); + + TTime timeNow; + timeNow.UniversalTime(); + badSatListBuilder->SetTimeStamp(timeNow); + } + + SUPLLOG(ELogP1, "CRrlpMessageBase::BuildAssistanceData() End\n"); + return KErrNone; + } + + +/** +WriteReferenceTimeData() + +Writes the recevieved GPS Assistance Data (Reference Time) to the Assistance +Data Builder. + +@param aReferenceTimeBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteReferenceTimeData(RUEPositioningGpsReferenceTimeBuilder* aReferenceTimeBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteReferenceTimeData() Begin\n"); + // GPS TIME elements + TUint gpsWeek = aGpsData.referenceTime.gpsTime.gpsWeek; + TUint gpsTow = aGpsData.referenceTime.gpsTime.gpsTOW23b * KGpsTowMultiplier; + aReferenceTimeBuilder->SetField(TUEPositioningGpsReferenceTime::EGpsWeek, gpsWeek); + aReferenceTimeBuilder->SetField(TUEPositioningGpsReferenceTime::EGpsTow1Msec, gpsTow); + + // GSM TIME elements (optional) + // Not currently supported by this implementation + // LBS assistance data builder support required. + + // GPS TOW ASSIST elements (optional) + if (aGpsData.referenceTime.m.gpsTowAssistPresent != 0) + { + RGpsTowAssistArrayBuilder towAssistArrayBuilder; + aReferenceTimeBuilder->GetArrayBuilder(TUEPositioningGpsReferenceTime::EGpsTowAssistArray, towAssistArrayBuilder); + + // array accessor + ASN1C_GPSTOWAssist towAssistArray(aGpsData.referenceTime.gpsTowAssist); + + TInt count = aGpsData.referenceTime.gpsTowAssist.count; + for (TInt i=0; isatelliteID; + TUint tlmMessage = towElement->tlmWord; + TBool alert = (towElement->alert !=0 ? ETrue : EFalse); + TBool antiSpoof = (towElement->antiSpoof !=0 ? ETrue : EFalse); + + towAssistBuilder.SetField(TGpsTowAssist::ESatID, satId); + towAssistBuilder.SetField(TGpsTowAssist::ETlmMessage, tlmMessage); + towAssistBuilder.SetField(TGpsTowAssist::EAlert, alert); + towAssistBuilder.SetField(TGpsTowAssist::EAntiSpoof, antiSpoof); + } + } + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteReferenceTimeData() End\n"); + } + + + +/** +WriteReferenceLocationData() + +Writes the recevieved GPS Assistance Data (Reference Location) to the Assistance +Data Builder. + +@param aReferenceLocationBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteReferenceLocationData(RReferenceLocationBuilder* aReferenceLocationBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteReferenceLocationData() Begin\n"); + // Allowed shape type is ellipsoid point with altitude and uncertainty ellipsoid + TUint shapeType = 0; + shapeType |= aGpsData.refLocation.threeDLocation.data[0]>>4; + + // handle latitude and longitude whatever the shape type + TUint latitude = 0; + latitude |= aGpsData.refLocation.threeDLocation.data[1]; + latitude = latitude<<8; + latitude |= aGpsData.refLocation.threeDLocation.data[2]; + latitude = latitude<<8; + latitude |= aGpsData.refLocation.threeDLocation.data[3]; + latitude &= 0x7FFFFF; // clear the sign of latitude bit. + + // latitude sign, 0 == north, 1 == south + TEllipsoidPointAltitudeEllipsoide::TLatitudeSign latitudeSign = TEllipsoidPointAltitudeEllipsoide::ENorth; + if ((aGpsData.refLocation.threeDLocation.data[1] & 128) != 0) + { + latitudeSign = TEllipsoidPointAltitudeEllipsoide::ESouth; + } + + TInt longitude = 0; + longitude |= aGpsData.refLocation.threeDLocation.data[4]; + longitude = longitude<<8; + longitude |= aGpsData.refLocation.threeDLocation.data[5]; + longitude = longitude<<8; + longitude |= aGpsData.refLocation.threeDLocation.data[6]; + + TUint altitude = 0; + altitude |= aGpsData.refLocation.threeDLocation.data[7]; + altitude = altitude<<8; + altitude |= aGpsData.refLocation.threeDLocation.data[8]; + + // handling of altitude and uncertainty dependant on shape type. + // note that RRLP specifies usage of 3D location with uncertainty, so + // no need to handle other types. + if (shapeType == K3DLocationWithUncertainty) + { + // altitude direction, 0 == above, 1 == below WGS84 ellipsoid + TEllipsoidPointAltitudeEllipsoide::TAltitudeDirection altitudeDirection = TEllipsoidPointAltitudeEllipsoide::EHeight; + if ((aGpsData.refLocation.threeDLocation.data[7] & 128) != 0) + { + altitudeDirection = TEllipsoidPointAltitudeEllipsoide::EDepth; + } + + // uncertainty etc... + TUint uncertSemiMaj = aGpsData.refLocation.threeDLocation.data[9]; + TUint uncertSemiMin = aGpsData.refLocation.threeDLocation.data[10]; + TUint orientation = aGpsData.refLocation.threeDLocation.data[11]; + TUint uncertAltitude = aGpsData.refLocation.threeDLocation.data[12]; + TUint confidence = aGpsData.refLocation.threeDLocation.data[13]; + + REllipsoidPointAltitudeEllipsoideBuilder ellipsoidPointAltBuilder; + aReferenceLocationBuilder->GetFieldBuilder(TReferenceLocation::EEllipsoidPointAltitudeEllipsoide, ellipsoidPointAltBuilder); + + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::ELatitudeSign, latitudeSign); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::ELatitude, latitude); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::ELongitude, longitude); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::EAltitudeDirection, altitudeDirection); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::EAltitude, altitude); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::EUncertaintySemiMajor, uncertSemiMaj); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::EUncertaintySemiMinor, uncertSemiMin); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::EOrientationMajorAxis, orientation); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::EUncertaintyAltitude, uncertAltitude); + ellipsoidPointAltBuilder.SetField(TEllipsoidPointAltitudeEllipsoide::EConfidence, confidence); + } + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteReferenceLocationData() End\n"); + } + + +/** +WriteNavigationModelData() + +Writes the recevieved GPS Assistance Data (Navigation Model) to the Assistance +Data Builder. + +@param aGpsNavigationModelBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteNavigationModelData(RUEPositioningGpsNavigationModelBuilder* aGpsNavigationModelBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteNavigationModelData() Begin\n"); + // Fetch a GpsNavigationModelSatInfoArray data item. + RNavigationModelSatInfoArrayBuilder navigationModelSatInfoArrayBuilder; + aGpsNavigationModelBuilder->GetArrayBuilder(TUEPositioningGpsNavigationModel::ENavigationModelSatelliteInfoArray, navigationModelSatInfoArrayBuilder); + + // array accessor + ASN1C_SeqOfNavModelElement satInfoArray(aGpsData.navigationModel.navModelList); + + TInt count = aGpsData.navigationModel.navModelList.count; + for (TInt i=0 ; iSetField(TNavigationModelSatInfo::ESatId, (TUint)aSatInfo.satelliteID); + aNavigationModelSatInfoBuilder->SetField(TNavigationModelSatInfo::ESatelliteStatus, (TSatelliteStatus)(aSatInfo.satStatus.t-EZeroOffsetAdjust)); + + // ephemeris data if either "new sat, new nav model" OR "existing sat, new nav model" + if (aSatInfo.satStatus.t == T_SatStatus_newSatelliteAndModelUC) + { + WriteSatInfoEphemeris(aNavigationModelSatInfoBuilder, *aSatInfo.satStatus.u.newSatelliteAndModelUC); + } + else if (aSatInfo.satStatus.t == T_SatStatus_newNaviModelUC) + { + WriteSatInfoEphemeris(aNavigationModelSatInfoBuilder, *aSatInfo.satStatus.u.newNaviModelUC); + } + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteNavigationModelSatInfo() End\n"); + } + + +/** +WriteSatInfoEphemeris() + +Writes the recevieved GPS Assistance Data (Navigation Model Satellite Info Element) +to the Assistance Data Builder. + +@param aNavigationModelSatInfoBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteSatInfoEphemeris(RNavigationModelSatInfoBuilder* aNavigationModelSatInfoBuilder, ASN1T_UncompressedEphemeris& aSatEphemeris) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteSatInfoEphemeris() Begin\n"); + REphemerisParameterBuilder ephemerisBuilder; + aNavigationModelSatInfoBuilder->GetFieldBuilder(TNavigationModelSatInfo::EEphemerisParameter, ephemerisBuilder); + + TUint value = aSatEphemeris.ephemCodeOnL2; + ephemerisBuilder.SetField(TEphemerisParameter::ECodeOnL2, value); + + value = aSatEphemeris.ephemURA; + ephemerisBuilder.SetField(TEphemerisParameter::EUraIndex, value); + + value = aSatEphemeris.ephemSVhealth; + ephemerisBuilder.SetField(TEphemerisParameter::ESatHealth, value); + + value = aSatEphemeris.ephemIODC; + ephemerisBuilder.SetField(TEphemerisParameter::EIodc, value); + + value = aSatEphemeris.ephemL2Pflag; + ephemerisBuilder.SetField(TEphemerisParameter::EL2Pflag, value); + + value = aSatEphemeris.ephemTgd; + ephemerisBuilder.SetField(TEphemerisParameter::ETGD, value); + + value = aSatEphemeris.ephemToc; + ephemerisBuilder.SetField(TEphemerisParameter::EToc, value); + + value = aSatEphemeris.ephemAF2; + ephemerisBuilder.SetField(TEphemerisParameter::EAf2, value); + + value = aSatEphemeris.ephemAF1; + ephemerisBuilder.SetField(TEphemerisParameter::EAf1, value); + + value = aSatEphemeris.ephemAF0; + ephemerisBuilder.SetField(TEphemerisParameter::EAf0, value); + + value = aSatEphemeris.ephemCrs; + ephemerisBuilder.SetField(TEphemerisParameter::ECrs, value); + + value = aSatEphemeris.ephemDeltaN; + ephemerisBuilder.SetField(TEphemerisParameter::EDeltaN, value); + + value = aSatEphemeris.ephemM0; + ephemerisBuilder.SetField(TEphemerisParameter::EM0, value); + + value = aSatEphemeris.ephemCuc; + ephemerisBuilder.SetField(TEphemerisParameter::ECuc, value); + + value = aSatEphemeris.ephemE; + ephemerisBuilder.SetField(TEphemerisParameter::EE, value); + + value = aSatEphemeris.ephemCus; + ephemerisBuilder.SetField(TEphemerisParameter::ECus, value); + + value = aSatEphemeris.ephemAPowerHalf; + ephemerisBuilder.SetField(TEphemerisParameter::EASqrt, value); + + value = aSatEphemeris.ephemToe; + ephemerisBuilder.SetField(TEphemerisParameter::EToe, value); + + value = aSatEphemeris.ephemFitFlag; + ephemerisBuilder.SetField(TEphemerisParameter::EFitInterval, value); + + value = aSatEphemeris.ephemAODA; + ephemerisBuilder.SetField(TEphemerisParameter::EAodo, value); + + value = aSatEphemeris.ephemCic; + ephemerisBuilder.SetField(TEphemerisParameter::ECic, value); + + value = aSatEphemeris.ephemOmegaA0; + ephemerisBuilder.SetField(TEphemerisParameter::EOmega0, value); + + value = aSatEphemeris.ephemCis; + ephemerisBuilder.SetField(TEphemerisParameter::ECis, value); + + value = aSatEphemeris.ephemI0; + ephemerisBuilder.SetField(TEphemerisParameter::EI0, value); + + value = aSatEphemeris.ephemCrc; + ephemerisBuilder.SetField(TEphemerisParameter::ECrc, value); + + value = aSatEphemeris.ephemW; + ephemerisBuilder.SetField(TEphemerisParameter::EOmega, value); + + value = aSatEphemeris.ephemOmegaADot; + ephemerisBuilder.SetField(TEphemerisParameter::EOmegaDot, value); + + value = aSatEphemeris.ephemIDot; + ephemerisBuilder.SetField(TEphemerisParameter::EIDot, value); + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteSatInfoEphemeris() End\n"); + } + + +/** +WriteIonosphericModelData() + +Writes the recevieved GPS Assistance Data (Ionospheric Model) to the Assistance +Data Builder. + +@param aGpsIonosphericModelBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteIonosphericModelData(RUEPositioningGpsIonosphericModelBuilder* aGpsIonosphericModelBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteIonosphericModelData() Begin\n"); + // Ionospheric Model Data + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EAlfa0, (TUint)aGpsData.ionosphericModel.alfa0); + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EAlfa1, (TUint)aGpsData.ionosphericModel.alfa1); + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EAlfa2, (TUint)aGpsData.ionosphericModel.alfa2); + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EAlfa3, (TUint)aGpsData.ionosphericModel.alfa3); + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EBeta0, (TUint)aGpsData.ionosphericModel.beta0); + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EBeta1, (TUint)aGpsData.ionosphericModel.beta1); + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EBeta2, (TUint)aGpsData.ionosphericModel.beta2); + aGpsIonosphericModelBuilder->SetField(TUEPositioningGpsIonosphericModel::EBeta3, (TUint)aGpsData.ionosphericModel.beta3); + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteIonosphericModelData() End\n"); + } + + +/** +WriteUtcModelData() + +Writes the recevieved GPS Assistance Data (UTC Model) to the Assistance +Data Builder. + +@param aGpsUtcModelBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteUtcModelData(RUEPositioningGpsUtcModelBuilder* aGpsUtcModelBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteUtcModelData() Begin\n"); + // Universal Time Coordinate Model + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::EA1, (TUint)aGpsData.utcModel.utcA1); + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::EA0, (TUint)aGpsData.utcModel.utcA0); + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::ETot, (TUint)aGpsData.utcModel.utcTot); + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::EWnt, (TUint)aGpsData.utcModel.utcWNt); + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::EDeltatLS, (TUint)aGpsData.utcModel.utcDeltaTls); + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::EWnlsf, (TUint)aGpsData.utcModel.utcWNlsf); + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::EDn, (TUint)aGpsData.utcModel.utcDN); + aGpsUtcModelBuilder->SetField(TUEPositioningGpsUtcModel::EDeltatLSF, (TUint)aGpsData.utcModel.utcDeltaTlsf); + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteUtcModelData() End\n"); + } + + +/** +WriteUtcModelData() + +Writes the recevieved GPS Assistance Data (UTC Model) to the Assistance +Data Builder. + +@param aGpsUtcModelBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteAlmanacData(RUEPositioningGpsAlmanacBuilder* aGpsAlmanacBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteAlmanacData() Begin\n"); + + // Almanac + aGpsAlmanacBuilder->SetField(TUEPositioningGpsAlmanac::EWnA, (TUint)aGpsData.almanac.alamanacWNa); + + // source array accessor + ASN1C_SeqOfAlmanacElement almanacArray(aGpsData.almanac.almanacList); + + // Populate almanac satellite info array + RAlmanacSatInfoArrayBuilder almanacSatInfoArrayBuilder; + aGpsAlmanacBuilder->GetArrayBuilder(TUEPositioningGpsAlmanac::EAlmanacInfoSatArray, almanacSatInfoArrayBuilder); + + TInt count = aGpsData.almanac.almanacList.count; + // Copy assistance data for a maximun of KAsn1RrlpMaxSatNumber + // satellites (LBS data structures cannot accomodate more) + for (TInt i=0 ; iSetField(TAlmanacSatInfo::ESatID, (TUint)aAlmanacElement.satelliteID); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EE, (TUint)aAlmanacElement.almanacE); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EToa, (TUint)aAlmanacElement.alamanacToa); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EDeltaI, (TUint)aAlmanacElement.almanacKsii); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EOmegaDot, (TUint)aAlmanacElement.almanacOmegaDot); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::ESatHealth, (TUint)aAlmanacElement.almanacSVhealth); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EASqrt, (TUint)aAlmanacElement.almanacAPowerHalf); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EOmega0, (TUint)aAlmanacElement.almanacOmega0); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EM0, (TUint)aAlmanacElement.almanacM0); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EOmega, (TUint)aAlmanacElement.almanacW); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EAf0, (TUint)aAlmanacElement.almanacAF0); + aAlmanacSatInfoBuilder->SetField(TAlmanacSatInfo::EAf1, (TUint)aAlmanacElement.almanacAF1); + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteAlmanacSatInfo() End\n"); + } + + +/** +WriteAcquisitionAssistanceData() + +Writes the recevieved GPS Assistance Data (Acquisition Assistance Data) to +the Assistance Data Builder. + +@param aGpsAcquisitionAssistanceBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteAcquisitionAssistanceData(RUEPositioningGpsAcquisitionAssistanceBuilder* aGpsAcquisitionAssistanceBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteAcquisitionAssistanceData() Begin\n"); + // Aquisition Assistance + + // GSM TIME elements (optional) + // Not currently supported by this implementation + // LBS assistance data builder support required. + + // source array accessor + ASN1C_SeqOfAcquisElement acquisAssistArray(aGpsData.acquisAssist.acquisList); + + // Populate almanac satellite info array + RAcquisitionSatInfoArrayBuilder acquisitionSatInfoArrayBuilder; + aGpsAcquisitionAssistanceBuilder->GetArrayBuilder(TUEPositioningGpsAcquisitionAssistance::ESatelliteInformationArray, acquisitionSatInfoArrayBuilder); + + TInt count = aGpsData.acquisAssist.acquisList.count; + for (TInt i=0 ; iSetField(TAcquisitionSatInfo::ESatID, (TUint)aAcquisAssistElement.svid); + aAcquisitionSatInfoBuilder->SetField(TAcquisitionSatInfo::EDoppler0thOrder, (TInt)aAcquisAssistElement.doppler0); + aAcquisitionSatInfoBuilder->SetField(TAcquisitionSatInfo::ECodePhase, (TUint)aAcquisAssistElement.codePhase); + aAcquisitionSatInfoBuilder->SetField(TAcquisitionSatInfo::EIntegerCodePhase, (TUint)aAcquisAssistElement.intCodePhase); + aAcquisitionSatInfoBuilder->SetField(TAcquisitionSatInfo::EGpsBitNumber, (TUint)aAcquisAssistElement.gpsBitNumber); + aAcquisitionSatInfoBuilder->SetField(TAcquisitionSatInfo::ECodePhaseSearchWindow, (TCodePhaseSearchWindow)aAcquisAssistElement.codePhaseSearchWindow); + + if (aAcquisAssistElement.m.addionalDopplerPresent != 0) + { + RExtraDopplerInfoBuilder extraDopplerInfoBuilder; + aAcquisitionSatInfoBuilder->GetFieldBuilder(TAcquisitionSatInfo::EExtraDopplerInfo, extraDopplerInfoBuilder); + extraDopplerInfoBuilder.SetField(TExtraDopplerInfo::EDoppler1stOrder, (TInt)aAcquisAssistElement.addionalDoppler.doppler1); + extraDopplerInfoBuilder.SetField(TExtraDopplerInfo::EDopplerUncertainty, (TDopplerUncertainty)aAcquisAssistElement.addionalDoppler.dopplerUncertainty); + } + + if (aAcquisAssistElement.m.addionalAnglePresent) + { + RTAzimuthAndElevationBuilder azimuthAndElevationBuilder; + aAcquisitionSatInfoBuilder->GetFieldBuilder(TAcquisitionSatInfo::EAzimuthAndElevation, azimuthAndElevationBuilder); + azimuthAndElevationBuilder.SetField(TAzimuthAndElevation::EAzimuth, (TUint)aAcquisAssistElement.addionalAngle.azimuth); + azimuthAndElevationBuilder.SetField(TAzimuthAndElevation::EElevation, (TUint)aAcquisAssistElement.addionalAngle.elevation); + } + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteAcquisAssistSatInfo() End\n"); + } + + +/** +WriteRealTimeIntegrityData() + +Writes the recevieved GPS Assistance Data (Real Time Integrity) to the +Assistance Data Builder. + +@param aBadSatListBuilder, the LBS assistance data builder +@param aGpsData, the received/decoded gps assistance data RRLP element +*/ +void CRrlpMessageBase::WriteRealTimeIntegrityData(RBadSatListBuilder* aBadSatListBuilder, ASN1T_ControlHeader& aGpsData) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::WriteRealTimeIntegrityData() Begin\n"); + // Real Time Integrity + RBadSatArrayBuilder badSatArrayBuilder; + aBadSatListBuilder->GetArrayBuilder(TBadSatList::EBadSatIdArray, badSatArrayBuilder); + + TInt count = aGpsData.realTimeIntegrity.n; + + for (TInt i=0 ; i) if a memory allocation has failed. +*/ +void CRrlpMessageBase::LeaveIfAllocErrorL() + { + SUPLLOG(ELogP1, "CRrlpMessageBase::LeaveIfAllocErrorL() Begin\n"); + if (iControl->getStatus() == RTERR_NOMEM) + { + User::Leave(KErrNoMemory); + } + else if (iControl->getStatus() != RT_OK) + { + User::Leave(KErrGeneral); + } + SUPLLOG(ELogP1, "CRrlpMessageBase::LeaveIfAllocErrorL() End\n"); + } + + +/** +Translates error codes returned by the ASN1 runtime library to distinguish +from Symbian global error codes. + +Errors are simply translated to positive error codes. They maintain their +meaning as described in rtxErrCodes.h and asn1ErrCodes.h. + +Exceptions: + RTERR_NOMEM is translated to global error code KErrNoMemory + +@see rtxErrCodes.h +@see asn1ErrCodes.h +*/ +TInt CRrlpMessageBase::ProcessAsn1Error(TInt aError) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() Begin\n"); + if (aError == RTERR_NOMEM) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (Out Of Memory)\n"); + return KErrNoMemory; + } + else + { + SUPLLOG2(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (ASN1Error runtime error %d)\n", aError); + return aError * -1; + } + } + +/** +Prints the content payload data structure to the logger +*/ +void CRrlpMessageBase::LogMessageContent() + { + SUPLLOG(ELogP9, "RRLP PAYLOAD CONTENT\n"); + //SUPLLOG_PDU(iControl); + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpprotocolerror.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlpprotocolerror.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,189 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "rrlpprotocolerror.h" +#include "supldevloggermacros.h" + +/** +Static Factory Constructor +*/ +EXPORT_C CRrlpProtocolError* CRrlpProtocolError::NewL(TBool aIsOutgoing) + { + SUPLLOG(ELogP1, "CRrlpProtocolError::NewL() Begin\n"); + CRrlpProtocolError* self = new (ELeave) CRrlpProtocolError(aIsOutgoing); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CRrlpProtocolError::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + + +/** +Private default constructor +*/ +CRrlpProtocolError::CRrlpProtocolError(TBool aIsOutgoing) + : CRrlpMessageBase(ERrlpProtocolError, aIsOutgoing) + { + } + + +/** +Second stage constructor +*/ +void CRrlpProtocolError::ConstructL() + { + // call base class ConstructL to create data structures. + CRrlpMessageBase::ConstructL(); + + // construct messaage specific data + // containers if this is an outgoing message + if (iIsOutgoingMessage) + { + // local reference to context object + OSCTXT* pctxt = iControl->getCtxtPtr(); + + iData->component.t = T_RRLP_Component_protocolError; + iData->component.u.protocolError = (ASN1T_ProtocolError*)rtxMemAllocZ(pctxt, sizeof(ASN1T_ProtocolError)); + LeaveIfAllocErrorL(); + } + } + + +/** +Destructor +*/ +CRrlpProtocolError::~CRrlpProtocolError() + { + SUPLLOG(ELogP1, "CRrlpProtocolError::~CRrlpProtocolError() Begin\n"); + SUPLLOG(ELogP1, "CRrlpProtocolError::~CRrlpProtocolError() End\n"); + } + + +/** +SetProtocolError() + +@param aErrorCode - the outgoing RRLP Protocol error code +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpProtocolError::SetProtocolError(const TRrlpErrorCode& aErrorCode) + { + SUPLLOG(ELogP8, "CRrlpProtocolError::SetProtocolError() Begin\n"); + SUPLLOG2(ELogP8, " - TRrlpErrorCode aLocError = %d", aErrorCode); + + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->component.u.protocolError != NULL, User::Invariant()); + + iData->component.u.protocolError->errorCause = aErrorCode; + + SUPLLOG(ELogP1, "CRrlpProtocolError::SetProtocolError() End\n"); + return KErrNone; + } + + +/** +ProtocolError() + +@param aErrorCode on return, populated with the received RRLP Error Code +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CRrlpProtocolError::GetProtocolError(TRrlpErrorCode& aErrorCode) + { + SUPLLOG(ELogP8, "CRrlpProtocolError::ProtocolError() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->component.u.protocolError != NULL, User::Invariant()); + + aErrorCode = (TRrlpErrorCode)iData->component.u.protocolError->errorCause; + + SUPLLOG2(ELogP8, " - TRrlpErrorCode aLocError = %d", aErrorCode); + SUPLLOG(ELogP1, "CRrlpProtocolError::ProtocolError() End\n"); + return KErrNone; + } + + +/** +GetExtendedReference() + +Populates aRrlpRef if Rel-5 Extended Reference is present in the received message + +@param aRrlpRef local copy of the session reference details +@return KErrNotFound if the extended reference parameters are not present, + KErrNone otherwise +*/ +TInt CRrlpProtocolError::GetExtendedReference(TRrlpReference& aRrlpRef) + { + __ASSERT_DEBUG(iData->component.u.protocolError != NULL, User::Invariant()); + + if (iData->component.u.protocolError->m.rel_5_ProtocolError_ExtensionPresent !=0) + { + if (iData->component.u.protocolError->rel_5_ProtocolError_Extension.m.extended_referencePresent !=0) + { + aRrlpRef.aRel5EntendedRefPresent = ETrue; + aRrlpRef.aRel5SmlcCode = iData->component.u.protocolError->rel_5_ProtocolError_Extension.extended_reference.smlc_code; + aRrlpRef.aRel5TransactionId = iData->component.u.protocolError->rel_5_ProtocolError_Extension.extended_reference.transaction_ID; + } + else + { + return KErrNotFound; + } + } + else + { + return KErrNotFound; + } + return KErrNone; + } + + +/** +SetExtendedReference() + +Sets the extended reference parameters in the outgoing message, if they are set +in the passed container. + +@param aRrlpRef on return, populated with the session reference details +@return KErrNotFound if no extended reference data is present, + KErrNone otherwise +*/ +TInt CRrlpProtocolError::SetExtendedReference(const TRrlpReference& aRrlpRef) + { + __ASSERT_DEBUG(iData->component.u.protocolError != NULL, User::Invariant()); + + // if present, populate the optional Rel-5 extended reference + if (aRrlpRef.aRel5EntendedRefPresent) + { + // mark the optional component present + iData->component.u.protocolError->m.rel_5_ProtocolError_ExtensionPresent = 1; + iData->component.u.protocolError->rel_5_ProtocolError_Extension.m.extended_referencePresent = 1; + ASN1T_Extended_reference* extendedRef = &iData->component.u.protocolError->rel_5_ProtocolError_Extension.extended_reference; + extendedRef->smlc_code = aRrlpRef.aRel5SmlcCode; + extendedRef->transaction_ID = aRrlpRef.aRel5TransactionId; + } + else + { + return KErrNotFound; + } + + return KErrNone; + } + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlputils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/rrlputils.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -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: +// + +/** + @file + @internalTechnology + +*/ +#include +#include "rrlputils.h" +#include "supldevloggermacros.h" +#include "rtxErrCodes.h" + +/** +Translates error codes returned by the ASN1 runtime library to distinguish +from Symbian global error codes. + +Errors are simply translated to positive error codes. They maintain their +meaning as described in rtxErrCodes.h and asn1ErrCodes.h. + +Exceptions: + RTERR_NOMEM is translated to global error code KErrNoMemory + +@see rtxErrCodes.h +@see asn1ErrCodes.h +*/ +TInt RrlpUtils::ProcessAsn1Error(TInt aError) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() Begin\n"); + if (aError == RTERR_NOMEM) + { + SUPLLOG(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (Out Of Memory)\n"); + return KErrNoMemory; + } + else + { + SUPLLOG2(ELogP1, "CRrlpMessageBase::ProcessAsn1Error() End (ASN1Error runtime error %d)\n", aError); + return aError * -1; + } + } + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplasn1decoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplasn1decoder.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,100 @@ +// 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: +// Location Based Services SUPL ASN1 Decoder API +// +// + +/** + @file + @internalTechnology + +*/ + +#include +#include "suplasn1decoder.h" +#include "suplasn1decoderimpl.h" +#include "supldevloggermacros.h" + + +/** +Provides SUPL ASN1 decoding functionality to the SUPL Protocol Module. + +@return an Instance of the SUPL ASN1 decoder. The calling application becomes +the owner of the returned instance and is responsible for its disposal. + +@internalTechnology +*/ +EXPORT_C CSuplAsn1Decoder* CSuplAsn1Decoder::NewL() + { + SUPLLOG(ELogP1, "CSuplAsn1Decoder::NewL() Begin\n"); + CSuplAsn1Decoder* newObj = new (ELeave) CSuplAsn1Decoder(); + CleanupStack::PushL(newObj); + newObj->ConstructL(); + SUPLLOG(ELogP1, "CSuplAsn1Decoder::NewL() End\n"); + CleanupStack::Pop(newObj); + return newObj; + } + +/** +Destructor + +@internalTechnology +*/ +CSuplAsn1Decoder::~CSuplAsn1Decoder() + { + SUPLLOG(ELogP1, "CSuplAsn1Decoder::~CSuplAsn1Decoder() Begin\n"); + delete iImpl; + iImpl = NULL; + SUPLLOG(ELogP1, "CSuplAsn1Decoder::~CSuplAsn1Decoder() End\n"); + } + +/** +Default constructor. + +@internalTechnology +*/ +CSuplAsn1Decoder::CSuplAsn1Decoder() + { + } + +/** +2nd phase constructor. +Creates and assigns all the required internal resources. + +@internalTechnology + +*/ +void CSuplAsn1Decoder::ConstructL() + { + iImpl = CSuplAsn1DecoderImpl::NewL(); + } + +/** +Passes an ASN1 encoded SUPL message to be decoded. + +A system requiring concurrent access to a channel must provide its own access +control mechanism. + +@return a CSuplMessageBase derived object encapsulating the decoded message +data. The calling application becomes the owner of the returned object and +is responsible for its disposal. + +@internalTechnology + +*/ +EXPORT_C CSuplMessageBase* CSuplAsn1Decoder::DecodeL(const TPtrC8* aBuf, TInt& aError) + { + return iImpl->DecodeL(aBuf, aError); + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplasn1decoderimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplasn1decoderimpl.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,271 @@ +// 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: +// Internal implementation of the SUPL ASN1 Decoder +// +// + +/** + @file + @internalTechnology + +*/ + +#include "ULP.h" +#include "suplasn1decoderimpl.h" +#include "suplinit.h" +#include "suplresponse.h" +#include "suplpos.h" +#include "suplend.h" +#include "supldevloggermacros.h" + +/** +Static factory constructor +*/ +EXPORT_C CSuplAsn1DecoderImpl* CSuplAsn1DecoderImpl::NewL() + { + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::NewL() Begin\n"); + CSuplAsn1DecoderImpl* self = new (ELeave) CSuplAsn1DecoderImpl(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +/** +Constructor +*/ +CSuplAsn1DecoderImpl::CSuplAsn1DecoderImpl() + { + } + +/** +Second stage constructor +*/ +void CSuplAsn1DecoderImpl::ConstructL() + { + } + +/** +Destructor +*/ +CSuplAsn1DecoderImpl::~CSuplAsn1DecoderImpl() + { + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::~CSuplAsn1DecoderImpl() Begin\n"); + delete iDecodeBuffer; + delete iData; + delete iControl; + // release the STDLIB resources associated with this thread + CloseSTDLIB(); + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::~CSuplAsn1DecoderImpl() End\n"); + } + +/** +DecodeL() + +Decodes a received message, passing back the decoded content in the form of a +CSuplMessageBase derived object. The calling code receives ownership of this +object and is responsible for its destruction. + +@param aBuf buffer from which the ASN1 message is to be decoded +@param aError on return, indicates error. KErrNone otherwise. +@return pointer to the decoded SUPL message. +*/ +EXPORT_C CSuplMessageBase* CSuplAsn1DecoderImpl::DecodeL(const TPtrC8* aBuf, TInt& aError) + { + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::DecodeL() Begin\n"); + aError = KErrNone; + + // Log the encoded ASN1 + SUPLLOG(ELogP8, "<- SUPL MESSAGE RECEIVED (HEX)\n"); + SUPLLOGHEX(ELogP8, aBuf->Ptr(), aBuf->Length()); + + // buffer pointer, fixed max length + OSOCTET* msgBuf = (OSOCTET*)aBuf->Ptr(); + TInt len = aBuf->Length(); + + // Create the message decode buffer + ASN1Context* context = new (ELeave) ASN1Context; + CleanupDeletePushL(context); + iDecodeBuffer = new (ELeave) ASN1PERDecodeBuffer (msgBuf, len, FALSE, context); + // construction of iDecodeBuffer successful, pop context off the cleanup stack + CleanupStack::Pop(context); + + // Create data and control objects to manage the decode + iData = new (ELeave) ASN1T_ULP_PDU(); + + // The 'new' above does not initialise member valuables. + // Need to do it manually. (include INC136464) + iData->message.t = 0; + iData->message.u.msSUPLINIT = NULL; + iData->message.u.msSUPLSTART = NULL; + iData->message.u.msSUPLRESPONSE = NULL; + iData->message.u.msSUPLPOSINIT = NULL; + iData->message.u.msSUPLPOS = NULL; + iData->message.u.msSUPLEND = NULL; + iData->message.u.msSUPLAUTHREQ = NULL; + iData->message.u.msSUPLAUTHRESP = NULL; + + iControl = new (ELeave) ASN1C_ULP_PDU (*iDecodeBuffer, *iData); + + // Decode the contents of the message buffer + iControl->Decode(); + + // check for errors + TInt stat = iControl->getStatus(); + if (stat == 0) + { + stat = AdditionalMessageValidation(); + } + if (stat != 0) + { + aError = ProcessAsn1Error(stat); + // delete all objects before return null + delete iDecodeBuffer; + iDecodeBuffer = NULL; + delete iData; + iData = NULL; + delete iControl; + iControl = NULL; + + return NULL; + } + + // build the appropriate LBS SUPL Message Type, and return. + TInt messageType = iData->message.t; + CSuplMessageBase* aMessage; + switch (messageType) + { + case T_UlpMessage_msSUPLINIT: + { + aMessage = CSuplInit::NewL(); + CleanupStack::PushL(aMessage); + break; + } + case T_UlpMessage_msSUPLRESPONSE: + { + aMessage = CSuplResponse::NewL(); + CleanupStack::PushL(aMessage); + break; + } + case T_UlpMessage_msSUPLPOS: + { + aMessage = CSuplPos::NewL(EFalse); + CleanupStack::PushL(aMessage); + break; + } + case T_UlpMessage_msSUPLEND: + { + aMessage = CSuplEnd::NewL(EFalse); + CleanupStack::PushL(aMessage); + break; + } + default: + { + // unexpected message type + aError = KErrNotSupported; + // delete all objects before return null + delete iDecodeBuffer; + iDecodeBuffer = NULL; + delete iData; + iData = NULL; + delete iControl; + iControl = NULL; + + return NULL; + } + } + + // Pass ownership of decoded data to the message object + aMessage->SetDecodedData(iData, iControl); + iControl = NULL; + iData = NULL; + + // delete the decode buffer object + delete iDecodeBuffer; + iDecodeBuffer = NULL; + + // Decode the content of encapsulated positioning method + if (messageType == T_UlpMessage_msSUPLPOS) + { + CSuplPos* posMessage = (CSuplPos*)aMessage; + posMessage->DecodePosPayloadL(aError); + } + + // store un-decoded SUPL INIT message for ver hash calculation + if (messageType == T_UlpMessage_msSUPLINIT) + { + CSuplInit* initMessage = (CSuplInit*)aMessage; + initMessage->SetReceivedMessageL(*aBuf); + } + + // LOG the received message + SUPLLOG(ELogP9, "<- SUPL MESSAGE RECEIVED AND DECODED\n"); + aMessage->LogMessageContent(); + + // pop the constructed message off the stack and return to caller. + CleanupStack::Pop(aMessage); + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::DecodeL() End\n"); + return aMessage; + } + +/** +Translates error codes returned by the ASN1 runtime library to distinguish +from Symbian global error codes. + +Errors are simply translated to positive error codes. They maintain their +meaning as described in rtxErrCodes.h and asn1ErrCodes.h, with the exception +of RTERR_NOMEM is translated to global error code KErrNoMemory. + +@see rtxErrCodes.h +@see asn1ErrCodes.h +*/ +TInt CSuplAsn1DecoderImpl::ProcessAsn1Error(TInt aError) + { + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::ProcessAsn1Error() Begin\n"); + if (aError == RTERR_NOMEM) + { + SUPLLOG(ELogP1, "CSuplAsn1DecoderImpl::ProcessAsn1Error() End (Out Of Memory)\n"); + return KErrNoMemory; + } + else + { + SUPLLOG2(ELogP1, "CSuplAsn1DecoderImpl::ProcessAsn1Error() End (ASN1 Runtime Error %d)\n", aError); + return aError * -1; + } + } + +/** +Check for additional errors in messages that +the control object cannot report for +various reasons. +This method returns error codes defined by the asn1 +compiler supplier. +*/ +TInt CSuplAsn1DecoderImpl::AdditionalMessageValidation() +{ + TInt stat = 0; + + // Set Session Id is mandatory in every + // received message. Its absence is not flagged + // by the controller because it is an optional + // parameter in some outgoing messages. + if (!iData->sessionID.m.slpSessionIDPresent) + { + stat = RTERR_SETMISRQ; + } + + return stat; +} + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplend.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplend.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,349 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "ULP.h" +#include "ASN1TTime.h" +#include +#include +#include "suplend.h" +#include "supldevloggermacros.h" + +/** +Static factor constructor +*/ +EXPORT_C CSuplEnd* CSuplEnd::NewL(TBool aIsOutgoingMessage) + { + SUPLLOG(ELogP1, "CSuplEnd::NewL() Begin\n"); + CSuplEnd* self = CSuplEnd::NewLC(aIsOutgoingMessage); + SUPLLOG(ELogP1, "CSuplEnd::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplEnd* CSuplEnd::NewLC(TBool aIsOutgoingMessage) + { + SUPLLOG(ELogP1, "CSuplEnd::NewLC() Begin\n"); + CSuplEnd* self = new (ELeave) CSuplEnd(aIsOutgoingMessage); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplEnd::NewLC() End\n"); + return self; + } + +/** +Constructor +*/ +CSuplEnd::CSuplEnd(TBool aIsOutgoingMessage) + : CSuplMessageBase::CSuplMessageBase(ESuplEnd, aIsOutgoingMessage) + { + } + + +/** +Second stage constructor +*/ +void CSuplEnd::ConstructL() + { + // call the base class ConstructL() to create common data structures + CSuplMessageBase::ConstructL(); + + // message specific structures for outgoing messages. + if (iIsOutgoingMessage) + { + // local reference to context object + OSCTXT* pctxt = iControl->getCtxtPtr(); + + // create the SUPL POS specific data structures + iData->message.t = T_UlpMessage_msSUPLEND; + iData->message.u.msSUPLEND = (ASN1T_SUPLEND*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SUPLEND)); + LeaveIfAllocErrorL(); + } + } + +/** +Destructor +*/ +CSuplEnd::~CSuplEnd() + { + SUPLLOG(ELogP1, "CSuplEnd::~CSuplEnd() Begin\n"); + SUPLLOG(ELogP1, "CSuplEnd::~CSuplEnd() End\n"); + } + + +/** +SetPosition() + +Set the Position parameter + +@param aPosInfo, position info as provided by LBS subsystem +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplEnd::SetPosition(const TPositionInfoBase& aPosInfo) + { + SUPLLOG(ELogP1, "CSuplEnd::SetPosition() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLEND != NULL, User::Invariant()); + + // flag that the optional position parameter is present + iData->message.u.msSUPLEND->m.positionPresent = 1; + + SUPLLOG(ELogP1, "CSuplEnd::SetPosition() End (Calling PopulatePosition())\n"); + return PopulatePosition(aPosInfo, iData->message.u.msSUPLEND->position); + } + + +/** +SetStatusCode() + +Set the SUPL Status Code + +@param aStatusCode, the status code for session termination +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplEnd::SetStatusCode(TSuplStatusCode& aStatusCode) + { + SUPLLOG(ELogP1, "CSuplEnd::SetStatusCode() Begin\n"); + SUPLLOG2(ELogP1, " - TSuplStatusCode aStatusCode = %d\n", aStatusCode); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLEND != NULL, User::Invariant()); + + // flag that the optional status code parameter is present and set param + iData->message.u.msSUPLEND->m.statusCodePresent = 1; + iData->message.u.msSUPLEND->statusCode = aStatusCode; + + SUPLLOG(ELogP1, "CSuplEnd::SetStatusCode() End\n"); + return KErrNone; + } + + + +/** +SetVer() + +Sets the Ver parameter, a hash of the received SUPL INIT message of the +outgoing message + +@param aVer, pointer to buffer containing the hash of the SUPL INIT message +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplEnd::SetVer(const TDesC8& aVer) + { + SUPLLOG(ELogP1, "CSuplEnd::SetVer() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLEND != NULL, User::Invariant()); + + ASN1T_SUPLEND& suplEnd = *iData->message.u.msSUPLEND; + suplEnd.m.verPresent = 1; + suplEnd.ver.numbits = 64; + TPtr8 target(suplEnd.ver.data, 8); + target.Copy(aVer); + + SUPLLOG(ELogP1, "CSuplEnd::SetVer() End\n"); + return KErrNone; + } + +/** +PositionPresent() + +@return ETrue if the position parameter is present +*/ +EXPORT_C TBool CSuplEnd::PositionPresent() + { + SUPLLOG(ELogP1, "CSuplEnd::PositionPresent() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLEND != NULL, User::Invariant()); + + if (iData->message.u.msSUPLEND->m.positionPresent != 0) + { + SUPLLOG(ELogP1, "CSuplEnd::PositionPresent(ETrue) End\n"); + return ETrue; + } + SUPLLOG(ELogP1, "CSuplEnd::PositionPresent(EFalse) End\n"); + return EFalse; + } + + +/** +Postion() + +Retrieve the received position information. + +@param aPosition, on return populated with the received position information +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplEnd::GetPosition(TPosition& aPosition) + { + SUPLLOG(ELogP1, "CSuplEnd::Position() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLEND != NULL, User::Invariant()); + + if (iData->message.u.msSUPLEND->m.positionPresent != 0) + { + ASN1T_Position& receivedPos = iData->message.u.msSUPLEND->position; + + TTime time(0); + TInt err = DecodeTime((TUint8*)receivedPos.timestamp, time); + + aPosition.SetTime(time); + + TReal64 latitude = receivedPos.positionEstimate.latitude; + latitude *= 90; + latitude /= 8388608; // 2^23 + if (receivedPos.positionEstimate.latitudeSign == PositionEstimate_latitudeSign::south) + { + latitude *= -1; + } + TReal64 longitude = receivedPos.positionEstimate.longitude; + longitude *= 360; + longitude /= 16777216; + aPosition.SetCoordinate(latitude, longitude); + + // horizontal uncertainty + // from 3gpp ts 23.032: uncert = C( (1+x)^k - 1 ), C = 10, x = 0.1 + if (receivedPos.positionEstimate.m.uncertaintyPresent != 0) + { + TUint k = receivedPos.positionEstimate.uncertainty.uncertaintySemiMajor; + TReal uncert; + Math::Pow(uncert, 1.1, k); + uncert -= 1; + uncert *= 10; + aPosition.SetHorizontalAccuracy(uncert); + } + + // vertical position + if (receivedPos.positionEstimate.m.altitudeInfoPresent != 0) + { + // actual altitude in meters + TReal32 altitude = receivedPos.positionEstimate.altitudeInfo.altitude; + // direction + if (receivedPos.positionEstimate.altitudeInfo.altitudeDirection == AltitudeInfo_altitudeDirection::depth) + { + altitude *= -1; + } + aPosition.SetCoordinate(latitude, longitude, altitude); + + // altitude uncertainty + // from 3gpp ts 23.032: altUncert = C( (1+x)^k - 1 ), C = 45, x = 0.025 + TUint kAlt = receivedPos.positionEstimate.altitudeInfo.altUncertainty; + TReal altUncert; + Math::Pow(altUncert, 1.025, kAlt); + altUncert -= 1; + altUncert *= 45; + aPosition.SetVerticalAccuracy(altUncert); + } + } + else + { + return KErrNotFound; + } + + SUPLLOG(ELogP1, "CSuplEnd::Position() End\n"); + return KErrNone; + } + + +/** +StatusCodePresent() + +@return ETrue if the status code parameter is present +*/ +EXPORT_C TBool CSuplEnd::StatusCodePresent() + { + SUPLLOG(ELogP1, "CSuplEnd::StatusCodePresent() Begin\n"); + if (iData->message.u.msSUPLEND->m.statusCodePresent != 0) + { + SUPLLOG(ELogP1, "CSuplEnd::StatusCodePresent(ETrue) End\n"); + return ETrue; + } + + SUPLLOG(ELogP1, "CSuplEnd::StatusCodePresent(EFalse) End\n"); + return EFalse; + } + + +/** +StatusCode() + +@return the SUPL status code +*/ +EXPORT_C TSuplStatusCode CSuplEnd::StatusCode() + { + SUPLLOG(ELogP1, "CSuplEnd::StatusCode() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLEND != NULL, User::Invariant()); + + if (iData->message.u.msSUPLEND->m.statusCodePresent != 0) + { + SUPLLOG2(ELogP1, "CSuplEnd::StatusCode() End (Status Code == %d\n", iData->message.u.msSUPLEND->statusCode); + return (TSuplStatusCode)iData->message.u.msSUPLEND->statusCode; + } + + SUPLLOG(ELogP1, "CSuplEnd::StatusCode() End (Status Code not present)\n"); + return ESuplStatusUnspecified; + } + + + +TInt CSuplEnd::DecodeTime(const TUint8* aTimeString, TTime& aTimeOut) + { + SUPLLOG(ELogP1, "CSuplEnd::DecodeTime() Begin\n"); + + TInt err = KErrNone; + + ASN1TUTCTime t; + err = t.parseString((const char*)aTimeString); + if (err != KErrNone) + { + return err; + } + + TInt month = t.getMonth(); + + TMonth monthEnum; + switch (month) + { + case 1: monthEnum = EJanuary; break; + case 2: monthEnum = EFebruary; break; + case 3: monthEnum = EMarch; break; + case 4: monthEnum = EApril; break; + case 5: monthEnum = EMay; break; + case 6: monthEnum = EJune; break; + case 7: monthEnum = EJuly; break; + case 8: monthEnum = EAugust; break; + case 9: monthEnum = ESeptember; break; + case 10: monthEnum = EOctober; break; + case 11: monthEnum = ENovember; break; + case 12: monthEnum = EDecember; break; + default: + __ASSERT_DEBUG(0, User::Invariant()); + return KErrArgument; + } + + //Get the day value, subtract 1 from it to convert to internal day values (0-...) + TInt day = t.getDay() - 1; + + TDateTime dateTime(t.getYear(), monthEnum, day, t.getHour(), t.getMinute(), t.getSecond(), 0); + aTimeOut = dateTime; + + SUPLLOG(ELogP1, "CSuplEnd::DecodeTime() End\n"); + return KErrNone; + } + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplinit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplinit.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,744 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "suplmessagebase.h" +#include "ULP.h" +#include "suplinit.h" +#include "supldevloggermacros.h" +#include +#include + +/** +Static factory constructor +*/ +EXPORT_C CSuplInit* CSuplInit::NewL() + { + SUPLLOG(ELogP1, "CSuplInit::NewL() Begin\n"); + CSuplInit* self = new (ELeave) CSuplInit(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplInit::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +/** +Constructor +*/ +CSuplInit::CSuplInit() + : CSuplMessageBase::CSuplMessageBase(ESuplInit, EFalse) + { + } + +/** +Second stage constructor +*/ +void CSuplInit::ConstructL() + { + CSuplMessageBase::ConstructL(); + } + +/** +Destructor +*/ +CSuplInit::~CSuplInit() + { + SUPLLOG(ELogP1, "CSuplInit::~CSuplInit() Begin\n"); + delete iMessage; + SUPLLOG(ELogP1, "CSuplInit::~CSuplInit() End\n"); + } + +/** +GetPosMethod() + +Populates aMethod according to SUPL INIT positioning method parameter + +The Positioning Method parameter of the SUPL INIT message is the method +desired by the SLP for the SUPL POS session. + +@param aMethod, on return populated as per the positioning method element +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplInit::GetPosMethod(TLbsNetPosRequestMethod& aMethod) + { + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + SUPLLOG(ELogP1, "CSuplInit::GetPosMethod() Begin\n"); + + // retrieve the posMethod value + ASN1T_PosMethod posMethod = iData->message.u.msSUPLINIT->posMethod; + + TLbsNetPosMethod posMethods[2]; + TInt numMethods = 1; + + switch (posMethod) + { + case PosMethod::agpsSETassisted: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + break; + + case PosMethod::agpsSETbased: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + break; + + case PosMethod::agpsSETassistedpref: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + posMethods[1].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++numMethods; + break; + + case PosMethod::PosMethod::agpsSETbasedpref: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + posMethods[1].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++numMethods; + break; + + case PosMethod::autonomousGPS: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::aFLT: + posMethods[0].SetPosMethod(KLbsPositioningMeansAflt, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::eCID: + posMethods[0].SetPosMethod(KLbsPositioningMeansCell, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::PosMethod::eOTD: + posMethods[0].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::oTDOA: + posMethods[0].SetPosMethod(KLbsPositioningMeansOtdoa, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::noPosition: + posMethods[0].SetPosMethod(KLbsPositioningMeansNone, TPositionModuleInfo::ETechnologyTerminal); + break; + + default: + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + SUPLLOG(ELogP1, "CSuplInit::GetPosMethod() Error - invalid argument\n"); + return KErrArgument; + } + + // populate the return parameter + TInt err = aMethod.SetPosMethods(posMethods, numMethods); + + SUPLLOG(ELogP1, "CSuplInit::GetPosMethod() End\n"); + return err; + } + + +/** +NotificationPresent() + +@return ETrue if optional notification parameter is present, EFalse otherwise +*/ +EXPORT_C TBool CSuplInit::NotificationPresent() + { + SUPLLOG(ELogP1, "CSuplInit::NotificationPresent() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + if (iData->message.u.msSUPLINIT->m.notificationPresent != 0) + { + SUPLLOG(ELogP1, "CSuplInit::NotificationPresent(ETrue) End\n"); + return ETrue; + } + SUPLLOG(ELogP1, "CSuplInit::NotificationPresent(EFalse) End\n"); + return EFalse; + } + +/** +NotificationType() + +Populates aPrivacy according to SUPL INIT notification element. + +If the notification element is not present, this is interpreted as "no +notification and no verification", as per the SUPL spec. + +@param aPrivacy, populated according to the notification element +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplInit::GetNotificationType(TLbsNetPosRequestPrivacy& aPrivacy) + { + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + SUPLLOG(ELogP1, "CSuplInit::NotificationType() Begin\n"); + + if (iData->message.u.msSUPLINIT->m.notificationPresent == 0) + { + aPrivacy.SetRequestAdvice(TLbsNetPosRequestPrivacy::ERequestAdviceSilent); + aPrivacy.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow); + } + else + { + ASN1T_Notification& notification = iData->message.u.msSUPLINIT->notification; + + // populate privacy request according to notification type. + switch (notification.notificationType) + { + case NotificationType::noNotificationNoVerification: + { + aPrivacy.SetRequestAdvice(TLbsNetPosRequestPrivacy::ERequestAdviceSilent); + aPrivacy.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow); + break; + } + case NotificationType::notificationOnly: + { + aPrivacy.SetRequestAdvice(TLbsNetPosRequestPrivacy::ERequestAdviceNotify); + aPrivacy.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow); + break; + } + case NotificationType::notificationAndVerficationAllowedNA: + { + aPrivacy.SetRequestAdvice(TLbsNetPosRequestPrivacy::ERequestAdviceVerify); + aPrivacy.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow); + break; + } + case NotificationType::notificationAndVerficationDeniedNA: + { + aPrivacy.SetRequestAdvice(TLbsNetPosRequestPrivacy::ERequestAdviceVerify); + aPrivacy.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionReject); + break; + } + case NotificationType::privacyOverride: + { + // this is option is not implemented by the LBS subsystem + aPrivacy.SetRequestAdvice(TLbsNetPosRequestPrivacy::ERequestAdviceStealth); + aPrivacy.SetRequestAction(TLbsNetPosRequestPrivacy::ERequestActionAllow); + break; + } + default: + { + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + SUPLLOG(ELogP1, "CSuplInit::NotificationType() Error - invalid notification type\n"); + return KErrNotFound; + } + } + } + + SUPLLOG(ELogP1, "CSuplInit::NotificationType() End\n"); + return KErrNone; + } + +/** +ExternalRequestInfoPresent() + +@return ETrue if optional requestor id and/or client name subparameter of the + notification element is present + EFalse otherwise +*/ +EXPORT_C TBool CSuplInit::ExternalRequestInfoPresent() + { + SUPLLOG(ELogP1, "CSuplInit::ExternalRequestInfoPresent() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + if (iData->message.u.msSUPLINIT->m.notificationPresent != 0) + { + if (iData->message.u.msSUPLINIT->notification.m.requestorIdPresent != 0 || + iData->message.u.msSUPLINIT->notification.m.clientNamePresent != 0 ) + { + SUPLLOG(ELogP1, "CSuplInit::ExternalRequestInfoPresent(ETrue) End\n"); + return ETrue; + } + } + SUPLLOG(ELogP1, "CSuplInit::ExternalRequestInfoPresent(EFalse) End\n"); + return EFalse; + } + + +/** +ExternalRequestInfo() + +Populates aRequestInfo according to SUPL INIT requestor id and/or client name +sub-elements of the notification element. + +@param aRequestInfo, populated according to received notification element +@return KErrNotFound if the notification element is not present + KErrNone otherwise +*/ +EXPORT_C TInt CSuplInit::GetExternalRequestInfo(TLbsExternalRequestInfo& aRequestInfo) + { + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + SUPLLOG(ELogP1, "CSuplInit::ExternalRequestInfo() Begin\n"); + + if (iData->message.u.msSUPLINIT->m.notificationPresent != 0) + { + ASN1T_Notification& notification = iData->message.u.msSUPLINIT->notification; + + // process requestor ID if it is present + if (notification.m.requestorIdPresent != 0 && notification.m.requestorIdTypePresent != 0) + { + // requestor type + switch (notification.requestorIdType) + { + case FormatIndicator::logicalName: + { + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatLogicalName); + break; + } + case FormatIndicator::e_mailAddress: + { + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatEmailAddress); + break; + } + case FormatIndicator::msisdn: + { + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatMSISDN); + break; + } + case FormatIndicator::url: + { + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatURL); + break; + } + case FormatIndicator::sipUrl: + { + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatSIPURL); + break; + } + case FormatIndicator::min: + { + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatMIN); + break; + } + case FormatIndicator::mdn: + { + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatMDN); + break; + } + default: + { + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + aRequestInfo.SetRequesterIdFormat(TLbsExternalRequestInfo::EFormatUnknown); + break; + } + } + + // requestor id + ASN1T_Notification_requestorId& requestorId = notification.requestorId; + TPtrC8 ptr(requestorId.data, requestorId.numocts); + aRequestInfo.SetRequesterId(ptr); + + // requestor encoding type + switch (notification.encodingType) + { + case EncodingType::ucs2: + { + aRequestInfo.SetRequesterIdCodingScheme(TLbsExternalRequestInfo::ECodingSchemeUCS2); + break; + } + case EncodingType::gsmDefault: + { + aRequestInfo.SetRequesterIdCodingScheme(TLbsExternalRequestInfo::ECodingSchemeGSMDefault); + break; + } + case EncodingType::utf8: + { + aRequestInfo.SetRequesterIdCodingScheme(TLbsExternalRequestInfo::ECodingSchemeUTF8); + break; + } + default: + { + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + aRequestInfo.SetRequesterIdCodingScheme(TLbsExternalRequestInfo::ECodingSchemeUnknown); + break; + } + } + } + + // process Client Name if it is present + if (notification.m.clientNamePresent != 0 && notification.m.clientNameTypePresent != 0) + { + // client name type + switch (notification.clientNameType) + { + case FormatIndicator::logicalName: + { + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatLogicalName); + break; + } + case FormatIndicator::e_mailAddress: + { + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatEmailAddress); + break; + } + case FormatIndicator::msisdn: + { + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatMSISDN); + break; + } + case FormatIndicator::url: + { + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatURL); + break; + } + case FormatIndicator::sipUrl: + { + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatSIPURL); + break; + } + case FormatIndicator::min: + { + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatMIN); + break; + } + case FormatIndicator::mdn: + { + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatMDN); + break; + } + default: + { + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + aRequestInfo.SetClientNameFormat(TLbsExternalRequestInfo::EFormatUnknown); + break; + } + } + + // client name + ASN1T_Notification_clientName& clientName = notification.clientName; + TPtrC8 ptr(clientName.data, clientName.numocts); + aRequestInfo.SetClientName(ptr); + + // client name encoding type + switch (notification.encodingType) + { + case EncodingType::ucs2: + { + aRequestInfo.SetClientNameCodingScheme(TLbsExternalRequestInfo::ECodingSchemeUCS2); + break; + } + case EncodingType::gsmDefault: + { + aRequestInfo.SetClientNameCodingScheme(TLbsExternalRequestInfo::ECodingSchemeGSMDefault); + break; + } + case EncodingType::utf8: + { + aRequestInfo.SetClientNameCodingScheme(TLbsExternalRequestInfo::ECodingSchemeUTF8); + break; + } + default: + { + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + aRequestInfo.SetClientNameCodingScheme(TLbsExternalRequestInfo::ECodingSchemeUnknown); + break; + } + } + } + + SUPLLOG(ELogP1, "CSuplInit::ExternalRequestInfo() End\n"); + return KErrNone; + } + + // notification element not present. + SUPLLOG(ELogP1, "CSuplInit::ExternalRequestInfo() End (Notification element not present)\n"); + return KErrNotFound; + } + + +/** +SlpAddressPresent() + +The SLP address is mandatory for non-Proxy mode operation, for proxy mode +operation the paramater is optional. + +@return ETrue if optional SLP address parameter is present, EFalse otherwise +*/ +EXPORT_C TBool CSuplInit::SlpAddressPresent() + { + SUPLLOG(ELogP1, "CSuplInit::SlpAddressPresent() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + if (iData->message.u.msSUPLINIT->m.sLPAddressPresent != 0) + { + SUPLLOG(ELogP1, "CSuplInit::SlpAddressPresent(ETrue) End\n"); + return ETrue; + } + + SUPLLOG(ELogP1, "CSuplInit::SlpAddressPresent(EFalse) End\n"); + return EFalse; + } + + +/** +SlpAddress() + +Populates aAddress according to SUPL INIT SLP address parameter + +The SLP address is mandatory for non-Proxy mode operation, for proxy mode +operation the paramater is optional. + +@param aAddress, populated according to the SLP Address Parameter +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplInit::GetSlpAddress(CSuplSlpAddress& aAddress) + { + SUPLLOG(ELogP1, "CSuplInit::SlpAddress() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + if (iData->message.u.msSUPLINIT->m.sLPAddressPresent == 0) + { + SUPLLOG(ELogP1, "CSuplInit::SlpAddress() End (SLP Address Not Present)\n"); + return KErrNotFound; + } + + ASN1T_SLPAddress& slpAddress = iData->message.u.msSUPLINIT->sLPAddress; + + switch (slpAddress.t) + { + case T_SLPAddress_iPAddress: + { + // SLP ID is an IP Address + aAddress.iSlpAddressType = ESuplSlpAddressTypeIp; + + // Pointer to the address data buffer + TBuf8<16>& ipAddress = aAddress.iIpAddress->iIpAddress; + + // IPv4 or IPv6 address? + if (slpAddress.u.iPAddress->t == T_IPAddress_ipv6Address) + { + aAddress.iIpAddress->iIpAddressType = ESuplIpAddressTypeV6; + TInt len = slpAddress.u.iPAddress->u.ipv6Address->numocts; + TUint8* data = slpAddress.u.iPAddress->u.ipv6Address->data; + ipAddress.Copy(data, len); + } + else + { + aAddress.iIpAddress->iIpAddressType = ESuplIpAddressTypeV4; + TInt len = slpAddress.u.iPAddress->u.ipv4Address->numocts; + TUint8* data = slpAddress.u.iPAddress->u.ipv4Address->data; + ipAddress.Copy(data, len); + } + break; + } + case T_SLPAddress_fQDN: + { + // FQDN is a NULL terminated string, length 1..255 + aAddress.iSlpAddressType = ESuplSlpAddressTypeFqdn; + + // find the length of the FQDN (NULL terminated) + const TUint8* tmp = (const TUint8*)slpAddress.u.fQDN; + TPtrC8 source = TPtrC8(tmp, 256); + _LIT8(KNull,"\0"); + TInt fqdnLength = source.Find(KNull); + + if (fqdnLength > 0 && fqdnLength <256) + { + // copy to the container + source.Set(tmp, fqdnLength); + TBuf8<256>& fqdn = aAddress.iFqdn->iFqdn; + fqdn.Copy(source); + fqdn.SetLength(fqdnLength); + } + else + { + // fqdn length is corrupt + __ASSERT_DEBUG(0, User::Invariant()); + return KErrCorrupt; + } + break; + } + case T_SLPAddress_extElem1: + default: + { + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + return KErrUnknown; + } + } + + SUPLLOG(ELogP1, "CSuplInit::SlpAddress() End\n"); + return KErrNone; + } + +/** +QopPresent() + +@return ETrue if optional QoP parameter is present, EFalse otherwise +*/ +EXPORT_C TBool CSuplInit::QopPresent() + { + SUPLLOG(ELogP1, "CSuplInit::QopPresent() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + if (iData->message.u.msSUPLINIT->m.qoPPresent != 0) + { + SUPLLOG(ELogP1, "CSuplInit::QopPresent(ETrue) End\n"); + return ETrue; + } + + SUPLLOG(ELogP1, "CSuplInit::QopPresent(EFalse) End\n"); + return EFalse; + } + + +/** +Qop() + +Populates aAddress according to SUPL INIT QoP parameter + +@param aQuality, populated according to QoP parameter +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplInit::GetQop (TLbsNetPosRequestQuality& aQuality) + { + SUPLLOG(ELogP1, "CSuplInit::Qop() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + if (iData->message.u.msSUPLINIT->m.qoPPresent == 0) + { + SUPLLOG(ELogP1, "CSuplInit::Qop() End (QoP element not present)\n"); + return KErrNotFound; + } + + ASN1T_QoP& qop = iData->message.u.msSUPLINIT->qoP; + + // horizontal accuracy + // convert to meters according to 3GPP TS 23.032 + TReal temp ; + Math::Pow(temp, 1.1, qop.horacc); + TReal accuracy = 10 * (temp - 1); + aQuality.SetMinHorizontalAccuracy(accuracy); + + // vertical accuracy + if (qop.m.veraccPresent) + { + // convert to meters according to 3GPP TS 23.032 + Math::Pow(temp, 1.025, qop.veracc); + TReal verAccuracy = 45 * (temp - 1); + aQuality.SetMinVerticalAccuracy(verAccuracy); + } + else + { + // Set vertical accuracy to NaN + TRealX nan; + nan.SetNaN(); + aQuality.SetMinVerticalAccuracy(nan); + } + + // max location age (max fix age) + if (qop.m.maxLocAgePresent) + { + // convert from seconds to microseconds + TTimeIntervalMicroSeconds maxLocAge(qop.maxLocAge * 1000 * 1000); + aQuality.SetMaxFixAge(maxLocAge); + } + + // delay (max fix time) + if (qop.m.delayPresent) + { + Math::Pow(temp, 2, qop.delay); + TTimeIntervalMicroSeconds maxFixTime(temp * 1000 * 1000); + aQuality.SetMaxFixTime(maxFixTime); + } + + SUPLLOG(ELogP1, "CSuplInit::Qop() End\n"); + return KErrNone; + } + +/** +SlpMode() + +Returns the SLP mode specified in the received SUPL INIT message. +Note that this implementation of the SUPL ASN1 does not include full support +of non-proxy operation. + +@return the mode of operation supported by the SLP, either proxy or non-proxy. +*/ +EXPORT_C CSuplInit::TSuplSlpMode CSuplInit::SlpMode() + { + SUPLLOG(ELogP1, "CSuplInit::SlpMode() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLINIT != NULL, User::Invariant()); + + if (iData->message.u.msSUPLINIT->sLPMode == SLPMode::proxy) + { + SUPLLOG(ELogP1, "CSuplInit::SlpMode(EProxyMode) End\n"); + return CSuplInit::ESuplSlpModeProxy; + } + + SUPLLOG(ELogP1, "CSuplInit::SlpMode(ENonProxyMode) End\n"); + return CSuplInit::ESuplSlpModeNonProxy; + } + +/** +SetReceivedMessageL() + +Stores a copy of the unencoded received message data. This is required in the +calculation of the hash key for SUPL INIT authorisation. + +@param aData - descriptor containing the received SUPL INIT message +@leave KErrNoMemory or other error codes +*/ +void CSuplInit::SetReceivedMessageL(const TDesC8& aData) + { + SUPLLOG(ELogP1, "CSuplInit::SetReceivedMessageL() Begin\n"); + delete iMessage; + iMessage = NULL; + iMessage = HBufC8::NewL(aData.Length()); + *iMessage = aData; + SUPLLOG(ELogP1, "CSuplInit::SetReceivedMessageL() End\n"); + } + + +/** +GetVerL() + +Returns the encoded hash of the received SUPL INIT message. +VER=H(H-SLP XOR opad, H(H-SLP XOR ipad, SUPL INIT)) + +@param aHSlp - the provisioned H-SLP address +@return descriptor pointer to the encoded hash of the received message +*/ +EXPORT_C TPtrC8 CSuplInit::GetVerL(const TDesC8 &aHSlp) + { + SUPLLOG(ELogP1, "CSuplInit::GetVerL() Begin\n"); + CMessageDigest *sha1 = CSHA1::NewL(); + CleanupStack::PushL(sha1); + CHMAC *hmac = CHMAC::NewL(aHSlp, sha1); + // If construction works, the CHMAC takes ownership of the sha1 object + CleanupStack::Pop(sha1); + CleanupStack::PushL(hmac); + + TPtrC8 hmac_value = hmac->Final(iMessage->Des()); + + // store the hmac. + iVer.Copy(hmac_value.Left(8)); + iVer.SetLength(8); + + CleanupStack::PopAndDestroy(hmac); + + // return a pointer to it. + TPtrC8 ver(iVer.Ptr(), 8); + + SUPLLOG(ELogP1, "CSuplInit::GetVerL() End\n"); + return ver; + } + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplmessagebase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplmessagebase.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,1186 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "ULP.h" +#include "suplmessagebase.h" +#include "suplpos.h" +#include "supldevloggermacros.h" +#include "suplrrlpasn1common.h" +#include +#include +#include +#include +#include +#include + +/** +Default constructor +*/ +CSuplMessageBase::CSuplMessageBase(TSuplMessageType aType, TBool aIsOutgoingMessage) + : iSuplMessageType(aType), iIsOutgoingMessage(aIsOutgoingMessage) + { + } + +/** +Destructor +*/ +CSuplMessageBase::~CSuplMessageBase() + { + SUPLLOG(ELogP1, "CSuplMessageBase::~CSuplMessageBase() Begin\n"); + delete iControl; + delete iData; + delete iEncodeBuffer; + // release the STDLIB resources associated with this thread + CloseSTDLIB(); + SUPLLOG(ELogP1, "CSuplMessageBase::~CSuplMessageBase() End\n"); + } + +/** +Second stage constructor + +Outgoing messages: constructs the data encapsulation and control objects. +Incoming message: no action +*/ +void CSuplMessageBase::ConstructL() + { + if (iIsOutgoingMessage) + { + iData = new (ELeave) ASN1T_ULP_PDU(); + ASN1Context* context = new (ELeave) ASN1Context; + CleanupDeletePushL(context); + iControl = new (ELeave) ASN1C_ULP_PDU(*context, *iData); + // construction of iControl successful, pop context off the cleanup stack + CleanupStack::Pop(context); + + // set the version parameter of the outgoing message + iData->version.maj = 1; + iData->version.min = 0; + iData->version.servind = 0; + } + } + + +/** +EncodeToL() + +Encode a populated outgoing message to the specified buffer. + +@param aBuf buffer pointer +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplMessageBase::EncodeToL(TPtr8& aBuf) + { + SUPLLOG(ELogP1, "CSuplMessageBase::EncodeToL() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + + TInt retval = KErrNone; + + // buffer pointer, fixed max length + TUint8* msgBuf = (TUint8*)aBuf.Ptr(); + TInt maxLength = aBuf.MaxLength(); + + // Log the un-encoded SUPL values + SUPLLOG(ELogP9, "-> ENCODING SUPL MESSAGE FOR SENDING\n"); + //LogMessageContent(); + + // if the message is a SUPL POS, encode the payload + if (iData->message.t == T_UlpMessage_msSUPLPOS) + { + CSuplPos* suplPos = reinterpret_cast (this); + retval = suplPos->EncodePosPayloadL(); + if (retval != KErrNone) + { + SUPLLOG(ELogP1, "CSuplMessageBase::EncodeToL() Error encoding Positioning Payload\n"); + return retval; + } + } + + // construct the encode buffer control object + iEncodeBuffer = new (ELeave) ASN1PEREncodeBuffer (msgBuf, (unsigned int)maxLength, FALSE, (OSRTContext*)iControl->getContext()); + + // Encode the message to the buffer + TInt stat = iControl->EncodeTo(*iEncodeBuffer); + + if (stat == 0) + { + // Set the length according to reported buffer length + TInt len = iEncodeBuffer->getMsgLen (); + iData->length = len; + aBuf.SetLength(len); + + // clear the encoded length field + msgBuf[0] = 0; + msgBuf[1] = 0; + + // set the encoded length field + msgBuf[0] |= (TUint8)( len >> 8 ); + msgBuf[1] |= (TUint8)( len ); + } + else + { + retval = ProcessAsn1Error(stat); + } + + // finished with encode buffer object + delete iEncodeBuffer; + iEncodeBuffer = NULL; + + // Log the encoded ASN1 + SUPLLOG(ELogP8, "-> ENCODED SUPL MESSAGE FOR SENDING (HEX)\n"); + SUPLLOGHEX(ELogP8, aBuf.Ptr(), aBuf.Length()); + + SUPLLOG2(ELogP1, "CSuplMessageBase::EncodeToL() End (retval = %d)\n", retval); + return retval; + } + +/** +SetDecodedData() + +Assign decoded ASN1 data, for received messages. +Takes ownership of passed objects. + +@param aData data structure containing decoded message parameters +@param aControl control structure associated with decoded data structure. +*/ +void CSuplMessageBase::SetDecodedData(ASN1T_ULP_PDU* aData, ASN1C_ULP_PDU* aControl) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetDecodedData() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + iData = aData; + iControl = aControl; + SUPLLOG(ELogP1, "CSuplMessageBase::SetDecodedData() End\n"); + } + + +/** +SetVersion() + +Set the SUPL version used +@param aVersion SUPL version in use +*/ +EXPORT_C void CSuplMessageBase::SetVersion(CSuplVersion& aVersion) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetVersion() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + + SUPLLOG2(ELogP1, " - TInt iMaj = %d\n", aVersion.iMaj); + SUPLLOG2(ELogP1, " - TInt iMin = %d\n", aVersion.iMin); + SUPLLOG2(ELogP1, " - TInt iServind = %d\n", aVersion.iServind); + + iData->version.maj = aVersion.iMaj; + iData->version.min = aVersion.iMin; + iData->version.servind = aVersion.iServind; + SUPLLOG(ELogP1, "CSuplMessageBase::SetVersion() End\n"); + } + + +/** +SetSessionId() + +Set the SUPL Session ID +@param aSessionId session identifier +*/ +EXPORT_C TInt CSuplMessageBase::SetSessionId(CSuplSessionId& aSessionId) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + + // local reference to context object + OSCTXT* pctxt = iControl->getCtxtPtr(); + + // populate SET Session ID, if present + // note this should always be present as this method is for building + // outgoing messages. + if (aSessionId.iSetSessionIdPresent) + { + iData->sessionID.m.setSessionIDPresent = 1; + + // SET Session ID / Session ID + iData->sessionID.setSessionID.sessionId = aSessionId.iSetSessionId->iSessionId; + + // SET Session ID / SET ID + ASN1T_SETId& setId = iData->sessionID.setSessionID.setId; + switch (aSessionId.iSetSessionId->iSetId->iSetIdType) + { + case ESuplSetIdTypeIPAddress: + { + // ID is based on IP Address + setId.t = T_SETId_iPAddress; + setId.u.iPAddress = (ASN1T_IPAddress*)rtxMemAllocZ(pctxt, sizeof(ASN1T_IPAddress)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + + if (aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddressType == ESuplIpAddressTypeV6) + { + setId.u.iPAddress->t = T_IPAddress_ipv6Address; + setId.u.iPAddress->u.ipv6Address = (ASN1T_IPAddress_ipv6Address*)rtxMemAllocZ(pctxt, sizeof(ASN1T_IPAddress_ipv6Address)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + + TInt len = aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddress.Length(); + void* data = (void*)aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddress.Ptr(); + memcpy ((void*)setId.u.iPAddress->u.ipv6Address->data, data, len); + setId.u.iPAddress->u.ipv6Address->numocts = len; + } + else + { + setId.u.iPAddress->t = T_IPAddress_ipv4Address; + setId.u.iPAddress->u.ipv4Address = (ASN1T_IPAddress_ipv4Address*)rtxMemAllocZ(pctxt, sizeof(ASN1T_IPAddress_ipv4Address)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + + TInt len = aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddress.Length(); + void* data = (void*)aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddress.Ptr(); + memcpy ((void*)setId.u.iPAddress->u.ipv4Address->data, data, len); + setId.u.iPAddress->u.ipv4Address->numocts = len; + } + break; + } + + case ESuplSetIdTypeMsisdn: + { + setId.t = T_SETId_msisdn; + setId.u.msisdn = (ASN1T_SETId_msisdn*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SETId_msisdn)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + TInt len = aSessionId.iSetSessionId->iSetId->iSetId.Length(); + void* data = (void*)aSessionId.iSetSessionId->iSetId->iSetId.Ptr(); + memcpy ((void*)setId.u.msisdn->data, data, len); + setId.u.msisdn->numocts = len; + break; + } + + case ESuplSetIdTypeMdn: + { + setId.t = T_SETId_mdn; + setId.u.mdn = (ASN1T_SETId_mdn*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SETId_mdn)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + TInt len = aSessionId.iSetSessionId->iSetId->iSetId.Length(); + void* data = (void*)aSessionId.iSetSessionId->iSetId->iSetId.Ptr(); + memcpy ((void*)setId.u.mdn->data, data, len); + setId.u.mdn->numocts = len; + break; + } + + case ESuplSetIdTypeMin: + { + setId.t = T_SETId_min; + setId.u.min = (ASN1T_SETId_min*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SETId_min)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + TInt len = aSessionId.iSetSessionId->iSetId->iSetId.Length(); + void* data = (void*)aSessionId.iSetSessionId->iSetId->iSetId.Ptr(); + memcpy ((void*)setId.u.min->data, data, len); + setId.u.min->numbits = len*8; + break; + } + + case ESuplSetIdTypeImsi: + { + setId.t = T_SETId_imsi; + setId.u.imsi = (ASN1T_SETId_imsi*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SETId_imsi)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + TInt len = aSessionId.iSetSessionId->iSetId->iSetId.Length(); + void* data = (void*)aSessionId.iSetSessionId->iSetId->iSetId.Ptr(); + memcpy ((void*)setId.u.imsi->data, data, len); + setId.u.imsi->numocts = len; + break; + } + + case ESuplSetIdTypeNai: + default: + { + __ASSERT_DEBUG(0, User::Invariant()); + return KErrNotSupported; + } + } + } + + // populate SLP Session ID, if present + // note this may not be present if building an outgoing SUPL START message, + // as it is specified by the first incoming message from the SLP. + if (aSessionId.iSlpSessionIdPresent) + { + iData->sessionID.m.slpSessionIDPresent = 1; + + // SLP Session ID / Session ID + TInt len = aSessionId.iSlpSessionId->iSessionId.Length(); + void* data = (void*)aSessionId.iSlpSessionId->iSessionId.Ptr(); + memcpy ((void*)iData->sessionID.slpSessionID.sessionID.data, data, len); + iData->sessionID.slpSessionID.sessionID.numocts = len; + + // SLP Session ID / SLP ID + if (aSessionId.iSlpSessionId->iSlpAddress->iSlpAddressType == ESuplSlpAddressTypeFqdn) + { + iData->sessionID.slpSessionID.slpId.t = T_SLPAddress_fQDN; + TInt len = aSessionId.iSlpSessionId->iSlpAddress->iFqdn->iFqdn.Length(); + + // allocate memory for the FQDN string + char* tmpstr = (char*) rtxMemAlloc (pctxt, len+1); + if (tmpstr == NULL) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + + void* source = (void*)aSessionId.iSlpSessionId->iSlpAddress->iFqdn->iFqdn.Ptr(); + memcpy ((void*)tmpstr, source, len); + tmpstr[len] = '\0'; // add null-terminator + iData->sessionID.slpSessionID.slpId.u.fQDN = tmpstr; + } + else + { + // SLP ID is an IP address + iData->sessionID.slpSessionID.slpId.t = T_SLPAddress_iPAddress; + iData->sessionID.slpSessionID.slpId.u.iPAddress = (ASN1T_IPAddress*)rtxMemAllocZ(pctxt, sizeof(ASN1T_IPAddress)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + + if (aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddressType == ESuplIpAddressTypeV6) + { // IPv6 + iData->sessionID.slpSessionID.slpId.u.iPAddress->t = T_IPAddress_ipv6Address; + iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv6Address = (ASN1T_IPAddress_ipv6Address*)rtxMemAllocZ(pctxt, sizeof(ASN1T_IPAddress_ipv6Address)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + + TInt len = aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddress.Length(); + void* data = (void*)aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddress.Ptr(); + memcpy ((void*)iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv6Address->data, data, len); + iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv6Address->numocts = len; + } + else + { // IPv4 + iData->sessionID.slpSessionID.slpId.u.iPAddress->t = T_IPAddress_ipv4Address; + iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv4Address = (ASN1T_IPAddress_ipv4Address*)rtxMemAllocZ(pctxt, sizeof(ASN1T_IPAddress_ipv4Address)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() Error, out of memory\n"); + return KErrNoMemory; + } + + TInt len = aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddress.Length(); + void* data = (void*)aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddress.Ptr(); + memcpy ((void*)iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv4Address->data, data, len); + iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv4Address->numocts = len; + } + } + } + SUPLLOG(ELogP1, "CSuplMessageBase::SetSessionId() End\n"); + return KErrNone; + } + +/** +MessageType() + +Returns the message type +@return message type (set at construction) +*/ +EXPORT_C CSuplMessageBase::TSuplMessageType CSuplMessageBase::MessageType() + { + SUPLLOG(ELogP1, "CSuplMessageBase::MessageType() Begin\n"); + SUPLLOG2(ELogP1, "CSuplMessageBase::MessageType() End (message type = %d)\n", iSuplMessageType); + return iSuplMessageType; + } + +/** +GetVersion() + +Populates aVersion with the SUPL version +@param aVersion on return, populated with version of received SUPL message +*/ +EXPORT_C TInt CSuplMessageBase::GetVersion(CSuplVersion& aVersion) + { + SUPLLOG(ELogP1, "CSuplMessageBase::Version() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + aVersion.iMaj = iData->version.maj; + aVersion.iMin = iData->version.min; + aVersion.iServind = iData->version.servind; + + SUPLLOG(ELogP1, "CSuplMessageBase::Version() End\n"); + return KErrNone; + } + +/** +GetSessionId() + +Populates aSessionId with the SUPL Session ID + +@param aSessionId on return, populated with session ID of received SUPL message +*/ +EXPORT_C TInt CSuplMessageBase::GetSessionId(CSuplSessionId& aSessionId) + { + SUPLLOG(ELogP1, "CSuplMessageBase::SessionId() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + + // populate SET Session ID, if present + // note in the case of a received SUPL INIT message, the + // SET Session ID is not present. + if (iData->sessionID.m.setSessionIDPresent != 0) + { + aSessionId.iSetSessionIdPresent = ETrue; + aSessionId.iSetSessionId->iSessionId = iData->sessionID.setSessionID.sessionId; + ASN1T_SETId& setId = iData->sessionID.setSessionID.setId; + + switch (setId.t) + { + case T_SETId_iPAddress: + { + aSessionId.iSetSessionId->iSetId->iSetIdType = ESuplSetIdTypeIPAddress; + // Pointer to the address data buffer + TBuf8<16>& ipAddress = aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddress; + + // IPv4 or IPv6 address? + if (setId.u.iPAddress->t == T_IPAddress_ipv6Address) + { + aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddressType = ESuplIpAddressTypeV6; + TInt len = setId.u.iPAddress->u.ipv6Address->numocts; + TUint8* data = setId.u.iPAddress->u.ipv6Address->data; + ipAddress.Copy(data, len); + } + else + { + aSessionId.iSetSessionId->iSetId->iIpAddress->iIpAddressType = ESuplIpAddressTypeV4; + TInt len = setId.u.iPAddress->u.ipv4Address->numocts; + TUint8* data = setId.u.iPAddress->u.ipv4Address->data; + ipAddress.Copy(data, len); + } + break; + } + case T_SETId_msisdn: + { + aSessionId.iSetSessionId->iSetId->iSetIdType = ESuplSetIdTypeMsisdn; + TBuf8<16>& targetSetId = aSessionId.iSetSessionId->iSetId->iSetId; + TInt len = setId.u.msisdn->numocts; + TUint8* data = setId.u.msisdn->data; + targetSetId.Copy(data, len); + break; + } + case T_SETId_mdn: + { + aSessionId.iSetSessionId->iSetId->iSetIdType = ESuplSetIdTypeMdn; + TBuf8<16>& targetSetId = aSessionId.iSetSessionId->iSetId->iSetId; + TInt len = setId.u.mdn->numocts; + TUint8* data = setId.u.mdn->data; + targetSetId.Copy(data, len); + break; + } + case T_SETId_min: + { + aSessionId.iSetSessionId->iSetId->iSetIdType = ESuplSetIdTypeMin; + TBuf8<16>& targetSetId = aSessionId.iSetSessionId->iSetId->iSetId; + TInt len = 5; // min is limited to 5 bytes (34 bits). Copy it all. + TUint8* data = setId.u.min->data; + targetSetId.Copy(data, len); + break; + } + case T_SETId_imsi: + { + aSessionId.iSetSessionId->iSetId->iSetIdType = ESuplSetIdTypeImsi; + TBuf8<16>& targetSetId = aSessionId.iSetSessionId->iSetId->iSetId; + TInt len = setId.u.imsi->numocts; + TUint8* data = setId.u.imsi->data; + targetSetId.Copy(data, len); + break; + } + case T_SETId_nai: + { + // we should not receive SET IDs of these types, as we will never + // have set them in the first outgoing message. + __ASSERT_DEBUG(0, User::Invariant()); + return KErrNotSupported; + } + case T_SETId_extElem1: + default: + { + __ASSERT_DEBUG(0, User::Invariant()); + return KErrCorrupt; + } + } + } // end of SET Session ID handling + + // populate SLP Session ID, if present + // note this should always be present as this method is intended for the + // decoding of received messages. + if (iData->sessionID.m.slpSessionIDPresent != 0) + { + aSessionId.iSlpSessionIdPresent = ETrue; + TUint8* dataSource = iData->sessionID.slpSessionID.sessionID.data; + TInt len = iData->sessionID.slpSessionID.sessionID.numocts; + aSessionId.iSlpSessionId->iSessionId.Copy(dataSource, len); + + if (iData->sessionID.slpSessionID.slpId.t == T_SLPAddress_fQDN) + { + // FQDN is a NULL terminated string, length 1..255 + aSessionId.iSlpSessionId->iSlpAddress->iSlpAddressType = ESuplSlpAddressTypeFqdn; + + // find the length of the FQDN (NULL terminated) + const TUint8* tmp = (const TUint8*)iData->sessionID.slpSessionID.slpId.u.fQDN; + TPtrC8 source = TPtrC8(tmp, 256); + _LIT8(KNull,"\0"); + TInt fqdnLength = source.Find(KNull); + + if (fqdnLength > 0 && fqdnLength <256) + { + // copy to the container + source.Set(tmp, fqdnLength); + TBuf8<256>& fqdn = aSessionId.iSlpSessionId->iSlpAddress->iFqdn->iFqdn; + fqdn.Copy(source); + fqdn.SetLength(fqdnLength); + } + else + { + // fqdn length is corrupt + __ASSERT_DEBUG(0, User::Invariant()); + return KErrCorrupt; + } + } + else if (iData->sessionID.slpSessionID.slpId.t == T_SLPAddress_iPAddress) + { + // SLP ID is an IP Address + aSessionId.iSlpSessionId->iSlpAddress->iSlpAddressType = ESuplSlpAddressTypeIp; + + // Pointer to the address data buffer + TBuf8<16>& ipAddress = aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddress; + + // IPv4 or IPv6 address? + if (iData->sessionID.slpSessionID.slpId.u.iPAddress->t == T_IPAddress_ipv6Address) + { + aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddressType = ESuplIpAddressTypeV6; + TInt len = iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv6Address->numocts; + TUint8* data = iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv6Address->data; + ipAddress.Copy(data, len); + } + else + { + aSessionId.iSlpSessionId->iSlpAddress->iIpAddress->iIpAddressType = ESuplIpAddressTypeV4; + TInt len = iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv4Address->numocts; + TUint8* data = iData->sessionID.slpSessionID.slpId.u.iPAddress->u.ipv4Address->data; + ipAddress.Copy(data, len); + } + } + else + { + // SLP ID Type is corrupt + __ASSERT_DEBUG(0, User::Invariant()); + SUPLLOG(ELogP1, "CSuplMessageBase::SessionId() End (unexpected SLP ID type)\n"); + return KErrCorrupt; + } + } // end of SLP Session ID handling + + SUPLLOG(ELogP1, "CSuplMessageBase::SessionId() End\n"); + return KErrNone; + } + +/** +PopulateSetCapabilities() + +Populates the data container specifying the content of the SET CAPABILITIES +componenet according to the passed LBS capabilities. + +Note that the Preferred Method parameter is set to the method identified +LAST in the array of capable methods. It is acceptable if this method is +repeated elsewhere in the passed array. + +@param aCapsSource Capabilities Source +@param aCapsTarget outgoing capabilities data object +@return error indication, KErrNone otherwise +*/ +TInt CSuplMessageBase::PopulateSetCapabilities(const TLbsNetPosCapabilities& aCapsSource, ASN1T_SETCapabilities& aCapsTarget) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateSetCapabilities() Begin\n"); + + // Specify supported positioning protocols. This implementation supports only RRLP + aCapsTarget.posProtocol.rrlp = ETrue; + + // the preferred method is the last identified in the array. + TInt prefMethod = PrefMethod::noPreference; + + // specify supported positioning methods + TLbsNetPosMethod posMethod; + for (TInt i=0 ; igetCtxtPtr(); + + // Cell information status + aLocTarget.status = aLocSource.iStatus; + + // Cell information is carrier type dependant + if (aLocSource.iType == ESuplLocationTypeGsm) + { + aLocTarget.cellInfo.t = T_CellInfo_gsmCell; + aLocTarget.cellInfo.u.gsmCell = (ASN1T_GsmCellInformation*)rtxMemAllocZ(pctxt, sizeof(ASN1T_GsmCellInformation)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateLocationId() Error, out of memory\n"); + return KErrNoMemory; + } + + // populate the cell information + CSuplGsmCellInfo* gsmInfo = aLocSource.iGsmCellInfo; + aLocTarget.cellInfo.u.gsmCell->refMCC = gsmInfo->iRefMCC; + aLocTarget.cellInfo.u.gsmCell->refMNC = gsmInfo->iRefMNC; + aLocTarget.cellInfo.u.gsmCell->refLAC = gsmInfo->iRefLAC; + aLocTarget.cellInfo.u.gsmCell->refCI = gsmInfo->iRefCI; + + // NMR is optional + if (gsmInfo->iNMR > 0) + { + + aLocTarget.cellInfo.u.gsmCell->m.nMRPresent = 1; + + // initialise the NMR list + ASN1C_NMR list (*iControl, aLocTarget.cellInfo.u.gsmCell->nMR); + list.init(); + + // populate the array + for (TInt i = 0; i < gsmInfo->iNMR; ++i) + { + ASN1T_NMRelement* nmrElement; + nmrElement = list.NewElement(); + if (nmrElement == NULL) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateLocationId() Error, out of memory\n"); + return KErrNoMemory; + } + nmrElement->aRFCN = gsmInfo->iNmrElements[i].iARFCN; + nmrElement->bSIC = gsmInfo->iNmrElements[i].iBSIC; + nmrElement->rxLev = gsmInfo->iNmrElements[i].iRxLev; + + list.Append(nmrElement); + } + } // NMR + + // TA is optional + if (gsmInfo->iTA >= 0) + { + aLocTarget.cellInfo.u.gsmCell->m.tAPresent = 1; + aLocTarget.cellInfo.u.gsmCell->tA = gsmInfo->iTA; + } + } + else if (aLocSource.iType == ESuplLocationTypeCdma) + { + iData->message.u.msSUPLSTART->locationId.cellInfo.t = T_CellInfo_cdmaCell; + aLocTarget.cellInfo.u.cdmaCell = (ASN1T_CdmaCellInformation*)rtxMemAllocZ(pctxt, sizeof(ASN1T_CdmaCellInformation)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateLocationId() Error, out of memory\n"); + return KErrNoMemory; + } + + // populate the cell information + CSuplCdmaCellInfo* cdmaInfo = aLocSource.iCdmaCellInfo; + aLocTarget.cellInfo.u.cdmaCell->refNID = cdmaInfo->iRefNID; + aLocTarget.cellInfo.u.cdmaCell->refSID = cdmaInfo->iRefSID; + aLocTarget.cellInfo.u.cdmaCell->refBASEID = cdmaInfo->iRefBASEID; + aLocTarget.cellInfo.u.cdmaCell->refBASELAT = cdmaInfo->iRefBASELAT; + aLocTarget.cellInfo.u.cdmaCell->reBASELONG = cdmaInfo->iReBASELONG; + aLocTarget.cellInfo.u.cdmaCell->refREFPN = cdmaInfo->iRefREFPN; + aLocTarget.cellInfo.u.cdmaCell->refWeekNumber = cdmaInfo->iRefWeekNumber; + aLocTarget.cellInfo.u.cdmaCell->refSeconds = cdmaInfo->iRefSeconds; + } + else if (aLocSource.iType == ESuplLocationTypeWcdma) + { + aLocTarget.cellInfo.t = T_CellInfo_wcdmaCell; + aLocTarget.cellInfo.u.wcdmaCell = (ASN1T_WcdmaCellInformation*)rtxMemAllocZ(pctxt, sizeof(ASN1T_WcdmaCellInformation)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateLocationId() Error, out of memory\n"); + return KErrNoMemory; + } + + // populate the cell information + CSuplWcdmaCellInfo* wcdmaInfo = aLocSource.iWcdmaCellInfo; + aLocTarget.cellInfo.u.wcdmaCell->refMCC = wcdmaInfo->iRefMCC; + aLocTarget.cellInfo.u.wcdmaCell->refMNC = wcdmaInfo->iRefMNC; + aLocTarget.cellInfo.u.wcdmaCell->refUC = wcdmaInfo->iRefUC; + } + else + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateLocationId() Error, unexpected location source type\n"); + return KErrArgument; + } + + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateLocationId() End\n"); + return KErrNone; + } + + +/** +PopulatePosition() + +Populates the outgoing position element, used in POS INIT and END messages. + +Timestamp is encoded in UTC format YYMMDDhhmmssZ + +Latitude is encoded as an integer N (0..2^23-1) from the actual latitude X +in degrees, where N <= 2^23 * X/90 < N+1 + +Longitude is encoded as an integer N (-2^23..2^23-1) from the actual +longitude X in degrees, where N <= 2^24 * X/360 < N+1 + +Horizontal Uncertainty is encoded as per 3GPP GAD, ie describing an +ellipse with semi-major and semi-minor axis measurements and orientation. +With only one value for horizontal accuracy available, the circle +described is encoded as an ellipse with semi-major = semi-minor axis and +0 degree orientation. The uncertainty is encoded to 7 bits, thus: + r = C( (1+x)^k - 1 ) +where r = distance in meters, C = 10, x = 0.1 and K is the encoded constant. + +Confidence information is not available in this implementation and is omitted + +Altitude, if data is available, is encoded as a 15 bit binary encoded number. + +Altitude uncertainty is encoded as a distance above or below the WGS84 +ellipsoid, using the same formula as for horizontal uncertainty, but where +C = 45, x = 0.025. Encoded value K is limited to 7 bits. + +If the passed TPositionInfoBase object is a TPositionCourseInfo, then the +optional velocity element is populated with data from the course info object. +Velocity information is encoded as per 3GPP TS 23.032, and the "horizontal +velocity with uncertainty" format is used. + +@param aPosSource Position source data from LBS +@param aPosTarget outgoing Position message data object +@return error indication, KErrNone otherwise +*/ +TInt CSuplMessageBase::PopulatePosition(const TPositionInfoBase& aPosSource, ASN1T_Position& aPosTarget) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulatePosition() Begin\n"); + + // access to source position data + TPosition position; + if ((aPosSource.PositionClassType() & EPositionInfoClass) != 0) + { + TPositionInfo posSource = reinterpret_cast (aPosSource); + posSource.GetPosition(position); + + // TIMESTAMP (mandatory) + // Convert timestamp to UTC format: YYMMDDhhmmssZ + TDateTime dateTime = position.Time().DateTime(); + iUtcTime.SetLength(iUtcTime.MaxLength()); + + iUtcTime[0]=(((dateTime.Year() % 1000) % 100) / 10) + 48; // second last number in the year + iUtcTime[1]=(((dateTime.Year() % 1000) % 100) % 10) + 48; // last number in the year + iUtcTime[2]=((dateTime.Month() + 1) / 10) + 48; + iUtcTime[3]=((dateTime.Month() + 1) % 10) + 48; + iUtcTime[4]=((dateTime.Day()) / 10) + 48; + iUtcTime[5]=((dateTime.Day()) % 10) + 48; + iUtcTime[6]=(dateTime.Hour() / 10) + 48; + iUtcTime[7]=(dateTime.Hour() % 10) + 48; + iUtcTime[8]=(dateTime.Minute() / 10) + 48; + iUtcTime[9]=(dateTime.Minute() % 10) + 48; + iUtcTime[10]=(dateTime.Second() / 10) + 48; + iUtcTime[11]=(dateTime.Second() % 10) + 48; + iUtcTime[12]= 0x5A; // ASCII for "Z" + + aPosTarget.timestamp = (const char*) &iUtcTime[0]; + + // POSITION ESTIMATE (mandatory) + // -- latitude/longitude (mandatory) + aPosTarget.positionEstimate.latitudeSign = PositionEstimate_latitudeSign::north; + TReal64 latitude = position.Latitude(); + TReal64 longitude = position.Longitude(); + if (latitude < 0) + { + aPosTarget.positionEstimate.latitudeSign = PositionEstimate_latitudeSign::south; + latitude *= -1; + } + aPosTarget.positionEstimate.latitude = latitude * KLbsLatitudeConst; + aPosTarget.positionEstimate.longitude = longitude * KLbsLongitudeConst; + + // -- uncertainty (optional) + if (position.HorizontalAccuracy() != 0) + { + TInt uncert = Uncertainty(position.HorizontalAccuracy()); + aPosTarget.positionEstimate.m.uncertaintyPresent = 1; + aPosTarget.positionEstimate.uncertainty.uncertaintySemiMajor = uncert; + aPosTarget.positionEstimate.uncertainty.uncertaintySemiMinor = uncert; + aPosTarget.positionEstimate.uncertainty.orientationMajorAxis = 0; + } + + // -- confidence (optional) + // this information is not available, omitted. + aPosTarget.positionEstimate.m.confidencePresent = 0; + aPosTarget.positionEstimate.confidence = 0; + + // -- altitude information (optional) + if (position.Altitude() != 0) + { + aPosTarget.positionEstimate.m.altitudeInfoPresent = 1; + TReal32 altitude = position.Altitude(); + aPosTarget.positionEstimate.altitudeInfo.altitudeDirection = AltitudeInfo_altitudeDirection::height; + if (altitude < 0) + { + aPosTarget.positionEstimate.altitudeInfo.altitudeDirection = AltitudeInfo_altitudeDirection::depth; + altitude *= -1; + } + aPosTarget.positionEstimate.altitudeInfo.altitude = EncodeAltitude(altitude); + aPosTarget.positionEstimate.altitudeInfo.altUncertainty = UncertaintyAltitude(position.VerticalAccuracy()); + } + } + else + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulatePosition() Error, position class is not EPositionInfoClass type\n"); + return KErrNotSupported; + } + + // handle velocity (TCourse) information + if ((aPosSource.PositionClassType() & EPositionCourseInfoClass) != 0) + { + TPositionCourseInfo posSource = reinterpret_cast (aPosSource); + TCourse course; + posSource.GetCourse(course); + + // -- velocity + aPosTarget.m.velocityPresent = 1; + TInt velErr = PopulateVelocity(course, aPosTarget.velocity); + + if (velErr != KErrNone) + { + return velErr; + } + } + + SUPLLOG(ELogP1, "CSuplMessageBase::PopulatePosition() End\n"); + return KErrNone; + } + +/* +PopulateVelocity() + +Populates the outgoing velocity sub-element with velocity information from +an LBS TCourse object. + +@param aVelSource course/velocity source data from LBS +@param aVelTarget outgoing velocity message data object +@return error indication, KErrNone otherwise +*/ +TInt CSuplMessageBase::PopulateVelocity(const TCourse& aCourse, ASN1T_Velocity& aVelTarget) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateVelocity() Begin\n"); + aVelTarget.t = T_Velocity_horveluncert; + aVelTarget.u.horveluncert = (ASN1T_Horveluncert*)rtxMemAllocZ(iControl->getCtxtPtr(), sizeof(ASN1T_Horveluncert)); + if (iControl->getStatus() != 0) + { + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateVelocity() Error, out of memory\n"); + return KErrNoMemory; + } + + // ---- bearing + TUint bearing = (TUint)aCourse.Heading(); + aVelTarget.u.horveluncert->bearing.numbits = 9; + aVelTarget.u.horveluncert->bearing.data[0] = bearing >> 1; // the first 8 of 9 bits + aVelTarget.u.horveluncert->bearing.data[1] = bearing << 7; // just the 9th bit, in msb + + // ---- horizontal speed. Convert meters per second -> kilomteres per hour + TReal32 horSpeed = aCourse.Speed() * KLbsMpsKmphConstant; + // adjust for GAD encoding and lose decimal precision + horSpeed += 0.5; + TUint horSpeedInt = (TUint)horSpeed; + // limit to 2^16-1 + if (horSpeedInt > 65535) + { + horSpeedInt = 65535; + } + aVelTarget.u.horveluncert->horspeed.numbits = 16; + aVelTarget.u.horveluncert->horspeed.data[0] = horSpeedInt >> 8; + aVelTarget.u.horveluncert->horspeed.data[1] = horSpeedInt; + + // ---- horizontal speed. Convert meters per second -> kilomteres per hour + TUint uncertSpeed = (TUint)(aCourse.SpeedAccuracy() * KLbsMpsKmphConstant); + if (uncertSpeed > 255) + { + uncertSpeed = 255; + } + aVelTarget.u.horveluncert->uncertspeed.numbits = 8; + aVelTarget.u.horveluncert->uncertspeed.data[0] = uncertSpeed; + + SUPLLOG(ELogP1, "CSuplMessageBase::PopulateVelocity() End\n"); + return KErrNone; + } + + + + +/** +LeaveIfAllocErrorL() + +Calls User::Leave() if a memory allocation has failed. +*/ +void CSuplMessageBase::LeaveIfAllocErrorL() + { + SUPLLOG(ELogP1, "CSuplMessageBase::LeaveIfAllocErrorL() Begin\n"); + if (iControl->getStatus() == RTERR_NOMEM) + { + SUPLLOG(ELogP1, "CSuplMessageBase::LeaveIfAllocErrorL() End (out of memory error)\n"); + User::Leave(KErrNoMemory); + } + else if (iControl->getStatus() != RT_OK) + { + SUPLLOG2(ELogP1, "CSuplMessageBase::LeaveIfAllocErrorL() End (ASN1 runtime error, %d)\n", iControl->getStatus()); + User::Leave(KErrGeneral); + } + SUPLLOG(ELogP1, "CSuplMessageBase::LeaveIfAllocErrorL() End\n"); + } + +/** +Uncertainty() + +Converts a minumum accuracy value in meters to an uncertainty value K as +described in 3GPP 23.032 (Universal Geographical Area Description) section 6.2. + +r = C((1+x)^K - 1) + +where r = distance in meters + C = 10 + x = 0.1 + K = uncertainty value + +hence K = ln(r/C + 1) / ln(1.1) + +@param aDistance - distance measurement in meters +@return uncertainty value K +*/ +TInt CSuplMessageBase::Uncertainty(const TReal32& aDistance) + { + SUPLLOG(ELogP1, "CSuplMessageBase::Uncertainty() Begin\n"); + TReal uncert; + Math::Ln(uncert, (aDistance/10) + 1 ); + uncert /= KLbsLogOnePointOne; + if (uncert>KLbsMaxUncert) + { + uncert = KLbsMaxUncert; + } + + // round to nearest whole number + TReal uncertRounded; + Math::Round(uncertRounded, uncert, 0); + + SUPLLOG(ELogP1, "CSuplMessageBase::Uncertainty() End\n"); + return (TInt)uncertRounded; + } + +/** +UncertaintyAltitude() + +Converts a minumum accuracy value in meters to an uncertainty altitude value K as +described in 3GPP 23.032 (Universal Geographical Area Description) section 6.4. + +r = C((1+x)^K - 1) + +where r = distance in meters + C = 45 + x = 0.1 + K = uncertainty value + +hence K = ln(r/C + 1) / ln(1.1) + +@param aDistance - altitude accuracy in meters +@return uncertainty altitude value K +*/ +TInt CSuplMessageBase::UncertaintyAltitude(const TReal32& aDistance) + { + SUPLLOG(ELogP1, "CSuplMessageBase::UncertaintyAltitude() Begin\n"); + TReal uncert; + Math::Ln(uncert, (aDistance/45) + 1 ); + uncert /= KLbsLogOnePointZeroTwoFive; + if (uncert>KLbsMaxUncert) + { + uncert = KLbsMaxUncert; + } + + // round to nearest whole number + TReal uncertRounded; + Math::Round(uncertRounded, uncert, 0); + + SUPLLOG(ELogP1, "CSuplMessageBase::UncertaintyAltitude() End\n"); + return (TInt)uncertRounded; + } + + +/** +EncodeAltitude() + +Converts an value for altiutude to an 15 bit binary coded number N + +@param aAltitude - altitude in meters +@return uncertainty altitude value K +*/ +TInt CSuplMessageBase::EncodeAltitude(const TReal32& aAltitude) + { + SUPLLOG(ELogP1, "CSuplMessageBase::EncodeAltitude() Begin\n"); + TInt altEncoded = (TInt)aAltitude; + if (altEncoded>KLbsMaxAltitude) + { + altEncoded = KLbsMaxAltitude; + } + + SUPLLOG(ELogP1, "CSuplMessageBase::EncodeAltitude() End\n"); + return altEncoded; + } + +/** +Translates error codes returned by the ASN1 runtime library to distinguish +from Symbian global error codes. + +Errors are simply translated to positive error codes. They maintain their +meaning as described in rtxErrCodes.h and asn1ErrCodes.h. + +Exceptions: + RTERR_NOMEM is translated to global error code KErrNoMemory + +@see rtxErrCodes.h +@see asn1ErrCodes.h +*/ +TInt CSuplMessageBase::ProcessAsn1Error(TInt aError) + { + SUPLLOG(ELogP1, "CSuplMessageBase::ProcessAsn1Error() Begin\n"); + if (aError == RTERR_NOMEM) + { + SUPLLOG(ELogP1, "CSuplMessageBase::ProcessAsn1Error() End (Out Of Memory)\n"); + return KErrNoMemory; + } + else + { + SUPLLOG2(ELogP1, "CSuplMessageBase::ProcessAsn1Error() End (ASN1 Runtime Error %d)\n", aError); + return aError * -1; + } + } + +/** +Prints the content of the data structure to the logger +*/ +EXPORT_C void CSuplMessageBase::LogMessageContent() + { + //SUPLLOG_PDU(iControl); + if (MessageType() == ESuplPos) + { + CSuplPos* suplPos = reinterpret_cast (this); + suplPos->LogPayload(); + } + } + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplmessagecommon.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplmessagecommon.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,468 @@ +// Copyright (c) 2007-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: +// + +/** + @file + @internalTechnology + +*/ + +#include "suplmessagecommon.h" +#include "supldevloggermacros.h" + +/** + * Supl IPAddress container + */ +EXPORT_C CSuplIpAddress* CSuplIpAddress::NewL() + { + SUPLLOG(ELogP1, "CSuplIpAddress::NewL() Begin\n"); + CSuplIpAddress* self = CSuplIpAddress::NewLC(); + SUPLLOG(ELogP1, "CSuplIpAddress::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplIpAddress* CSuplIpAddress::NewLC() + { + SUPLLOG(ELogP1, "CSuplIpAddress::NewLC() Begin\n"); + CSuplIpAddress* self = new (ELeave) CSuplIpAddress(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplIpAddress::NewLC() End\n"); + return self; + } + +EXPORT_C CSuplIpAddress::~CSuplIpAddress() + { + SUPLLOG(ELogP1, "CSuplIpAddress::~CSuplIpAddress() Begin\n"); + SUPLLOG(ELogP1, "CSuplIpAddress::~CSuplIpAddress() End\n"); + } + +EXPORT_C TBool CSuplIpAddress::operator==(const CSuplIpAddress& other) const + { + return (iIpAddressType==other.iIpAddressType && + iIpAddress==other.iIpAddress); + } + +CSuplIpAddress::CSuplIpAddress() + { + } + +void CSuplIpAddress::ConstructL() + { + } + + +/** + * Supl FQDN container + */ +EXPORT_C CSuplFqdn* CSuplFqdn::NewL() + { + SUPLLOG(ELogP1, "CSuplFqdn::NewL() Begin\n"); + CSuplFqdn* self = new (ELeave) CSuplFqdn(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplFqdn::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplFqdn::~CSuplFqdn() + { + SUPLLOG(ELogP1, "CSuplFqdn::~CSuplFqdn() Begin\n"); + SUPLLOG(ELogP1, "CSuplFqdn::~CSuplFqdn() End\n"); + } + +EXPORT_C TBool CSuplFqdn::operator==(const CSuplFqdn& other) const + { + return (iFqdn==other.iFqdn); + } + +CSuplFqdn::CSuplFqdn() + { + } + +void CSuplFqdn::ConstructL() + { + } + + +/** + * Supl SLP Address container + */ +EXPORT_C CSuplSlpAddress* CSuplSlpAddress::NewL() + { + SUPLLOG(ELogP1, "CSuplSlpAddress::NewL() Begin\n"); + CSuplSlpAddress* self = new (ELeave) CSuplSlpAddress(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplSlpAddress::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplSlpAddress::~CSuplSlpAddress() + { + SUPLLOG(ELogP1, "CSuplSlpAddress::~CSuplSlpAddress() Begin\n"); + delete iIpAddress; + delete iFqdn; + SUPLLOG(ELogP1, "CSuplSlpAddress::~CSuplSlpAddress() End\n"); + } + +EXPORT_C TBool CSuplSlpAddress::operator==(const CSuplSlpAddress& other) const + { + return (iSlpAddressType==other.iSlpAddressType && + *iIpAddress==*other.iIpAddress && + *iFqdn==*other.iFqdn); + } + +CSuplSlpAddress::CSuplSlpAddress() + { + } + +void CSuplSlpAddress::ConstructL() + { + iIpAddress = CSuplIpAddress::NewL(); + iFqdn = CSuplFqdn::NewL(); + } + + +/** + * Supl SLP Session ID container + */ +EXPORT_C CSuplSlpSessionId* CSuplSlpSessionId::NewL() + { + SUPLLOG(ELogP1, "CSuplSlpSessionId::NewL() Begin\n"); + CSuplSlpSessionId* self = new (ELeave) CSuplSlpSessionId(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + SUPLLOG(ELogP1, "CSuplSlpSessionId::NewL() End\n"); + return self; + } + +EXPORT_C CSuplSlpSessionId::~CSuplSlpSessionId() + { + SUPLLOG(ELogP1, "CSuplSlpSessionId::~CSuplSlpSessionId() Begin\n"); + delete iSlpAddress; + SUPLLOG(ELogP1, "CSuplSlpSessionId::~CSuplSlpSessionId() End\n"); + } + +EXPORT_C TBool CSuplSlpSessionId::operator==(const CSuplSlpSessionId& other) const + { + return (iSessionId==other.iSessionId && + *iSlpAddress==*other.iSlpAddress); + } + +void CSuplSlpSessionId::ConstructL() + { + iSlpAddress = CSuplSlpAddress::NewL(); + } + + +/** + * Supl SET ID container + */ +EXPORT_C CSuplSetId* CSuplSetId::NewL() + { + SUPLLOG(ELogP1, "CSuplSetId::NewL() Begin\n"); + CSuplSetId* self = new (ELeave) CSuplSetId(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplSetId::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplSetId::~CSuplSetId() + { + SUPLLOG(ELogP1, "CSuplSetId::~CSuplSetId() Begin\n"); + delete iIpAddress; + SUPLLOG(ELogP1, "CSuplSetId::~CSuplSetId() End\n"); + } + +EXPORT_C TBool CSuplSetId::operator==(const CSuplSetId& other) const + { + return (iSetIdType==other.iSetIdType && + *iIpAddress==*other.iIpAddress && + iSetId == other.iSetId); + } + +CSuplSetId::CSuplSetId() + { + } + +void CSuplSetId::ConstructL() + { + iIpAddress = CSuplIpAddress::NewL(); + } + + +/** + * Supl SET Session ID container + */ +EXPORT_C CSuplSetSessionId* CSuplSetSessionId::NewL() + { + SUPLLOG(ELogP1, "CSuplSetSessionId::NewL() Begin\n"); + CSuplSetSessionId* self = new (ELeave) CSuplSetSessionId(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplSetSessionId::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplSetSessionId::~CSuplSetSessionId() + { + SUPLLOG(ELogP1, "CSuplSetSessionId::~CSuplSetSessionId() Begin\n"); + delete iSetId; + SUPLLOG(ELogP1, "CSuplSetSessionId::~CSuplSetSessionId() End\n"); + } + +EXPORT_C TBool CSuplSetSessionId::operator==(const CSuplSetSessionId& other) const + { + return (iSessionId==other.iSessionId && + *iSetId==*other.iSetId); + } + +CSuplSetSessionId::CSuplSetSessionId() + { + } + +void CSuplSetSessionId::ConstructL() + { + iSetId = CSuplSetId::NewL(); + } + + +/** + * Supl Session ID container + */ +EXPORT_C CSuplSessionId* CSuplSessionId::NewL() + { + SUPLLOG(ELogP1, "CSuplSessionId::NewL() \n"); + CSuplSessionId* self = CSuplSessionId::NewLC(); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplSessionId* CSuplSessionId::NewLC() + { + SUPLLOG(ELogP1, "CSuplSessionId::NewLC() Begin\n"); + CSuplSessionId* self = new (ELeave) CSuplSessionId(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplSessionId::NewLC() End\n"); + return self; + } + +EXPORT_C CSuplSessionId::~CSuplSessionId() + { + SUPLLOG(ELogP1, "CSuplSessionId::~CSuplSessionId() Begin\n"); + delete iSetSessionId; + delete iSlpSessionId; + SUPLLOG(ELogP1, "CSuplSessionId::~CSuplSessionId() End\n"); + } + +EXPORT_C TBool CSuplSessionId::operator==(const CSuplSessionId& other) const + { + return (iSetSessionIdPresent==other.iSetSessionIdPresent && + iSlpSessionIdPresent==other.iSlpSessionIdPresent && + *iSetSessionId==*other.iSetSessionId && + *iSlpSessionId==*other.iSlpSessionId); + } + +CSuplSessionId::CSuplSessionId() + { + } + +void CSuplSessionId::ConstructL() + { + iSetSessionId = CSuplSetSessionId::NewL(); + iSlpSessionId = CSuplSlpSessionId::NewL(); + } + +/** + * Supl Version container + */ +EXPORT_C CSuplVersion* CSuplVersion::NewL() + { + SUPLLOG(ELogP1, "CSuplVersion::NewL() Begin\n"); + CSuplVersion* self = new (ELeave) CSuplVersion(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplVersion::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +CSuplVersion::CSuplVersion() + { + } + +EXPORT_C CSuplVersion::~CSuplVersion() + { + SUPLLOG(ELogP1, "CSuplVersion::~CSuplVersion() Begin\n"); + SUPLLOG(ELogP1, "CSuplVersion::~CSuplVersion() End\n"); + } + +EXPORT_C TBool CSuplVersion::operator==(const CSuplVersion& other) const + { + return (iMaj==other.iMaj && + iMin==other.iMin && + iServind==other.iServind); + } + +void CSuplVersion::ConstructL() + { + } + +/** + * Supl GSM Cell Info container + */ +EXPORT_C CSuplGsmCellInfo* CSuplGsmCellInfo::NewL() + { + SUPLLOG(ELogP1, "CSuplGsmCellInfo::NewL() Begin\n"); + CSuplGsmCellInfo* self = new (ELeave) CSuplGsmCellInfo(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplGsmCellInfo::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplGsmCellInfo::~CSuplGsmCellInfo() + { + SUPLLOG(ELogP1, "CSuplGsmCellInfo::~CSuplGsmCellInfo() Begin\n"); + SUPLLOG(ELogP1, "CSuplGsmCellInfo::~CSuplGsmCellInfo() End\n"); + } + +CSuplGsmCellInfo::CSuplGsmCellInfo() + { + } + +void CSuplGsmCellInfo::ConstructL() + { + } + +/** + * Supl CDMA Cell Info container + */ +EXPORT_C CSuplCdmaCellInfo* CSuplCdmaCellInfo::NewL() + { + SUPLLOG(ELogP1, "CSuplCdmaCellInfo::NewL() Begin\n"); + CSuplCdmaCellInfo* self = new (ELeave) CSuplCdmaCellInfo(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplCdmaCellInfo::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplCdmaCellInfo::~CSuplCdmaCellInfo() + { + SUPLLOG(ELogP1, "CSuplCdmaCellInfo::~CSuplCdmaCellInfo() Begin\n"); + SUPLLOG(ELogP1, "CSuplCdmaCellInfo::~CSuplCdmaCellInfo() End\n"); + } + +CSuplCdmaCellInfo::CSuplCdmaCellInfo() + { + } + +void CSuplCdmaCellInfo::ConstructL() + { + } + +/** + * Supl WCDMA Cell Info container + */ +EXPORT_C CSuplWcdmaCellInfo* CSuplWcdmaCellInfo::NewL() + { + SUPLLOG(ELogP1, "CSuplWcdmaCellInfo::NewL() Begin\n"); + CSuplWcdmaCellInfo* self = new (ELeave) CSuplWcdmaCellInfo(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplWcdmaCellInfo::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplWcdmaCellInfo::~CSuplWcdmaCellInfo() + { + SUPLLOG(ELogP1, "CSuplWcdmaCellInfo::~CSuplWcdmaCellInfo() Begin\n"); + SUPLLOG(ELogP1, "CSuplWcdmaCellInfo::~CSuplWcdmaCellInfo() End\n"); + } + +CSuplWcdmaCellInfo::CSuplWcdmaCellInfo() + { + } + +void CSuplWcdmaCellInfo::ConstructL() + { + } + +/** + * Supl Location ID container + */ +EXPORT_C CSuplLocationId* CSuplLocationId::NewL(TSuplLocationType aType) + { + SUPLLOG(ELogP1, "CSuplLocationId::NewL() Begin\n"); + CSuplLocationId* self = new (ELeave) CSuplLocationId(aType); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplLocationId::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplLocationId::~CSuplLocationId() + { + SUPLLOG(ELogP1, "CSuplLocationId::~CSuplLocationId() Begin\n"); + delete iGsmCellInfo; + delete iCdmaCellInfo; + delete iWcdmaCellInfo; + SUPLLOG(ELogP1, "CSuplLocationId::~CSuplLocationId() End\n"); + } + +CSuplLocationId::CSuplLocationId(TSuplLocationType aType) + : iType(aType) + { + } + +void CSuplLocationId::ConstructL() + { + switch (iType) + { + case ESuplLocationTypeGsm: + iGsmCellInfo = CSuplGsmCellInfo::NewL(); + break; + + case ESuplLocationTypeCdma: + iCdmaCellInfo = CSuplCdmaCellInfo::NewL(); + break; + + case ESuplLocationTypeWcdma: + iWcdmaCellInfo = CSuplWcdmaCellInfo::NewL(); + break; + + default: + User::Leave(KErrNotSupported); + break; + } + } + + + + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplpos.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplpos.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,532 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "ULP.h" + +#include "suplpos.h" +#include "suplpospayload.h" +#include "rrlpmeasureposrequest.h" +#include "rrlpassistancedata.h" +#include "rrlpprotocolerror.h" +#include "suplasn1error.h" +#include "supldevloggermacros.h" + +#include +#include + +/** +Static factory constructor +*/ +EXPORT_C CSuplPos* CSuplPos::NewL(TBool aIsOutgoingMessage) + { + SUPLLOG(ELogP1, "CSuplPos::NewL() Begin\n"); + CSuplPos* self = CSuplPos::NewLC(aIsOutgoingMessage); + SUPLLOG(ELogP1, "CSuplPos::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CSuplPos* CSuplPos::NewLC(TBool aIsOutgoingMessage) + { + SUPLLOG(ELogP1, "CSuplPos::NewLC() Begin\n"); + CSuplPos* self = new (ELeave) CSuplPos(aIsOutgoingMessage); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplPos::NewLC() End\n"); + return self; + } + + +/** +Constructor +*/ +CSuplPos::CSuplPos(TBool aIsOutgoingMessage) + : CSuplMessageBase::CSuplMessageBase(ESuplPos, aIsOutgoingMessage) + { + } + + +/** +Second stage constructor +*/ +void CSuplPos::ConstructL() + { + // call the base class ConstructL() to create common data structures + CSuplMessageBase::ConstructL(); + + // message specific structures for outgoing messages. + if (iIsOutgoingMessage) + { + // local reference to context object + OSCTXT* pctxt = iControl->getCtxtPtr(); + + // create the SUPL POS specific data structures + iData->message.t = T_UlpMessage_msSUPLPOS; + iData->message.u.msSUPLPOS = (ASN1T_SUPLPOS*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SUPLPOS)); + LeaveIfAllocErrorL(); + + iData->message.u.msSUPLPOS->m.velocityPresent = 0; + + iData->message.u.msSUPLPOS->posPayLoad.t = T_PosPayLoad_rrlpPayload; + iData->message.u.msSUPLPOS->posPayLoad.u.rrlpPayload = (ASN1T_PosPayLoad_rrlpPayload*)rtxMemAllocZ(pctxt, sizeof(ASN1T_PosPayLoad_rrlpPayload)); + LeaveIfAllocErrorL(); + } + } + + +/** +Destructor +*/ +CSuplPos::~CSuplPos() + { + SUPLLOG(ELogP1, "CSuplPos::~CSuplPos() Begin\n"); + delete iPosPayload; + delete iDecodeBuffer; + delete iPayloadData; + delete iPayloadPdu; + SUPLLOG(ELogP1, "CSuplPos::~CSuplPos() End\n"); + } + + +/** +SetVelocity() + +Set the velocity parameter. The parameter TPositionInfoBase must contain +course information (eg be TPositionCourseInfo or derived) for the velocity +parameter to be set. + +@param aPosInfo: contains current velocity estimate +@return KErrNone normally + KErrNotFound if no TCourse information present + KErrNoMemory if failed to allocate memory to store the outgoing data +*/ +EXPORT_C TInt CSuplPos::SetVelocity(const TPositionInfoBase& aPosInfo) + { + SUPLLOG(ELogP1, "CSuplPos::SetVelocity() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLPOS != NULL, User::Invariant()); + + // handle velocity (TCourse) information + if ((aPosInfo.PositionClassType() & EPositionCourseInfoClass) != 0) + { + TPositionCourseInfo courseInfo = reinterpret_cast (aPosInfo); + TCourse course; + courseInfo.GetCourse(course); + + // populate the velocity parameter + iData->message.u.msSUPLPOS->m.velocityPresent = 1; + TInt velErr = PopulateVelocity(course, iData->message.u.msSUPLPOS->velocity); + if (velErr != KErrNone) + { + SUPLLOG(ELogP1, "CSuplPos::SetVelocity() End (error populating velocity)\n"); + return velErr; + } + } + else + { + // passed parameter does not contain course information. + SUPLLOG(ELogP1, "CSuplPos::SetVelocity() End (Course Information Not Present)\n"); + return KErrNotFound; + } + + SUPLLOG(ELogP1, "CSuplPos::SetVelocity() End\n"); + return KErrNone; + } + + +/** +VelocityPresent() + +@return ETrue if the optional velocity parameter is present +*/ +EXPORT_C TBool CSuplPos::VelocityPresent() + { + SUPLLOG(ELogP1, "CSuplPos::VelocityPresent() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLPOS != NULL, User::Invariant()); + + if (iData->message.u.msSUPLPOS->m.velocityPresent != 0) + { + SUPLLOG(ELogP1, "CSuplPos::VelocityPresent(ETrue) End\n"); + return ETrue; + } + + SUPLLOG(ELogP1, "CSuplPos::VelocityPresent(EFalse) End\n"); + return EFalse; + } + + +/** +Velocity() + +Populates aPosInfo according to the velocity parameter +The parameter TPositionInfoBase must be able to store course information +(eg be TPositionCourseInfo or derived) for the velocity parameter to be set. + +Note that the LBS course API currently does not support vertical velocity, +so vertical speed information is ignored. + +@param aPosInfo: on return, populated with velocity information. +@return KErrNotFound if the velocity is not available in the received message + KErrNotSupported if the TPositionInfoBase can not hold course information. + KErrArgument if the received data is not in the expected format. + KErrNone otherwise +*/ +EXPORT_C TInt CSuplPos::GetVelocity(TPositionInfoBase& aPosInfo) + { + SUPLLOG(ELogP1, "CSuplPos::Velocity() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLPOS != NULL, User::Invariant()); + + // check the velocity was present in the received message + if (iData->message.u.msSUPLPOS->m.velocityPresent == 0) + { + return KErrNotFound; + } + + // check the TPositionInfoBase can receive course information. + if ((aPosInfo.PositionClassType() & EPositionCourseInfoClass) == 0) + { + __ASSERT_DEBUG(0, User::Invariant()); + return KErrNotSupported; + } + + // source velocity reference + ASN1T_Velocity& velocity = iData->message.u.msSUPLPOS->velocity; + + // target course reference + TCourse course; + + // set the course information according to the received velocity type + switch (velocity.t) + { + case T_Velocity_horvel: + { + TUint bearing = 0; + bearing = velocity.u.horvel->bearing.data[0] << 1; + bearing |= velocity.u.horvel->bearing.data[1] >> 7; + + TUint speed = 0; + speed = velocity.u.horvel->horspeed.data[0] << 8; + speed |= velocity.u.horvel->horspeed.data[1]; + + course.SetHeading((TReal32)bearing); + course.SetSpeed(ConvertHorSpeedToMetersPerSecond(speed)); + break; + } + case T_Velocity_horandvervel: + { + TUint bearing = 0; + bearing = velocity.u.horandvervel->bearing.data[0] << 1; + bearing |= velocity.u.horandvervel->bearing.data[1] >> 7; + + TUint speed = 0; + speed = velocity.u.horandvervel->horspeed.data[0] << 8; + speed |= velocity.u.horandvervel->horspeed.data[1]; + + course.SetHeading((TReal32)bearing); + course.SetSpeed(ConvertHorSpeedToMetersPerSecond(speed)); + break; + } + case T_Velocity_horveluncert: + { + TUint bearing = 0; + bearing = velocity.u.horveluncert->bearing.data[0] << 1; + bearing |= velocity.u.horveluncert->bearing.data[1] >> 7; + + TUint speed = 0; + speed = velocity.u.horveluncert->horspeed.data[0] << 8; + speed |= velocity.u.horveluncert->horspeed.data[1]; + + TUint speedAccuracy = velocity.u.horveluncert->uncertspeed.data[0]; + + course.SetHeading((TReal32)bearing); + course.SetSpeed(ConvertHorSpeedToMetersPerSecond(speed)); + course.SetSpeedAccuracy(ConvertHorSpeedAccuracyToMetersPerSecond(speedAccuracy)); + break; + } + case T_Velocity_horandveruncert: + { + TUint bearing = 0; + bearing = velocity.u.horandveruncert->bearing.data[0] << 1; + bearing |= velocity.u.horandveruncert->bearing.data[1] >> 7; + + TUint speed = 0; + speed = velocity.u.horandveruncert->horspeed.data[0] << 8; + speed |= velocity.u.horandveruncert->horspeed.data[1]; + + TUint speedAccuracy = velocity.u.horandveruncert->horuncertspeed.data[0]; + + course.SetHeading((TReal32)bearing); + course.SetSpeed(ConvertHorSpeedToMetersPerSecond(speed)); + course.SetSpeedAccuracy(ConvertHorSpeedAccuracyToMetersPerSecond(speedAccuracy)); + break; + } + default: + { + __ASSERT_DEBUG(0, User::Invariant()); + return KErrArgument; + } + } + + // set the course information in the return parameter. + TPositionCourseInfo posInfo = reinterpret_cast (aPosInfo); + posInfo.SetCourse(course); + + SUPLLOG(ELogP1, "CSuplPos::Velocity() End\n"); + return KErrNone; + } + + +/** +SetPosPayload() + +Assigns the payload RRLP message for outgoing messages. +CSuplPos instance takes immediate ownership of the CSuplPosPayload object. + +@param +*/ +EXPORT_C void CSuplPos::SetPosPayload(CSuplPosPayload* aPayload) + { + SUPLLOG(ELogP1, "CSuplPos::SetPosPayload() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iPosPayload == NULL, User::Invariant()); + iPosPayload = aPayload; + SUPLLOG(ELogP1, "CSuplPos::SetPosPayload() End\n"); + } + + +/** +DecodePosPayloadL() + +Decodes the content of received positioning payload. Must be called before content +of the payload may be accessed + +@param aError, on return indicates if an error was encountered, + eg KErrNotSupported for unsupported payload types. +*/ +void CSuplPos::DecodePosPayloadL(TInt& aError) + { + SUPLLOG(ELogP1, "CSuplPos::DecodePosPayloadL() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iPosPayload == NULL, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLPOS != NULL, User::Invariant()); + + // check that the payload is RRLP + if (iData->message.u.msSUPLPOS->posPayLoad.t != T_PosPayLoad_rrlpPayload) + { + aError = ESuplAsn1ErrUnsupportedPosProtocol; + return; + } + + // extract the RRLP payload and decode and compare... + TInt payloadLength = iData->message.u.msSUPLPOS->posPayLoad.u.rrlpPayload->numocts; + OSOCTET* payloadptr = &iData->message.u.msSUPLPOS->posPayLoad.u.rrlpPayload->data[0]; + + // Create the payload decode buffer + ASN1Context* payloadContext = new (ELeave) ASN1Context; + CleanupDeletePushL(payloadContext); + iDecodeBuffer = new (ELeave) ASN1PERDecodeBuffer (payloadptr, payloadLength, FALSE, payloadContext); + // construction of iDecodeBuffer successful, pop payloadContext off the cleanup stack + CleanupStack::Pop(payloadContext); + + // Create data and control objects to manage the decode + iPayloadData = new (ELeave) ASN1T_PDU(); + iPayloadPdu = new (ELeave) ASN1C_PDU (*iDecodeBuffer, *iPayloadData); + + TInt stat = iPayloadPdu->Decode(); + + // return now if error encountered while decoding + if (stat != KErrNone) + { + aError = ProcessAsn1Error(stat); + return; + } + + // build payload content wrapper. + switch (iPayloadData->component.t) + { + case T_RRLP_Component_msrPositionReq: + { + iPosPayload = CRrlpMeasurePositionRequest::NewL(); + break; + } + + case T_RRLP_Component_assistanceData: + { + iPosPayload = CRrlpAssistanceData::NewL(); + break; + } + + case T_RRLP_Component_protocolError: + { + iPosPayload = CRrlpProtocolError::NewL(EFalse); + break; + } + + case T_RRLP_Component_msrPositionRsp: + case T_RRLP_Component_assistanceDataAck: + default: + { + // unsupported message type + aError = ESuplAsn1ErrUnsupportedPosMessageType; + return; + } + } + + // pass ownership of the decoded message content. + CRrlpMessageBase* rrlpMessage = (CRrlpMessageBase*)iPosPayload; + rrlpMessage->SetDecodedData(iPayloadData, iPayloadPdu); + iPayloadData = NULL; + iPayloadPdu = NULL; + + // no longer need the decode buffer object. + delete iDecodeBuffer; + iDecodeBuffer = NULL; + SUPLLOG(ELogP1, "CSuplPos::DecodePosPayloadL() End\n"); + } + + +/** +PosPayload() + +Returns the decoded positioning payload for received SUPL POS messages. +Note that ownership of the position payload is returned - the calling entity +becomes responsible for the destruction of the positioning payload. + +@return pointer to the positioning payload. +*/ +EXPORT_C CSuplPosPayload* CSuplPos::PosPayload() + { + SUPLLOG(ELogP1, "CSuplPos::PosPayload() Begin\n"); + __ASSERT_DEBUG(!iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iPosPayload != NULL, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLPOS != NULL, User::Invariant()); + + CSuplPosPayload* posPayload = iPosPayload; + iPosPayload = NULL; + + SUPLLOG(ELogP1, "CSuplPos::PosPayload() End\n"); + + return posPayload; + } + + +/** +EncodePosPayloadL() + +Encodes the positioning payload. + +@return error indication, KErrNone otherwise +*/ +TInt CSuplPos::EncodePosPayloadL() + { + SUPLLOG(ELogP1, "CSuplPos::EncodePosPayloadL() Begin\n"); + __ASSERT_DEBUG(iIsOutgoingMessage, User::Invariant()); + __ASSERT_DEBUG(iPosPayload!=NULL, User::Invariant()); + + // encode the positioning payload. + // Payload is encoded directly to the supl payload container. + TPtr8 payloadPtr(iData->message.u.msSUPLPOS->posPayLoad.u.rrlpPayload->data, 8192); + TInt err = iPosPayload->EncodeToL(payloadPtr); + if (err!=KErrNone) + { + SUPLLOG(ELogP1, "CSuplPos::EncodePosPayloadL() Error\n"); + return ProcessAsn1Error(err); + } + + // set the SUPL payload length to the encoded payload. + iData->message.u.msSUPLPOS->posPayLoad.u.rrlpPayload->numocts = payloadPtr.Length(); + + SUPLLOG(ELogP1, "CSuplPos::EncodePosPayloadL() End\n"); + return KErrNone; + } + +/** +ConvertHorSpeedToMetersPerSecond() + +Converts received speed value N to meters per second, according to +3GPP GAD: + +for N = 0 N <= h < N+0.5 +for 0 < N < 2^16-1 N-0.5 <= h < N+0.5 +for N=2^16-1 N-0.5 <= h + +where h = speed in km/hour + +@param aSpeed - the received, encoded speed N. +@return the uncertainty speed in meters per second. +*/ +TReal32 CSuplPos::ConvertHorSpeedToMetersPerSecond(TUint aSpeed) + { + SUPLLOG(ELogP1, "CSuplPos::ConvertHorSpeedToMetersPerSecond() Begin\n"); + TReal32 kph; + if (aSpeed == 0) + { + kph = 0; + } + else if (aSpeed < 65536) + { + kph = aSpeed - 0.5; + } + else + { + kph = 65535 - 0.5; + } + + TReal32 metersPerSec = kph / 3.6; + SUPLLOG(ELogP1, "CSuplPos::ConvertHorSpeedToMetersPerSecond() End\n"); + return metersPerSec; + } + +/** +ConvertHorSpeedAccuracyToMetersPerSecond() + +Converts received speed uncertainty value N to meters per second, according to +3GPP GAD: + +Uncertainty is encoded in increments of 1 kilometer per hour using an 8bit +encoded number N. N is therefore the uncertainty speed in kmph, except for +N=255 which indicates that the uncertainty is not specified + +@param aSpeedAccuracy - the received, encoded uncertainty speed N. +@return the uncertainty speed in meters per second. +*/ +TReal32 CSuplPos::ConvertHorSpeedAccuracyToMetersPerSecond(TUint aSpeedAccuracy) + { + SUPLLOG(ELogP1, "CSuplPos::ConvertHorSpeedAccuracyToMetersPerSecond() Begin\n"); + TReal32 metersPerSec = aSpeedAccuracy / 3.6; + SUPLLOG(ELogP1, "CSuplPos::ConvertHorSpeedAccuracyToMetersPerSecond() End\n"); + return metersPerSec; + } + +/** +Prints the content payload data structure to the logger +*/ +void CSuplPos::LogPayload() + { + if (iPosPayload) + { + iPosPayload->LogMessageContent(); + } + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplposinit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplposinit.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,265 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "ULP.h" +#include "suplposinit.h" +#include "supldevloggermacros.h" + +/** +Static factory constructor +*/ +EXPORT_C CSuplPosInit* CSuplPosInit::NewL() + { + SUPLLOG(ELogP1, "CSuplPosInit::NewL() Begin\n"); + CSuplPosInit* self = new (ELeave) CSuplPosInit(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplPosInit::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + + +/** +Constructor +*/ +CSuplPosInit::CSuplPosInit() + : CSuplMessageBase::CSuplMessageBase(ESuplPosInit, ETrue) + { + } + + +/** +Second stage constructor +*/ +void CSuplPosInit::ConstructL() + { + // call the base class ConstructL() to create data structures + CSuplMessageBase::ConstructL(); + + // local reference to context object + OSCTXT* pctxt = iControl->getCtxtPtr(); + + iData->message.t = T_UlpMessage_msSUPLPOSINIT; + iData->message.u.msSUPLPOSINIT = (ASN1T_SUPLPOSINIT*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SUPLPOSINIT)); + LeaveIfAllocErrorL(); + } + + +/** +Destructor +*/ +CSuplPosInit::~CSuplPosInit() + { + SUPLLOG(ELogP1, "CSuplPosInit::~CSuplPosInit() Begin\n"); + SUPLLOG(ELogP1, "CSuplPosInit::~CSuplPosInit() End\n"); + } + + +/** +SetCapabilities() + +Sets the capabilities parameter of the outgoing message + +@param aCapabilities, LBS capabilities +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplPosInit::SetCapabilities(const TLbsNetPosCapabilities& aCapabilities) + { + __ASSERT_DEBUG(iData->message.u.msSUPLPOSINIT != NULL, User::Invariant()); + SUPLLOG(ELogP1, "CSuplPosInit::SetCapabilities() Begin\n"); + + TInt err = PopulateSetCapabilities(aCapabilities, iData->message.u.msSUPLPOSINIT->sETCapabilities); + + SUPLLOG(ELogP1, "CSuplPosInit::SetCapabilities() End\n"); + return err; + } + + +/** +SetRequestedAssistanceData() + +Sets the requested assistance data parameter + +@param aDataReqMask, bitmask indicating requested assistance data components. +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplPosInit::SetRequestedAssistanceData(const TLbsAsistanceDataGroup& aDataReqMask) + { + __ASSERT_DEBUG(iData->message.u.msSUPLPOSINIT != NULL, User::Invariant()); + SUPLLOG(ELogP1, "CSuplPosInit::SetRequestedAssistanceData() Begin\n"); + SUPLLOG2(ELogP1, " - TLbsAsistanceDataGroup aDataReqMask = 0x%08X\n", aDataReqMask); \ + + // pointer to message body + ASN1T_SUPLPOSINIT* msgBody = iData->message.u.msSUPLPOSINIT; + + if (aDataReqMask == EAssistanceDataNone) + { + // no assistance data requested + return KErrNone; + } + + // indicate parameter is set + msgBody->m.requestedAssistDataPresent = 1; + + if (aDataReqMask & EAssistanceDataAquisitionAssistance) + { + msgBody->requestedAssistData.acquisitionAssistanceRequested = ETrue; + } + + if (aDataReqMask & EAssistanceDataBadSatList) + { + msgBody->requestedAssistData.realTimeIntegrityRequested = ETrue; + } + + if (aDataReqMask & EAssistanceDataNavigationModel) + { + msgBody->requestedAssistData.navigationModelRequested = ETrue; + + // Navigation Model Data + // Note that setting nSAT (number of satellites for which the SET has + // ephemeris data available) to zero means that the SLP should ignore + // values for gpsWeek and gpsToe. The TOE-Limit also becomes redundant. + // Also means there is no need to include any additional satellite + // information. See OMA-TS-V1_0-20070615A p22-23 for further detail. + msgBody->requestedAssistData.m.navigationModelDataPresent = 1; + msgBody->requestedAssistData.navigationModelData.gpsWeek = 0; + msgBody->requestedAssistData.navigationModelData.gpsToe = 0; + msgBody->requestedAssistData.navigationModelData.nSAT = 0; + msgBody->requestedAssistData.navigationModelData.toeLimit = 0; + msgBody->requestedAssistData.navigationModelData.m.satInfoPresent = 0; + } + + if (aDataReqMask & EAssistanceDataReferenceTime) + { + msgBody->requestedAssistData.referenceTimeRequested = ETrue; + } + + if (aDataReqMask & EAssistanceDataIonosphericModel) + { + msgBody->requestedAssistData.ionosphericModelRequested = ETrue; + } + + if (aDataReqMask & EAssistanceDataDgpsCorrections) + { + msgBody->requestedAssistData.dgpsCorrectionsRequested = ETrue; + } + + if (aDataReqMask & EAssistanceDataReferenceLocation) + { + msgBody->requestedAssistData.referenceLocationRequested = ETrue; + } + + if (aDataReqMask & EAssistanceDataAlmanac) + { + msgBody->requestedAssistData.almanacRequested = ETrue; + } + + if (aDataReqMask & EAssistanceDataPositioningGpsUtcModel) + { + msgBody->requestedAssistData.utcModelRequested = ETrue; + } + + SUPLLOG(ELogP1, "CSuplPosInit::SetRequestedAssistanceData() End\n"); + return KErrNone; + } + + +/** +SetLocationId() + +Set the location ID parameter + +Location ID - Describes the globally unique cell identification of the most current serving cell. + Cell Info (m) The following cell IDs are supported: + - GSM Cell Info + - WCDMA Cell Info + - CDMA Cell Info + Status (m) Describes whether or not the cell info is: + - Not Current, last known cell info + - Current, the present cell info + - Unknown (ie not known whether the cell id is current or not current) + +Note: The Status parameter does NOT apply to WCDMA optional parameters +(Frequency Info, Primary Scrambling Code and Measured Results List). Frequency +Info, Primary Scrambling Code and Measured Results List, if present, are always +considered to be correct for the current cell. + +@param aLocationId, describes the current location +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplPosInit::SetLocationId(const CSuplLocationId& aLocationId) + { + SUPLLOG(ELogP1, "CSuplPosInit::SetLocationId() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLPOSINIT != NULL, User::Invariant()); + + TInt retval = PopulateLocationId(aLocationId, iData->message.u.msSUPLPOSINIT->locationId); + SUPLLOG2(ELogP1, "CSuplPosInit::SetLocationId() End, retval = %d\n", retval); + return retval; + } + + +/** +SetPosition() + +Sets the Position parameter of the outgoing message (optional) + +@param aPosInfo, position as supplied by LBS subsystem +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplPosInit::SetPosition(const TPositionInfoBase& aPosInfo) + { + SUPLLOG(ELogP1, "CSuplPosInit::SetPosition() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLPOSINIT != NULL, User::Invariant()); + + // flag that the optional position parameter is present + iData->message.u.msSUPLPOSINIT->m.positionPresent = 1; + + TInt retval = PopulatePosition(aPosInfo, iData->message.u.msSUPLPOSINIT->position); + SUPLLOG2(ELogP1, "CSuplPosInit::SetPosition() End, retval = %d\n", retval); + return retval; + } + + +/** +SetVer() + +Sets the Ver parameter, a hash of the received SUPL INIT message of the +outgoing message + +@param aVer, pointer to buffer containing the hash of the SUPL INIT message +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplPosInit::SetVer(const TDesC8& aVer) + { + SUPLLOG(ELogP1, "CSuplPosInit::SetVer() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLPOSINIT != NULL, User::Invariant()); + + ASN1T_SUPLPOSINIT& posInit = *iData->message.u.msSUPLPOSINIT; + posInit.m.verPresent = 1; + posInit.ver.numbits = 64; + TPtr8 target(posInit.ver.data, 8); + target.Copy(aVer); + + SUPLLOG(ELogP1, "CSuplPosInit::SetVer() End\n"); + return KErrNone; + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplpospayload.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplpospayload.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,182 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "RRLP-Messages.h" +#include "ULP.h" +#include "suplpospayload.h" +#include "supldevloggermacros.h" +#include "rrlputils.h" +#include "rrlpmeasureposrequest.h" +#include "rrlpassistancedata.h" +#include "rrlpprotocolerror.h" +#include "suplasn1error.h" + +/** +Default Constructor +*/ +CSuplPosPayload::CSuplPosPayload(TSuplPosPayloadType aType, TBool aIsOutgoingMsg) + : iMessageType(aType), iIsOutgoingMessage(aIsOutgoingMsg) + { + SUPLLOG(ELogP1, "CSuplPosPayload::CSuplPosPayload() Begin\n"); + SUPLLOG(ELogP1, "CSuplPosPayload::CSuplPosPayload() End\n"); + } + +/** +Default Constructor +*/ +CSuplPosPayload::~CSuplPosPayload() + { + SUPLLOG(ELogP1, "CSuplPosPayload::~CSuplPosPayload() Begin\n"); + SUPLLOG(ELogP1, "CSuplPosPayload::~CSuplPosPayload() End\n"); + } + +/** +EncodeToL() + +Encode a populated outgoing message + +@param aBuf the destination buffer to encode to +@return error indication, KErrNone otherwise +*/ +TInt CSuplPosPayload::EncodeToL(TPtr8& /*aBuf*/) + { + SUPLLOG(ELogP1, "CSuplPosPayload::~CSuplPosPayload() Begin\n"); + SUPLLOG(ELogP1, "CSuplPosPayload::~CSuplPosPayload() End\n"); + return KErrNotSupported; + } + +/** +Prints the content payload data structure to the logger +Default implementation logs nothing and should be overridden +*/ +void CSuplPosPayload::LogMessageContent() + { + SUPLLOG(ELogP1, "CSuplPosPayload::LogMessageContent() Begin\n"); + SUPLLOG(ELogP1, "CSuplPosPayload::LogMessageContent() End\n"); + } + +/** +MessageType() + +@return the positioning payload message type +*/ +EXPORT_C CSuplPosPayload::TSuplPosPayloadType CSuplPosPayload::MessageType() + { + SUPLLOG(ELogP1, "CSuplPosPayload::MessageType() Begin\n"); + SUPLLOG2(ELogP1, "CSuplPosPayload::MessageType() End (iMessageType = %d)\n", iMessageType); + return iMessageType; + } + +/** + * DecodePosPayload + * + * decodes a pospayload and returns a CSuplPosPayload* (eg CRrlpMeasurePositionRequest*) containing the decoded rrlp payload + * + * @param aPosPayload an asn1-encoded rrlp pos payload. Caller takes ownership. + * @param aError any error encountered + */ +EXPORT_C CSuplPosPayload* CSuplPosPayload::DecodePosPayloadL(const HBufC8* aPosPayload, TInt& aError) + { + SUPLLOG(ELogP1, "CSuplPosPayload::DecodePosPayloadL() Begin\n"); + + CSuplPosPayload *decodedRrlpMsg = NULL; + + const ASN1T_PosPayLoad_rrlpPayload* posPayLoad = reinterpret_cast(aPosPayload); + + // extract the RRLP payload and decode and compare... + TInt payloadLength = posPayLoad->numocts; + const OSOCTET* payloadptr = &posPayLoad->data[0]; + + // Create the payload decode buffer + // CleanupDeletePushL used for ASN1x_X classes rather than CleanupStack::PushL() to ensure + // class destructors are called on PopAndDestroy. This is necessary to ensure ASN1Context + // reference counter is decremented correctly and memory released. + ASN1Context* payloadContext = new (ELeave) ASN1Context; + CleanupDeletePushL(payloadContext); + ASN1PERDecodeBuffer* decodeBuffer = new (ELeave) ASN1PERDecodeBuffer (payloadptr, payloadLength, FALSE, payloadContext); + // construction of iDecodeBuffer successful, pop payloadContext off the cleanup stack + CleanupStack::Pop(payloadContext); // now owned by decodeBuffer + CleanupDeletePushL(decodeBuffer); + + // Create data and control objects to manage the decode + ASN1T_PDU* payloadData = new (ELeave) ASN1T_PDU(); + CleanupDeletePushL(payloadData); + ASN1C_PDU* payloadPdu = new (ELeave) ASN1C_PDU(*decodeBuffer, *payloadData); + CleanupDeletePushL(payloadPdu); + + TInt stat = payloadPdu->Decode(); + + // return now if error encountered while decoding + if (stat != KErrNone) + { + aError = RrlpUtils::ProcessAsn1Error(stat); + CleanupStack::PopAndDestroy(payloadPdu); + CleanupStack::PopAndDestroy(payloadData); + CleanupStack::PopAndDestroy(decodeBuffer); + return NULL; + } + + // build payload content wrapper. + switch (payloadData->component.t) + { + case T_RRLP_Component_msrPositionReq: + { + decodedRrlpMsg = CRrlpMeasurePositionRequest::NewL(); + break; + } + + case T_RRLP_Component_assistanceData: + { + decodedRrlpMsg = CRrlpAssistanceData::NewL(); + break; + } + + case T_RRLP_Component_protocolError: + { + decodedRrlpMsg = CRrlpProtocolError::NewL(EFalse); + break; + } + + case T_RRLP_Component_msrPositionRsp: + case T_RRLP_Component_assistanceDataAck: + default: + { + // unsupported message type + aError = ESuplAsn1ErrUnsupportedPosMessageType; + CleanupStack::PopAndDestroy(payloadPdu); + CleanupStack::PopAndDestroy(payloadData); + CleanupStack::PopAndDestroy(decodeBuffer); + return NULL; + } + } + + CleanupStack::Pop(payloadPdu); + CleanupStack::Pop(payloadData); + CleanupStack::PopAndDestroy(decodeBuffer); + + // pass ownership of the decoded message content. + static_cast(decodedRrlpMsg)->SetDecodedData(payloadData, payloadPdu); + + SUPLLOG(ELogP1, "CSuplPosPayload::DecodePosPayloadL() End\n"); + + return decodedRrlpMsg; + + } diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplresponse.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplresponse.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,245 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "ULP.h" +#include "suplresponse.h" +#include "supldevloggermacros.h" + +/** +Static factory constructor +*/ +EXPORT_C CSuplResponse* CSuplResponse::NewL() + { + SUPLLOG(ELogP1, "CSuplResponse::NewL() Begin\n"); + CSuplResponse* self = new (ELeave) CSuplResponse(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplResponse::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +/** +Constructor +*/ +CSuplResponse::CSuplResponse() + : CSuplMessageBase::CSuplMessageBase(ESuplResponse, EFalse) + { + } + +/** +Second stage constructor +*/ +void CSuplResponse::ConstructL() + { + // call the base class ConstructL() to create common data structures + CSuplMessageBase::ConstructL(); + } + + +/** +Destructor +*/ +CSuplResponse::~CSuplResponse() + { + SUPLLOG(ELogP1, "CSuplResponse::~CSuplResponse() Begin\n"); + SUPLLOG(ELogP1, "CSuplResponse::~CSuplResponse() End\n"); + } + + +/** +GetPosMethod() + +The Positioning Method parameter of the SUPL RESPONSE message is the method +that SHALL be used for the SUPL POS session. + +@param aMethod on return, populated according to Pos Method parameter +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplResponse::GetPosMethod(TLbsNetPosRequestMethod& aMethod) + { + SUPLLOG(ELogP1, "CSuplResponse::GetPosMethod() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLRESPONSE != NULL, User::Invariant()); + + // pointer to message body + ASN1T_SUPLRESPONSE* msgBody = iData->message.u.msSUPLRESPONSE; + + TLbsNetPosMethod posMethods[2]; + TInt numMethods = 1; + + switch (msgBody->posMethod) + { + case PosMethod::agpsSETassisted: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + break; + + case PosMethod::agpsSETbased: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + break; + + case PosMethod::agpsSETassistedpref: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + posMethods[1].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + ++numMethods; + break; + + case PosMethod::PosMethod::agpsSETbasedpref: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); + posMethods[1].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted); + ++numMethods; + break; + + case PosMethod::autonomousGPS: + posMethods[0].SetPosMethod(KLbsPositioningMeansGps, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::aFLT: + posMethods[0].SetPosMethod(KLbsPositioningMeansAflt, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::eCID: + posMethods[0].SetPosMethod(KLbsPositioningMeansCell, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::PosMethod::eOTD: + posMethods[0].SetPosMethod(KLbsPositioningMeansEotd, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::oTDOA: + posMethods[0].SetPosMethod(KLbsPositioningMeansOtdoa, TPositionModuleInfo::ETechnologyTerminal); + break; + + case PosMethod::noPosition: + posMethods[0].SetPosMethod(KLbsPositioningMeansNone, TPositionModuleInfo::ETechnologyTerminal); + break; + + default: + // error + __ASSERT_DEBUG(EFalse, User::Invariant()); + return KErrArgument; + } + + // populate the return parameter + TInt err = aMethod.SetPosMethods(posMethods, numMethods); + + SUPLLOG(ELogP1, "CSuplResponse::GetPosMethod() End\n"); + return err; + } + + +/** +SlpAddressPresent() + +The SLP Address is conditionally present - it is required if the SUPL Session +is operating in non-Proxy mode, otherwise it is not required. + +@return ETrue if the SlpAddress parameter is present +*/ +EXPORT_C TBool CSuplResponse::SlpAddressPresent() + { + SUPLLOG(ELogP1, "CSuplResponse::SlpAddressPresent() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLRESPONSE != NULL, User::Invariant()); + + if (iData->message.u.msSUPLRESPONSE->m.sLPAddressPresent == 0) + { + SUPLLOG(ELogP1, "CSuplResponse::SlpAddressPresent(EFalse) End\n"); + return EFalse; + } + + SUPLLOG(ELogP1, "CSuplResponse::SlpAddressPresent(ETrue) End\n"); + return ETrue; + } + + +/** +SlpAddress() + +@param aAddress, populated according to the SLP address parameter +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplResponse::GetSlpAddress(CSuplSlpAddress& aAddress) + { + SUPLLOG(ELogP1, "CSuplResponse::SlpAddress() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLRESPONSE != NULL, User::Invariant()); + __ASSERT_DEBUG(iData->message.u.msSUPLRESPONSE->m.sLPAddressPresent != 0, User::Invariant()); + + // pointer to message body + ASN1T_SUPLRESPONSE* msgBody = iData->message.u.msSUPLRESPONSE; + + if (msgBody->m.sLPAddressPresent == 0) + { + SUPLLOG(ELogP1, "CSuplResponse::SlpAddress() End (SLP Address element not present)\n"); + return KErrNotFound; + } + + if (msgBody->sLPAddress.t == T_SLPAddress_fQDN) + { + // FQDN is a NULL terminated string, length 1..255 + aAddress.iSlpAddressType = ESuplSlpAddressTypeFqdn; + + // find the length of the FQDN (NULL terminated) + const TUint8* tmp = (const TUint8*)msgBody->sLPAddress.u.fQDN; + TPtrC8 source = TPtrC8(tmp, 256); + _LIT8(KNull,"\0"); + TInt fqdnLength = source.Find(KNull); + source.Set(tmp, fqdnLength); + + // copy to the container + TBuf8<256>& fqdn = aAddress.iFqdn->iFqdn; + fqdn.Copy(source); + fqdn.SetLength(fqdnLength); + } + + else if (msgBody->sLPAddress.t == T_SLPAddress_iPAddress) + { + // SLP ID is an IP Address + aAddress.iSlpAddressType = ESuplSlpAddressTypeIp; + + // Reference to the address data buffer + TBuf8<16>& ipAddress = aAddress.iIpAddress->iIpAddress; + + // IPv4 or IPv6 address? + if (msgBody->sLPAddress.u.iPAddress->t == T_IPAddress_ipv6Address) + { + aAddress.iIpAddress->iIpAddressType = ESuplIpAddressTypeV6; + TInt len = msgBody->sLPAddress.u.iPAddress->u.ipv6Address->numocts; + TUint8* data = msgBody->sLPAddress.u.iPAddress->u.ipv6Address->data; + ipAddress.Copy(data, len); + } + else + { + aAddress.iIpAddress->iIpAddressType = ESuplIpAddressTypeV4; + TInt len = msgBody->sLPAddress.u.iPAddress->u.ipv4Address->numocts; + TUint8* data = msgBody->sLPAddress.u.iPAddress->u.ipv4Address->data; + ipAddress.Copy(data, len); + } + } + else + { + // error + __ASSERT_DEBUG(0, User::Invariant()); + return KErrArgument; + } + + SUPLLOG(ELogP1, "CSuplResponse::SlpAddress() End\n"); + return KErrNone; + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplstart.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplpmcore/suplrrlpasn1/src/suplstart.cpp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,260 @@ +// 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: +// + +/** + @file + @internalTechnology + +*/ + +#include "ULP.h" +#include "suplstart.h" +#include "supldevloggermacros.h" +#include "suplrrlpasn1common.h" +#include + +/** +Default minimum horizontal accuracy in meters +*/ +const TInt KLbsSuplMinHorAccDefault = 20; + + +/** +Static factory constructor +*/ +EXPORT_C CSuplStart* CSuplStart::NewL() + { + SUPLLOG(ELogP1, "CSuplStart::NewL() Begin\n"); + CSuplStart* self = CSuplStart::NewLC(); + SUPLLOG(ELogP1, "CSuplStart::NewL() End\n"); + CleanupStack::Pop(self); + return self; + } + +/** +Static factory constructor +*/ +EXPORT_C CSuplStart* CSuplStart::NewLC() + { + SUPLLOG(ELogP1, "CSuplStart::NewL() Begin\n"); + CSuplStart* self = new (ELeave) CSuplStart(); + CleanupStack::PushL(self); + self->ConstructL(); + SUPLLOG(ELogP1, "CSuplStart::NewLC() End\n"); + return self; + } + +/** +Constructor +*/ +CSuplStart::CSuplStart() + : CSuplMessageBase::CSuplMessageBase(ESuplStart, ETrue) + { + SUPLLOG(ELogP1, "CSuplMessageBase::CSuplMessageBase() Begin\n"); + SUPLLOG(ELogP1, "CSuplMessageBase::CSuplMessageBase() End\n"); + } + + +/** +Second stage constructor +*/ +void CSuplStart::ConstructL() + { + // call the base class ConstructL() to create data structures + CSuplMessageBase::ConstructL(); + + // local reference to context object + OSCTXT* pctxt = iControl->getCtxtPtr(); + + iData->message.t = T_UlpMessage_msSUPLSTART; + iData->message.u.msSUPLSTART = (ASN1T_SUPLSTART*)rtxMemAllocZ(pctxt, sizeof(ASN1T_SUPLSTART)); + LeaveIfAllocErrorL(); + } + + +/** +Destructor +*/ +CSuplStart::~CSuplStart() + { + SUPLLOG(ELogP1, "CSuplStart::~CSuplStart() Begin\n"); + SUPLLOG(ELogP1, "CSuplStart::~CSuplStart() End\n"); + } + + +/** +SetCapabilities() + +Populates the SET Capabilities parameter of the outgoing SUPL START message. + +SET Capabilities + - Pos Technology (m) Bitmask indicating technologies the SET supports + - Pref Method (m) which GPS mode the SET prefers (TA, TB, noPref) + - Pos Protocol (m) which underlying positioning protocols are supported + +@param aCapabilities, current capabilities reported by LBS subsystem +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplStart::SetCapabilities(TLbsNetPosCapabilities& aCapabilities) + { + SUPLLOG(ELogP1, "CSuplStart::SetCapabilities() Begin\n"); + __ASSERT_DEBUG(iData->message.u.msSUPLSTART != NULL, User::Invariant()); + + TInt err = PopulateSetCapabilities(aCapabilities, iData->message.u.msSUPLSTART->sETCapabilities); + + SUPLLOG(ELogP1, "CSuplStart::SetCapabilities() End\n"); + return err; + } + + +/** +SetLocationId() + +Set the location ID parameter + +Location ID - Describes the globally unique cell identification of the most current serving cell. + Cell Info (m) The following cell IDs are supported: + - GSM Cell Info + - WCDMA Cell Info + - CDMA Cell Info + Status (m) Describes whether or not the cell info is: + - Not Current, last known cell info + - Current, the present cell info + - Unknown (ie not known whether the cell id is current or not current) + +Note: The Status parameter does NOT apply to WCDMA optional parameters +(Frequency Info, Primary Scrambling Code and Measured Results List). Frequency +Info, Primary Scrambling Code and Measured Results List, if present, are always +considered to be correct for the current cell. + +@param aLocationId, describes the current location +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplStart::SetLocationId(const CSuplLocationId& aLocationId) + { + __ASSERT_DEBUG(iData->message.u.msSUPLSTART != NULL, User::Invariant()); + SUPLLOG(ELogP1, "CSuplStart::SetLocationId() Begin\n"); + + TInt err = PopulateLocationId(aLocationId, iData->message.u.msSUPLSTART->locationId); + + SUPLLOG(ELogP1, "CSuplStart::SetLocationId() End\n"); + return err; + } + + +/** +SetQoP() + +Set the QoP parameter + +QoP - the desired quality of position + horacc (m) (0..127) + veracc (o) (0..127) + maxLocAge (o) (0..65535) + delay (o) (0..7) + +@param aQuality, the required quality of position +@return error indication, KErrNone otherwise +*/ +EXPORT_C TInt CSuplStart::SetQoP(TLbsNetPosRequestQuality& aQuality) + { + __ASSERT_DEBUG(iData->message.u.msSUPLSTART != NULL, User::Invariant()); + SUPLLOG(ELogP1, "CSuplStart::SetQoP() Begin\n"); + + // pointer to message body + ASN1T_SUPLSTART* msgBody = iData->message.u.msSUPLSTART; + + // local reference to context object + iControl->getCtxtPtr(); + + // indicate that the optional QoP component is present + msgBody->m.qoPPresent = 1; + + // Horizontal accuracy + if (aQuality.MinHorizontalAccuracy() != 0) + { + msgBody->qoP.horacc = Uncertainty(aQuality.MinHorizontalAccuracy()); + } + else + { + msgBody->qoP.horacc = Uncertainty(KLbsSuplMinHorAccDefault); + } + + // vertical accuracy + if (aQuality.MinVerticalAccuracy() != 0) + { + msgBody->qoP.veracc = UncertaintyAltitude(aQuality.MinVerticalAccuracy()); + msgBody->qoP.m.veraccPresent = 1; + } + + // max location age / max fix age + TTimeIntervalMicroSeconds maxAge = aQuality.MaxFixAge(); + if (maxAge.Int64() != 0) + { + TInt64 maxAgeSeconds = maxAge.Int64() / KLbsMilliSeconds; + if (maxAgeSeconds > 65535) + { + // limit to 16 bits (65535 = 2^16 - 1) + maxAgeSeconds = 65535; + } + msgBody->qoP.maxLocAge = maxAgeSeconds; + msgBody->qoP.m.maxLocAgePresent = 1; + } + + // delay / max fix time + TTimeIntervalMicroSeconds maxFixTime = aQuality.MaxFixTime(); + if (maxFixTime.Int64() != 0) + { + msgBody->qoP.m.delayPresent = 1; + TInt seconds = maxFixTime.Int64() / KLbsMilliSeconds; + if (seconds <= 1) + { + msgBody->qoP.delay = 0; + } + else if (seconds <= 2) + { + msgBody->qoP.delay = 1; + } + else if (seconds <= 4) + { + msgBody->qoP.delay = 2; + } + else if (seconds <= 8) + { + msgBody->qoP.delay = 3; + } + else if (seconds <= 16) + { + msgBody->qoP.delay = 4; + } + else if (seconds <= 32) + { + msgBody->qoP.delay = 5; + } + else if (seconds <= 64) + { + msgBody->qoP.delay = 6; + } + else + { + // maximum value + msgBody->qoP.delay = 7; + } + } + + SUPLLOG(ELogP1, "CSuplStart::SetQoP() End\n"); + return KErrNone; + } + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplprotocolmodule/HostSettingsApi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplprotocolmodule/HostSettingsApi/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,28 @@ +// 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: +// + +// Main projects, in build order +PRJ_EXPORTS +../inc/lbshostsettings.h lbs/lbshostsettings.h +../inc/lbshostsettingsclasstypes.h lbs/lbshostsettingsclasstypes.h +// Note: this file is exported for testing and techview only. Not used in a device +10285AA8.txt z:/private/10202be9/10285aa8.txt +lbshostsettings.iby /epoc32/rom/include/lbshostsettings.iby + +PRJ_MMPFILES +lbshostsettings.mmp +//gnumakefile createlbssuplstore.mk + +#include "../test/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplprotocolmodule/SuplPushAPI/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplprotocolmodule/SuplPushAPI/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,27 @@ +// Copyright (c) 2007-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: +// Bld.inf file for the SUPL Push API component. +// +// + +PRJ_EXPORTS +../inc/lbssuplpushcommon.h lbs/lbssuplpushcommon.h +../inc/lbssuplpush.h lbs/lbssuplpush.h +../inc/lbssuplpushreceiver.h lbs/lbssuplpushreceiver.h +lbssuplpush.iby /epoc32/rom/include/lbssuplpush.iby + +PRJ_MMPFILES +lbssuplpush.mmp + +#include "../test/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplprotocolmodule/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplprotocolmodule/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,28 @@ +// 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: +// + +PRJ_EXPORTS +lbssupl.iby /epoc32/rom/include/lbssupl.iby + +// ConfML files +../conf/suplprotocolmodule.confml OS_LAYER_EXPORTS_CONFML(suplprotocolmodule.confml) +../conf/suplprotocolmodule_10285AA8.crml OS_LAYER_EXPORTS_CRML(suplprotocolmodule_10285aa8.crml) + +// Main projects, in build order +#include "../HostSettingsApi/group/bld.inf" +#include "../SuplConnectionManager/group/bld.inf" +#include "../SuplProtocol/group/bld.inf" + +#include "../SuplPushAPI/group/bld.inf" diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplprotocolmodule/group/lbs_suplprotocolmodule.mrp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplprotocolmodule/group/lbs_suplprotocolmodule.mrp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,37 @@ +# +# Copyright (c) 2010 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: +# + +component lbs_suplprotocolmodule + +source \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\ + +binary \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\group all + +exports \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\group + +notes_source \component_defs\release.src + + +ipr E +ipr T \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\HostSettingsAPI\test +ipr T \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\SuplConnectionManager\test +ipr T \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\SuplRrlpProtocol\test +ipr T \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\SuplProtocol\test +ipr T \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\SuplPushAPI\test +ipr T \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\SuplRrlpAsn1\test +ipr T \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\test +ipr B \sf\os\lbs\networkprotocolmodules\suplprotocolmodule\test\export + diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplprotocolmodule/group/lbssupl.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplprotocolmodule/group/lbssupl.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,36 @@ +// 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: +// + +#ifndef __LBS_SUPL_IBY__ +#define __LBS_SUPL_IBY__ + + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) && defined(SYMBIAN_INCLUDE_LOCATION_SUPLv10) + +#include "supldevlogger.iby" +#include "asn1export.iby" +#include "asn1supl.iby" +#include "asn1rrlp.iby" +#include "lbshostsettings.iby" +#include "suplrrlpprotocol.iby" +#include "lbssuplconnectionmanager.iby" +#include "suplprotocolmodule.iby" +#include "lbssuplpush.iby" +#include "suplrrlpasn1.iby" + +#endif // SYMBIAN_EXCLUDE_LOCATION, SYMBIAN_INCLUDE_LOCATION_SUPLv10 + + +#endif // __LBS_SUPL_IBY__ diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplproxyprotocolmodule/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,26 @@ +// Copyright (c) 2007-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: +// + +// SUPL Proxy Protocol Module specific: +#include "../clientapi/common/posmsgapi/group/bld.inf" +#include "../clientapi/suplposmsgpluginapi/group/bld.inf" +#include "../clientapi/suplposmsgplugin/group/bld.inf" +#include "../supltiapi/group/bld.inf" +#include "../suplproxyprotocolmodule/group/bld.inf" + +#include "../test/group/bld.inf" + +PRJ_EXPORTS +lbs_suplproxyprotocolmodule.iby /epoc32/rom/include/lbs_suplproxyprotocolmodule.iby diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/group/lbs_suplproxyprotocolmodule.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplproxyprotocolmodule/group/lbs_suplproxyprotocolmodule.iby Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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: +* +*/ +#ifndef __LBS_SUPLPROXYPROTOCOLMODULE_IBY__ +#define __LBS_SUPLPROXYPROTOCOLMODULE_IBY__ + +REM LBS SUPL Proxy Protocol Module + +#if !defined(SYMBIAN_EXCLUDE_LOCATION) +#include "lbsnetworkprivacy.iby" +#include "lbsprivacyrequest.iby" + +#include "suplproxyclientpossession.iby" +#include "epos_omasuplposmsgpluginimpl.iby" +#include "netpmutils.iby" +#include "epos_omasuplposmessageplugin.iby" +#include "supltiapi.iby" +#include "suplrrlpprotocol.iby" +#include "suplrrlpasn1.iby" +#include "asn1export.iby" +#include "asn1supl.iby" +#include "asn1rrlp.iby" + +#include "lbssuplproxyprotocolmodule.iby" + +#endif // SYMBIAN_EXCLUDE_LOCATION +#endif diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/group/lbs_suplproxyprotocolmodule.mrp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplproxyprotocolmodule/group/lbs_suplproxyprotocolmodule.mrp Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,29 @@ +# +# Copyright (c) 2010 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: +# + +component lbs_suplproxyprotocolmodule + +source \sf\os\lbs\networkprotocolmodules\suplproxyprotocolmodule + +binary \sf\os\lbs\networkprotocolmodules\suplproxyprotocolmodule\group all + +exports \sf\os\lbs\networkprotocolmodules\suplproxyprotocolmodule\group + +notes_source \component_defs\release.src + +ipr E + +ipr T \sf\os\lbs\networkprotocolmodules\suplproxyprotocolmodule\test diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/suplproxyprotocolmodule/conf/suplproxyprotocolmodule_102871ed.crml Binary file networkprotocolmodules/suplproxyprotocolmodule/suplproxyprotocolmodule/conf/suplproxyprotocolmodule_102871ed.crml has changed diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/suplproxyprotocolmodule/data/102871ed.txt Binary file networkprotocolmodules/suplproxyprotocolmodule/suplproxyprotocolmodule/data/102871ed.txt has changed diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/suplproxyprotocolmodule/group/102871ed.cre Binary file networkprotocolmodules/suplproxyprotocolmodule/suplproxyprotocolmodule/group/102871ed.cre has changed diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/test/te_lbs_sppm_privfwcap/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplproxyprotocolmodule/test/te_lbs_sppm_privfwcap/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,34 @@ +// Copyright (c) 2007-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: +// + +PRJ_TESTMMPFILES + +lbs_sppm_privfwcap.MMP + + + +PRJ_TESTEXPORTS + +../scripts/Cap_00022010_lbs_sppm_privfwcapSub.script c:/testdata/scripts/cap_00022010_lbs_sppm_privfwcapsub.script +../scripts/Cap_00022000_lbs_sppm_privfwcapSub.script c:/testdata/scripts/cap_00022000_lbs_sppm_privfwcapsub.script +../scripts/Cap_00020010_lbs_sppm_privfwcapSub.script c:/testdata/scripts/cap_00020010_lbs_sppm_privfwcapsub.script +../scripts/Cap_00002010_lbs_sppm_privfwcapSub.script c:/testdata/scripts/cap_00002010_lbs_sppm_privfwcapsub.script +../scripts/Cap_00020000_lbs_sppm_privfwcapSub.script c:/testdata/scripts/cap_00020000_lbs_sppm_privfwcapsub.script +../scripts/Cap_00000010_lbs_sppm_privfwcapSub.script c:/testdata/scripts/cap_00000010_lbs_sppm_privfwcapsub.script +../scripts/Cap_00000002_lbs_sppm_privfwcapSub.script c:/testdata/scripts/cap_00000002_lbs_sppm_privfwcapsub.script +../scripts/lbs_sppm_privfwcap.script c:/testdata/scripts/lbs_sppm_privfwcap.script + + +./lbs_sppm_privfwcap.IBY /epoc32/rom/include/lbs_sppm_privfwcap.iby diff -r 2965a06983dc -r 81c9bee26a45 networkprotocolmodules/suplproxyprotocolmodule/test/te_sppm_dummynetgateway/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocolmodules/suplproxyprotocolmodule/test/te_sppm_dummynetgateway/group/bld.inf Tue Jul 13 12:25:28 2010 +0100 @@ -0,0 +1,17 @@ +// Copyright (c) 2007-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: +// + +PRJ_TESTMMPFILES +te_sppm_dummynetgateway.mmp \ No newline at end of file