|
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 "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: Implementation of iap |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HSSIAPHANDLER_H |
|
20 #define HSSIAPHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "hssiapsettings.h" |
|
25 #include "hssiapsettingshandler.h" |
|
26 |
|
27 // CLASS DECLARATION |
|
28 /** |
|
29 * @brief IAP settings handler |
|
30 */ |
|
31 class CHssIapHandler : public CBase |
|
32 { |
|
33 public: // Methods |
|
34 |
|
35 // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * Static constructor. |
|
39 * @return Pointer to the constructed object. |
|
40 */ |
|
41 static CHssIapHandler* NewL( ); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~CHssIapHandler(); |
|
47 |
|
48 /** |
|
49 * Starts IAP changes |
|
50 * @param aIapID, IAP id |
|
51 * @param aSettings, IAP settings struct |
|
52 * @return KErrNone if successful, otherwise one of system wide errorcodes. |
|
53 */ |
|
54 TInt ChangeSettingsL( const TUint aIapID, const THssIapSettings& aSettings ); |
|
55 |
|
56 /** |
|
57 * Gets Network Id |
|
58 * @param aIapId, IAP id |
|
59 * @param aNetId, Network id |
|
60 * @return None |
|
61 */ |
|
62 void GetNetworkIdL( const TUint aIapId, TUint32& aNetId ); |
|
63 |
|
64 /** |
|
65 * Gets all Iaps of client |
|
66 * @param aUId, UID of client |
|
67 * @param aIapIdArray, Array for client's Iaps |
|
68 * @return None |
|
69 */ |
|
70 void GetClientIapsL( const TUid aUid, RArray<TUint>& aIapIdArray ); |
|
71 |
|
72 protected: |
|
73 |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 CHssIapHandler(); |
|
78 |
|
79 /** |
|
80 * By default Symbian 2nd phase constructor is private. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 private: |
|
85 |
|
86 /** |
|
87 * Writes WEP keys from aSettings to current WLANServiceTable record |
|
88 * @param aSettings, IAP settings struct |
|
89 * @return KErrNone if successful, otherwice one of system wide errorcodes. |
|
90 */ |
|
91 TInt WriteWepKeysL( const THssIapSettings& aSettings ); |
|
92 |
|
93 /** |
|
94 * Copies wepkey string from wepkey structs TUint8 |
|
95 * buffer to a WLANServiceTable (CommsDat) |
|
96 * @param aInputKey, WepKey |
|
97 * @param aFormat, format of WepKey ( ascii/hexadecimal) |
|
98 * @param aPackedKey, packed WepKey |
|
99 */ |
|
100 void PackWepKeyCommsDatL( const SHssWep& aInputKey, |
|
101 const EHssWEPKeyFormat& aFormat, |
|
102 CMDBField<TDesC8>* aPackedKey ); |
|
103 |
|
104 /** |
|
105 * Converts Hotspot EAP settings to EAPOL EAP settings |
|
106 * @param aHssEap, Hotspot EAP settings |
|
107 * @param aEap, EAPOL EAP settings |
|
108 */ |
|
109 void ConvertEApSettings( THssEapSettings& aHssEap, EAPSettings& aEap ); |
|
110 |
|
111 /** |
|
112 * Converts ascii to hecxadecimal |
|
113 * @param aSource, ascii |
|
114 * @param aDest, hexa |
|
115 */ |
|
116 void ConvertAsciiToHex( const TDes8& aSource, |
|
117 HBufC8*& aDest ); |
|
118 |
|
119 /** |
|
120 * Writes eap type to descriptor |
|
121 * @param aEapType, Eap type |
|
122 * @param aEapString, Eap type descrpitor |
|
123 * @param aEapCode, Eap id code |
|
124 */ |
|
125 void GetEapTypeDesC( TUint aEapType, TDes8& aEapString, TChar& aEapCode ); |
|
126 |
|
127 private: // Data |
|
128 |
|
129 /** |
|
130 * CommsDat WLAN record instance |
|
131 * Own |
|
132 */ |
|
133 CMDBGenericRecord* iWLANRecord; |
|
134 |
|
135 }; |
|
136 |
|
137 |
|
138 #endif |