35 #include "eap_type_aka.h" |
35 #include "eap_type_aka.h" |
36 #include "EapAkaGlobal.h" |
36 #include "EapAkaGlobal.h" |
37 #include <EapTypeInfo.h> |
37 #include <EapTypeInfo.h> |
38 #include "eap_am_type_aka_symbian.h" |
38 #include "eap_am_type_aka_symbian.h" |
39 #include "EapAkaDbUtils.h" |
39 #include "EapAkaDbUtils.h" |
40 #include "EapConversion.h" |
40 |
|
41 #include <EapAkaUiConnection.h> |
|
42 #include "EapAkaUi.h" |
|
43 |
41 |
44 |
42 #include "eap_am_tools_symbian.h" |
45 #include "eap_am_tools_symbian.h" |
43 #include "EapTraceSymbian.h" |
|
44 |
|
45 |
46 |
46 // LOCAL CONSTANTS |
47 // LOCAL CONSTANTS |
47 |
48 |
48 // The version number of this interface. |
49 // The version number of this interface. |
49 const TUint KInterfaceVersion = 1; |
50 const TUint KInterfaceVersion = 1; |
135 } |
136 } |
136 return type; |
137 return type; |
137 } |
138 } |
138 |
139 |
139 // ---------------------------------------------------------- |
140 // ---------------------------------------------------------- |
140 |
141 TInt CEapAka::InvokeUiL() |
141 CEapTypeInfo* CEapAka::GetInfoL() |
142 { |
|
143 TInt buttonId(0); |
|
144 |
|
145 #ifdef USE_EAP_EXPANDED_TYPES |
|
146 |
|
147 CEapAkaUiConnection uiConn(iIndexType, iIndex, iTunnelingType.get_vendor_type()); |
|
148 |
|
149 #else |
|
150 |
|
151 CEapAkaUiConnection uiConn(iIndexType, iIndex, iTunnelingType); |
|
152 |
|
153 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
154 |
|
155 CEapAkaUi* ui = CEapAkaUi::NewL(&uiConn); |
|
156 CleanupStack::PushL(ui); |
|
157 buttonId = ui->InvokeUiL(); |
|
158 CleanupStack::PopAndDestroy(ui); |
|
159 return buttonId; |
|
160 } |
|
161 |
|
162 // ---------------------------------------------------------- |
|
163 CEapTypeInfo* CEapAka::GetInfoLC() |
142 { |
164 { |
143 CEapTypeInfo* info = new(ELeave) CEapTypeInfo( |
165 CEapTypeInfo* info = new(ELeave) CEapTypeInfo( |
144 (TDesC&)KReleaseDate, |
166 (TDesC&)KReleaseDate, |
145 (TDesC&)KEapTypeVersion, |
167 (TDesC&)KEapTypeVersion, |
146 (TDesC&)KManufacturer); |
168 (TDesC&)KManufacturer); |
147 |
169 |
|
170 CleanupStack::PushL(info); |
148 return info; |
171 return info; |
149 } |
172 } |
150 |
173 |
151 // ---------------------------------------------------------- |
174 // ---------------------------------------------------------- |
152 |
|
153 void CEapAka::DeleteConfigurationL() |
175 void CEapAka::DeleteConfigurationL() |
154 { |
176 { |
155 EapAkaDbUtils::DeleteConfigurationL(iIndexType, iIndex, iTunnelingType); |
177 EapAkaDbUtils::DeleteConfigurationL(iIndexType, iIndex, iTunnelingType); |
156 } |
178 } |
157 |
179 |
162 return KInterfaceVersion; |
184 return KInterfaceVersion; |
163 } |
185 } |
164 |
186 |
165 // ---------------------------------------------------------- |
187 // ---------------------------------------------------------- |
166 |
188 |
167 void CEapAka::SetTunnelingType(const TEapExpandedType aTunnelingType) |
189 void CEapAka::SetTunnelingType(const TInt aTunnelingType) |
168 { |
190 { |
169 EAP_TRACE_DATA_DEBUG_SYMBIAN( |
191 #ifdef USE_EAP_EXPANDED_TYPES |
170 (EAPL("CEapAka::SetTunnelingType - tunneling type"), |
192 |
171 aTunnelingType.GetValue().Ptr(), aTunnelingType.GetValue().Length())); |
193 // Vendor id is eap_type_vendor_id_ietf always in this plugin. |
172 |
194 iTunnelingType.set_eap_type_values(eap_type_vendor_id_ietf, aTunnelingType); |
173 eap_type_value_e aInternalType; |
195 |
174 |
196 #else |
175 TInt err = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
197 |
176 &aTunnelingType, |
198 iTunnelingType = static_cast<eap_type_value_e>(aTunnelingType); |
177 &aInternalType); |
199 |
178 |
200 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
179 iTunnelingType = aInternalType; |
201 } |
180 |
|
181 |
|
182 } |
|
183 |
202 |
184 |
203 |
185 // ---------------------------------------------------------- |
204 // ---------------------------------------------------------- |
186 void CEapAka::SetIndexL( |
205 void CEapAka::SetIndexL( |
187 const TIndexType aIndexType, |
206 const TIndexType aIndexType, |
202 iIndexType = tmpIndexType; |
221 iIndexType = tmpIndexType; |
203 iIndex = tmpIndex; |
222 iIndex = tmpIndex; |
204 |
223 |
205 RDbNamedDatabase db; |
224 RDbNamedDatabase db; |
206 |
225 |
207 RFs session; |
226 RDbs session; |
|
227 |
|
228 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
208 |
229 |
209 CleanupClosePushL(session); |
230 CleanupClosePushL(session); |
210 CleanupClosePushL(db); |
231 CleanupClosePushL(db); |
211 TInt error = session.Connect(); |
232 |
212 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::SetIndexL(): - session.Connect(), error=%d\n"), error)); |
|
213 User::LeaveIfError(error); |
|
214 |
|
215 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
|
216 |
|
217 EapAkaDbUtils::SetIndexL( |
233 EapAkaDbUtils::SetIndexL( |
218 db, |
234 db, |
219 iIndexType, |
235 iIndexType, |
220 iIndex, |
236 iIndex, |
221 iTunnelingType, |
237 iTunnelingType, |
224 iTunnelingType); |
240 iTunnelingType); |
225 |
241 |
226 iIndexType = aIndexType; |
242 iIndexType = aIndexType; |
227 iIndex = aIndex; |
243 iIndex = aIndex; |
228 |
244 |
229 db.Close(); |
245 CleanupStack::PopAndDestroy(2); // db |
230 session.Close(); |
|
231 |
|
232 CleanupStack::PopAndDestroy(&db); |
|
233 CleanupStack::PopAndDestroy(&session); |
|
234 } |
246 } |
235 |
247 |
236 // ---------------------------------------------------------- |
248 // ---------------------------------------------------------- |
237 |
249 |
238 void CEapAka::SetConfigurationL(const EAPSettings& aSettings) |
250 void CEapAka::SetConfigurationL(const EAPSettings& aSettings) |
239 { |
251 { |
240 RDbNamedDatabase db; |
252 RDbNamedDatabase db; |
241 |
253 |
242 RFs session; |
254 RDbs session; |
243 |
255 |
|
256 // This also creates the IAP entry if it doesn't exist |
|
257 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
|
258 |
244 CleanupClosePushL(session); |
259 CleanupClosePushL(session); |
245 CleanupClosePushL(db); |
260 CleanupClosePushL(db); |
246 TInt error = session.Connect(); |
261 |
247 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::SetConfigurationL(): - session.Connect(), error=%d\n"), error)); |
|
248 User::LeaveIfError(error); |
|
249 |
|
250 // This also creates the IAP entry if it doesn't exist |
|
251 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
|
252 |
|
253 EapAkaDbUtils::SetConfigurationL( |
262 EapAkaDbUtils::SetConfigurationL( |
254 db, |
263 db, |
255 aSettings, |
264 aSettings, |
256 iIndexType, |
265 iIndexType, |
257 iIndex, |
266 iIndex, |
258 iTunnelingType); |
267 iTunnelingType); |
259 |
268 |
260 db.Close(); |
269 CleanupStack::PopAndDestroy(2); // db, session |
261 session.Close(); |
|
262 |
|
263 CleanupStack::PopAndDestroy(&db); |
|
264 CleanupStack::PopAndDestroy(&session); |
|
265 } |
270 } |
266 |
271 |
267 // ---------------------------------------------------------- |
272 // ---------------------------------------------------------- |
268 |
273 |
269 void CEapAka::GetConfigurationL(EAPSettings& aSettings) |
274 void CEapAka::GetConfigurationL(EAPSettings& aSettings) |
270 { |
275 { |
271 RDbNamedDatabase db; |
276 RDbNamedDatabase db; |
272 |
277 |
273 RFs session; |
278 RDbs session; |
274 |
279 |
|
280 // This also creates the IAP entry if it doesn't exist |
|
281 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
|
282 |
275 CleanupClosePushL(session); |
283 CleanupClosePushL(session); |
276 CleanupClosePushL(db); |
284 CleanupClosePushL(db); |
277 TInt error = session.Connect(); |
|
278 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::SetConfigurationL(): - session.Connect(), error=%d\n"), error)); |
|
279 User::LeaveIfError(error); |
|
280 |
|
281 // This also creates the IAP entry if it doesn't exist |
|
282 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
|
283 |
285 |
284 EapAkaDbUtils::GetConfigurationL( |
286 EapAkaDbUtils::GetConfigurationL( |
285 db, |
287 db, |
286 aSettings, |
288 aSettings, |
287 iIndexType, |
289 iIndexType, |
288 iIndex, |
290 iIndex, |
289 iTunnelingType); |
291 iTunnelingType); |
290 |
292 |
291 db.Close(); |
293 CleanupStack::PopAndDestroy(2); // db, session |
292 session.Close(); |
|
293 |
|
294 CleanupStack::PopAndDestroy(&db); |
|
295 CleanupStack::PopAndDestroy(&session); |
|
296 } |
294 } |
297 |
295 |
298 // ---------------------------------------------------------- |
296 // ---------------------------------------------------------- |
299 |
297 |
300 void CEapAka::CopySettingsL( |
298 void CEapAka::CopySettingsL( |
316 iIndexType = tmpIndexType; |
314 iIndexType = tmpIndexType; |
317 iIndex = tmpIndex; |
315 iIndex = tmpIndex; |
318 |
316 |
319 RDbNamedDatabase db; |
317 RDbNamedDatabase db; |
320 |
318 |
321 RFs session; |
319 RDbs session; |
322 |
320 |
|
321 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
|
322 |
323 CleanupClosePushL(session); |
323 CleanupClosePushL(session); |
324 CleanupClosePushL(db); |
324 CleanupClosePushL(db); |
325 TInt error = session.Connect(); |
325 |
326 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::CopySettingsL(): - session.Connect(), error=%d\n"), error)); |
|
327 User::LeaveIfError(error); |
|
328 |
|
329 EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); |
|
330 |
|
331 EapAkaDbUtils::CopySettingsL( |
326 EapAkaDbUtils::CopySettingsL( |
332 db, |
327 db, |
333 iIndexType, |
328 iIndexType, |
334 iIndex, |
329 iIndex, |
335 iTunnelingType, |
330 iTunnelingType, |
336 aDestinationIndexType, |
331 aDestinationIndexType, |
337 aDestinationIndex, |
332 aDestinationIndex, |
338 iTunnelingType); |
333 iTunnelingType); |
339 |
334 |
340 db.Close(); |
335 CleanupStack::PopAndDestroy(2); // db |
341 session.Close(); |
336 |
342 |
337 } |
343 CleanupStack::PopAndDestroy(&db); |
|
344 CleanupStack::PopAndDestroy(&session); |
|
345 } |
|
346 |
|
347 // End of file |
338 // End of file |