75 // ----------------------------------------------------------------------------- |
75 // ----------------------------------------------------------------------------- |
76 // CreateClientIapL |
76 // CreateClientIapL |
77 // ----------------------------------------------------------------------------- |
77 // ----------------------------------------------------------------------------- |
78 // |
78 // |
79 void CHssIapSettingsHandler::CreateClientIapL( const TDesC& aIapName, |
79 void CHssIapSettingsHandler::CreateClientIapL( const TDesC& aIapName, |
80 TUint32& aIapId, |
80 TUint32& aIapId, |
81 const TUid aUid ) |
81 const TDesC& aUid ) |
82 { |
82 { |
83 DEBUG("CHssIapSettingsHandler::CreateClientIapL"); |
83 DEBUG("CHssIapSettingsHandler::CreateClientIapL"); |
84 |
84 |
85 RCmManagerExt cmManager; |
85 RCmManagerExt cmManager; |
86 cmManager.OpenL(); |
86 cmManager.OpenL(); |
104 RCmConnectionMethodExt plugin = cmManager.CreateConnectionMethodL( KUidWlanBearerType ); |
104 RCmConnectionMethodExt plugin = cmManager.CreateConnectionMethodL( KUidWlanBearerType ); |
105 CleanupClosePushL( plugin ); |
105 CleanupClosePushL( plugin ); |
106 |
106 |
107 plugin.SetStringAttributeL( ECmName, aIapName ); |
107 plugin.SetStringAttributeL( ECmName, aIapName ); |
108 plugin.SetStringAttributeL( EWlanSSID, aIapName ); |
108 plugin.SetStringAttributeL( EWlanSSID, aIapName ); |
109 plugin.SetStringAttributeL( EWlanServiceExtensionTableName, aUid.Name() ); |
109 plugin.SetStringAttributeL( EWlanServiceExtensionTableName, aUid ); |
110 plugin.SetStringAttributeL( ECmConfigDaemonManagerName, KHotSpotPlugin ); |
110 plugin.SetStringAttributeL( ECmConfigDaemonManagerName, KHotSpotPlugin ); |
111 plugin.SetBoolAttributeL( ECmProtected, ETrue ); |
111 plugin.SetBoolAttributeL( ECmProtected, ETrue ); |
112 |
112 |
113 destination.AddConnectionMethodL( plugin ); |
113 destination.AddConnectionMethodL( plugin ); |
114 destination.UpdateL(); |
114 destination.UpdateL(); |
162 wlanMgmtClient->GetConnectionSecurityMode( secMode ); |
162 wlanMgmtClient->GetConnectionSecurityMode( secMode ); |
163 |
163 |
164 HBufC* ssid( NULL ); |
164 HBufC* ssid( NULL ); |
165 TWlanSsid ssidConn; |
165 TWlanSsid ssidConn; |
166 |
166 |
167 wlanMgmtClient->GetConnectionSsid( ssidConn ); |
167 User::LeaveIfError( wlanMgmtClient->GetConnectionSsid( ssidConn ) ); |
168 |
|
169 ssid = HBufC::NewLC( ssidConn.Length() ); |
168 ssid = HBufC::NewLC( ssidConn.Length() ); |
170 ssid->Des().Copy( ssidConn ); |
169 ssid->Des().Copy( ssidConn ); |
171 |
170 |
172 TUint32 serviceId(0); |
171 TUint32 serviceId(0); |
173 TUint32 easyWlanIapId(0); |
172 TUint32 easyWlanIapId(0); |
233 |
232 |
234 RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapId ); |
233 RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapId ); |
235 CleanupClosePushL( plugin ); |
234 CleanupClosePushL( plugin ); |
236 |
235 |
237 cmManager.RemoveAllReferencesL( plugin ); |
236 cmManager.RemoveAllReferencesL( plugin ); |
238 CleanupStack::Pop( &plugin ); |
|
239 |
|
240 TBool result = plugin.DeleteL(); |
237 TBool result = plugin.DeleteL(); |
|
238 |
241 DEBUG1("CHssIapSettingsHandler:::DeleteIapL result = %d ", result); |
239 DEBUG1("CHssIapSettingsHandler:::DeleteIapL result = %d ", result); |
242 |
240 CleanupStack::PopAndDestroy( &plugin ); |
243 CleanupStack::PopAndDestroy( &cmManager ); |
241 CleanupStack::PopAndDestroy( &cmManager ); |
244 } |
|
245 |
|
246 // ----------------------------------------------------------------------------- |
|
247 // FindClientL |
|
248 // ----------------------------------------------------------------------------- |
|
249 // |
|
250 TInt CHssIapSettingsHandler::FindClientL( const TUint aIapId, TUid& aUid, TDes8& aUidText ) |
|
251 { |
|
252 DEBUG("CHssIapSettingsHandler::FindClientL"); |
|
253 TInt ret( KErrNone ); |
|
254 aUid = TUid::Null(); |
|
255 RCmManagerExt cmManager; |
|
256 cmManager.OpenL(); |
|
257 CleanupClosePushL( cmManager ); |
|
258 |
|
259 RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapId ); |
|
260 CleanupClosePushL( plugin ); |
|
261 |
|
262 HBufC* uid = plugin.GetStringAttributeL( EWlanServiceExtensionTableName ); |
|
263 |
|
264 TBuf8<KExtensionAPILength> buffer; |
|
265 buffer.Copy( *uid ); |
|
266 delete uid; |
|
267 // Find and remove [ and ]. |
|
268 // If found [ it's known that buffer contains UID |
|
269 TInt indx = buffer.Find( KMark1 ); |
|
270 if ( KErrNotFound != indx ) |
|
271 { |
|
272 DEBUG("CHssIapSettingsHandler::FindClientL Client is found"); |
|
273 buffer.Delete( indx, 1 ); |
|
274 indx = buffer.Find( KMark2 ); |
|
275 if ( KErrNotFound != indx ) |
|
276 { |
|
277 buffer.Delete( indx, 1 ); |
|
278 } |
|
279 // Convert TBuf to TUid |
|
280 TLex8 lex( buffer ); |
|
281 TUint value( 0 ); |
|
282 User::LeaveIfError( lex.Val( value, EHex ) ); |
|
283 aUid.iUid = value; |
|
284 aUidText = buffer; |
|
285 } |
|
286 |
|
287 CleanupStack::PopAndDestroy( &plugin ); // Close() called on "plugin" |
|
288 CleanupStack::PopAndDestroy( &cmManager ); |
|
289 DEBUG("CHssIapSettingsHandler::FindClientL"); |
|
290 |
|
291 return ret; |
|
292 } |
242 } |
293 |
243 |
294 // --------------------------------------------------------- |
244 // --------------------------------------------------------- |
295 // SaveWEPKeyL() |
245 // SaveWEPKeyL() |
296 // --------------------------------------------------------- |
246 // --------------------------------------------------------- |