networkprotocolmodules/suplproxyprotocolmodule/suplproxyprotocolmodule/src/suplproxymodule.cpp
changeset 60 9a7e3d5f461a
parent 36 b47902b73a93
equal deleted inserted replaced
51:95c570bf4a05 60:9a7e3d5f461a
   570 		reqParams.GetRequestQuality(quality);
   570 		reqParams.GetRequestQuality(quality);
   571 		netSession->SetQuality(quality);
   571 		netSession->SetQuality(quality);
   572 		
   572 		
   573 		// Add this request to the queue of outstanding requests
   573 		// Add this request to the queue of outstanding requests
   574 		LBSLOG2(ELogP1, "CSuplProxyProtocol::RequestNetworkLocation() Adding sppm session object 0x%x to array\n", aSessionId);
   574 		LBSLOG2(ELogP1, "CSuplProxyProtocol::RequestNetworkLocation() Adding sppm session object 0x%x to array\n", aSessionId);
   575 		iLbsNetSessions.Append(netSession);    
   575 		TInt err = iLbsNetSessions.Append(netSession);
       
   576 		if(KErrNone != err)
       
   577 		    {
       
   578 		    LBSLOG(ELogP1, "CSuplProxyProtocol::RequestNetworkLocation() - iLbsNetSessions.Append failed!!\n");
       
   579             delete netSession;
       
   580 		    }
   576     	}
   581     	}
   577 
   582 
   578     //Create the prioritised list of positioning methods
   583     //Create the prioritised list of positioning methods
   579     TLbsNetPosRequestMethod posReqMethods;
   584     TLbsNetPosRequestMethod posReqMethods;
   580     TLbsNetPosMethod posMethod[2];
   585     TLbsNetPosMethod posMethod[2];
   731 					// Store the positioning method
   736 					// Store the positioning method
   732 					netSession->SetPosMethod(posReqMethods);
   737 					netSession->SetPosMethod(posReqMethods);
   733 
   738 
   734 	                // Add this request to the queue of outstanding requests
   739 	                // Add this request to the queue of outstanding requests
   735 					LBSLOG2(ELogP1, "CSuplProxyProtocol::RequestSelfLocation() Adding sppm session object 0x%x to array\n", aSessionId);
   740 					LBSLOG2(ELogP1, "CSuplProxyProtocol::RequestSelfLocation() Adding sppm session object 0x%x to array\n", aSessionId);
   736 	                iLbsNetSessions.Append(netSession);					
   741 	                TInt err = iLbsNetSessions.Append(netSession);
       
   742 	                if(KErrNone != err)
       
   743 	                    {
       
   744 		    			LBSLOG(ELogP1, "CSuplProxyProtocol::RequestSelfLocation() - iLbsNetSessions.Append failed!!\n");
       
   745 	                    delete netSession;
       
   746 	                    return;
       
   747 	                    }
   737                 	}
   748                 	}
   738                 
   749                 
   739                 //Inform LBS of the start of an MOLR - TB 
   750                 //Inform LBS of the start of an MOLR - TB 
   740                 StatusUpdate(MLbsNetworkProtocolObserver2::EServiceSelfLocation, ETrue);
   751                 StatusUpdate(MLbsNetworkProtocolObserver2::EServiceSelfLocation, ETrue);
   741 
   752 
   988 			CLbsNetSession* netSession = new CLbsNetSession(sessionId, MLbsNetworkProtocolObserver::EServiceMobileTerminated);
   999 			CLbsNetSession* netSession = new CLbsNetSession(sessionId, MLbsNetworkProtocolObserver::EServiceMobileTerminated);
   989 			if(netSession)
  1000 			if(netSession)
   990 				{
  1001 				{
   991 				netSession->SetExtRequestInfo(extReqInfo);
  1002 				netSession->SetExtRequestInfo(extReqInfo);
   992 				LBSLOG2(ELogP1, "CSuplProxyProtocol::ProcessRequest() Adding sppm session object 0x%x to array\n", sessionId);
  1003 				LBSLOG2(ELogP1, "CSuplProxyProtocol::ProcessRequest() Adding sppm session object 0x%x to array\n", sessionId);
   993 				iLbsNetSessions.Append(netSession);
  1004 				TInt err = iLbsNetSessions.Append(netSession);
       
  1005 				if (err != KErrNone)
       
  1006 					{
       
  1007 					// A problem occured and the request could not be added to the buffer
       
  1008 					LBSLOG_WARN2(ELogP1, "CSuplProxyProtocol::ProcessRequest() - iLbsNetSessions.Append failed!! - (%d)\n", err);
       
  1009 					if (aRequest->IsResponseRequired())
       
  1010 						{
       
  1011 						aRequest->CompleteRequest(err);
       
  1012 						}
       
  1013                     delete netSession;
       
  1014 					delete aRequest;
       
  1015 					return;
       
  1016 					}
   994 				}
  1017 				}
   995         	}
  1018         	}
   996         }
  1019         }
   997 
  1020 
   998 	TLbsNetPosRequestPrivacy requestPrivacy;
  1021 	TLbsNetPosRequestPrivacy requestPrivacy;
  1143 			//Store the observer (subsession) for forwarding future requests/updates
  1166 			//Store the observer (subsession) for forwarding future requests/updates
  1144 			netSession->SetPosProtocolResponseObserver(aObserver);
  1167 			netSession->SetPosProtocolResponseObserver(aObserver);
  1145 			netSession->SetPosSessionStarted(ETrue);
  1168 			netSession->SetPosSessionStarted(ETrue);
  1146 			netSession->SetSessionStarted();
  1169 			netSession->SetSessionStarted();
  1147 			LBSLOG2(ELogP1, "CSuplProxyProtocol::NotifySubSessionOpen() Adding sppm session object 0x%x to array\n", sessionId);
  1170 			LBSLOG2(ELogP1, "CSuplProxyProtocol::NotifySubSessionOpen() Adding sppm session object 0x%x to array\n", sessionId);
  1148 			iLbsNetSessions.Append(netSession);
  1171 			TInt err = iLbsNetSessions.Append(netSession);
       
  1172             if(KErrNone != err)
       
  1173                    {
       
  1174 	    		   LBSLOG(ELogP1, "CSuplProxyProtocol::NotifySubSessionOpen() - iLbsNetSessions.Append failed!!\n");
       
  1175                    delete netSession;
       
  1176                    }
  1149         	}
  1177         	}
  1150         //Update LBS of the currently active services including this new session type
  1178         //Update LBS of the currently active services including this new session type
  1151         StatusUpdate(MLbsNetworkProtocolObserver2::EServiceTriggeredMolr,ETrue);
  1179         StatusUpdate(MLbsNetworkProtocolObserver2::EServiceTriggeredMolr,ETrue);
  1152         }
  1180         }
  1153     else
  1181     else