794 TInt CWlanMgmtImpl::StartAggressiveBgScan( |
794 TInt CWlanMgmtImpl::StartAggressiveBgScan( |
795 TUint aInterval ) |
795 TUint aInterval ) |
796 { |
796 { |
797 TraceDump( INFO_LEVEL, ( _L( "CWlanMgmtImpl::StartAggressiveBgScan()" ) ) ); |
797 TraceDump( INFO_LEVEL, ( _L( "CWlanMgmtImpl::StartAggressiveBgScan()" ) ) ); |
798 return iServer.StartAggressiveBgScan( aInterval ); |
798 return iServer.StartAggressiveBgScan( aInterval ); |
|
799 } |
|
800 |
|
801 // --------------------------------------------------------- |
|
802 // CWlanMgmtImpl::GetAvailableIaps |
|
803 // --------------------------------------------------------- |
|
804 // |
|
805 void CWlanMgmtImpl::GetAvailableIaps( |
|
806 TInt& aCacheLifetime, |
|
807 TUint& aMaxDelay, |
|
808 TBool aFilteredResults, |
|
809 TRequestStatus& aStatus, |
|
810 RArray<TWlanIapAvailabilityData>& aAvailableIaps ) |
|
811 { |
|
812 TraceDump( INFO_LEVEL, ( _L( "CWlanMgmtImpl::GetAvailableIaps() (async)" ) ) ); |
|
813 |
|
814 aAvailableIaps.Reset(); |
|
815 |
|
816 aStatus = KRequestPending; |
|
817 iPendingAvailableIapsStatus = &aStatus; |
|
818 iAvailableIapsRequest = new CWlanAvailableIapsRequest( *this, iServer, aAvailableIaps, aCacheLifetime, aMaxDelay, aFilteredResults ); |
|
819 if ( !iAvailableIapsRequest ) |
|
820 { |
|
821 User::RequestComplete( iPendingAvailableIapsStatus, KErrNoMemory ); |
|
822 iPendingAvailableIapsStatus = NULL; |
|
823 return; |
|
824 } |
|
825 iAvailableIapsRequest->IssueRequest(); |
799 } |
826 } |
800 |
827 |
801 // --------------------------------------------------------- |
828 // --------------------------------------------------------- |
802 // CWlanMgmtImpl::ScanComplete |
829 // CWlanMgmtImpl::ScanComplete |
803 // --------------------------------------------------------- |
830 // --------------------------------------------------------- |
1067 TInt& aCacheLifetime, |
1094 TInt& aCacheLifetime, |
1068 TUint& aMaxDelay ) : |
1095 TUint& aMaxDelay ) : |
1069 CActive( CActive::EPriorityStandard ), |
1096 CActive( CActive::EPriorityStandard ), |
1070 iCallback( aCallback ), |
1097 iCallback( aCallback ), |
1071 iServer( aServer ), |
1098 iServer( aServer ), |
1072 iPendingAvailableIaps( aAvailableIaps ), |
1099 iPendingAvailableIapIds( &aAvailableIaps ), |
|
1100 iPendingAvailableIaps( NULL ), |
1073 iAvailableIapsBuf( iAvailableIaps ), |
1101 iAvailableIapsBuf( iAvailableIaps ), |
1074 iCacheLifetimeBuf( aCacheLifetime ), |
1102 iCacheLifetimeBuf( aCacheLifetime ), |
1075 iMaxDelayBuf( aMaxDelay ) |
1103 iMaxDelayBuf( aMaxDelay ), |
|
1104 iFilteredResults( ETrue ) |
1076 { |
1105 { |
1077 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::CWlanAvailableIapsRequest()" ) ) ); |
1106 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::CWlanAvailableIapsRequest()" ) ) ); |
1078 CActiveScheduler::Add( this ); |
1107 CActiveScheduler::Add( this ); |
1079 } |
1108 } |
1080 |
1109 |
|
1110 // C++ default constructor can NOT contain any code, that |
|
1111 // might leave. |
|
1112 // |
|
1113 CWlanAvailableIapsRequest::CWlanAvailableIapsRequest( |
|
1114 CWlanMgmtImpl& aCallback, |
|
1115 RWLMServer& aServer, |
|
1116 RArray<TWlanIapAvailabilityData>& aAvailableIaps, |
|
1117 TInt& aCacheLifetime, |
|
1118 TUint& aMaxDelay, |
|
1119 TBool aFilteredResults ) : |
|
1120 CActive( CActive::EPriorityStandard ), |
|
1121 iCallback( aCallback ), |
|
1122 iServer( aServer ), |
|
1123 iPendingAvailableIapIds( NULL ), |
|
1124 iPendingAvailableIaps( &aAvailableIaps ), |
|
1125 iAvailableIapsBuf( iAvailableIaps ), |
|
1126 iCacheLifetimeBuf( aCacheLifetime ), |
|
1127 iMaxDelayBuf( aMaxDelay ), |
|
1128 iFilteredResults( aFilteredResults ) |
|
1129 { |
|
1130 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::CWlanAvailableIapsRequest()" ) ) ); |
|
1131 CActiveScheduler::Add( this ); |
|
1132 } |
|
1133 |
1081 // Destructor |
1134 // Destructor |
1082 CWlanAvailableIapsRequest::~CWlanAvailableIapsRequest() |
1135 CWlanAvailableIapsRequest::~CWlanAvailableIapsRequest() |
1083 { |
1136 { |
1084 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::CWlanAvailableIapsRequest()" ) ) ); |
1137 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::CWlanAvailableIapsRequest()" ) ) ); |
1085 Cancel(); |
1138 Cancel(); |
|
1139 iPendingAvailableIapIds = NULL; |
|
1140 iPendingAvailableIaps = NULL; |
1086 } |
1141 } |
1087 |
1142 |
1088 // --------------------------------------------------------- |
1143 // --------------------------------------------------------- |
1089 // CWlanAvailableIapsRequest::IssueRequest |
1144 // CWlanAvailableIapsRequest::IssueRequest |
1090 // --------------------------------------------------------- |
1145 // --------------------------------------------------------- |
1091 // |
1146 // |
1092 void CWlanAvailableIapsRequest::IssueRequest() |
1147 void CWlanAvailableIapsRequest::IssueRequest() |
1093 { |
1148 { |
1094 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::IssueRequest()" ) ) ); |
1149 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::IssueRequest()" ) ) ); |
1095 iServer.GetAvailableIaps( iAvailableIapsBuf, iCacheLifetimeBuf, iMaxDelayBuf, iStatus ); |
1150 iServer.GetAvailableIaps( iAvailableIapsBuf, iCacheLifetimeBuf, iMaxDelayBuf, iFilteredResults, iStatus ); |
1096 SetActive(); |
1151 SetActive(); |
1097 } |
1152 } |
1098 |
1153 |
1099 // --------------------------------------------------------- |
1154 // --------------------------------------------------------- |
1100 // CWlanAvailableIapsRequest::RunL |
1155 // CWlanAvailableIapsRequest::RunL |
1101 // --------------------------------------------------------- |
1156 // --------------------------------------------------------- |
1102 // |
1157 // |
1103 void CWlanAvailableIapsRequest::RunL() |
1158 void CWlanAvailableIapsRequest::RunL() |
1104 { |
1159 { |
1105 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::RunL()" ) ) ); |
1160 TraceDump( INFO_LEVEL, ( _L( "CWlanAvailableIapsRequest::RunL()" ) ) ); |
1106 for ( TUint idx( 0 ); idx < iAvailableIaps.count; ++idx ) |
1161 if( iPendingAvailableIapIds ) |
1107 { |
1162 { |
1108 iPendingAvailableIaps.Append( iAvailableIaps.iaps[idx] ); |
1163 for ( TUint idx( 0 ); idx < iAvailableIaps.count; ++idx ) |
|
1164 { |
|
1165 iPendingAvailableIapIds->Append( iAvailableIaps.iaps[idx].iapId ); |
|
1166 } |
|
1167 } |
|
1168 else if( iPendingAvailableIaps ) |
|
1169 { |
|
1170 for ( TUint idx( 0 ); idx < iAvailableIaps.count; ++idx ) |
|
1171 { |
|
1172 TWlanIapAvailabilityData tmp; |
|
1173 tmp.iIapId = iAvailableIaps.iaps[idx].iapId; |
|
1174 // RCPI -> RSSI CONVERSION |
|
1175 // Note: conversion may round the result by 0.5 units |
|
1176 tmp.iRssi = ( 110 - ( iAvailableIaps.iaps[idx].rcpi / 2 ) ); |
|
1177 iPendingAvailableIaps->Append( tmp ); |
|
1178 } |
1109 } |
1179 } |
1110 iCallback.AvailableIapsComplete( iStatus.Int() ); |
1180 iCallback.AvailableIapsComplete( iStatus.Int() ); |
1111 } |
1181 } |
1112 |
1182 |
1113 // --------------------------------------------------------- |
1183 // --------------------------------------------------------- |