author | Richard Taylor <richard.i.taylor@nokia.com> |
Wed, 14 Jul 2010 14:50:01 +0100 | |
changeset 616 | 24e4ef208cca |
parent 591 | 22486c9c7b15 |
permissions | -rw-r--r-- |
591 | 1 |
/* |
616
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
2 |
* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). |
591 | 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 |
||
616
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
44 |
// Custom trace extraction content required for this component |
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
45 |
typedef TUint8 TGroupId; |
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
46 |
#define GROUPIDMASK 0x00ff0000 |
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
47 |
#define GROUPIDSHIFT 16 |
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
48 |
#define TRACEIDMASK 0x0000ffff |
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
49 |
#define TRACEIDSHIFT 0 |
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
50 |
#define EXTRACT_GROUP_ID(aTraceName) static_cast<TGroupId>((aTraceName & GROUPIDMASK) >> GROUPIDSHIFT) |
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
51 |
|
24e4ef208cca
sbs version 2.14.2
Richard Taylor <richard.i.taylor@nokia.com>
parents:
591
diff
changeset
|
52 |
|
591 | 53 |
/** |
54 |
* The class for parsing the tuning data stored in PERM server. |
|
55 |
* |
|
56 |
* @lib wlanhwinit.lib |
|
57 |
* @since Series 60 3.1 |
|
58 |
*/ |
|
59 |
NONSHARABLE_CLASS( CWlanHwInitPermParser ) : public CBase |
|
60 |
{ |
|
61 |
public: // Constructors and destructor |
|
62 |
||
63 |
/** |
|
64 |
* Two-phased constructor. |
|
65 |
*/ |
|
66 |
static CWlanHwInitPermParser* NewL(); |
|
67 |
||
68 |
/** |
|
69 |
* Destructor. |
|
70 |
*/ |
|
71 |
virtual ~CWlanHwInitPermParser(); |
|
72 |
||
73 |
// New functions |
|
74 |
||
75 |
TPtr8 GetNvsBuffer(); |
|
76 |
void CompareNvsBuffer(); |
|
77 |
TPtr8 GetTuningBuffer(); |
|
78 |
void UpdateNvsData(nvsUpdateList updateList); |
|
79 |
void GenerateDefaultTuningData(); |
|
80 |
void SetMacAddress(const TMacAddr& pMacAddress); |
|
81 |
||
82 |
/** |
|
83 |
* Return the parsed tuning values from perm data. |
|
84 |
* @since Series 60 3.1 |
|
85 |
* @param aData Parsed tuning values. |
|
86 |
* @return Status code. |
|
87 |
*/ |
|
88 |
TInt GetTuningValues( |
|
89 |
TDes8& aData ); |
|
90 |
||
91 |
/** |
|
92 |
* Set tuning values to perm data. |
|
93 |
* @since Series 60 3.1 |
|
94 |
* @param aData Tuning values to be stored. |
|
95 |
* @return Status code. |
|
96 |
*/ |
|
97 |
TInt SetTuningValues(TDesC8& aData, nvsUpdateList updateList); |
|
98 |
||
99 |
private: |
|
100 |
||
101 |
/** |
|
102 |
* C++ default constructor. |
|
103 |
*/ |
|
104 |
CWlanHwInitPermParser(); |
|
105 |
||
106 |
/** |
|
107 |
* By default Symbian 2nd phase constructor is private. |
|
108 |
*/ |
|
109 |
void ConstructL(); |
|
110 |
||
111 |
private: // Data |
|
112 |
||
113 |
TMacAddr iMacAddress; |
|
114 |
/** The current tuning data. */ |
|
115 |
HBufC8* iTuningData; |
|
116 |
HBufC8* iNvsData; |
|
117 |
}; |
|
118 |
||
119 |
#endif // WLANHWINITPERMPARSER_H |