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