|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Implements generic base for NIFMAN side of configuration daemon |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file NIFConfigurationControl.cpp |
|
20 @internalAll |
|
21 */ |
|
22 #include <comms-infras/ss_log.h> |
|
23 #include "nifnullconfiguration.h" |
|
24 #include <comms-infras/nifif.h> |
|
25 #include <commsdattypeinfov1_1.h> |
|
26 #include <cdbcols.h> |
|
27 #include <cdblen.h> |
|
28 |
|
29 #ifdef __CFLOG_ACTIVE |
|
30 _LIT8(KNifConfigControlSubTag, "NifConfigControl"); |
|
31 #endif |
|
32 |
|
33 EXPORT_C CNifConfigurationControl* CNifConfigurationControl::NewL(MNifIfNotify& aNifIfNotify) |
|
34 /** |
|
35 NewL - accesses comm db to find out which derivative of CNifConfigurationControl class |
|
36 to create to handle the subsequent configuration and communication with configurator. |
|
37 @internalAll |
|
38 @version 0.02 |
|
39 @param aNifIfNotify[in] represents the connection the instance is dealing with |
|
40 @return a new CNifConfigurationControl derivative |
|
41 **/ |
|
42 { |
|
43 const TUid KUidNifConfigurationIf = {0x101FEBE1}; //interface ID |
|
44 TBuf8<KCommsDbSvrMaxFieldLength> serverName; |
|
45 TInt err = aNifIfNotify.ReadDes(TPtrC(KCDTypeNameConfigDaemonManagerName), serverName); |
|
46 |
|
47 if (err!=KErrNone && err!=KErrNotFound) |
|
48 { |
|
49 User::Leave(err); |
|
50 } |
|
51 if (serverName.Length() == 0 || err == KErrNotFound) |
|
52 { |
|
53 __FLOG_STATIC0(KESockSubConnectionTag, KNifConfigControlSubTag, |
|
54 _L8("CNifConfigurationControl::NewL - creating CNifNullConfiguration object")); |
|
55 // default behaviour with old CommDB or connection not using config daemons... |
|
56 return new(ELeave)CNifNullConfiguration(aNifIfNotify); |
|
57 } |
|
58 else |
|
59 { |
|
60 __FLOG_STATIC0(KESockSubConnectionTag, KNifConfigControlSubTag, |
|
61 _L8("CNifConfigurationControl::NewL - creating CNifConfigurationIf object")); |
|
62 TEComResolverParams teComResolverParams; |
|
63 teComResolverParams.SetDataType(serverName); |
|
64 TAny* pImplem = REComSession::CreateImplementationL(KUidNifConfigurationIf, |
|
65 _FOFF(CNifConfigurationIf, iDtor_ID_Key), &aNifIfNotify, teComResolverParams); |
|
66 return reinterpret_cast<CNifConfigurationIf*>(pImplem); |
|
67 } |
|
68 } |
|
69 |
|
70 void CNifNullConfiguration::RunL() |
|
71 /** |
|
72 RunL - called when request completes does nothing |
|
73 @internalAll |
|
74 @version 0.01 |
|
75 @see CActive::RunL |
|
76 **/ |
|
77 { |
|
78 __FLOG(_L8("CNifNullConfiguration::RunL")); |
|
79 } |
|
80 |
|
81 void CNifNullConfiguration::CancelControl() |
|
82 /** |
|
83 CancelControl - cancels request asynchronously to avoid deadlock |
|
84 @internalAll |
|
85 @version 0.01 |
|
86 **/ |
|
87 { |
|
88 __FLOG(_L8("CNifNullConfiguration::CancelControl")); |
|
89 } |
|
90 |
|
91 void CNifNullConfiguration::AsyncDelete() |
|
92 /** |
|
93 AsyncDelete - controls deletion asynchronously to avoid deadlock |
|
94 @internalAll |
|
95 @version 0.01 |
|
96 **/ |
|
97 { |
|
98 __FLOG(_L8("CNifNullConfiguration::AsyncDelete")); |
|
99 // in this case there is no asynchronous stuff to worry about... |
|
100 // so we jsut go away nicely. |
|
101 delete this; |
|
102 } |
|
103 |
|
104 void CNifNullConfiguration::ConfigureNetworkL() |
|
105 /** |
|
106 ConfigureNetworkL - signals nothing even if it should signal KLinkLayerOpen with KErrNone |
|
107 @internalAll |
|
108 @version 0.01 |
|
109 **/ |
|
110 { |
|
111 __FLOG(_L8("CNifNullConfiguration::ConfigureNetworkL")); |
|
112 } |
|
113 |
|
114 void CNifNullConfiguration::LinkLayerDown() |
|
115 /** |
|
116 LinkLayerDown - does nothing. |
|
117 @internalAll |
|
118 @version 0.01 |
|
119 **/ |
|
120 { |
|
121 __FLOG(_L8("CNifNullConfiguration::LinkLayerDown")); |
|
122 } |
|
123 |
|
124 void CNifNullConfiguration::LinkLayerUp() |
|
125 /** |
|
126 LinkLayerUp - does nothing. |
|
127 @internalAll |
|
128 @version 0.01 |
|
129 **/ |
|
130 { |
|
131 __FLOG(_L8("CNifNullConfiguration::LinkLayerUp")); |
|
132 } |
|
133 |
|
134 void CNifNullConfiguration::Deregister( |
|
135 TInt /* aCause */) |
|
136 /** |
|
137 Generates the KConfigDaemonStartingDeregistration and |
|
138 KConfigDaemonFinishedDeregistrationStop progress notifications, |
|
139 this indicates to CNifAgentRef that the NIF is to be stopped. |
|
140 @internalAll |
|
141 **/ |
|
142 { |
|
143 iNifIfNotify->IfProgress(KConfigDaemonStartingDeregistration, KErrNone); |
|
144 iNifIfNotify->IfProgress(KConfigDaemonFinishedDeregistrationStop, KErrNone); |
|
145 } |
|
146 |
|
147 void CNifNullConfiguration::SendIoctlMessageL(const ESock::RLegacyResponseMsg& aMessage) |
|
148 /** |
|
149 * SendIoctlMessageL forwards Ioctl request to the daemon and activates the AO to wait for response |
|
150 * |
|
151 @internalAll |
|
152 @version 0.01 |
|
153 @param aMessage[in] a message to be processed (it's the caller's responsibility to forward just Ioctl |
|
154 * messages) |
|
155 **/ |
|
156 { |
|
157 __FLOG(_L8("CNifNullConfiguration::SendIoctlMessageL")); |
|
158 aMessage.Complete(KErrNotSupported); |
|
159 } |
|
160 |
|
161 void CNifNullConfiguration::DoCancel() |
|
162 /** |
|
163 DoCancel - does nothing |
|
164 @internalAll |
|
165 @version 0.01 |
|
166 @see CActive::DoCancel |
|
167 **/ |
|
168 { |
|
169 __FLOG(_L8("CNifNullConfiguration::DoCancel()")); |
|
170 } |
|
171 |
|
172 void CNifNullConfiguration::EventNotification(TNetworkAdaptorEventType /*aEventType*/, TUint /*aEvent*/, const TDesC8& /*aEventData*/, TAny* /*aSource*/) |
|
173 /** |
|
174 Notification - does nothing. |
|
175 @internalAll |
|
176 @version 0.01 |
|
177 **/ |
|
178 { |
|
179 __FLOG(_L8("CNifNullConfiguration::EventNotification")); |
|
180 } |
|
181 |