sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/testTC/inc/wlanhwinitpermparser.h
changeset 13 c327db0664bb
child 28 b8fa7dfeeaa1
equal deleted inserted replaced
12:5e7562f67577 13:c327db0664bb
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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 the License "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:  The class for parsing the tuning data stored in PERM server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef WLANHWINITPERMPARSER_H
       
    20 #define WLANHWINITPERMPARSER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "wlanhwinitinterface.h"
       
    24 
       
    25 // Initialization Data Block constants
       
    26 const TUint32 KInitMagic = 0x19171513;
       
    27 const TUint32 KInitTypeEnd = 0;
       
    28 const TUint32 KInitTypeNvMem = 1;
       
    29 const TUint32 KInitTypeCode = 2;
       
    30 
       
    31 //These offsets are defined in Initialization Data Block document.
       
    32 const TUint32 KNvMemTypeOffset = 4;
       
    33 const TUint32 KNvMemLengthOffset = 8;
       
    34 const TUint32 KNvMemValueOffset = 12;
       
    35 
       
    36 const TUint32 KNvMemTypeOffset32 = 1;
       
    37 const TUint32 KNvMemLengthOffset32 = 2;
       
    38 const TUint32 KNvMemValueOffset32 = 3;
       
    39 
       
    40 typedef TUint nvsUpdateList;
       
    41 #define UPDATE_MAC_ADDR 		0x0080
       
    42 #define UPDATE_ALL 				  0xFFFF
       
    43 
       
    44 /**
       
    45 * The class for parsing the tuning data stored in PERM server.
       
    46 *
       
    47 * @lib wlanhwinit.lib
       
    48 * @since Series 60 3.1
       
    49 */
       
    50 NONSHARABLE_CLASS( CWlanHwInitPermParser ) : public CBase
       
    51     {
       
    52     public:  // Constructors and destructor
       
    53         
       
    54         /**
       
    55         * Two-phased constructor.
       
    56         */
       
    57         static CWlanHwInitPermParser* NewL();
       
    58         
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CWlanHwInitPermParser();
       
    63 
       
    64         // New functions
       
    65 
       
    66         TPtr8 GetNvsBuffer();
       
    67         void CompareNvsBuffer();
       
    68         TPtr8 GetTuningBuffer();
       
    69         void UpdateNvsData(nvsUpdateList updateList);
       
    70         void GenerateDefaultTuningData();
       
    71         void SetMacAddress(const TMacAddr& pMacAddress);
       
    72         
       
    73         /**
       
    74         * Return the parsed tuning values from perm data.
       
    75         * @since Series 60 3.1
       
    76         * @param aData Parsed tuning values.
       
    77         * @return Status code.
       
    78         */
       
    79         TInt GetTuningValues(
       
    80             TDes8& aData );
       
    81 
       
    82         /**
       
    83         * Set tuning values to perm data.
       
    84         * @since Series 60 3.1
       
    85         * @param aData Tuning values to be stored.
       
    86         * @return Status code.
       
    87         */
       
    88         TInt SetTuningValues(TDesC8& aData, nvsUpdateList updateList);
       
    89 
       
    90     private:
       
    91 
       
    92         /**
       
    93         * C++ default constructor.
       
    94         */
       
    95         CWlanHwInitPermParser();
       
    96 
       
    97         /**
       
    98         * By default Symbian 2nd phase constructor is private.
       
    99         */
       
   100         void ConstructL();
       
   101 
       
   102     private:    // Data
       
   103 
       
   104         TMacAddr iMacAddress;
       
   105         /** The current tuning data. */
       
   106         HBufC8* iTuningData;
       
   107         HBufC8* iNvsData;
       
   108     };
       
   109 
       
   110 #endif // WLANHWINITPERMPARSER_H