// ---------------------------------------------------------
// CT_LbsClientPosTp76::CheckModuleInfoL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsClientPosTp76::CheckModuleInfoL(const TPositionModuleInfo& dbInfo,
                                const TPositionModuleInfo& clientInfo)
    {
    _LIT(KNotSame, "Module Info from settings is not the same as when read by GetModuleInfoById");
    if (dbInfo.IsAvailable() != clientInfo.IsAvailable() ||
        dbInfo.ModuleId() != clientInfo.ModuleId() ||
        dbInfo.DeviceLocation() != clientInfo.DeviceLocation() ||
        dbInfo.Capabilities() != clientInfo.Capabilities() ||
        dbInfo.TechnologyType() != clientInfo.TechnologyType() ||
        dbInfo.Version().iBuild != clientInfo.Version().iBuild ||
        dbInfo.Version().iMajor != clientInfo.Version().iMajor ||
        dbInfo.Version().iMinor != clientInfo.Version().iMinor ||
        dbInfo.Version().Name() != clientInfo.Version().Name() ||
        dbInfo.ClassesSupported(EPositionInfoFamily) != clientInfo.ClassesSupported(EPositionInfoFamily))
        {
        LogErrorAndLeaveL(KNotSame);
        }
    TPositionQuality dbQuality;
    TPositionQuality clientQuality;
    dbInfo.GetPositionQuality(dbQuality);
    clientInfo.GetPositionQuality(clientQuality);
    if (dbQuality.TimeToFirstFix() != clientQuality.TimeToFirstFix() ||
        dbQuality.TimeToNextFix() != clientQuality.TimeToNextFix() ||
        dbQuality.HorizontalAccuracy() != clientQuality.HorizontalAccuracy() ||
        dbQuality.VerticalAccuracy() != clientQuality.VerticalAccuracy() ||
        dbQuality.CostIndicator() != clientQuality.CostIndicator() || 
        dbQuality.PowerConsumption() != clientQuality.PowerConsumption() )
        {
        LogErrorAndLeaveL(KNotSame);
        }


    TBuf<30> name1;
    TBuf<30> name2;
    dbInfo.GetModuleName(name1);
    clientInfo.GetModuleName(name2);
    if (name1 != name2)
        {
        LogErrorAndLeaveL(KNotSame);
        }
    }
示例#2
0
EXPORT_C TBool T_LbsUtils::Compare_ModuleInfo(TPositionModuleInfo& aModInfoSideA, TPositionModuleInfo& aModInfoSideB)
	{
	// Compare all module information items and quality.
	
	// Compare module id.
	if (aModInfoSideA.ModuleId() != aModInfoSideB.ModuleId())
		{
		return EFalse;
		}	

	//	Compare is available flag.
	if (aModInfoSideA.IsAvailable() != aModInfoSideB.IsAvailable())
		{
		return EFalse;
		}	

	// Compare technology type.
	if (aModInfoSideA.TechnologyType() != aModInfoSideB.TechnologyType())
		{
		return EFalse;
		}	

	//	Compare device location.
	if (aModInfoSideA.DeviceLocation() != aModInfoSideB.DeviceLocation())
		{
		return EFalse;
		}	

	//	Compare capabilities.
	if (aModInfoSideA.Capabilities() != aModInfoSideB.Capabilities())
		{
		return EFalse;
		}	

	// Compare each of the family classes. Use min and max enum values.
	for (TInt i = EPositionInfoFamily; i <= EPositionUpdateOptionsFamily; i++)
		{
		if (aModInfoSideA.ClassesSupported(static_cast<TPositionClassFamily>(i)) != aModInfoSideB.ClassesSupported(static_cast<TPositionClassFamily>(i)))
			{
			return EFalse;
			}	
		}
		
	// Compare version.
	if ((aModInfoSideA.Version().iMajor != aModInfoSideB.Version().iMajor) ||
		(aModInfoSideA.Version().iMinor != aModInfoSideB.Version().iMinor) ||
		(aModInfoSideA.Version().iBuild != aModInfoSideB.Version().iBuild))
		{
		return EFalse;
		}	

	// Compare module name.
	TBuf<KPositionMaxModuleName> modNameSideA;
	TBuf<KPositionMaxModuleName> modNameSideB;

	aModInfoSideA.GetModuleName(modNameSideA);
	aModInfoSideB.GetModuleName(modNameSideB);
	if (0 != modNameSideA.Compare(modNameSideB))
	{
		return EFalse;
	}

	// Compare module quality.
	TPositionQuality qualitySideA;
	TPositionQuality qualitySideB;	
	
	aModInfoSideA.GetPositionQuality(qualitySideA);
	aModInfoSideB.GetPositionQuality(qualitySideB);
	
	return Compare_PositionQuality(qualitySideA, qualitySideB);
	}