1 /* |
|
2 * Copyright (c) 2007-2008 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 file contains the implementation of CSPSupplementaryServicesMonitor class |
|
15 * member functions. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #include "cspsupplementaryservicesmonitor.h" |
|
22 #include "csprovider.h" |
|
23 #include "csplogger.h" |
|
24 |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CSPSupplementaryServicesMonitor::CSPSupplementaryServicesMonitor |
|
28 // C++ default constructor can NOT contain any code, that |
|
29 // might leave. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CSPSupplementaryServicesMonitor::CSPSupplementaryServicesMonitor |
|
33 ( |
|
34 CSProvider& aOwner, |
|
35 RMmCustomAPI& aCustomAPI |
|
36 ) : CActive( EPriorityStandard ), |
|
37 iOwner( aOwner ), |
|
38 iCustomAPI( aCustomAPI ) |
|
39 { |
|
40 CSPLOGSTRING( CSPOBJECT, |
|
41 "CSPSupplementaryServicesMonitor::CSPSupplementaryServicesMonitor: complete" ); |
|
42 CActiveScheduler::Add( this ); |
|
43 } |
|
44 |
|
45 // Destructor |
|
46 CSPSupplementaryServicesMonitor::~CSPSupplementaryServicesMonitor() |
|
47 { |
|
48 Cancel(); |
|
49 CSPLOGSTRING( CSPOBJECT, |
|
50 "CALL CSPSupplementaryServicesMonitor::~CSPSupplementaryServicesMonitor: Complete." ); |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // CSPSupplementaryServicesMonitor::StartMonitoring |
|
55 // Starts supplementary services monitoring |
|
56 // (other items were commented in a header). |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 void CSPSupplementaryServicesMonitor::StartMonitoring() |
|
60 { |
|
61 if ( !IsActive() ) |
|
62 { |
|
63 CSPLOGSTRING( CSPREQOUT, |
|
64 "CALL CSPSupplementaryServicesMonitor::StartMonitoring: RMMCustomAPI::NotifySsNetworkEvent() called" ); |
|
65 iCustomAPI.NotifySsNetworkEvent( iStatus, iSsTypeAndMode, iSsInfo ); |
|
66 SetActive(); |
|
67 } |
|
68 else |
|
69 { |
|
70 CSPLOGSTRING( CSPINT, |
|
71 "CALL CSPSupplementaryServicesMonitor::StartMonitoring: Already active" ); |
|
72 } |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CSPSupplementaryServicesMonitor::DoCancel |
|
77 // Cancels active object requests |
|
78 // Method calls CancelAsyncRequest from the CustomaEtel object |
|
79 // (other items were commented in a header). |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 void CSPSupplementaryServicesMonitor::DoCancel() |
|
83 { |
|
84 iCustomAPI.CancelAsyncRequest( ECustomNotifySsNetworkEventIPC ); |
|
85 CSPLOGSTRING( CSPINT, |
|
86 "CALL CSPSupplementaryServicesMonitor::DoCancel: \ |
|
87 RMMCustomAPI::CancelAsyncRequest( ECustomNotifySsRequestCompleteIPC ) called" ); |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CSPSupplementaryServicesMonitor::RunL |
|
92 // CMethod gets notification from etel that asyncronous request is completed. |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 void CSPSupplementaryServicesMonitor::RunL() |
|
96 { |
|
97 CSPLOGSTRING( CSPINT, "CSPSupplementaryServicesMonitor::RunL" ); |
|
98 if ( iStatus == KErrNone ) |
|
99 { |
|
100 CSPLOGSTRING2( CSPINT, |
|
101 "CSPSupplementaryServicesMonitor::RunL: iSsTypeAndMode.iSsType: %d", |
|
102 iSsTypeAndMode.iSsType ); |
|
103 |
|
104 iOwner.NotifySsEvent( iSsTypeAndMode, iSsInfo ); |
|
105 StartMonitoring(); |
|
106 } |
|
107 } |
|
108 |
|
109 // End of File |
|