supl/locationomasuplprotocolhandler/protocolhandler/src/epos_comasuplprotocolmanager.cpp
branchRCL_3
changeset 19 d6e4203b7ebe
parent 16 6fcbaa43369c
child 41 d746aee05493
equal deleted inserted replaced
17:e000e7e1f1b1 19:d6e4203b7ebe
   367 	TInt errorCode = GetSuplVersion(major,aPacket);
   367 	TInt errorCode = GetSuplVersion(major,aPacket);
   368 	if(errorCode != KErrNone )		
   368 	if(errorCode != KErrNone )		
   369 		{			
   369 		{			
   370 		HandlePacketError(errorCode);
   370 		HandlePacketError(errorCode);
   371 		return;
   371 		return;
   372 		} 
   372 		}
       
   373 	
       
   374 	//Work out what SUPL Protocol Hanlder version should be used
   373 	if( major == 1 )
   375 	if( major == 1 )
   374 		{
   376 		{
       
   377 		//SUPL v1
   375 		if(iOMASuplProtocolHandler1)
   378 		if(iOMASuplProtocolHandler1)
   376 		    {
   379 		    {
   377 		    iOMASuplProtocolHandler1->HandlePacket(aPacket,aPortNum);
   380 		    iOMASuplProtocolHandler1->HandlePacket(aPacket,aPortNum);
   378 		    }
   381 		    }
   379 		}
   382 		}
   380 	else 
   383 	else if ( major == 2 )
   381 		{
   384 		{
       
   385 		//SUPL v2
   382 		if(iOMASuplProtocolHandler2)
   386 		if(iOMASuplProtocolHandler2)
   383             {
   387             {
   384             iOMASuplProtocolHandler2->HandlePacket(aPacket,aPortNum);
   388             iOMASuplProtocolHandler2->HandlePacket(aPacket,aPortNum);
   385             }	
   389             }
   386     else
   390 		}
   387     	if (iOMASuplProtocolHandler1)
   391 	else
       
   392 		{
       
   393 		//Use either of the Protocol Handlers to handle the packet 
       
   394 		if (iOMASuplProtocolHandler1)
   388     		{
   395     		{
   389     		iOMASuplProtocolHandler1->HandlePacket(aPacket,aPortNum);
   396     		iOMASuplProtocolHandler1->HandlePacket(aPacket,aPortNum);
   390     		}
   397     		}
       
   398 		else if(iOMASuplProtocolHandler2)
       
   399             {
       
   400             iOMASuplProtocolHandler2->HandlePacket(aPacket,aPortNum);
       
   401             } 
   391 		}			
   402 		}			
   392 	}
   403 	}
   393 
   404 
   394 // -----------------------------------------------------------------------------
   405 // -----------------------------------------------------------------------------
   395 // COMASUPLProtocolManager::HandlePacketError
   406 // COMASUPLProtocolManager::HandlePacketError
   504 		if(status)
   515 		if(status)
   505 			User::RequestComplete(status,KErrBadDescriptor);
   516 			User::RequestComplete(status,KErrBadDescriptor);
   506 		return;
   517 		return;
   507 		}
   518 		}
   508 
   519 
       
   520 	//Work out what SUPL Protocol Hanlder version should be used
   509 	TInt major = aSuplSession->GetSUPLVersion();	
   521 	TInt major = aSuplSession->GetSUPLVersion();	
   510 	if( major == 1 )
   522 	if( major == 1 )
   511 		{
   523 		{
       
   524 		//SUPL v1
   512 		if(iOMASuplProtocolHandler1)
   525 		if(iOMASuplProtocolHandler1)
   513 		    {
   526 		    {
   514 		    iOMASuplProtocolHandler1->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
   527 		    iOMASuplProtocolHandler1->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
   515 		    }
   528 		    }
   516 		}
   529 		}
   517 	else 
   530 	else if( major == 2 )
   518 		{
   531 		{
       
   532 		//SUPL v2
   519 		if(iOMASuplProtocolHandler2)
   533 		if(iOMASuplProtocolHandler2)
   520 		    {
   534 		    {
   521 		    iOMASuplProtocolHandler2->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
   535 		    iOMASuplProtocolHandler2->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
   522 		    }
   536 		    }
   523 		else
   537 		}
   524     	if (iOMASuplProtocolHandler1)
   538 	else
       
   539 		{
       
   540 		//Use either of the Protocol Handlers (if they exist) to handle the packet 
       
   541 		if (iOMASuplProtocolHandler1)
   525     		{
   542     		{
   526     		iOMASuplProtocolHandler1->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
   543     		iOMASuplProtocolHandler1->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
   527     		}
   544     		}
       
   545 		else if(iOMASuplProtocolHandler2)
       
   546 		    {
       
   547 		    iOMASuplProtocolHandler2->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
       
   548 		    }    	
   528 		}			
   549 		}			
   529 	}
   550 	}
   530 
   551 
   531 // -----------------------------------------------------------------------------
   552 // -----------------------------------------------------------------------------
   532 // COMASUPLProtocolManager::DeInitialize
   553 // COMASUPLProtocolManager::DeInitialize