networkprotocolmodules/suplprotocolmodule/SuplProtocol/src/suplassistancedatamgr.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file provides the implementation of the class that manages
       
    15 // assistance data during location requests.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalTechnology
       
    22  @deprecated
       
    23 */
       
    24 
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <lbs/lbsnetcommon.h>
       
    28 #include <lbs/lbsnetprotocolbase.h>
       
    29 #include <lbs/lbsassistancereferencelocation.h>
       
    30 #include "suplassistancedatamgr.h"
       
    31 #include "supldevloggermacros.h"
       
    32 
       
    33 /** Constant to identify an empty set of assistance data.
       
    34 */
       
    35 const TInt KAssistDataEmpty = 0;
       
    36 
       
    37 /** KAssistDataReportTimer
       
    38 Identity of timer
       
    39 */
       
    40 const TInt KAssistDataReportTimer = 0x01;
       
    41 
       
    42 /** KAssistDataReportTimerDurationInSec
       
    43 Timer duration for when assistance data is expected from network
       
    44 */
       
    45 const TInt KAssistDataReportTimerDurationInSec = 1;
       
    46 
       
    47 /** Static constructor.
       
    48 @return A new instance of the CSuplAssistanceDataManager class.
       
    49 */  
       
    50 CSuplAssistanceDataManager* CSuplAssistanceDataManager::NewL(MSuplProtocolManagerObserver& aGateway)
       
    51 	{
       
    52 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::NewL() Begin\n");
       
    53 	CSuplAssistanceDataManager* self = new (ELeave) CSuplAssistanceDataManager(aGateway);
       
    54 	CleanupStack::PushL(self);
       
    55 	self->ConstructL();
       
    56 	CleanupStack::Pop(self);
       
    57 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::NewL() End\n");
       
    58 	return self;
       
    59 	}
       
    60 
       
    61 
       
    62 /** Standard constructor.
       
    63 */  
       
    64 CSuplAssistanceDataManager::CSuplAssistanceDataManager(MSuplProtocolManagerObserver& aGateway):
       
    65 							iGateway(aGateway)
       
    66 	{
       
    67 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::CSuplAssistanceDataManager() Begin\n");
       
    68 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::CSuplAssistanceDataManager() End\n");
       
    69 	}
       
    70 
       
    71 
       
    72 /** Standard destructor.
       
    73 */  
       
    74 CSuplAssistanceDataManager::~CSuplAssistanceDataManager()
       
    75 	{
       
    76 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::~CSuplAssistanceDataManager() Begin\n");
       
    77 	delete iAssistDataReportTimer;
       
    78 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::~CSuplAssistanceDataManager() End\n");
       
    79 	}
       
    80 
       
    81 
       
    82 /** Private second-stage constructor.
       
    83 */  
       
    84 void CSuplAssistanceDataManager::ConstructL()
       
    85 	{
       
    86 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::ConstructL() Begin\n");
       
    87 	iAssistDataReportTimer = CLbsCallbackTimer::NewL(*this);
       
    88 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::ConstructL() End\n");
       
    89 	}
       
    90 
       
    91 
       
    92 /** Process assistance data request.
       
    93 This is called by the protocol manager to process an assistance data request
       
    94 received from LBS.
       
    95 
       
    96 The method first identifies any errors in the assistance data request mask. If any
       
    97 assistance data types are unsupported, this method sends a response to LBS
       
    98 for those types with error code KErrArgument.
       
    99 
       
   100 Then, if there are any state machines ready to handle an assistance data request, the
       
   101 iPendingDataMask mask is added to aDataRequestMask and then cleared. Otherwise, it is
       
   102 aDataRequestMask that is added to iPendingDataMask.
       
   103 
       
   104 The state machines that must receive the assitance data request are returned by this
       
   105 method as a mask of type MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask.
       
   106 
       
   107 @param aDataRequest The set of assistance data requested by LBS.
       
   108 @return aDataRequest The set of assistance data that must be requested from the state machines
       
   109 @return MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask the state machine that
       
   110 		must receive the assistance data request.
       
   111 */
       
   112 MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask CSuplAssistanceDataManager::ProcessDataRequest(TLbsAsistanceDataGroup& aDataRequestMask)
       
   113 	{
       
   114 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::ProcessDataRequest() Begin\n");
       
   115 
       
   116 	// state machines ready for assistance data requests
       
   117 	MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask readyMachinesMask = MLbsNetworkProtocolObserver::EServiceNone;
       
   118 
       
   119 	// Identify invalid parts of the request.
       
   120 	TLbsAsistanceDataGroup validSet = EAssistanceDataAquisitionAssistance
       
   121 									 | EAssistanceDataBadSatList
       
   122 									 | EAssistanceDataNavigationModel
       
   123 									 | EAssistanceDataReferenceTime
       
   124 									 | EAssistanceDataIonosphericModel
       
   125 									 | EAssistanceDataReferenceLocation
       
   126 									 | EAssistanceDataAlmanac
       
   127 									 | EAssistanceDataPositioningGpsUtcModel;
       
   128 
       
   129 	// Create a request error mask for any invalid parts of the request
       
   130 	TLbsAsistanceDataGroup requestErrorMask = aDataRequestMask & ~validSet;
       
   131 
       
   132 	if (requestErrorMask != 0)
       
   133 		{
       
   134 		// Send an error back to LBS for the assistance data types in the
       
   135 		// error mask
       
   136 		//
       
   137 		RLbsAssistanceDataBuilderSet dummyAssistanceData; //ignored by LBS when error is not KErrNone
       
   138 		iGateway.AssistanceDataInd(requestErrorMask, dummyAssistanceData, KErrArgument);
       
   139 		}
       
   140 
       
   141 	// Remove from the request mask any assistance data types reported to LBS
       
   142 	// within the last second. Those need not be requested again. Remove also
       
   143 	// invalid assitance data types
       
   144 	aDataRequestMask = aDataRequestMask & ~iReportedDataMask & validSet;
       
   145 
       
   146 	// See if there are any state machines ready to process assistance data requests
       
   147 	// (they must get an assistance data request even if it is empty)
       
   148 	if (iReadyMachinesMask != MLbsNetworkProtocolObserver::EServiceNone)
       
   149 		{
       
   150 		// Add pending assistance data to the request and clear the pending mask;
       
   151 		aDataRequestMask = aDataRequestMask | iPendingDataMask;
       
   152 		iPendingDataMask = KAssistDataEmpty;
       
   153 
       
   154 		// The request will be forwarded to all the ready machines. After that
       
   155 		// they are no longer ready for new assistance data requests (until they
       
   156 		// reported as ready again with MachineReadyForAssistanceDataRequest())
       
   157 		readyMachinesMask = iReadyMachinesMask;
       
   158 		iReadyMachinesMask = MLbsNetworkProtocolObserver::EServiceNone;
       
   159 		}
       
   160 	else
       
   161 		{
       
   162 		// Add requested assistance data types to the pending ones
       
   163 		iPendingDataMask = iPendingDataMask | aDataRequestMask;
       
   164 		}
       
   165 
       
   166 	// If any machine is going to get the assistance data request, remember what 
       
   167 	// assistance data types are going to be retrieved by each state machine.
       
   168 	if (readyMachinesMask != MLbsNetworkProtocolObserver::EServiceNone)
       
   169 		{
       
   170 		if (readyMachinesMask & MLbsNetworkProtocolObserver::EServiceSelfLocation)
       
   171 			{
       
   172 			iMoLrRequestedDataMask = aDataRequestMask;
       
   173 			}
       
   174 		
       
   175 		if (readyMachinesMask & MLbsNetworkProtocolObserver::EServiceMobileTerminated)
       
   176 			{
       
   177 			iMtLrRequestedDataMask = aDataRequestMask;
       
   178 			}
       
   179 		}
       
   180 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::ProcessDataRequest() End\n");
       
   181 	return readyMachinesMask;
       
   182 	}
       
   183 
       
   184 
       
   185 /** Process Assistance Data Report
       
   186 
       
   187 Called by the Protocol Manager when a state machine (aStateMachine) has reported that it
       
   188 has obtained assistance data. The assistance data types reported in this call are those in
       
   189 aDataReportMask. If the error code aReason is KErrNone, then the assistance data is be available
       
   190 in aAssistanceDataBuilder.
       
   191 
       
   192 The error in aReason applies to all of the assistance data types in aDataReportMask.
       
   193 
       
   194 This method sends the Assistance Data (or error indication) to LBS.
       
   195 
       
   196 If Reference Location is part of the reported set of assistance data, it is extracted,
       
   197 converted to the format expected by LBS and sent to LBS.
       
   198 
       
   199 @param aAssistanceData. The actual assistance data being reported when aReason is KErrNone
       
   200 @param aDataReportMask. The assistanced data types being reported
       
   201 @param aReason. If KErrNone, assistance data are being reported, otherwise, a failure to collect
       
   202 				the assistance data types in aDataReportMask is what is being reported in this call.
       
   203 @param aStateMachine. The service type of the state machine reporting the assistance data types.
       
   204 					Used to identify the machine. @see MLbsNetworkProtocolObserver.
       
   205 @param aSessionId. The unique ID of the session being conducted by the state machine that is reporting
       
   206 					assistance data. Used when sendig reference location back to LBS.
       
   207 */
       
   208 void CSuplAssistanceDataManager::AssistanceDataReport(const RLbsAssistanceDataBuilderSet& aAssistanceData,
       
   209 						  const TLbsAsistanceDataGroup& aDataReportMask, TInt aReason,
       
   210 						  const MLbsNetworkProtocolObserver::TLbsNetProtocolService& aStateMachine,
       
   211 						  const TLbsNetSessionId& aSessionId)
       
   212 	{
       
   213 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::AssistanceDataReport() Begin\n");
       
   214 
       
   215 	TLbsAsistanceDataGroup missingDataTypes = KAssistDataEmpty;
       
   216 
       
   217 	if (aReason != KErrNone)
       
   218 		{
       
   219 		// Errored assistance data should be reported to LBS.
       
   220 		TLbsAsistanceDataGroup reportDataMask = KAssistDataEmpty;
       
   221 
       
   222 		if (MLbsNetworkProtocolObserver::EServiceSelfLocation == aStateMachine)
       
   223 			{
       
   224 			// Report error on only those assistance data types that are not being
       
   225 			// collected by any other state machines and have not been
       
   226 			// reported recently
       
   227 			reportDataMask = aDataReportMask & ~iMtLrRequestedDataMask & ~iReportedDataMask;
       
   228 			iMoLrRequestedDataMask = KAssistDataEmpty;
       
   229 			}
       
   230 		else if (MLbsNetworkProtocolObserver::EServiceMobileTerminated == aStateMachine)
       
   231 			{
       
   232 			// Report error on only those assistance data types that are not being
       
   233 			// collected by any other state machines and have not been
       
   234 			// reported recently
       
   235 			reportDataMask = aDataReportMask & ~iMoLrRequestedDataMask & ~iReportedDataMask;
       
   236 			iMtLrRequestedDataMask = KAssistDataEmpty;
       
   237 			}
       
   238 		else
       
   239 			{
       
   240 			// This should not happen
       
   241 			ASSERT(EFalse);
       
   242 			}
       
   243 
       
   244 		if (reportDataMask != KAssistDataEmpty)
       
   245 			{
       
   246 			iGateway.AssistanceDataInd(reportDataMask, aAssistanceData, KErrArgument);
       
   247 			}
       
   248 		}
       
   249 	else
       
   250 		{
       
   251 		// Extract Reference Location from the reported assistance data if present and 
       
   252 		// send it to LBS as a Location Update.
       
   253 		//
       
   254 		if (EAssistanceDataReferenceLocation == (aDataReportMask & EAssistanceDataReferenceLocation))
       
   255 			{
       
   256 			RReferenceLocationBuilder* refLocBuilderPtr;
       
   257 			RLbsAssistanceDataBuilderSet& data = const_cast<RLbsAssistanceDataBuilderSet&>(aAssistanceData);
       
   258 			if (KErrNone == data.GetDataBuilder(refLocBuilderPtr))
       
   259 				{
       
   260  				if (refLocBuilderPtr->IsDataAvailable())
       
   261 					{
       
   262 					// Create a Ref Loc Reader with data from the Builder
       
   263 		            RReferenceLocationReader refLocReader;
       
   264 					TInt err = KErrNone;
       
   265 					TRAP(err,refLocReader.OpenL());
       
   266 					if (KErrNone == err)
       
   267 						{
       
   268 						refLocReader.DataBuffer() = refLocBuilderPtr->DataBuffer();
       
   269 
       
   270 						// Obtain position info from the Ref Loc Reader and set it in a TPositionInfo
       
   271 						if(refLocReader.FieldExists(TReferenceLocation::EEllipsoidPointAltitudeEllipsoide))
       
   272 							{
       
   273 							REllipsoidPointAltitudeEllipsoideReader ellipsoidReader;
       
   274 							refLocReader.GetFieldReader(TReferenceLocation::EEllipsoidPointAltitudeEllipsoide, ellipsoidReader);
       
   275 							TPositionInfo positionInfo;
       
   276 							TPosition position;
       
   277 							TUint tempUint;
       
   278 							TInt  tempInt;
       
   279 							TReal64 latitudeDegrees;
       
   280 							TReal64 longitudeDegrees;
       
   281 							TReal32 altitudeMeters;
       
   282 							TReal aux = 0;
       
   283 							TReal32 uncertainty;
       
   284 
       
   285 							position.SetCurrentTime();
       
   286 							// Get latitude and convert to degrees
       
   287 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::ELatitudeSign, tempInt);
       
   288 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::ELatitude, tempUint);
       
   289 							latitudeDegrees = (tempUint * 90.0) / 8388608.0; //*90/2^23 ; ETSI TS 123.032
       
   290 	                        latitudeDegrees *= (tempInt == TEllipsoidPointAltitudeEllipsoide::ESouth)? -1: 1;
       
   291 
       
   292 							// Get longitude and convert to degreees
       
   293 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::ELongitude, tempInt);
       
   294 							longitudeDegrees = (tempInt * 45.0) / 2097152.0; //*360/2^24; ETSI TS 123.032
       
   295 
       
   296 							// Get altitude (meters) and apply sign
       
   297 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::EAltitudeDirection, tempInt);
       
   298 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::EAltitude, tempUint);
       
   299 							altitudeMeters = tempUint; // ETSI TS 123.032
       
   300 							altitudeMeters *= (tempInt == TEllipsoidPointAltitudeEllipsoide::EDepth)? -1: 1;
       
   301 								
       
   302 							position.SetCoordinate(latitudeDegrees, longitudeDegrees, altitudeMeters);
       
   303 
       
   304 							// Get both horizontal uncertainties, convert to meters and set Horizontal Accuracy to the largest
       
   305 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::EUncertaintySemiMajor, tempUint);
       
   306 							Math::Pow(aux, 1.1, tempUint);
       
   307 						    uncertainty = 10*(aux - 1); // ETSI TS 123.032 : C(((1+x)^k) -1);  x = 0.1; C= 10
       
   308 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::EUncertaintySemiMinor, tempUint);
       
   309 							Math::Pow(aux, 1.1, tempUint);
       
   310 							uncertainty = uncertainty > (10*(aux - 1))? uncertainty : (10*(aux - 1));
       
   311 							
       
   312 							position.SetHorizontalAccuracy(uncertainty);
       
   313 
       
   314 							// Get vertical uncertainty, convert to meters and set Vertical Accuracy
       
   315 							ellipsoidReader.GetField(TEllipsoidPointAltitudeEllipsoide::EUncertaintyAltitude, tempUint);
       
   316 							Math::Pow(aux,1.025, tempUint);
       
   317 						    uncertainty = 45*(aux - 1); //ETSI TS 123.032; C(((1+x)^k) -1); C=45; x=0.025
       
   318 							position.SetVerticalAccuracy(uncertainty);
       
   319 
       
   320 							positionInfo.SetPosition(position);
       
   321 
       
   322 							const TPositionModuleId id = {KSuplv1UidValue};
       
   323 							positionInfo.SetModuleId(id);
       
   324 							positionInfo.SetUpdateType(EPositionUpdateGeneral);
       
   325 							positionInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork);
       
   326 							positionInfo.SetPositionModeReason(EPositionModeReasonNone);
       
   327 							
       
   328 							refLocReader.Close();
       
   329 							// Send the position to LBS
       
   330 							iGateway.NetworkLocationInd(aSessionId, positionInfo);
       
   331 							}
       
   332 						}
       
   333 					}
       
   334 				}
       
   335 
       
   336 			}
       
   337 
       
   338 		// Check if all of the assistance data types expected from the machine sending this
       
   339 		// assistance data report are being reported. Send to LBS an error for the missing
       
   340 		// assistance data types if they are not being collected from another machine.
       
   341 		if (MLbsNetworkProtocolObserver::EServiceSelfLocation == aStateMachine)
       
   342 			{
       
   343 			if (aDataReportMask != iMoLrRequestedDataMask)
       
   344 				{
       
   345 				// Some data types are missing from the report. Pick those not being
       
   346 				// taken care of by the MTLR state machine.
       
   347 				missingDataTypes = iMoLrRequestedDataMask & ~aDataReportMask & ~iMtLrRequestedDataMask;
       
   348 				}
       
   349 				
       
   350 			// No longer expecting assistance data from this machine
       
   351 			iMoLrRequestedDataMask = KAssistDataEmpty;			
       
   352 			}
       
   353 		else if (MLbsNetworkProtocolObserver::EServiceMobileTerminated == aStateMachine)
       
   354 			{		
       
   355 			if (aDataReportMask != iMtLrRequestedDataMask)
       
   356 				{
       
   357 				// Some data types are missing from the report. Pick those not being
       
   358 				// taken care of by the MOLR state machine.
       
   359 				missingDataTypes = iMtLrRequestedDataMask & ~aDataReportMask & ~iMoLrRequestedDataMask;
       
   360 				}
       
   361 				
       
   362 			// No longer expecting assistance data from this machine
       
   363 			iMtLrRequestedDataMask = KAssistDataEmpty;
       
   364 			}
       
   365 
       
   366 		if (KAssistDataEmpty != missingDataTypes)
       
   367 			{
       
   368 			RLbsAssistanceDataBuilderSet dummyAssistanceData; //ignored by LBS when error is not KErrNone
       
   369 			iGateway.AssistanceDataInd(missingDataTypes, dummyAssistanceData, KErrNotFound);
       
   370 			}
       
   371 
       
   372 
       
   373 		// Send received assistance data to LBS
       
   374 		iGateway.AssistanceDataInd(aDataReportMask, aAssistanceData, KErrNone);
       
   375 
       
   376 		// Remember this report for one second to guard agains this report
       
   377 		// crossing in transit with a request from LBS which includes some
       
   378 		// of the assitance data types being reported.
       
   379 		iReportedDataMask = iReportedDataMask | aDataReportMask;
       
   380 		if (iAssistDataReportTimer->IsActive())
       
   381 			{
       
   382 			iAssistDataReportTimer->Cancel();
       
   383 			}
       
   384 		iAssistDataReportTimer->EventAfter(TTimeIntervalSeconds(KAssistDataReportTimerDurationInSec), KAssistDataReportTimer);
       
   385 		}
       
   386 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::AssistanceDataReport() End\n");
       
   387 	}
       
   388 
       
   389 /** Set a machine as able to handle assistance data requests
       
   390 
       
   391 This method is called by the Protocol Manager when it detects that a SUPL state machin
       
   392 has sent a Location Request to LBS (which signals the point when it must/can received
       
   393 an assistance data request)
       
   394 */
       
   395 void CSuplAssistanceDataManager::MachineReadyForAssistanceDataRequest(const MLbsNetworkProtocolObserver::TLbsNetProtocolService& aStateMachine)
       
   396 	{
       
   397 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::MachineReadyForAssistanceDataRequest() Begin\n");
       
   398 	// Add this machine to the "ready" state machines mask
       
   399 	iReadyMachinesMask = iReadyMachinesMask | aStateMachine;
       
   400 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::MachineReadyForAssistanceDataRequest() End\n");
       
   401 	}
       
   402 
       
   403 
       
   404 /** Inform that a state machine is no longer active
       
   405 
       
   406 This method is called by the Protocol Manager when it detects that a SUPL state machine
       
   407 has terminated. If any assistance data were expected from this machine, an assistance data
       
   408 report with KErrNotFound is sent to LBS for those assistance data types.
       
   409 */
       
   410 void CSuplAssistanceDataManager::MachineTerminated(const MLbsNetworkProtocolObserver::TLbsNetProtocolService& aStateMachine)
       
   411 	{
       
   412 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::MachineTerminated() Begin\n");
       
   413 	TLbsAsistanceDataGroup orphanedDataRequestMask = KAssistDataEmpty;
       
   414 
       
   415 	// Remove this machine from the "ready" state machines mask
       
   416 	iReadyMachinesMask = iReadyMachinesMask &  ~aStateMachine;
       
   417 
       
   418 	// If any assistance data was being collected from the machine (and not being collected from
       
   419 	// another machine), a failure to collect those assistance data types must be reported to LBS 
       
   420 	if ( (MLbsNetworkProtocolObserver::EServiceSelfLocation == aStateMachine)
       
   421 		&& (KAssistDataEmpty != iMoLrRequestedDataMask))
       
   422 		{
       
   423 		orphanedDataRequestMask = iMoLrRequestedDataMask & ~iMtLrRequestedDataMask;
       
   424 		}
       
   425 	else if ( (MLbsNetworkProtocolObserver::EServiceMobileTerminated == aStateMachine)
       
   426 			&& (KAssistDataEmpty != iMtLrRequestedDataMask))
       
   427 		{
       
   428 		orphanedDataRequestMask = iMtLrRequestedDataMask & ~iMoLrRequestedDataMask;
       
   429 		}
       
   430 
       
   431 	// Add the pending assistance data to the orphaned mask and clear the pending mask
       
   432 	orphanedDataRequestMask = orphanedDataRequestMask | iPendingDataMask;
       
   433 	iPendingDataMask = KAssistDataEmpty;
       
   434 	
       
   435 	if (KAssistDataEmpty != orphanedDataRequestMask)
       
   436 		{
       
   437 		RLbsAssistanceDataBuilderSet dummyAssistanceData; //ignored by LBS when error is not KErrNone
       
   438 		iGateway.AssistanceDataInd(orphanedDataRequestMask, dummyAssistanceData, KErrNotFound);
       
   439 		}
       
   440 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::MachineTerminated() End\n");
       
   441 	}
       
   442 
       
   443 /** Timer expired callback.
       
   444 This is used for clearing the reportedassistance
       
   445 data mask one second after sending the assistance
       
   446 data to LBS.
       
   447 @param aTimerId The timer event identifier.
       
   448 */
       
   449 void CSuplAssistanceDataManager::OnTimerEventL(TInt aTimerId)
       
   450 	{
       
   451 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::OnTimerEventL() Begin\n");
       
   452 	// Perform relevant action for the expired timer
       
   453 	switch (aTimerId)
       
   454 		{
       
   455 		// Additional assistance data timer
       
   456 		case KAssistDataReportTimer:
       
   457 			iReportedDataMask = KAssistDataEmpty;
       
   458 			break;
       
   459 
       
   460 		// Ignore unknown timer events
       
   461 		default:
       
   462 			break;
       
   463 		};
       
   464 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::OnTimerEventL() End\n");
       
   465 	}
       
   466 
       
   467 /** Timer callback error handler.
       
   468 This is called if the timer expiry callback leaves.
       
   469 
       
   470 @param aTimerId The timer event identifier.
       
   471 @param aError Error value.
       
   472 */
       
   473 TInt CSuplAssistanceDataManager::OnTimerError(TInt /*aTimerId*/, TInt aError)
       
   474 	{
       
   475 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::OnTimerError() Begin\n");
       
   476 	SUPLLOG(ELogP1, "CSuplAssistanceDataManager::OnTimerError() End\n");
       
   477 	return aError;
       
   478 	}