24
|
1 |
/**
|
|
2 |
* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* This file contains the definition of the
|
|
16 |
* handling MIP handovers in a CDMA2000 network.
|
|
17 |
*
|
|
18 |
*
|
|
19 |
*/
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
/**
|
|
24 |
@file MIPCDMA.H
|
|
25 |
@internalComponent
|
|
26 |
*/
|
|
27 |
|
|
28 |
#ifndef __MIPCDMA_H__
|
|
29 |
#define __MIPCDMA_H__
|
|
30 |
#include <e32base.h>
|
|
31 |
#include <etel.h>
|
|
32 |
#include <etelmm.h>
|
|
33 |
#include <comms-infras/dbaccess.h>
|
|
34 |
|
|
35 |
class CPSDAgent;
|
|
36 |
class CMIPCdmaEtelZoneChangeRequest;
|
|
37 |
|
|
38 |
class CMipCdmaHandoverHandler : public CActive
|
|
39 |
/**
|
|
40 |
This class is the main class that handles MIP handover in a
|
|
41 |
CDMA2000 network. It is written as an active object.
|
|
42 |
It is triggered by one of two things
|
|
43 |
1) a PPPLinkDown event or
|
|
44 |
2) an ETEL notification that we have changed Zone
|
|
45 |
|
|
46 |
When either of these two events come in it triggers a timer.
|
|
47 |
If the timer runs out before the other event takes place a normal
|
|
48 |
Reconnect dialog box is shown. But, if the other event takes place
|
|
49 |
before the timer runs out, we will restart the connection without
|
|
50 |
user intervention.
|
|
51 |
Lifetime of the object is as long as its owner.
|
|
52 |
|
|
53 |
@internalComponent
|
|
54 |
*/
|
|
55 |
{
|
|
56 |
public:
|
|
57 |
static CMipCdmaHandoverHandler* NewLC(CPSDAgent& aAgent, CCommsDbAccess& aDb);
|
|
58 |
static CMipCdmaHandoverHandler* NewL(CPSDAgent& aAgent, CCommsDbAccess& aDb);
|
|
59 |
~CMipCdmaHandoverHandler();
|
|
60 |
|
|
61 |
//Trigger Functions
|
|
62 |
TBool PPPLinkDownEvent();
|
|
63 |
void ETELChangedZoneEvent();
|
|
64 |
|
|
65 |
//Starting and stopping to listen
|
|
66 |
TInt StartListening();
|
|
67 |
void StopListening();
|
|
68 |
|
|
69 |
private:
|
|
70 |
CMipCdmaHandoverHandler(CPSDAgent& aAgent, CCommsDbAccess& aDb);
|
|
71 |
void ConstructL();
|
|
72 |
|
|
73 |
// From CActive
|
|
74 |
virtual void DoCancel();
|
|
75 |
virtual void RunL();
|
|
76 |
|
|
77 |
void StartTimer();
|
|
78 |
void RestartPPP();
|
|
79 |
private:
|
|
80 |
RTimer iTimer; ///< Timer object
|
|
81 |
TBool iPPPLinkDownEvent; ///< Boolean describing if we have got a PPPLinkDownEvent
|
|
82 |
TBool iETELChangedZoneEvent; ///< Boolean describing if we have got an ETEL Zone Change Event
|
|
83 |
CPSDAgent& iAgent; ///< Reference to our owner(parent)
|
|
84 |
CMIPCdmaEtelZoneChangeRequest* iMipCdmaEtelZoneChanger; ///< Handle to our subclass that is responsible for receiving ETEL Zone change notifications
|
|
85 |
CCommsDbAccess& iDb;
|
|
86 |
};
|
|
87 |
|
|
88 |
class CMIPCdmaEtelZoneChangeRequest : public CActive
|
|
89 |
/**
|
|
90 |
This class is a subclass owned by the CMipCdmaHandoverHandler.
|
|
91 |
It is responsible to receive ETEL Zone change events.
|
|
92 |
The class is written as an active object.
|
|
93 |
|
|
94 |
When a notification comes in this class will notify its owner.
|
|
95 |
Lifetime of the object is as long as its owner.
|
|
96 |
The object can be started and stopped from the owner.
|
|
97 |
|
|
98 |
@internalComponent
|
|
99 |
*/
|
|
100 |
{
|
|
101 |
public:
|
|
102 |
static CMIPCdmaEtelZoneChangeRequest* NewLC(CMipCdmaHandoverHandler& aHandoverHandler, CPSDAgent& aAgent, CCommsDbAccess& aDb);
|
|
103 |
static CMIPCdmaEtelZoneChangeRequest* NewL(CMipCdmaHandoverHandler& aHandoverHandler, CPSDAgent& aAgent, CCommsDbAccess& aDb);
|
|
104 |
~CMIPCdmaEtelZoneChangeRequest();
|
|
105 |
|
|
106 |
//Trigger Function
|
|
107 |
void StartRequest();
|
|
108 |
|
|
109 |
//Starting and stopping to listen to notifications
|
|
110 |
TInt StartListening();
|
|
111 |
void StopListening();
|
|
112 |
|
|
113 |
private:
|
|
114 |
CMIPCdmaEtelZoneChangeRequest(CMipCdmaHandoverHandler& aHandoverHandler, CPSDAgent& aAgent, CCommsDbAccess& aDb);
|
|
115 |
void ConstructL();
|
|
116 |
|
|
117 |
// From CActive
|
|
118 |
virtual void DoCancel();
|
|
119 |
virtual void RunL();
|
|
120 |
|
|
121 |
void InitPhoneL();
|
|
122 |
private:
|
|
123 |
TBool iFirstTime; ///< Boolean stating if it is the first time the object is run.
|
|
124 |
CMipCdmaHandoverHandler& iHandoverHandler; ///< Handle to our owner/parent that we report to
|
|
125 |
CPSDAgent& iAgent; ///< Handle to the agent class
|
|
126 |
CCommsDbAccess& iDb; ///< Handle to CommDB
|
|
127 |
TBool iStarted; ///< Boolean describing if we are started (i.e. the link is up)
|
|
128 |
RTelServer iTelServer; ///< Handle to a phone server
|
|
129 |
RMobilePhone iMmPhone; ///< Handle to a phone object
|
|
130 |
HBufC* iTsyName; ///< Handle to the TSY name
|
|
131 |
RMobilePhone::TMobilePhoneNetworkInfoV1 iAsyncCurrentNetwork; ///< Object storing network information
|
|
132 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iPhoneNetworkInfoPckg; ///< Package object for the TMobilePhoneNetworkInfoV1 object
|
|
133 |
RMobilePhone::TMobilePhoneLocationAreaV1 iAsyncLocArea; ///< Object storing location information
|
|
134 |
RMobilePhone::TMobilePhoneNetworkIdentity iCurrentCdmaSID; ///< Object storing SID
|
|
135 |
RMobilePhone::TMobilePhoneNetworkIdentity iCurrentNetworkId; ///< Object storing NID
|
|
136 |
};
|
|
137 |
#endif
|