189 return result; |
189 return result; |
190 } |
190 } |
191 |
191 |
192 |
192 |
193 // ----------------------------------------------------------------------------- |
193 // ----------------------------------------------------------------------------- |
194 // CWlanSupport::GetSignalStrength |
194 // CWlanSupport::GetSignalStrengthL |
195 // ----------------------------------------------------------------------------- |
195 // ----------------------------------------------------------------------------- |
196 // |
196 // |
197 TInt CWlanSupport::GetSignalStrengthL( |
197 TInt CWlanSupport::GetSignalStrengthL( |
198 const RMessage2& aMessage, |
198 const RMessage2& aMessage, |
199 TInt& aSignalStrength ) |
199 TInt& aSignalStrength ) |
414 //LOGEXITFN1("CWlanSupport::AppendAvailableIaps()", err) |
414 //LOGEXITFN1("CWlanSupport::AppendAvailableIaps()", err) |
415 return err; |
415 return err; |
416 } |
416 } |
417 |
417 |
418 // ----------------------------------------------------------------------------- |
418 // ----------------------------------------------------------------------------- |
419 // CWlanSupport::AppendAvailableIapsBySsid |
419 // CWlanSupport::AppendAvailableIapsBySsidL |
420 // ----------------------------------------------------------------------------- |
420 // ----------------------------------------------------------------------------- |
421 // |
421 // |
422 TInt CWlanSupport::AppendAvailableIapsBySsidL( RArray<TUint>& aIdArray ) |
422 TInt CWlanSupport::AppendAvailableIapsBySsidL( RArray<TUint>& aIdArray ) |
423 { |
423 { |
424 LOGENTRFN("CWlanSupport::AppendAvailableIapsBySsidL()") |
424 LOGENTRFN("CWlanSupport::AppendAvailableIapsBySsidL()") |
772 // Signal strength |
772 // Signal strength |
773 TUint signalStrength(scanInfo->RXLevel()); |
773 TUint signalStrength(scanInfo->RXLevel()); |
774 LOGIT1("CWlanSupport::GetWLANNetworksL: signalStrength %d", signalStrength) |
774 LOGIT1("CWlanSupport::GetWLANNetworksL: signalStrength %d", signalStrength) |
775 |
775 |
776 // SecurityMode |
776 // SecurityMode |
777 TUint8 ieLength( 0 ); |
777 TUint securityMode = ConvertWlan2ConnMonExtSecMode(scanInfo); |
778 const TUint8* wpaData; |
|
779 |
|
780 TUint securityMode( EConnMonSecurityOpen ); |
|
781 if ( scanInfo->Capability() & KWlan802Dot11CapabilityPrivacyMask ) |
|
782 { |
|
783 if ( ( scanInfo->InformationElement( |
|
784 KWlan802Dot11RsnIE, |
|
785 ieLength, |
|
786 &wpaData ) == KErrNone ) || |
|
787 ( scanInfo->WpaIE( |
|
788 ieLength, |
|
789 &wpaData ) == KErrNone ) ) |
|
790 { |
|
791 securityMode = EConnMonSecurityWpa; // WPA |
|
792 } |
|
793 else |
|
794 { |
|
795 securityMode = EConnMonSecurityWep; // WEP |
|
796 } |
|
797 } |
|
798 LOGIT1("CWlanSupport::GetWLANNetworksL: securityMode %d", securityMode) |
778 LOGIT1("CWlanSupport::GetWLANNetworksL: securityMode %d", securityMode) |
799 |
779 |
800 // SSID == name |
780 // SSID == name |
801 TBuf8<TConnMonWLANNetwork::KMaxNameLength> name8; |
781 TBuf8<TConnMonWLANNetwork::KMaxNameLength> name8; |
802 TUint8 ieLen( 0 ); |
782 TUint8 ieLen( 0 ); |
865 return KRequestPending; |
845 return KRequestPending; |
866 } |
846 } |
867 |
847 |
868 |
848 |
869 // ----------------------------------------------------------------------------- |
849 // ----------------------------------------------------------------------------- |
870 // CWlanSupport::ParseWlanNetworks |
850 // CWlanSupport::ParseWlanNetworksL |
871 // ----------------------------------------------------------------------------- |
851 // ----------------------------------------------------------------------------- |
872 // |
852 // |
873 void CWlanSupport::ParseWlanNetworksL( |
853 void CWlanSupport::ParseWlanNetworksL( |
874 CWlanScanInfo* aScanInfo, |
854 CWlanScanInfo* aScanInfo, |
875 RConnMonWlanNetworksPtrArray& aWlanNetworks ) |
855 RConnMonWlanNetworksPtrArray& aWlanNetworks ) |
898 |
878 |
899 // Signal strength |
879 // Signal strength |
900 TUint signalStrength( aScanInfo->RXLevel() ); |
880 TUint signalStrength( aScanInfo->RXLevel() ); |
901 |
881 |
902 // SecurityMode |
882 // SecurityMode |
903 TUint8 ieLength( 0 ); |
883 TUint securityMode = ConvertWlan2ConnMonExtSecMode(aScanInfo); |
904 const TUint8* wpaData; |
884 |
905 |
|
906 TUint securityMode( EConnMonSecurityOpen ); |
|
907 if ( aScanInfo->Capability() & KWlan802Dot11CapabilityPrivacyMask ) |
|
908 { |
|
909 if ( ( aScanInfo->InformationElement( |
|
910 KWlan802Dot11RsnIE, |
|
911 ieLength, |
|
912 &wpaData ) == KErrNone ) || |
|
913 ( aScanInfo->WpaIE( |
|
914 ieLength, |
|
915 &wpaData ) == KErrNone ) ) |
|
916 { |
|
917 securityMode = EConnMonSecurityWpa; // WPA |
|
918 } |
|
919 else |
|
920 { |
|
921 securityMode = EConnMonSecurityWep; // WEP |
|
922 } |
|
923 } |
|
924 |
|
925 // SSID == name |
885 // SSID == name |
926 TBuf8<CConnMonWlanNetwork::KMaxNameLength> name8; |
886 TBuf8<CConnMonWlanNetwork::KMaxNameLength> name8; |
927 TUint8 ieLen( 0 ); |
887 TUint8 ieLen( 0 ); |
928 const TUint8* ieData; |
888 const TUint8* ieData; |
929 ieData = NULL; |
889 ieData = NULL; |
968 LOGEXITFN("CWlanSupport::ParseWlanNetworksL()") |
928 LOGEXITFN("CWlanSupport::ParseWlanNetworksL()") |
969 } |
929 } |
970 |
930 |
971 |
931 |
972 // ----------------------------------------------------------------------------- |
932 // ----------------------------------------------------------------------------- |
973 // CWlanSupport::GetCurrentWlanNetwork |
933 // CWlanSupport::GetCurrentWlanNetworkL |
974 // ----------------------------------------------------------------------------- |
934 // ----------------------------------------------------------------------------- |
975 // |
935 // |
976 TInt CWlanSupport::GetCurrentWlanNetworkL( |
936 TInt CWlanSupport::GetCurrentWlanNetworkL( |
977 RConnMonWlanNetworksPtrArray& aWlanNetwork ) |
937 RConnMonWlanNetworksPtrArray& aWlanNetwork ) |
978 { |
938 { |
1043 return KRequestPending; |
1003 return KRequestPending; |
1044 } |
1004 } |
1045 |
1005 |
1046 |
1006 |
1047 // ----------------------------------------------------------------------------- |
1007 // ----------------------------------------------------------------------------- |
1048 // CWlanSupport::ParseWlanNetworks |
1008 // CWlanSupport::ParseWlanProbeRawBuffersL |
1049 // ----------------------------------------------------------------------------- |
1009 // ----------------------------------------------------------------------------- |
1050 // |
1010 // |
1051 void CWlanSupport::ParseWlanProbeRawBuffersL( |
1011 void CWlanSupport::ParseWlanProbeRawBuffersL( |
1052 CWlanScanInfo* aScanInfo, |
1012 CWlanScanInfo* aScanInfo, |
1053 RConnMonWlanProbeRawBuffersPtrArray& aWlanProbeRawBuffers ) |
1013 RConnMonWlanProbeRawBuffersPtrArray& aWlanProbeRawBuffers ) |
1198 LOGEXITFN1("CWlanSupport::WlanSessionIndex()", result) |
1158 LOGEXITFN1("CWlanSupport::WlanSessionIndex()", result) |
1199 return result; |
1159 return result; |
1200 } |
1160 } |
1201 |
1161 |
1202 // ----------------------------------------------------------------------------- |
1162 // ----------------------------------------------------------------------------- |
1203 // CWlanSupport::SetIntAttribute |
1163 // CWlanSupport::SetIntAttributeL |
1204 // ----------------------------------------------------------------------------- |
1164 // ----------------------------------------------------------------------------- |
1205 // |
1165 // |
1206 TInt CWlanSupport::SetIntAttributeL( |
1166 TInt CWlanSupport::SetIntAttributeL( |
1207 const RMessage2& aMessage, |
1167 const RMessage2& aMessage, |
1208 const TInt aValue ) |
1168 const TInt aValue ) |
1230 LOGEXITFN1("CWlanSupport::SetIntAttributeL()", result) |
1190 LOGEXITFN1("CWlanSupport::SetIntAttributeL()", result) |
1231 return result; |
1191 return result; |
1232 } |
1192 } |
1233 |
1193 |
1234 // ----------------------------------------------------------------------------- |
1194 // ----------------------------------------------------------------------------- |
1235 // CWlanSupport::SetUintAttribute |
1195 // CWlanSupport::SetUintAttributeL |
1236 // ----------------------------------------------------------------------------- |
1196 // ----------------------------------------------------------------------------- |
1237 // |
1197 // |
1238 TInt CWlanSupport::SetUintAttributeL( |
1198 TInt CWlanSupport::SetUintAttributeL( |
1239 const RMessage2& aMessage, |
1199 const RMessage2& aMessage, |
1240 const TUint aValue ) |
1200 const TUint aValue ) |
1262 LOGEXITFN1("CWlanSupport::SetUintAttributeL()", result) |
1222 LOGEXITFN1("CWlanSupport::SetUintAttributeL()", result) |
1263 return result; |
1223 return result; |
1264 } |
1224 } |
1265 |
1225 |
1266 // ----------------------------------------------------------------------------- |
1226 // ----------------------------------------------------------------------------- |
1267 // CWlanSupport::GetIntAttribute |
1227 // CWlanSupport::GetIntAttributeL |
1268 // ----------------------------------------------------------------------------- |
1228 // ----------------------------------------------------------------------------- |
1269 // |
1229 // |
1270 TInt CWlanSupport::GetIntAttributeL( const RMessage2& aMessage, TInt& aValue ) |
1230 TInt CWlanSupport::GetIntAttributeL( const RMessage2& aMessage, TInt& aValue ) |
1271 { |
1231 { |
1272 LOGENTRFN("CWlanSupport::GetIntAttributeL()") |
1232 LOGENTRFN("CWlanSupport::GetIntAttributeL()") |
1291 LOGEXITFN1("CWlanSupport::GetIntAttributeL()", err) |
1251 LOGEXITFN1("CWlanSupport::GetIntAttributeL()", err) |
1292 return err; |
1252 return err; |
1293 } |
1253 } |
1294 |
1254 |
1295 // ----------------------------------------------------------------------------- |
1255 // ----------------------------------------------------------------------------- |
1296 // CWlanSupport::GetUintAttribute |
1256 // CWlanSupport::GetUintAttributeL |
1297 // ----------------------------------------------------------------------------- |
1257 // ----------------------------------------------------------------------------- |
1298 // |
1258 // |
1299 TInt CWlanSupport::GetUintAttributeL( const RMessage2& aMessage, TUint& aValue ) |
1259 TInt CWlanSupport::GetUintAttributeL( const RMessage2& aMessage, TUint& aValue ) |
1300 { |
1260 { |
1301 LOGENTRFN("CWlanSupport::GetUintAttributeL()") |
1261 LOGENTRFN("CWlanSupport::GetUintAttributeL()") |
1320 LOGEXITFN1("CWlanSupport::GetUintAttributeL()", err) |
1280 LOGEXITFN1("CWlanSupport::GetUintAttributeL()", err) |
1321 return err; |
1281 return err; |
1322 } |
1282 } |
1323 |
1283 |
1324 // ----------------------------------------------------------------------------- |
1284 // ----------------------------------------------------------------------------- |
1325 // CWlanSupport::SetStringAttribute |
1285 // CWlanSupport::SetStringAttributeL |
1326 // |
1286 // |
1327 // Currently assumes the descriptor attribute 'aValue' length has been checked |
1287 // Currently assumes the descriptor attribute 'aValue' length has been checked |
1328 // earlier and is short enough. |
1288 // earlier and is short enough. |
1329 // ----------------------------------------------------------------------------- |
1289 // ----------------------------------------------------------------------------- |
1330 // |
1290 // |
1356 LOGEXITFN1("CWlanSupport::SetStringAttributeL()", err) |
1316 LOGEXITFN1("CWlanSupport::SetStringAttributeL()", err) |
1357 return err; |
1317 return err; |
1358 } |
1318 } |
1359 |
1319 |
1360 // ----------------------------------------------------------------------------- |
1320 // ----------------------------------------------------------------------------- |
1361 // CWlanSupport::GetStringAttribute |
1321 // CWlanSupport::GetStringAttributeL |
1362 // ----------------------------------------------------------------------------- |
1322 // ----------------------------------------------------------------------------- |
1363 // |
1323 // |
1364 TInt CWlanSupport::GetStringAttributeL( |
1324 TInt CWlanSupport::GetStringAttributeL( |
1365 const RMessage2& aMessage, |
1325 const RMessage2& aMessage, |
1366 TDes& aValue ) |
1326 TDes& aValue ) |
1467 } |
1427 } |
1468 } |
1428 } |
1469 |
1429 |
1470 LOGEXITFN1("CWlanSupport::WlanRssGoodEnough()", value) |
1430 LOGEXITFN1("CWlanSupport::WlanRssGoodEnough()", value) |
1471 return value; |
1431 return value; |
|
1432 } |
|
1433 |
|
1434 // ----------------------------------------------------------------------------- |
|
1435 // CWlanSupport::ConvertWlan2ConnMonExtSecMode |
|
1436 // ----------------------------------------------------------------------------- |
|
1437 // |
|
1438 TUint CWlanSupport::ConvertWlan2ConnMonExtSecMode(CWlanScanInfo* scanInfo) |
|
1439 { |
|
1440 LOGENTRFN("CWlanSupport::ConvertWlan2ConnMonExtSecMode()") |
|
1441 |
|
1442 TUint securityMode(EConnMonSecurityOpen); |
|
1443 switch (scanInfo->ExtendedSecurityMode()) |
|
1444 { |
|
1445 case EWlanConnectionExtentedSecurityModeOpen: |
|
1446 securityMode = EConnMonSecurityOpen; |
|
1447 break; |
|
1448 |
|
1449 case EWlanConnectionExtentedSecurityModeWepOpen: |
|
1450 case EWlanConnectionExtentedSecurityModeWepShared: |
|
1451 securityMode = EConnMonSecurityWep; |
|
1452 break; |
|
1453 |
|
1454 case EWlanConnectionExtentedSecurityMode802d1x: |
|
1455 securityMode = EConnMonSecurity802d1x; |
|
1456 break; |
|
1457 |
|
1458 case EWlanConnectionExtentedSecurityModeWpa: |
|
1459 case EWlanConnectionExtentedSecurityModeWpa2: |
|
1460 securityMode = EConnMonSecurityWpa; |
|
1461 break; |
|
1462 |
|
1463 case EWlanConnectionExtentedSecurityModeWpaPsk: |
|
1464 case EWlanConnectionExtentedSecurityModeWpa2Psk: |
|
1465 securityMode = EConnMonSecurityWpaPsk; |
|
1466 break; |
|
1467 |
|
1468 case EWlanConnectionExtentedSecurityModeWapi: |
|
1469 case EWlanConnectionExtentedSecurityModeWapiPsk: |
|
1470 default: |
|
1471 securityMode = EConnMonSecurityOpen; |
|
1472 break; |
|
1473 } |
|
1474 |
|
1475 LOGEXITFN1("CWlanSupport::ConvertWlan2ConnMonExtSecMode()", securityMode) |
|
1476 return securityMode; |
1472 } |
1477 } |
1473 |
1478 |
1474 // ============================ MEMBER FUNCTIONS =============================== |
1479 // ============================ MEMBER FUNCTIONS =============================== |
1475 |
1480 |
1476 // ----------------------------------------------------------------------------- |
1481 // ----------------------------------------------------------------------------- |
1786 } |
1791 } |
1787 LOGEXITFN("CWlanSession::SetWlanScanCacheLifetime()") |
1792 LOGEXITFN("CWlanSession::SetWlanScanCacheLifetime()") |
1788 } |
1793 } |
1789 |
1794 |
1790 // ----------------------------------------------------------------------------- |
1795 // ----------------------------------------------------------------------------- |
1791 // CWlanSession::GetScanResults |
1796 // CWlanSession::GetScanResultsL |
1792 // ----------------------------------------------------------------------------- |
1797 // ----------------------------------------------------------------------------- |
1793 // |
1798 // |
1794 void CWlanSession::GetScanResultsL( const RMessage2& aMessage ) |
1799 void CWlanSession::GetScanResultsL( const RMessage2& aMessage ) |
1795 { |
1800 { |
1796 LOGENTRFN("CWlanSession::GetScanResultsL()") |
1801 LOGENTRFN("CWlanSession::GetScanResultsL()") |
2000 } |
2005 } |
2001 //LOGEXITFN("CWlanSession::CompleteActiveRequestsWithError()") |
2006 //LOGEXITFN("CWlanSession::CompleteActiveRequestsWithError()") |
2002 } |
2007 } |
2003 |
2008 |
2004 // ----------------------------------------------------------------------------- |
2009 // ----------------------------------------------------------------------------- |
2005 // CWlanSession::CompleteActiveRequests |
2010 // CWlanSession::CompleteActiveRequestsL |
2006 // ----------------------------------------------------------------------------- |
2011 // ----------------------------------------------------------------------------- |
2007 // |
2012 // |
2008 void CWlanSession::CompleteActiveRequestsL( |
2013 void CWlanSession::CompleteActiveRequestsL( |
2009 const TInt aStatus, |
2014 const TInt aStatus, |
2010 CWlanScanInfo* aScanInfo, |
2015 CWlanScanInfo* aScanInfo, |
2174 |
2179 |
2175 LOGEXITFN("CWlanSession::CompleteGetSignalStrengthRequest()") |
2180 LOGEXITFN("CWlanSession::CompleteGetSignalStrengthRequest()") |
2176 } |
2181 } |
2177 |
2182 |
2178 // ----------------------------------------------------------------------------- |
2183 // ----------------------------------------------------------------------------- |
2179 // CWlanSession::CompleteGetNetworkNamesRequest |
2184 // CWlanSession::CompleteGetNetworkNamesRequestL |
2180 // Completes the asynchronous client request: GetPckgAttribute( KNetworkNames ) |
2185 // Completes the asynchronous client request: GetPckgAttribute( KNetworkNames ) |
2181 // ----------------------------------------------------------------------------- |
2186 // ----------------------------------------------------------------------------- |
2182 // |
2187 // |
2183 void CWlanSession::CompleteGetNetworkNamesRequestL( |
2188 void CWlanSession::CompleteGetNetworkNamesRequestL( |
2184 CWlanScanInfo* aScanInfo, |
2189 CWlanScanInfo* aScanInfo, |
2205 |
2210 |
2206 LOGEXITFN("CWlanSession::CompleteGetNetworkNamesRequestL()") |
2211 LOGEXITFN("CWlanSession::CompleteGetNetworkNamesRequestL()") |
2207 } |
2212 } |
2208 |
2213 |
2209 // ----------------------------------------------------------------------------- |
2214 // ----------------------------------------------------------------------------- |
2210 // CWlanSession::CompleteGetWlanNetworksRequest |
2215 // CWlanSession::CompleteGetWlanNetworksRequestL |
2211 // Completes the asynchronous client request: GetPckgAttribute( KWlanNetworks ) |
2216 // Completes the asynchronous client request: GetPckgAttribute( KWlanNetworks ) |
2212 // ----------------------------------------------------------------------------- |
2217 // ----------------------------------------------------------------------------- |
2213 // |
2218 // |
2214 void CWlanSession::CompleteGetWlanNetworksRequestL( |
2219 void CWlanSession::CompleteGetWlanNetworksRequestL( |
2215 CWlanScanInfo* aScanInfo, |
2220 CWlanScanInfo* aScanInfo, |
2257 |
2262 |
2258 LOGEXITFN("CWlanSession::CompleteGetWlanNetworksRequestL()") |
2263 LOGEXITFN("CWlanSession::CompleteGetWlanNetworksRequestL()") |
2259 } |
2264 } |
2260 |
2265 |
2261 // ----------------------------------------------------------------------------- |
2266 // ----------------------------------------------------------------------------- |
2262 // CWlanSession::CompleteGetWlanSsidNetworksRequest |
2267 // CWlanSession::CompleteGetWlanSsidNetworksRequestL |
2263 // Completes the asynchronous client request: GetPckgAttribute( KWlanSsidNetworks ) |
2268 // Completes the asynchronous client request: GetPckgAttribute( KWlanSsidNetworks ) |
2264 // ----------------------------------------------------------------------------- |
2269 // ----------------------------------------------------------------------------- |
2265 // |
2270 // |
2266 void CWlanSession::CompleteGetWlanSsidNetworksRequestL( |
2271 void CWlanSession::CompleteGetWlanSsidNetworksRequestL( |
2267 CWlanScanInfo* aScanInfo, |
2272 CWlanScanInfo* aScanInfo, |
2309 |
2314 |
2310 LOGEXITFN("CWlanSession::CompleteGetWlanSsidNetworksRequestL()") |
2315 LOGEXITFN("CWlanSession::CompleteGetWlanSsidNetworksRequestL()") |
2311 } |
2316 } |
2312 |
2317 |
2313 // ----------------------------------------------------------------------------- |
2318 // ----------------------------------------------------------------------------- |
2314 // CWlanSession::CompleteGetWlanProbeRawBuffersRequest |
2319 // CWlanSession::CompleteGetWlanProbeRawBuffersRequestL |
2315 // Completes the asynchronous client request: GetPckgAttribute( KWlanProbeRawBuffers ) |
2320 // Completes the asynchronous client request: GetPckgAttribute( KWlanProbeRawBuffers ) |
2316 // ----------------------------------------------------------------------------- |
2321 // ----------------------------------------------------------------------------- |
2317 // |
2322 // |
2318 void CWlanSession::CompleteGetWlanProbeRawBuffersRequestL( |
2323 void CWlanSession::CompleteGetWlanProbeRawBuffersRequestL( |
2319 CWlanScanInfo* aScanInfo, |
2324 CWlanScanInfo* aScanInfo, |