|
1 /* |
|
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This module contains the implementation of CNWNetworkMcnEngine |
|
15 * class member functions. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "CNWGsmSessionImplementation.h" |
|
23 #include "CNWGsmMessageHandler.h" |
|
24 #include "CNWNetworkMCNEngine.h" |
|
25 #include "CNWNetworkMcnTimer.h" |
|
26 #include "NWPanic.pan" |
|
27 #include "NWLogger.h" |
|
28 #include <CMcn.h> |
|
29 #include <CMcnTopicArray.h> |
|
30 #include <centralrepository.h> |
|
31 #include <SettingsInternalCRKeys.h> |
|
32 |
|
33 // CONSTANTS |
|
34 const TUint KNWzero = 0; |
|
35 const TInt KMCNOn = 1; |
|
36 const TInt KMCNOff = 0; |
|
37 |
|
38 |
|
39 // ============================ MEMBER FUNCTIONS ============================== |
|
40 |
|
41 // ---------------------------------------------------------------------------- |
|
42 // CNWNetworkMcnEngine::CNWNetworkMcnEngine |
|
43 // C++ default constructor can NOT contain any code, that |
|
44 // might leave. |
|
45 // ---------------------------------------------------------------------------- |
|
46 // |
|
47 CNWNetworkMcnEngine::CNWNetworkMcnEngine( |
|
48 CNWGsmMessageHandler& aMessageHandler, |
|
49 TNWInfo& aNetworkInfo, // ref. to network info struct |
|
50 RMmCustomAPI& aCustomAPI, //ref. to customAPI |
|
51 CNWGsmNetworkCellReselectionHandler& aCellReselectionHandler ) |
|
52 : CActive( EPriorityStandard ), |
|
53 iGsmMessageHandler( aMessageHandler ), |
|
54 iNWNetworkInfo( aNetworkInfo ), |
|
55 iCustomAPI( aCustomAPI ), |
|
56 iCellReselectionHandler( aCellReselectionHandler ) |
|
57 { |
|
58 NWLOGSTRING( KNWINT, |
|
59 "NW:CNWNetworkMcnEngine::CNWNetworkMcnEngine() Begin" ); |
|
60 |
|
61 iComparedCellId = KNWzero; //new cellId that will be used to comparization |
|
62 iListenMCNDisplay = EFalse; //Boolean indicating if to listen MCN Display area |
|
63 |
|
64 CActiveScheduler::Add( this ); |
|
65 |
|
66 NWLOGSTRING( KNWOBJECT, |
|
67 "NW: CNWNetworkMcnEngine::CNWNetworkMcnEngine() End"); |
|
68 } |
|
69 |
|
70 // ---------------------------------------------------------------------------- |
|
71 // CNWNetworkMcnEngine::NewL |
|
72 // Symbian two phased constructor. |
|
73 // ---------------------------------------------------------------------------- |
|
74 // |
|
75 CNWNetworkMcnEngine* CNWNetworkMcnEngine::NewL( |
|
76 CNWGsmMessageHandler& aMessageHandler, |
|
77 TNWInfo& aNetworkInfo, // ref. to network info struct |
|
78 RMmCustomAPI& aCustomAPI, // ref. to customAPI |
|
79 CNWGsmNetworkCellReselectionHandler& aCellReselectionHandler ) |
|
80 { |
|
81 NWLOGSTRING( KNWINT, |
|
82 "NW:CNWNetworkMcnEngine::NewL() Begin" ); |
|
83 |
|
84 CNWNetworkMcnEngine* self = new (ELeave) CNWNetworkMcnEngine( |
|
85 aMessageHandler, |
|
86 aNetworkInfo, |
|
87 aCustomAPI, |
|
88 aCellReselectionHandler ); |
|
89 |
|
90 CleanupStack::PushL( self ); |
|
91 self->ConstructL(); |
|
92 CleanupStack::Pop( self ); |
|
93 |
|
94 NWLOGSTRING( KNWINT, |
|
95 "NW:CNWNetworkMcnEngine::NewL() Begin" ); |
|
96 |
|
97 return self; |
|
98 } |
|
99 |
|
100 // ---------------------------------------------------------------------------- |
|
101 // CNWNetworkMcnEngine::ConstructL |
|
102 // Symbian default constructor can leave. |
|
103 // ---------------------------------------------------------------------------- |
|
104 // |
|
105 void CNWNetworkMcnEngine::ConstructL() |
|
106 { |
|
107 NWLOGSTRING( KNWINT, |
|
108 "NW:CNWNetworkMcnEngine::ConstructL() Begin" ); |
|
109 |
|
110 iTimer = CNWNetworkMcnTimer::NewL(); |
|
111 |
|
112 // Connecting and initialization |
|
113 iRepository = CRepository::NewL( KCRUidNetworkSettings ); |
|
114 |
|
115 // Get the value from Central Repository |
|
116 iRepository->Get( KSettingsMcnDisplay, iListenMCNDisplay ); |
|
117 NWLOGSTRING( KNWMESOUT, |
|
118 "NW: CNWNetworkMCNEngine::ConstructL: CRepository->Get() called" ); |
|
119 NotifyMcnDisplayChanged(); |
|
120 // Reset initial values |
|
121 ResetIndicatorValues(); |
|
122 |
|
123 NWLOGSTRING( KNWINT, |
|
124 "NW:CNWNetworkMcnEngine::ConstructL() Begin" ); |
|
125 } |
|
126 |
|
127 // ---------------------------------------------------------------------------- |
|
128 // CNWNetworkMcnEngine::~CNWNetworkMcnEngine |
|
129 // Destructor |
|
130 // ---------------------------------------------------------------------------- |
|
131 // |
|
132 CNWNetworkMcnEngine::~CNWNetworkMcnEngine() |
|
133 { |
|
134 NWLOGSTRING( KNWINT, |
|
135 "NW:CNWNetworkMcnEngine::~CNWNetworkMcnEngine() Begin" ); |
|
136 |
|
137 Cancel(); |
|
138 |
|
139 if( iMcn ) |
|
140 { |
|
141 if( iCBSState == EListeningMCN ) |
|
142 { |
|
143 iMcn->Unregister( this ); |
|
144 NWLOGSTRING( KNWMESOUT, |
|
145 "NW: CNWNetworkMCNEngine::~CNWNetworkMcnEngine: \ |
|
146 iMcn->Unregister() called" ); |
|
147 } |
|
148 iMcn = NULL; // CNWGsmNetworkCellReselectionHandler has ownership of iMcn. |
|
149 } |
|
150 |
|
151 delete iRepository; |
|
152 delete iTimer; |
|
153 |
|
154 NWLOGSTRING( KNWOBJECT, |
|
155 "NW: CNWNetworkMcnEngine::~CNWNetworkMcnEngine() End"); |
|
156 } |
|
157 |
|
158 // ---------------------------------------------------------------------------- |
|
159 // CNWNetworkMcnEngine::CellInfoChanged |
|
160 // Gets called when a message of a subscribed topic is received from the |
|
161 // network. |
|
162 // (other items were commented in a header). |
|
163 // ---------------------------------------------------------------------------- |
|
164 // |
|
165 TInt CNWNetworkMcnEngine::CellInfoChanged( |
|
166 const TCbsMcnMessage& aMcnMessage ) //MCN message received from the network |
|
167 { |
|
168 NWLOGSTRING3( KNWOBJECT, |
|
169 "NW: CNWNetworkMcnEngine::CellInfoChanged() Begin,\ |
|
170 aMcnMessage.iTopicNumber = %d, aMcnMessage.iNetworkMode = %d ", |
|
171 aMcnMessage.iTopicNumber, aMcnMessage.iNetworkMode ); |
|
172 |
|
173 TInt errorCode = HandleCBSMessages( aMcnMessage ); |
|
174 if ( errorCode == KErrNone ) |
|
175 { |
|
176 iGsmMessageHandler.SendMessage( |
|
177 MNWMessageObserver::ENWMessageCurrentCellInfoMessage ); |
|
178 } |
|
179 |
|
180 NWLOGSTRING( KNWOBJECT, |
|
181 "NW: CNWNetworkMcnEngine::CellInfoChanged() End"); |
|
182 return KErrNone; |
|
183 } |
|
184 |
|
185 // ---------------------------------------------------------------------------- |
|
186 // CNWNetworkMcnEngine::SharedDataCallBack |
|
187 // This is a static callback function which is called when a Shared Data's |
|
188 // notify event completes. |
|
189 // (other items were commented in a header). |
|
190 // ---------------------------------------------------------------------------- |
|
191 // |
|
192 TInt CNWNetworkMcnEngine::SharedDataCallBack( |
|
193 TAny* aAny ) |
|
194 { |
|
195 NWLOGSTRING( KNWOBJECT, |
|
196 "NW: CNWNetworkMcnEngine::SharedDataCallBack() Begin"); |
|
197 |
|
198 CNWNetworkMcnEngine* self = static_cast<CNWNetworkMcnEngine*>( aAny ); |
|
199 self->GetMcnDisplayValue(); |
|
200 |
|
201 NWLOGSTRING( KNWOBJECT, |
|
202 "NW: CNWNetworkMcnEngine::SharedDataCallBack() End"); |
|
203 return KErrNone; |
|
204 } |
|
205 |
|
206 // ---------------------------------------------------------------------------- |
|
207 // CNWNetworkMcnEngine::GetMcnDisplayValue |
|
208 // Description: This function reads MCN display value from Shared Data or from |
|
209 // Central Repository and decides if to listen for MCN display info changes. |
|
210 // (other items were commented in a header). |
|
211 // ---------------------------------------------------------------------------- |
|
212 // |
|
213 void CNWNetworkMcnEngine::GetMcnDisplayValue() |
|
214 { |
|
215 NWLOGSTRING( KNWOBJECT, |
|
216 "NW: CNWNetworkMcnEngine::GetMcnDisplayValue() Begin"); |
|
217 |
|
218 TInt uid( 0 ); |
|
219 // Get the value from Central Repository |
|
220 iRepository->Get( KSettingsMcnDisplay, uid ); |
|
221 NWLOGSTRING( KNWMESOUT, |
|
222 "NW: CNWNetworkMCNEngine::GetMcnDisplayValue: \ |
|
223 CRepository->Get() called" ); |
|
224 |
|
225 //when cell info display value changes to |
|
226 if( uid == KMCNOn ) |
|
227 { |
|
228 NWLOGSTRING( KNWINT, |
|
229 "NW: CNWNetworkMCNEngine::GetMcnDisplayValue: MCN changed to ON" ); |
|
230 iListenMCNDisplay = ETrue; |
|
231 StartIndicatorHandling(); |
|
232 } |
|
233 else if( uid == KMCNOff ) |
|
234 { |
|
235 NWLOGSTRING( KNWINT, |
|
236 "NW: CNWNetworkMCNEngine::GetMcnDisplayValue: MCN changed to OFF"); |
|
237 // cancel timer and unregister |
|
238 iTimer->Cancel(); |
|
239 if( iMcn ) |
|
240 { |
|
241 iMcn->Unregister( this ); |
|
242 NWLOGSTRING( KNWMESOUT, |
|
243 "NW: CNWNetworkMCNEngine::GetMcnDisplayValue: \ |
|
244 iMcn->Unregister() called"); |
|
245 } |
|
246 iState = EIdle; |
|
247 iCBSState = EListeningNone; |
|
248 iListenMCNDisplay = EFalse; |
|
249 |
|
250 ResetIndicatorValues(); |
|
251 |
|
252 NWLOGSTRING( KNWINT, "NW: CNWNetworkMCNEngine::MCN Displaying"); |
|
253 iGsmMessageHandler.SendMessage( |
|
254 MNWMessageObserver::ENWMessageCurrentCellInfoMessage ); |
|
255 } |
|
256 |
|
257 NWLOGSTRING( KNWOBJECT, |
|
258 "NW: CNWNetworkMcnEngine::GetMcnDisplayValue() End"); |
|
259 } |
|
260 |
|
261 // ---------------------------------------------------------------------------- |
|
262 // CNWNetworkMcnEngine::CellReselection |
|
263 // Is called by CNWNetworkCurrentNetworkMonitor in case of cell |
|
264 // re-selection. |
|
265 // (other items were commented in a header). |
|
266 // ---------------------------------------------------------------------------- |
|
267 // |
|
268 void CNWNetworkMcnEngine::CellReselection() |
|
269 { |
|
270 NWLOGSTRING( KNWINT, |
|
271 "NW: CNWNetworkMCNEngine::CellReselection() Begin" ); |
|
272 |
|
273 StartIndicatorHandling(); |
|
274 |
|
275 NWLOGSTRING( KNWOBJECT, |
|
276 "NW: CNWNetworkMcnEngine::CellReselection() End"); |
|
277 } |
|
278 |
|
279 // ---------------------------------------------------------------------------- |
|
280 // CNWNetworkMcnEngine::RegisterToCBS |
|
281 // Registers to listening CBS messages. |
|
282 // (other items were commented in a header). |
|
283 // ---------------------------------------------------------------------------- |
|
284 // |
|
285 void CNWNetworkMcnEngine::RegisterToCBSL( |
|
286 TUint16 aTopic ) |
|
287 { |
|
288 NWLOGSTRING( KNWINT, |
|
289 "NW: CNWNetworkMCNEngine::RegisterToCBSL() Begin" ); |
|
290 |
|
291 // Specify topics with CMcnTopicArray. |
|
292 CMcnTopicArray* topics = CMcnTopicArray::NewL(); |
|
293 CleanupStack::PushL( topics ); |
|
294 topics->AddCbTopicL( aTopic ); // MCN Info (cell info) |
|
295 |
|
296 iMcn = iCellReselectionHandler.GetMcnPtr(); |
|
297 |
|
298 if( iMcn ) |
|
299 { |
|
300 NWLOGSTRING( KNWMESOUT, |
|
301 "NW: CNWNetworkMCNEngine::RegisterToCBS: \ |
|
302 iMcn->RegisterL() called" ); |
|
303 // Register. Parameter observer is an instance of CCbsMcnObserver. |
|
304 iMcn->RegisterL( this, *topics ); |
|
305 NWLOGSTRING( KNWINT, |
|
306 "NW: CNWNetworkMCNEngine::RegisterToCBS: \ |
|
307 Registered to MCN messages" ); |
|
308 } |
|
309 else |
|
310 { |
|
311 NWLOGSTRING( KNWINT, |
|
312 "NW: CNWNetworkMcnEngine::RegisterToCBSL: iMcn = NULL" ); |
|
313 } |
|
314 |
|
315 CleanupStack::PopAndDestroy( topics ); |
|
316 |
|
317 NWLOGSTRING( KNWINT, |
|
318 "NW: CNWNetworkMCNEngine::RegisterToCBSL() End " ); |
|
319 } |
|
320 // ---------------------------------------------------------------------------- |
|
321 // CNWNetworkMcnEngine::StartIndicatorHandling |
|
322 // Handles MCN display. |
|
323 // (other items were commented in a header). |
|
324 // ---------------------------------------------------------------------------- |
|
325 // |
|
326 void CNWNetworkMcnEngine::StartIndicatorHandling() |
|
327 { |
|
328 NWLOGSTRING( KNWINT, |
|
329 "NW: CNWNetworkMCNEngine::StartIndicatorHandling() Begin" ); |
|
330 |
|
331 if( iListenMCNDisplay ) |
|
332 { |
|
333 NWLOGSTRING( KNWINT, |
|
334 "NW: CNWNetworkMCNEngine::StartIndicatorHandling: MCN ON" ); |
|
335 if( iCBSState != EListeningMCN ) |
|
336 { |
|
337 TRAPD( err, RegisterToCBSL( KNWMcnMsgId ) ); |
|
338 if( err != KErrNone ) |
|
339 { |
|
340 NWLOGSTRING( KNWERROR, |
|
341 "NW: CNWNetworkMcnEngine::StartIndicatorHandling: \ |
|
342 Couldn't register to CBS messages ! "); |
|
343 ResetIndicatorValues(); |
|
344 iGsmMessageHandler.SendMessage( |
|
345 MNWMessageObserver::ENWMessageCurrentCellInfoMessage ); |
|
346 } |
|
347 else |
|
348 { |
|
349 if ( iMcn ) |
|
350 { |
|
351 iCBSState = EListeningMCN; |
|
352 } |
|
353 } |
|
354 } |
|
355 |
|
356 //Put timer on and wait for max 5 seconds if there is |
|
357 //MCN display active, else wait 120secs. |
|
358 //Set the timer to 120secs is used to wait the message arrival. |
|
359 //If past 120secs, it may be a network problem. |
|
360 //So no need to wait any more, cancel the timer to save resource |
|
361 if( iNWNetworkInfo.iMCNIndicatorType == ENWMCNIndicatorTypeActive ) |
|
362 { |
|
363 iTimer->Cancel(); |
|
364 iTimer->After( KWaitTimeToClearOldMcnIndicator, this ); |
|
365 iState=ECbsWaitingToClearMcnIndicator; |
|
366 NWLOGSTRING( KNWINT, |
|
367 "NW: CNWNetworkMCNEngine::StartIndicatorHandling: \ |
|
368 Started 5s timer" ); |
|
369 } |
|
370 else |
|
371 { |
|
372 iTimer->Cancel(); |
|
373 iTimer->After( KWaitTimeForNewMcn, this ); |
|
374 iState=ECbsWaitingForNewMcn; |
|
375 NWLOGSTRING( KNWINT, |
|
376 "NW: CNWNetworkMCNEngine::StartIndicatorHandling: Started\ |
|
377 120s timer" ); |
|
378 } |
|
379 } |
|
380 else if( iNWNetworkInfo.iMCNIndicatorType == ENWMCNIndicatorTypeActive ) |
|
381 { |
|
382 NWLOGSTRING( KNWINT, |
|
383 "NW: CNWNetworkMCNEngine::StartIndicatorHandling: MCN Displaying"); |
|
384 ResetIndicatorValues(); |
|
385 iGsmMessageHandler.SendMessage( |
|
386 MNWMessageObserver::ENWMessageCurrentCellInfoMessage ); |
|
387 } |
|
388 |
|
389 NWLOGSTRING( KNWINT, |
|
390 "NW: CNWNetworkMCNEngine::StartIndicatorHandling() Begin" ); |
|
391 } |
|
392 |
|
393 // ---------------------------------------------------------------------------- |
|
394 // CNWNetworkMcnEngine::HandleCBSMessages |
|
395 // Handles CBS messages. |
|
396 // (other items were commented in a header). |
|
397 // ---------------------------------------------------------------------------- |
|
398 // |
|
399 TInt CNWNetworkMcnEngine::HandleCBSMessages( |
|
400 const TCbsMcnMessage& aMcnMessage )//MCN message received from the network. |
|
401 { |
|
402 NWLOGSTRING2( KNWINT, |
|
403 "NW: CNWNetworkMCNEngine::HandleCBSMessages() Begin,\ |
|
404 aMcnMessage.iTopicNumber = %d ", aMcnMessage.iTopicNumber ); |
|
405 |
|
406 //Retrieve CBS message data |
|
407 TMcnMessage mcnInfo = aMcnMessage.iBuffer; |
|
408 TInt length = mcnInfo.Length(); |
|
409 TInt err=KErrNone; |
|
410 |
|
411 //MCN Display message, check that we really are listening it |
|
412 if( aMcnMessage.iTopicNumber == KNWMcnMsgId && iCBSState == EListeningMCN ) |
|
413 { |
|
414 if ( length > KCbsMcnMessageMaxLength ) |
|
415 { |
|
416 NWLOGSTRING( KNWINT, |
|
417 "NW: CNWNetworkMCNEngine::HandleCBSMessages() End,\ |
|
418 Incorrect message" ); |
|
419 //incorrect message. Nothing to do |
|
420 return KErrArgument; |
|
421 } |
|
422 |
|
423 NWLOGSTRING( KNWINT, |
|
424 "NW: CNWNetworkMCNEngine::HandleCBSMessages: \ |
|
425 MCN message arrived" ); |
|
426 // cancel timer and unregister |
|
427 iTimer->Cancel(); |
|
428 iState = EIdle; |
|
429 if( iMcn ) |
|
430 { |
|
431 iMcn->Unregister( this ); |
|
432 NWLOGSTRING( KNWMESOUT, |
|
433 "NW: CNWNetworkMCNEngine::HandleCBSMessages: \ |
|
434 iMcn.Unregister() called" ); |
|
435 } |
|
436 iCBSState = EListeningNone; |
|
437 |
|
438 if ( length > KNWMCNNameLength ) |
|
439 { |
|
440 iNWNetworkInfo.iMCNName.Copy( mcnInfo.Left( KNWMCNNameLength ) ); |
|
441 } |
|
442 else |
|
443 { |
|
444 iNWNetworkInfo.iMCNName.Copy( mcnInfo ); |
|
445 } |
|
446 |
|
447 iNWNetworkInfo.iMCNIndicatorType = ENWMCNIndicatorTypeActive; |
|
448 NWLOGSTRING( KNWINT, |
|
449 "NW: CNWNetworkMCNEngine::HandleCBSMessages: MCN display updated"); |
|
450 } |
|
451 |
|
452 NWLOGSTRING2( KNWINT, |
|
453 "NW: CNWNetworkMCNEngine::HandleCBSMessages() End,\ |
|
454 err = %d ", err ); |
|
455 return err; |
|
456 } |
|
457 |
|
458 // ---------------------------------------------------------------------------- |
|
459 // CNWNetworkMcnEngine::HandleTimeOutL |
|
460 // Handles timeout. |
|
461 // (other items were commented in a header). |
|
462 // ---------------------------------------------------------------------------- |
|
463 // |
|
464 void CNWNetworkMcnEngine::HandleTimeOut() |
|
465 { |
|
466 NWLOGSTRING( KNWINT, |
|
467 "NW: CNWNetworkMCNEngine::HandleTimeOut() Begin" ); |
|
468 |
|
469 switch ( iState ) |
|
470 { |
|
471 case ECbsWaitingToClearMcnIndicator: |
|
472 { |
|
473 //Sends clear indicator to UI and then restarts |
|
474 //timer for 115 more seconds |
|
475 ResetIndicatorValues(); |
|
476 iGsmMessageHandler.SendMessage( |
|
477 MNWMessageObserver::ENWMessageCurrentCellInfoMessage ); |
|
478 iTimer->Cancel(); |
|
479 iTimer->After( KWaitTimeForNewMcnAfterClearingOld, this ); |
|
480 iState=ECbsWaitingForNewMcn; |
|
481 NWLOGSTRING( KNWINT, |
|
482 "NW: CNWNetworkMCNEngine::HandleTimeOutL: 115s timer started" ); |
|
483 } |
|
484 break; |
|
485 case ECbsWaitingForNewMcn: |
|
486 { |
|
487 NWLOGSTRING( KNWINT, |
|
488 "NW: CNWNetworkMCNEngine::HandleTimeOutL: \ |
|
489 115/120s timer expired" ); |
|
490 if( iMcn ) |
|
491 { |
|
492 //Unregisters when 120/115sec timer expires |
|
493 iMcn->Unregister( this ); |
|
494 NWLOGSTRING( KNWMESOUT, |
|
495 "NW: CNWNetworkMCNEngine::HandleTimeOutL: \ |
|
496 iMcn.Unregister() called" ); |
|
497 } |
|
498 ResetIndicatorValues(); |
|
499 iCBSState=EListeningNone; |
|
500 iState=EIdle; |
|
501 } |
|
502 break; |
|
503 case EIdle: |
|
504 break; |
|
505 default: |
|
506 __ASSERT_DEBUG( !iState, Panic( ENWPanicInvalidState ) ); |
|
507 break; |
|
508 } |
|
509 |
|
510 NWLOGSTRING( KNWINT, |
|
511 "NW: CNWNetworkMCNEngine::HandleTimeOut() End" ); |
|
512 } |
|
513 |
|
514 // ---------------------------------------------------------------------------- |
|
515 // CNWNetworkMcnEngine::ResetIndicatorValues |
|
516 // Resets Viag's and MCN display's TPEInfo values. |
|
517 // (other items were commented in a header). |
|
518 // ---------------------------------------------------------------------------- |
|
519 // |
|
520 void CNWNetworkMcnEngine::ResetIndicatorValues() |
|
521 { |
|
522 NWLOGSTRING( KNWINT, |
|
523 "NW: CNWNetworkMCNEngine::ResetIndicatorValues() Begin" ); |
|
524 |
|
525 iNWNetworkInfo.iMCNIndicatorType = ENWMCNIndicatorTypeNone; |
|
526 iNWNetworkInfo.iMCNName.Zero(); |
|
527 |
|
528 NWLOGSTRING( KNWINT, |
|
529 "NW: CNWNetworkMCNEngine::ResetIndicatorValues() End" ); |
|
530 } |
|
531 |
|
532 // -------------------------------------------------------------------------- |
|
533 // CNWNetworkMcnEngine::DoCancel |
|
534 // Cancels the pending async. command. |
|
535 // (other items were commented in a header). |
|
536 // ---------------------------------------------------------------------------- |
|
537 // |
|
538 void CNWNetworkMcnEngine::DoCancel() |
|
539 { |
|
540 NWLOGSTRING( KNWINT, "NW: CNWNetworkMcnEngine::DoCancel() Begin" ); |
|
541 // Cancel all the asynchronous service requests |
|
542 iRepository->NotifyCancel( KSettingsMcnDisplay ); |
|
543 |
|
544 NWLOGSTRING( KNWINT, |
|
545 "NW: CNWNetworkMCNEngine::DoCancel() End" ); |
|
546 } |
|
547 |
|
548 // ---------------------------------------------------------------------------- |
|
549 // CNWNetworkMcnEngine::RunL |
|
550 // Receives the completion of the pending async. command |
|
551 // ---------------------------------------------------------------------------- |
|
552 // |
|
553 void CNWNetworkMcnEngine::RunL() |
|
554 { |
|
555 NWLOGSTRING2( KNWREQEND, |
|
556 "NET CNWNetworkMcnEngine::RunL() Begin,\ |
|
557 iStatus.Int() = %I ", iStatus.Int() ); |
|
558 |
|
559 if ( iStatus == NCentralRepositoryConstants::KUnspecifiedKey || |
|
560 iStatus == KSettingsMcnDisplay ) |
|
561 { |
|
562 NWLOGSTRING( KNWINT, "NW CNWNetworkMcnEngine::RunL: NotifyRequest !" ); |
|
563 // Get the current value from Central Repository |
|
564 GetMcnDisplayValue(); |
|
565 NotifyMcnDisplayChanged(); |
|
566 } |
|
567 else |
|
568 { |
|
569 NWLOGSTRING ( KNWERROR, |
|
570 "NW: CNWNetworkMcnEngine::RunL: NOTIFYREQUEST FAILED!" ); |
|
571 } |
|
572 |
|
573 NWLOGSTRING( KNWINT, |
|
574 "NW: CNWNetworkMCNEngine::RunL() End" ); |
|
575 } |
|
576 |
|
577 // ---------------------------------------------------------------------------- |
|
578 // CNWNetworkMcnEngine::NotifyMcnDisplayChanged |
|
579 // Calls NotifyRequest from Central Repository |
|
580 // ---------------------------------------------------------------------------- |
|
581 // |
|
582 void CNWNetworkMcnEngine::NotifyMcnDisplayChanged() |
|
583 { |
|
584 NWLOGSTRING( KNWINT, |
|
585 "NW: CNWNetworkMCNEngine::NotifyMcnDisplayChanged() Begin " ); |
|
586 |
|
587 iRepository->NotifyRequest( KSettingsMcnDisplay, iStatus ); |
|
588 NWLOGSTRING( KNWREQOUT, |
|
589 "NW CNWNetworkMcnEngine::NotifyMcnDisplayChanged: \ |
|
590 CRepository::NotifyRequest" ); |
|
591 SetActive(); |
|
592 |
|
593 NWLOGSTRING( KNWINT, |
|
594 "NW: CNWNetworkMCNEngine::NotifyMcnDisplayChanged() End " ); |
|
595 } |
|
596 |
|
597 |
|
598 // End of File |