locationmgmt/networkgateway/src/netobserver.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 // Contains implementation to CNetObserver class that 'observes' protocol messages from
       
    15 // a location protocol module.
       
    16 // 
       
    17 //
       
    18 
       
    19 #include "netgateway.h"
       
    20 #include "netobserver.h"
       
    21 
       
    22 // constructor
       
    23 
       
    24 CNetObserver::CNetObserver(CNetworkGateway* aParent, TLbsProtocolModuleId aModuleId)
       
    25 	{
       
    26 	iParentToCall = aParent;
       
    27 	iModuleUId = aModuleId;
       
    28 	}
       
    29 
       
    30 void CNetObserver::GetCurrentCapabilities(TLbsNetPosCapabilities& aCapabilities) const
       
    31 	{
       
    32 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    33 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
    34 	iParentToCall->GetCurrentCapabilities(aCapabilities);
       
    35 	}
       
    36 
       
    37 void CNetObserver::ProcessStatusUpdate(TLbsNetProtocolServiceMask aActiveServiceMask)
       
    38 	{
       
    39 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    40 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
    41 	iParentToCall->ProcessStatusUpdate(aActiveServiceMask);
       
    42 	}
       
    43 
       
    44 void CNetObserver::ProcessPrivacyRequest(const TLbsNetSessionId& aSessionId,
       
    45 										    TBool aEmergency, 
       
    46 										    const TLbsNetPosRequestPrivacy& aPrivacy,
       
    47 										    const TLbsExternalRequestInfo& aRequestInfo)
       
    48 	{
       
    49 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    50 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
    51 	iParentToCall->ProcessPrivacyRequest(aSessionId, aEmergency, aPrivacy, aRequestInfo);
       
    52 	}
       
    53 
       
    54 void CNetObserver::ProcessLocationRequest(const TLbsNetSessionId& aSessionId,
       
    55 											 TBool aEmergency,
       
    56 											 TLbsNetProtocolService aService, 
       
    57 											 const TLbsNetPosRequestQuality& aQuality,
       
    58 											 const TLbsNetPosRequestMethod& aMethod)
       
    59 	{
       
    60 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    61 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
    62 	iParentToCall->ProcessLocationRequest(aSessionId, aEmergency, aService, aQuality, aMethod);
       
    63 	}
       
    64 
       
    65 void CNetObserver::ProcessSessionComplete(const TLbsNetSessionId& aSessionId,
       
    66 											 TInt  aReason)
       
    67 	{
       
    68 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    69 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
    70 	iParentToCall->ProcessSessionComplete(aSessionId, aReason);
       
    71 	}
       
    72 
       
    73 void CNetObserver::ProcessAssistanceData(TLbsAsistanceDataGroup aDataMask,
       
    74 										 const RLbsAssistanceDataBuilderSet& aData,
       
    75 						   				 TInt aReason)
       
    76 	{
       
    77 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    78 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
    79 	iParentToCall->ProcessAssistanceData(aDataMask, aData, aReason);
       
    80 	}
       
    81 
       
    82 
       
    83 void CNetObserver::ProcessAssistanceData(TLbsAsistanceDataGroup aDataMask,
       
    84 								const RLbsAssistanceDataBuilderSet& aData,
       
    85 								TInt aReason,
       
    86 								const TLbsNetSessionIdArray& aSessionIdArray)
       
    87 	{
       
    88 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    89 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
    90 	iParentToCall->ProcessAssistanceData(aDataMask, aData, aReason, aSessionIdArray);
       
    91 	}
       
    92 
       
    93 
       
    94 
       
    95 void CNetObserver::ProcessLocationUpdate(const TLbsNetSessionId& aSessionId,
       
    96 											 const TPositionInfoBase& aPosInfo)
       
    97 	{
       
    98 	// Simply record from which PM this was received and call the parent equivalent of this function
       
    99 	iParentToCall->SetReceivingProtocolModule(iModuleUId);
       
   100 	iParentToCall->ProcessLocationUpdate(aSessionId, aPosInfo);
       
   101 	}