|
1 /* |
|
2 * Copyright (c) 2008 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: AT NVRAM status change listener and notifier |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CDUNATNVRAMLISTEN_H |
|
19 #define C_CDUNATNVRAMLISTEN_H |
|
20 |
|
21 #include <atext.h> |
|
22 #include <atextcommon.h> |
|
23 #include "DunTransporter.h" |
|
24 |
|
25 /** |
|
26 * Class for AT NVRAM status change listener |
|
27 * |
|
28 * @lib dunatext.lib |
|
29 * @since TB9.2 |
|
30 */ |
|
31 NONSHARABLE_CLASS( CDunAtNvramListen ) : public CActive |
|
32 { |
|
33 |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Two-phased constructor. |
|
38 * @param aAtCmdExt Pointer to AT command extension |
|
39 * @param aAtCmdExtCommon Pointer to AT command extension to common |
|
40 * functionality |
|
41 * @return Instance of self |
|
42 */ |
|
43 static CDunAtNvramListen* NewL( RATExt* aAtCmdExt, |
|
44 RATExtCommon* aAtCmdExtCommon ); |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @param aAtCmdExt Pointer to AT command extension |
|
49 * @param aAtCmdExtCommon Pointer to AT command extension to common |
|
50 * functionality |
|
51 * @return Instance of self |
|
52 */ |
|
53 static CDunAtNvramListen* NewLC( RATExt* aAtCmdExt, |
|
54 RATExtCommon* aAtCmdExtCommon ); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CDunAtNvramListen(); |
|
60 |
|
61 /** |
|
62 * Resets data to initial values |
|
63 * |
|
64 * @since TB9.2 |
|
65 * @return None |
|
66 */ |
|
67 void ResetData(); |
|
68 |
|
69 /** |
|
70 * Starts waiting for NVRAM status changes |
|
71 * |
|
72 * @since TB9.2 |
|
73 * @return Symbian error code on error, KErrNone otherwise |
|
74 */ |
|
75 TInt IssueRequest(); |
|
76 |
|
77 /** |
|
78 * Stops waiting for NVRAM status changes |
|
79 * |
|
80 * @since TB9.2 |
|
81 * @return Symbian error code on error, KErrNone otherwise |
|
82 */ |
|
83 TInt Stop(); |
|
84 |
|
85 private: |
|
86 |
|
87 CDunAtNvramListen( RATExt* aAtCmdExt, |
|
88 RATExtCommon* aAtCmdExtCommon ); |
|
89 |
|
90 void ConstructL(); |
|
91 |
|
92 /** |
|
93 * Initializes this class |
|
94 * |
|
95 * @since TB9.2 |
|
96 * @return None |
|
97 */ |
|
98 void Initialize(); |
|
99 |
|
100 // from base class CActive |
|
101 |
|
102 /** |
|
103 * From CActive. |
|
104 * Gets called when NVRAM has changed |
|
105 * |
|
106 * @since TB9.2 |
|
107 * @return None |
|
108 */ |
|
109 void RunL(); |
|
110 |
|
111 /** |
|
112 * From CActive. |
|
113 * Gets called on cancel |
|
114 * |
|
115 * @since TB9.2 |
|
116 * @return None |
|
117 */ |
|
118 void DoCancel(); |
|
119 |
|
120 private: // data |
|
121 |
|
122 /** |
|
123 * AT command extension |
|
124 * Not own. |
|
125 */ |
|
126 RATExt* iAtCmdExt; |
|
127 |
|
128 /** |
|
129 * AT command extension to common functionality |
|
130 * Not own. |
|
131 */ |
|
132 RATExtCommon* iAtCmdExtCommon; |
|
133 |
|
134 /** |
|
135 * Current state of NVRAM status change listening; active or inactive |
|
136 */ |
|
137 TDunState iNvramHandleState; |
|
138 |
|
139 /** |
|
140 * Buffer for NVRAM |
|
141 */ |
|
142 TBuf8<KDefaultNvramBufLength> iNvramBuffer; |
|
143 |
|
144 /** |
|
145 * Flag to indicate start of receiving |
|
146 */ |
|
147 TBool iStarted; |
|
148 |
|
149 }; |
|
150 |
|
151 #endif // C_CDUNATNVRAMLISTEN_H |