44
|
1 |
// Copyright (c) 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 |
// @file activatecontextandgetip.h
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#ifndef __CACTIVATECONTEXTANDGETIP_H__
|
|
19 |
#define __CACTIVATECONTEXTANDGETIP_H__
|
|
20 |
|
|
21 |
// user include
|
|
22 |
#include <callbacktimer.h>
|
|
23 |
#include "atcommandcontrolbase.h"
|
|
24 |
|
|
25 |
class CATHelperCommand;
|
|
26 |
class CATGprsContextActivate;
|
|
27 |
class CATGPRSGetContextAddr;
|
|
28 |
class CATGprsContextConnect;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* CActivatContextAndGetAddr inherits from the CATCommandControlBase class.
|
|
32 |
* This class provide the common functionalities for activatinf context and
|
|
33 |
* get context address.
|
|
34 |
*
|
|
35 |
*/
|
|
36 |
class CActivatContextAndGetAddr : public CATCommandControlBase
|
|
37 |
{
|
|
38 |
public:
|
|
39 |
static CActivatContextAndGetAddr* NewL(CGlobalPhonemanager& aGloblePhone,
|
|
40 |
CCtsyDispatcherCallback& aCtsyDispatcherCallback);
|
|
41 |
/**
|
|
42 |
* Destructor
|
|
43 |
*
|
|
44 |
*/
|
|
45 |
~CActivatContextAndGetAddr();
|
|
46 |
virtual void AtCommandExecuteComplete(TAtEventSource aEventSource, TInt aStatus);
|
|
47 |
/**
|
|
48 |
* start the request
|
|
49 |
*/
|
|
50 |
void StartRequest();
|
|
51 |
/*
|
|
52 |
* Set the parameter of AT command
|
|
53 |
*
|
|
54 |
* @param aContext The context to be set configuration
|
|
55 |
*/
|
|
56 |
void SetContext(const TInt aContextId);
|
|
57 |
|
|
58 |
protected :
|
|
59 |
/**
|
|
60 |
* Constructor
|
|
61 |
*
|
|
62 |
* @param aGloblePhone
|
|
63 |
* @param aCtsyDispatcherCallback
|
|
64 |
*/
|
|
65 |
CActivatContextAndGetAddr(CGlobalPhonemanager& aGloblePhone,
|
|
66 |
CCtsyDispatcherCallback& aCtsyDispatcherCallback);
|
|
67 |
/**
|
|
68 |
* 2nd Constructor
|
|
69 |
*/
|
|
70 |
void ConstructL();
|
|
71 |
|
|
72 |
private:
|
|
73 |
/**
|
|
74 |
* Call back when the at command finished
|
|
75 |
*
|
|
76 |
*/
|
|
77 |
void DispatcherCallback(TInt aError);
|
|
78 |
/**
|
|
79 |
* Start an AT Command
|
|
80 |
* @param aAtCommand the AT Command class
|
|
81 |
*/
|
|
82 |
void StartATCommand(CAtCommandBase* aAtCommand);
|
|
83 |
/**
|
|
84 |
* End an AT Command
|
|
85 |
* @param aAtCommand the AT Command class
|
|
86 |
*/
|
|
87 |
void EndATCommand(CAtCommandBase* aAtCommand);
|
|
88 |
/**
|
|
89 |
* Start an AT Help Command
|
|
90 |
* @param aATString the AT Command string
|
|
91 |
* @param aATType the AT Command Type
|
|
92 |
*/
|
|
93 |
void ExecuteATHelpCommand(const TDesC8& aATString,TLtsyATCommandType aATType);
|
|
94 |
|
|
95 |
private:
|
|
96 |
CATHelperCommand* iATHelperCommand;
|
|
97 |
CATGprsContextActivate* iATGprsContextActivate;
|
|
98 |
CATGPRSGetContextAddr* iATGPRSGetContextAddr;
|
|
99 |
CATGprsContextConnect* iATGprsContextConnect;
|
|
100 |
/**
|
|
101 |
* Context ID
|
|
102 |
*/
|
|
103 |
TInt iContextId;
|
|
104 |
/**
|
|
105 |
* Identify the Type of AT Command
|
|
106 |
*/
|
|
107 |
TLtsyATCommandType iATType;
|
|
108 |
TUint iConnectionSpeed;
|
|
109 |
enum
|
|
110 |
{
|
|
111 |
EATNone,
|
|
112 |
EATActivateContext,
|
|
113 |
EATGetContextIp
|
|
114 |
} iATCommandName;
|
|
115 |
|
|
116 |
};
|
|
117 |
#endif //__CACTIVATECONTEXTANDGETIP_H__
|