|
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 defines the class for the MO-LR protocol state machine. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 @deprecated |
|
22 */ |
|
23 |
|
24 #ifndef __SUPLMOLRFSMSESSION_H__ |
|
25 #define __SUPLMOLRFSMSESSION_H__ |
|
26 |
|
27 #include "suplfsmsessionbase.h" |
|
28 #include <lbs/lbshostsettings.h> |
|
29 |
|
30 /** MO-LR protocol state machine. |
|
31 This class manages the MO-LR protocol procedure and is employed when the protocol |
|
32 module is required to handle interactions for a mobile self-locate. |
|
33 |
|
34 The class implements the pure virtual methods defined by CSuplFsmSessionBase. |
|
35 @see CSuplFsmSessionBase |
|
36 |
|
37 The class also implements a timer observer interface defined by MLbsCallbackTimerObserver |
|
38 @see MLbsCallbackTimerObserver |
|
39 */ |
|
40 NONSHARABLE_CLASS(CSuplMolrFsmSession) : public CSuplFsmSessionBase |
|
41 { |
|
42 public: |
|
43 |
|
44 /** Type of MO-LR state machine with regards to the |
|
45 positioning methods it supports. |
|
46 */ |
|
47 enum TSuplMolrMachineType |
|
48 { |
|
49 /** This type of machine only declares to the network |
|
50 that CellBased positioning method is possible*/ |
|
51 ESuplMolrCellBased, |
|
52 /** This type of machine declares to the network all of |
|
53 LBS's supported positioning methods (i.e. cell-based and |
|
54 agps variants supported by underlying hardware)*/ |
|
55 ESuplMolrUnspecified |
|
56 }; |
|
57 |
|
58 public: |
|
59 |
|
60 static CSuplMolrFsmSession* NewL(MSuplFsmSessionObserver& aObserver, TSuplMolrMachineType aMachineType = ESuplMolrUnspecified); |
|
61 virtual ~CSuplMolrFsmSession(); |
|
62 |
|
63 void StartSuplResponseTimer(); |
|
64 |
|
65 // CSuplFsmSessionBase pure virtual methods |
|
66 TBool SelectNextState(TBool& aForceRedo); |
|
67 void PostTransition(); |
|
68 void CancelProcedure(); |
|
69 //void DoQueuedRequest(TInt aRequest); |
|
70 |
|
71 // Called by the Protocol Manager (events from LBS) |
|
72 void MoLrReq(const TLbsNetSessionId& aSessionId, const TLbsNetPosRequestOptionsBase& aOptions); |
|
73 void LocationResp(TInt aReason, const TPositionInfoBase& aPosInfo); |
|
74 void AssistanceDataReq(const TLbsAssistanceDataGroup& aFilter); |
|
75 void AdoptNewLbsSessionId(const TLbsNetSessionId& aSessionId); |
|
76 // Note: for cancelling requests from LBS PM uses base class method CancelMachine() |
|
77 |
|
78 // Derived from MSuplPositioningProtocolFsmObserver (events from the Positioning Protocol) |
|
79 void ProcessAssistanceData(const TLbsAsistanceDataGroup& aGroupMask, TInt aReason); |
|
80 void ProcessPositioningRequest(const TLbsNetPosRequestQuality& aQuality, |
|
81 const TLbsNetPosRequestMethod& aPosMethod); |
|
82 void PositioningPayloadToNetwork(const CSuplPosPayload* aPositioningPayload); |
|
83 void PositioningProtocolError(const TInt& aError); |
|
84 |
|
85 // MLbsCallbackTimerObserver methods |
|
86 void OnTimerEventL(TInt aTimerId); |
|
87 |
|
88 // Called by the state handler when the procedure completes |
|
89 void CompleteProcedure(); |
|
90 |
|
91 // Called by the state handler |
|
92 CSuplMolrFsmSession::TSuplMolrMachineType MachineType(); |
|
93 TInt GetHostId(TLbsHostSettingsId& aHostId); |
|
94 |
|
95 private: |
|
96 |
|
97 CSuplMolrFsmSession(MSuplFsmSessionObserver& aObserver, TSuplMolrMachineType aMachineType); |
|
98 void ConstructL(); |
|
99 void InitialiseProcedure(); |
|
100 TBool DetermineStateFromStartSent(); |
|
101 |
|
102 private: |
|
103 |
|
104 /* Type of MO-LR state machine depending on |
|
105 supported positioning methods*/ |
|
106 TSuplMolrMachineType iMachineType; |
|
107 }; |
|
108 |
|
109 #endif // __SUPLMOLRFSMSESSION_H__ |
|
110 |