author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:20:32 +0100 | |
branch | RCL_3 |
changeset 25 | f28ada11abbf |
parent 24 | 63be7eb3fc78 |
permissions | -rw-r--r-- |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Implementation of iapsettings |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
// INCLUDE FILES |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include "hssiapsettingshandler.h" |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include "hotspotclientserver.h" |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include "am_debug.h" |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <es_enum.h> |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
25 | 26 |
#include <cmconnectionmethodext.h> |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#include <cmconnectionmethoddef.h> |
25 | 28 |
#include <cmdestinationext.h> |
29 |
#include <cmmanagerext.h> |
|
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
using namespace CMManager; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
// ============================ MEMBER FUNCTIONS =============================== |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
// CHssIapSettingsHandler |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
CHssIapSettingsHandler::CHssIapSettingsHandler( ) |
3
ff3b37722600
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
40 |
{ |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
DEBUG("CHssIapSettingsHandler::CHssIapSettingsHandler"); |
3
ff3b37722600
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
42 |
} |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
// ConstructL |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
void CHssIapSettingsHandler::ConstructL() |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
DEBUG("CHssIapSettingsHandler::ConstructL()"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
// NewL |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
CHssIapSettingsHandler* CHssIapSettingsHandler::NewL() |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
CHssIapSettingsHandler* self = new( ELeave ) CHssIapSettingsHandler(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
CleanupStack::PushL( self ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
self->ConstructL(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
CleanupStack::Pop( self ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
return self; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
// ~CHssIapSettingsHandler |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
CHssIapSettingsHandler::~CHssIapSettingsHandler() |
3
ff3b37722600
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
{ |
ff3b37722600
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
DEBUG("CHssIapSettingsHandler::~CHssIapSettingsHandler()"); |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
// CreateClientIapL |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
void CHssIapSettingsHandler::CreateClientIapL( const TDesC& aIapName, |
10
dff6ebfd236f
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
80 |
TUint32& aIapId, |
dff6ebfd236f
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
81 |
const TDesC& aUid ) |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
DEBUG("CHssIapSettingsHandler::CreateClientIapL"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
|
25 | 85 |
RCmManagerExt cmManager; |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
cmManager.OpenL(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
CleanupClosePushL( cmManager ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
// Read all destination(SNAP) settings into an array |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
RArray<TUint32> destinations; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
CleanupClosePushL( destinations ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
cmManager.AllDestinationsL( destinations ); |
25 | 94 |
RCmDestinationExt destination; |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
// Loop through each destination |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
for( TInt i = 0; i < destinations.Count(); i++ ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
destination = cmManager.DestinationL(destinations[i]); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
CleanupClosePushL(destination); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
// Internet destination will always exist in the system. |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
// Internet destination will have ESnapPurposeInternet set in its metadata. |
25 | 102 |
if ( destination.MetadataL( CMManager::ESnapMetadataPurpose ) == |
103 |
CMManager::ESnapPurposeInternet ) |
|
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
{ |
25 | 105 |
RCmConnectionMethodExt plugin = cmManager.CreateConnectionMethodL( KUidWlanBearerType ); |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
CleanupClosePushL( plugin ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
plugin.SetStringAttributeL( ECmName, aIapName ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
plugin.SetStringAttributeL( EWlanSSID, aIapName ); |
10
dff6ebfd236f
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
110 |
plugin.SetStringAttributeL( EWlanServiceExtensionTableName, aUid ); |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
plugin.SetStringAttributeL( ECmConfigDaemonManagerName, KHotSpotPlugin ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
plugin.SetBoolAttributeL( ECmProtected, ETrue ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
destination.AddConnectionMethodL( plugin ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
destination.UpdateL(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
aIapId = plugin.GetIntAttributeL( ECmIapId ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
CleanupStack::PopAndDestroy( &plugin ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
CleanupStack::PopAndDestroy(); // destination |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
CleanupStack::PopAndDestroy(); // destinations |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
CleanupStack::PopAndDestroy( &cmManager ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
DEBUG("CHssIapSettingsHandler::CreateClientIapL Done"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
// ----------------------------------------------------------------------------- |
25 | 129 |
// CreateIapL |
130 |
// ----------------------------------------------------------------------------- |
|
131 |
// |
|
132 |
TInt CHssIapSettingsHandler::CreateIapL( TBool aHotspot ) |
|
133 |
{ |
|
134 |
DEBUG("CHssIapSettingsHandler::CreateIapL"); |
|
135 |
TInt ret ( KErrNone ); |
|
136 |
RCmManagerExt cmManager; |
|
137 |
cmManager.OpenL(); |
|
138 |
CleanupClosePushL( cmManager ); |
|
139 |
||
140 |
// Read all destination(SNAP) settings into an array |
|
141 |
RArray<TUint32> destinations; |
|
142 |
CleanupClosePushL( destinations ); |
|
143 |
||
144 |
cmManager.AllDestinationsL( destinations ); |
|
145 |
RCmDestinationExt destination; |
|
146 |
// Loop through each destination |
|
147 |
for( TInt i = 0; i < destinations.Count(); i++ ) |
|
148 |
{ |
|
149 |
destination = cmManager.DestinationL( destinations[i] ); |
|
150 |
CleanupClosePushL( destination ); |
|
151 |
// Internet destination will always exist in the system. |
|
152 |
// Internet destination will have ESnapPurposeInternet |
|
153 |
// set in its metadata. |
|
154 |
if ( destination.MetadataL( CMManager::ESnapMetadataPurpose ) == |
|
155 |
CMManager::ESnapPurposeInternet ) |
|
156 |
{ |
|
157 |
CWlanMgmtClient* wlanMgmtClient = CWlanMgmtClient::NewL(); |
|
158 |
CleanupStack::PushL( wlanMgmtClient ); |
|
159 |
||
160 |
TWlanConnectionMode connMode; |
|
161 |
User::LeaveIfError( |
|
162 |
wlanMgmtClient->GetConnectionMode( connMode ) ); |
|
163 |
||
164 |
TWlanConnectionSecurityMode secMode; |
|
165 |
User::LeaveIfError( |
|
166 |
wlanMgmtClient->GetConnectionSecurityMode( secMode ) ); |
|
167 |
||
168 |
HBufC* ssid( NULL ); |
|
169 |
TWlanSsid ssidConn; |
|
170 |
||
171 |
User::LeaveIfError( |
|
172 |
wlanMgmtClient->GetConnectionSsid( ssidConn ) ); |
|
173 |
ssid = HBufC::NewLC( ssidConn.Length() ); |
|
174 |
ssid->Des().Copy( ssidConn ); |
|
175 |
||
176 |
TUint32 serviceId(0); |
|
177 |
TUint32 easyWlanIapId(0); |
|
178 |
easyWlanIapId = cmManager.EasyWlanIdL(); |
|
179 |
||
180 |
RCmConnectionMethodExt easyWlanPlugin; |
|
181 |
easyWlanPlugin = cmManager.ConnectionMethodL( easyWlanIapId ); |
|
182 |
CleanupClosePushL( easyWlanPlugin ); |
|
183 |
TBool scanSsid = easyWlanPlugin.GetBoolAttributeL( EWlanScanSSID ); |
|
184 |
TUint32 easyWlanServiceId = |
|
185 |
easyWlanPlugin.GetIntAttributeL( EWlanServiceId ); |
|
186 |
CleanupStack::PopAndDestroy(); // easyWlanPlugin; |
|
187 |
||
188 |
RCmConnectionMethodExt plugin = |
|
189 |
cmManager.CreateConnectionMethodL( KUidWlanBearerType ); |
|
190 |
CleanupClosePushL( plugin ); |
|
191 |
plugin.SetStringAttributeL( ECmName, *ssid ); |
|
192 |
plugin.SetStringAttributeL( EWlanSSID, *ssid ); |
|
193 |
plugin.SetIntAttributeL( CMManager::EWlanSecurityMode, |
|
194 |
ConvertConnectionSecurityModeToSecModeL( secMode )); |
|
195 |
plugin.SetIntAttributeL( EWlanConnectionMode, |
|
196 |
ConvertConnectionModeToNetModeL( connMode ) ); |
|
197 |
plugin.SetBoolAttributeL( EWlanScanSSID, scanSsid ); |
|
198 |
||
199 |
if ( aHotspot ) |
|
200 |
{ |
|
201 |
// A hotspot IAP. Mark it so it can be deleted after the use. |
|
202 |
plugin.SetStringAttributeL( ECmConfigDaemonManagerName, |
|
203 |
KHotSpotPlugin ); |
|
204 |
} |
|
205 |
||
206 |
destination.AddConnectionMethodL( plugin ); |
|
207 |
destination.UpdateL(); |
|
208 |
serviceId = plugin.GetIntAttributeL( EWlanServiceId ); |
|
209 |
ret = plugin.GetIntAttributeL( ECmIapId ); |
|
210 |
CleanupStack::PopAndDestroy( &plugin ); |
|
211 |
if ( secMode == EWlanConnectionSecurityWep ) |
|
212 |
{ |
|
213 |
SaveWEPKeyL( easyWlanServiceId, serviceId ); |
|
214 |
} |
|
215 |
||
216 |
if ( secMode == EWlanConnectionSecurityWpaPsk ) |
|
217 |
{ |
|
218 |
SaveWPAKeyL( easyWlanServiceId, serviceId ); |
|
219 |
} |
|
220 |
||
221 |
CleanupStack::PopAndDestroy( ssid ); |
|
222 |
CleanupStack::PopAndDestroy( wlanMgmtClient ); |
|
223 |
} |
|
224 |
CleanupStack::PopAndDestroy( &destination ); |
|
225 |
} |
|
226 |
CleanupStack::PopAndDestroy( &destinations ); |
|
227 |
CleanupStack::PopAndDestroy( &cmManager ); |
|
228 |
||
229 |
DEBUG1("CHssIapSettingsHandler::CreateIapL Done iapId: %d", ret); |
|
230 |
return ret; |
|
231 |
} |
|
232 |
||
233 |
// ----------------------------------------------------------------------------- |
|
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
// DeleteIapL |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
// ----------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
void CHssIapSettingsHandler::DeleteIapL( const TUint aIapId ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
DEBUG1("CHssIapSettingsHandler:::DeleteIapL aIapId=%d ", aIapId); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
|
25 | 241 |
RCmManagerExt cmManager; |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
cmManager.OpenL(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
CleanupClosePushL( cmManager ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
|
25 | 245 |
RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapId ); |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
CleanupClosePushL( plugin ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
cmManager.RemoveAllReferencesL( plugin ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
TBool result = plugin.DeleteL(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
|
10
dff6ebfd236f
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
251 |
DEBUG1("CHssIapSettingsHandler:::DeleteIapL result = %d ", result); |
dff6ebfd236f
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
8
diff
changeset
|
252 |
CleanupStack::PopAndDestroy( &plugin ); |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
CleanupStack::PopAndDestroy( &cmManager ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
// --------------------------------------------------------- |
25 | 257 |
// MoveIapL() |
258 |
// --------------------------------------------------------- |
|
259 |
// |
|
260 |
void CHssIapSettingsHandler::MoveIapL( const TUint aIapId ) |
|
261 |
{ |
|
262 |
DEBUG1("CHssIapSettingsHandler::MoveIapL aIapId=%d ", aIapId); |
|
263 |
// Now move to Internet SNAP |
|
264 |
RCmManagerExt cmManager; |
|
265 |
cmManager.OpenL(); |
|
266 |
CleanupClosePushL( cmManager ); |
|
267 |
||
268 |
// Read all destination(SNAP) settings into an array |
|
269 |
RArray<TUint32> destinations; |
|
270 |
CleanupClosePushL( destinations ); |
|
271 |
||
272 |
cmManager.AllDestinationsL( destinations ); |
|
273 |
RCmDestinationExt destination; |
|
274 |
// Loop through each destination |
|
275 |
for( TInt i = 0; i < destinations.Count(); i++ ) |
|
276 |
{ |
|
277 |
destination = cmManager.DestinationL( destinations[i] ); |
|
278 |
CleanupClosePushL( destination ); |
|
279 |
// Internet destination will always exist in the system. |
|
280 |
// Internet destination will have ESnapPurposeInternet |
|
281 |
// set in its metadata. |
|
282 |
if ( destination.MetadataL( CMManager::ESnapMetadataPurpose ) == |
|
283 |
CMManager::ESnapPurposeInternet ) |
|
284 |
{ |
|
285 |
RCmConnectionMethodExt iap = cmManager.ConnectionMethodL( aIapId ); |
|
286 |
CleanupClosePushL( iap ); |
|
287 |
iap.SetStringAttributeL( ECmConfigDaemonManagerName, KHotSpotPlugin ); |
|
288 |
destination.AddConnectionMethodL( iap ); |
|
289 |
CleanupStack::PopAndDestroy( &iap ); |
|
290 |
destination.UpdateL(); |
|
291 |
} |
|
292 |
CleanupStack::PopAndDestroy( &destination ); |
|
293 |
} |
|
294 |
CleanupStack::PopAndDestroy( &destinations ); |
|
295 |
CleanupStack::PopAndDestroy( &cmManager ); |
|
296 |
||
297 |
DEBUG( "CHssIapSettingsHandler::MoveIapL Done" ); |
|
298 |
} |
|
299 |
||
300 |
// --------------------------------------------------------- |
|
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
301 |
// SaveWEPKeyL() |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
// --------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
304 |
void CHssIapSettingsHandler::SaveWEPKeyL( const TUint32 aFrom, |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
305 |
const TUint32 aTo ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
306 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
307 |
DEBUG("CHssIapSettingsHandler::SaveWEPKey"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
308 |
TInt err( KErrNone ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
309 |
TUint attempts( KHssMaxTransAttempts ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
310 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
311 |
CMDBSession* dbSession = |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
312 |
CMDBSession::NewLC( CMDBSession::LatestVersion() ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
313 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
// open a transaction to make sure key is saved |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
315 |
do |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
316 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
317 |
TRAP( err, dbSession->OpenTransactionL() ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
318 |
if ( err ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
320 |
DEBUG1("CHssIapSettingsHandler::SaveWEPKey err: %d", err); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
321 |
User::After( KHssRetryAfter ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
322 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
323 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
324 |
while ( err && attempts-- ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
325 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
326 |
if ( err != KErrNone ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
327 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
328 |
dbSession->Close(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
329 |
CleanupStack::PopAndDestroy( dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
User::LeaveIfError( err ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
332 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
333 |
CleanupStack::PushL( TCleanupItem( RollbackCommsDat, dbSession ) ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
334 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
335 |
CMDBGenericRecord* wlanRecord = static_cast<CMDBGenericRecord*> |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
336 |
( CCDRecordBase::RecordFactoryL( 0)); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
337 |
CleanupStack::PushL( wlanRecord ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
338 |
wlanRecord->InitializeL( KGenericTable(),NULL ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
339 |
wlanRecord->SetRecordId( aFrom ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
340 |
wlanRecord->LoadL( *dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
TInt format = |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
343 |
*((CMDBField<TUint32>*)wlanRecord->GetFieldByIdL( KCDTIdWlanFormatKey1 )); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
344 |
CMDBField<TDesC8>* wepKey = |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
345 |
static_cast<CMDBField<TDesC8>*>(wlanRecord->GetFieldByIdL(KCDTIdWlanWepKey1)); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
346 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
347 |
TBuf8<KWLMMaxWEPKeyLength> buf8; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
348 |
buf8.Copy( *wepKey ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
349 |
CleanupStack::PopAndDestroy( wlanRecord ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
350 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
351 |
CMDBGenericRecord* wlanRecordNew = static_cast<CMDBGenericRecord*> |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
352 |
( CCDRecordBase::RecordFactoryL( 0)); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
353 |
CleanupStack::PushL( wlanRecordNew ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
354 |
wlanRecordNew->InitializeL( KGenericTable(),NULL ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
355 |
wlanRecordNew->SetRecordId( aTo ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
356 |
wlanRecordNew->LoadL( *dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
357 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
358 |
CMDBField<TDesC8>* wepKeyNew = |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
359 |
static_cast<CMDBField<TDesC8>*>(wlanRecordNew->GetFieldByIdL(KCDTIdWlanWepKey1)); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
360 |
*((CMDBField<TUint32>*)wlanRecordNew->GetFieldByIdL( KCDTIdWlanFormatKey1 )) = format; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
361 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
362 |
wepKeyNew->SetL(buf8); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
363 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
364 |
wlanRecordNew->ModifyL( *dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
365 |
CleanupStack::PopAndDestroy( wlanRecordNew ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
366 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
367 |
CleanupStack::Pop( 1 ); // transaction rollback popped |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
368 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
369 |
dbSession->CommitTransactionL(); |
22
3b2fb68d23df
Revision: 201024
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
14
diff
changeset
|
370 |
|
3b2fb68d23df
Revision: 201024
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
14
diff
changeset
|
371 |
dbSession->Close(); |
3b2fb68d23df
Revision: 201024
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
14
diff
changeset
|
372 |
CleanupStack::PopAndDestroy( dbSession ); |
0
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
373 |
DEBUG("CHssIapSettingsHandler::SaveWEPKey Done"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
374 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
375 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
376 |
// --------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
377 |
// SaveWPAKeyL() |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
378 |
// --------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
379 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
380 |
void CHssIapSettingsHandler::SaveWPAKeyL( const TUint32 aFrom, |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
381 |
const TUint32 aTo ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
382 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
383 |
DEBUG("CHssIapSettingsHandler::SaveWPAKey"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
384 |
TInt err( KErrNone ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
385 |
TUint attempts( KHssMaxTransAttempts ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
386 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
CMDBSession* dbSession = |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
CMDBSession::NewLC( CMDBSession::LatestVersion() ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
389 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
// open a transaction to make sure key is saved |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
391 |
do |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
TRAP( err, dbSession->OpenTransactionL() ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
if ( err ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
DEBUG1("CHssIapSettingsHandler::SaveWPAKey err: %d", err); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
User::After( KHssRetryAfter ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
while ( err && attempts-- ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
if ( err != KErrNone ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
dbSession->Close(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
CleanupStack::PopAndDestroy( dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
406 |
User::LeaveIfError( err ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
CleanupStack::PushL( TCleanupItem( RollbackCommsDat, dbSession ) ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
CMDBGenericRecord* wlanRecord = static_cast<CMDBGenericRecord*> |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
412 |
( CCDRecordBase::RecordFactoryL( 0)); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
CleanupStack::PushL( wlanRecord ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
414 |
wlanRecord->InitializeL( KGenericTable(), NULL ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
415 |
wlanRecord->SetRecordId( aFrom ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
416 |
wlanRecord->LoadL( *dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
CMDBField<TDesC8>* binField = |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
(CMDBField<TDesC8>*)wlanRecord->GetFieldByIdL(KCDTIdWlanWpaPreSharedKey); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
TBuf8<KWLMMaxWpaPskLength> buf8; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
buf8.Copy( *binField ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
CleanupStack::PopAndDestroy( wlanRecord ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
CMDBGenericRecord* wlanRecordNew = static_cast<CMDBGenericRecord*> |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
( CCDRecordBase::RecordFactoryL( 0)); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
CleanupStack::PushL( wlanRecordNew ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
427 |
wlanRecordNew->InitializeL( KGenericTable(),NULL ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
wlanRecordNew->SetRecordId( aTo ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
429 |
wlanRecordNew->LoadL( *dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
431 |
CMDBField<TDesC8>* binFieldNew = |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
(CMDBField<TDesC8>*)wlanRecordNew->GetFieldByIdL(KCDTIdWlanWpaPreSharedKey); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
binFieldNew->SetMaxLengthL( KWLMMaxWpaPskLength ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
434 |
binFieldNew->SetL( buf8 ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
*((CMDBField<TUint32>*)wlanRecordNew->GetFieldByIdL(KCDTIdWlanEnableWpaPsk)) = ETrue; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
wlanRecordNew->ModifyL( *dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
CleanupStack::PopAndDestroy( wlanRecordNew ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
439 |
CleanupStack::Pop( 1 ); // transaction rollback popped |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
441 |
dbSession->CommitTransactionL(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
442 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
443 |
dbSession->Close(); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
CleanupStack::PopAndDestroy( dbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
445 |
DEBUG("CHssIapSettingsHandler::SaveWPAKey Done"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
448 |
// ---------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
449 |
// RollbackCommsDat |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
450 |
// ---------------------------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
451 |
void CHssIapSettingsHandler::RollbackCommsDat( TAny* aDbSession ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
452 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
DEBUG("CHssIapSettingsHandler::RollbackCommsDat"); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
CommsDat::CMDBSession* session = static_cast<CommsDat::CMDBSession*>( aDbSession ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
TRAP_IGNORE( session->RollbackTransactionL() ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
456 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
458 |
// --------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
459 |
// ConvertConnectionSecurityModeToSecModeL |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
// --------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
462 |
TWlanSecMode CHssIapSettingsHandler::ConvertConnectionSecurityModeToSecModeL( |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
TWlanConnectionSecurityMode aSecurityMode ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
465 |
DEBUG( "CHssIapSettingsHandler::ConvertConnectionSecurityModeToSecModeL" ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
466 |
switch( aSecurityMode ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
467 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
468 |
case EWlanConnectionSecurityOpen: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
469 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
470 |
return EWlanSecModeOpen; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
471 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
473 |
case EWlanConnectionSecurityWep: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
474 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
475 |
return EWlanSecModeWep; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
476 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
477 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
478 |
case EWlanConnectionSecurity802d1x: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
return EWlanSecMode802_1x; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
case EWlanConnectionSecurityWpa: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
case EWlanConnectionSecurityWpaPsk: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
485 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
return EWlanSecModeWpa; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
488 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
default: |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
490 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
User::Leave( KErrNotSupported ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
492 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
495 |
return EWlanSecModeOpen; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
496 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
497 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
498 |
// --------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
499 |
// ConvertConnectionModeToNetModeL |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
// --------------------------------------------------------- |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
501 |
// |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
502 |
TWlanNetMode CHssIapSettingsHandler::ConvertConnectionModeToNetModeL( |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
503 |
TWlanConnectionMode aConnMode ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
505 |
DEBUG( "CHssIapSettingsHandler::ConvertConnectionModeToNetModeL" ); |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
506 |
if ( EWlanConnectionModeAdhoc == aConnMode ) |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
507 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
508 |
return EAdhoc; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
509 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
510 |
else |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
511 |
{ |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
512 |
return EInfra; |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
513 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
514 |
} |
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
515 |
|
56b72877c1cb
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
516 |
// End of File |