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