1 /* |
|
2 * Copyright (c) 2010 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "creator_traces.h" |
|
21 #include "creator_wepsecuritysettings.h" |
|
22 #include <commdb.h> |
|
23 //#include <featmgr.h> |
|
24 #include <WlanCdbCols.h> |
|
25 |
|
26 //#include <commsdattypesv1_1.h> |
|
27 //#include <cmmanagertablefields.h> |
|
28 //#include <wlancontainer.h> |
|
29 |
|
30 |
|
31 |
|
32 //---------------------------------------------------------------------------- |
|
33 |
|
34 CCreatorWEPSecuritySettings* CCreatorWEPSecuritySettings::NewL() |
|
35 { |
|
36 CCreatorWEPSecuritySettings* self = CCreatorWEPSecuritySettings::NewLC(); |
|
37 CleanupStack::Pop(self); |
|
38 return self; |
|
39 } |
|
40 |
|
41 CCreatorWEPSecuritySettings* CCreatorWEPSecuritySettings::NewLC() |
|
42 { |
|
43 CCreatorWEPSecuritySettings* self = new (ELeave) CCreatorWEPSecuritySettings; |
|
44 CleanupStack::PushL(self); |
|
45 self->ConstructL(); |
|
46 return self; |
|
47 } |
|
48 |
|
49 CCreatorWEPSecuritySettings::CCreatorWEPSecuritySettings() |
|
50 { |
|
51 } |
|
52 |
|
53 void CCreatorWEPSecuritySettings::ConstructL() |
|
54 { |
|
55 LOGSTRING("Creator: CCreatorWEPSecuritySettings::ConstructL"); |
|
56 } |
|
57 |
|
58 CCreatorWEPSecuritySettings::~CCreatorWEPSecuritySettings() |
|
59 { |
|
60 LOGSTRING("Creator: CCreatorWEPSecuritySettings::~CCreatorWEPSecuritySettings"); |
|
61 |
|
62 |
|
63 } |
|
64 |
|
65 |
|
66 |
|
67 //---------------------------------------------------------------------------- |
|
68 |
|
69 |
|
70 |
|
71 // --------------------------------------------------------- |
|
72 // CWEPSecuritySettingsImpl::SaveL |
|
73 // --------------------------------------------------------- |
|
74 // |
|
75 void CCreatorWEPSecuritySettings::SaveL( TUint32 /*aIapId*/, |
|
76 CCommsDatabase& /*aCommsDb*/ ) const |
|
77 { |
|
78 /* |
|
79 // Data of the key |
|
80 TBuf8<KMaxLengthOfKeyData> iKeyData[KMaxNumberofKeys]; |
|
81 |
|
82 CCommsDbTableView* wLanServiceTable; |
|
83 |
|
84 // Caller MUST initiate a transaction, WE WILL NOT. |
|
85 |
|
86 wLanServiceTable = aCommsDb.OpenViewMatchingUintLC( |
|
87 TPtrC( WLAN_SERVICE ), TPtrC( WLAN_SERVICE_ID ), aIapId ); |
|
88 TInt errorCode = wLanServiceTable->GotoFirstRecord(); |
|
89 |
|
90 if ( errorCode == KErrNone ) |
|
91 { |
|
92 wLanServiceTable->UpdateRecord(); |
|
93 } |
|
94 else |
|
95 { |
|
96 TUint32 dummyUid( 0 ); //was KUidNone |
|
97 User::LeaveIfError( wLanServiceTable->InsertRecord( dummyUid ) ); |
|
98 |
|
99 // Save link to LAN service |
|
100 wLanServiceTable->WriteUintL( TPtrC( WLAN_SERVICE_ID ), aIapId ); |
|
101 } |
|
102 |
|
103 // Save index of key in use |
|
104 wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_INDEX ), |
|
105 ( TUint32& ) iKeyInUse ); |
|
106 |
|
107 // Save index of key in use |
|
108 wLanServiceTable->WriteUintL( TPtrC( NU_WLAN_AUTHENTICATION_MODE ), |
|
109 ( TUint32& ) iAuthentication ); |
|
110 |
|
111 // Save first WEP key |
|
112 wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY1 ), |
|
113 iKeyData[KFirstKey] ); |
|
114 |
|
115 // Save second WEP key |
|
116 wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY2 ), |
|
117 iKeyData[KSecondKey] ); |
|
118 |
|
119 // Save third WEP key |
|
120 wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY3 ), |
|
121 iKeyData[KThirdKey] ); |
|
122 |
|
123 // Save fourth WEP key |
|
124 wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY4 ), |
|
125 iKeyData[KFourthKey] ); |
|
126 |
|
127 // Save the format of the keys |
|
128 wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY1_FORMAT ), |
|
129 ( TUint32& ) iKeyFormat[KFirstKey] ); |
|
130 |
|
131 wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY2_FORMAT ), |
|
132 ( TUint32& ) iKeyFormat[KSecondKey] ); |
|
133 |
|
134 wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY3_FORMAT ), |
|
135 ( TUint32& ) iKeyFormat[KThirdKey] ); |
|
136 |
|
137 wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY4_FORMAT ), |
|
138 ( TUint32& ) iKeyFormat[KFourthKey] ); |
|
139 |
|
140 wLanServiceTable->PutRecordChanges(); |
|
141 |
|
142 CleanupStack::PopAndDestroy( wLanServiceTable ); // wLanServiceTable |
|
143 */ |
|
144 } |
|
145 |
|