130 void CBTEngDeviceSearch::CancelSearch() |
125 void CBTEngDeviceSearch::CancelSearch() |
131 { |
126 { |
132 TRACE_FUNC_ENTRY |
127 TRACE_FUNC_ENTRY |
133 if( iActive->IsActive() && iClientReq == EDeviceSearch) |
128 if( iActive->IsActive() && iClientReq == EDeviceSearch) |
134 { |
129 { |
|
130 iActive->Cancel(); |
135 if (iActive->RequestId() == KDevSearchAoReqId) |
131 if (iActive->RequestId() == KDevSearchAoReqId) |
136 { |
132 { |
137 iNotifier.CancelNotifier( KDeviceSelectionNotifierUid ); |
|
138 iActive->CancelRequest(); |
|
139 iNotifier.Close(); |
133 iNotifier.Close(); |
140 NotifyClient(KErrAbort); |
134 NotifyClient(KErrAbort); |
141 } |
135 } |
142 else if (iActive->RequestId() == KDevEirServiceListAoReqId) |
136 else if (iActive->RequestId() == KDevEirServiceListAoReqId) |
143 { |
137 { |
144 iHostResolver.Cancel(); |
|
145 iHostResolver.Close(); |
138 iHostResolver.Close(); |
146 } |
139 } |
147 } |
140 } |
148 |
|
149 TRACE_FUNC_EXIT |
141 TRACE_FUNC_EXIT |
150 } |
142 } |
151 |
143 |
152 // --------------------------------------------------------------------------- |
144 // --------------------------------------------------------------------------- |
153 // Get cached EIR data from host resolver and extract service uuids |
145 // Get cached EIR data from host resolver and extract service uuids |
180 void CBTEngDeviceSearch::CancelGetEirServiceUUIDs() |
172 void CBTEngDeviceSearch::CancelGetEirServiceUUIDs() |
181 { |
173 { |
182 TRACE_FUNC_ENTRY |
174 TRACE_FUNC_ENTRY |
183 if( iActive->IsActive() && iClientReq == EGetDeviceEir) |
175 if( iActive->IsActive() && iClientReq == EGetDeviceEir) |
184 { |
176 { |
185 iHostResolver.Cancel(); |
177 iActive->Cancel(); |
186 iHostResolver.Close(); |
178 iHostResolver.Close(); |
187 } |
179 } |
188 TRACE_FUNC_EXIT |
180 TRACE_FUNC_EXIT |
189 } |
181 } |
190 |
182 |
191 // --------------------------------------------------------------------------- |
183 // --------------------------------------------------------------------------- |
192 // From class MBTEngActiveObserver. |
184 // From class MBTEngActiveObserver. |
193 // Callback to notify that an outstanding request has completed. |
185 // Callback to notify that an outstanding request has completed. |
194 // --------------------------------------------------------------------------- |
186 // --------------------------------------------------------------------------- |
195 // |
187 // |
196 void CBTEngDeviceSearch::RequestCompletedL( CBTEngActive* aActive, TInt aId, |
188 void CBTEngDeviceSearch::RequestCompletedL( CBTEngActive* aActive, |
197 TInt aStatus ) |
189 TInt aStatus ) |
198 { |
190 { |
199 TRACE_FUNC_ARG( ( _L( "status: %d") , aStatus ) ) |
191 TRACE_FUNC_ARG( ( _L( "status: %d") , aStatus ) ) |
200 (void) aActive; |
192 (void) aActive; |
201 if ( aId == KDevSearchAoReqId ) |
193 if ( aActive->RequestId() == KDevSearchAoReqId ) |
202 { |
194 { |
203 HandleDeviceSelectionResultL(aStatus); |
195 HandleDeviceSelectionResultL(aStatus); |
204 } |
196 } |
205 else if (aId == KDevEirServiceListAoReqId) |
197 else if ( aActive->RequestId() == KDevEirServiceListAoReqId ) |
206 { |
198 { |
207 HandleDeviceEirDataResult( aStatus ); |
199 HandleDeviceEirDataResult( aStatus ); |
208 } |
200 } |
209 TRACE_FUNC_EXIT |
201 TRACE_FUNC_EXIT |
|
202 } |
|
203 |
|
204 // --------------------------------------------------------------------------- |
|
205 // From class MBTEngActiveObserver. |
|
206 // Handles cancelation of an outstanding request |
|
207 // --------------------------------------------------------------------------- |
|
208 // |
|
209 void CBTEngDeviceSearch::CancelRequest( TInt aRequestId ) |
|
210 { |
|
211 TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) ) |
|
212 if ( aRequestId == KDevSearchAoReqId ) |
|
213 { |
|
214 iNotifier.CancelNotifier( KDeviceSelectionNotifierUid ); |
|
215 } |
|
216 else if ( aRequestId == KDevEirServiceListAoReqId ) |
|
217 { |
|
218 iHostResolver.Cancel(); |
|
219 } |
|
220 TRACE_FUNC_EXIT |
210 } |
221 } |
211 |
222 |
212 // --------------------------------------------------------------------------- |
223 // --------------------------------------------------------------------------- |
213 // From class MBTEngActiveObserver. |
224 // From class MBTEngActiveObserver. |
214 // Callback to notify that an error has occurred in RunL. |
225 // Callback to notify that an error has occurred in RunL. |
215 // --------------------------------------------------------------------------- |
226 // --------------------------------------------------------------------------- |
216 // |
227 // |
217 void CBTEngDeviceSearch::HandleError( CBTEngActive* aActive, TInt aId, |
228 void CBTEngDeviceSearch::HandleError( CBTEngActive* aActive, |
218 TInt aError ) |
229 TInt aError ) |
219 { |
230 { |
220 TRACE_FUNC_ARG( ( _L( "error: %d") , aError ) ) |
231 TRACE_FUNC_ARG( ( _L( "error: %d") , aError ) ) |
221 (void) aActive; |
232 (void) aActive; |
222 (void) aId; |
|
223 iNotifier.Close(); |
233 iNotifier.Close(); |
224 iHostResolver.Close(); |
234 iHostResolver.Close(); |
225 NotifyClient(aError); |
235 NotifyClient(aError); |
226 } |
236 } |
227 |
237 |