|
1 // Copyright (c) 2008-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 // |
|
15 |
|
16 #include <comms-infras/ss_mmnode.h> |
|
17 #include "netcfgextprov.h" |
|
18 #include "netcfgextnotify.h" |
|
19 #include <commsdattypeinfov1_1.h> |
|
20 |
|
21 using namespace Elements; |
|
22 using namespace Messages; |
|
23 using namespace ESock; |
|
24 |
|
25 _LIT(KIAPId, "IAP\\Id"); |
|
26 _LIT(KIAPNetwork, "IAP\\IAPNetwork"); |
|
27 |
|
28 EXPORT_C CNetCfgExtNotify* CNetCfgExtNotify::NewL(CSubConnectionProviderBase* aScpr) |
|
29 { |
|
30 return new(ELeave) CNetCfgExtNotify(aScpr); |
|
31 } |
|
32 |
|
33 CNetCfgExtNotify::CNetCfgExtNotify(CSubConnectionProviderBase* aScpr) |
|
34 : iScpr(aScpr) |
|
35 { |
|
36 } |
|
37 |
|
38 void CNetCfgExtNotify::IfProgress(TInt aStage, TInt aError) |
|
39 { |
|
40 TStateChange change(aStage, aError); |
|
41 RClientInterface::OpenPostMessageClose(iScpr->Id(), iScpr->Id(), |
|
42 TCFMessage::TStateChange(change).CRef()); |
|
43 } |
|
44 |
|
45 TInt CNetCfgExtNotify::DoReadInt(const TDesC& aField, TUint32& aValue,const RMessagePtr2* /*aMessage*/) |
|
46 { |
|
47 const ESock::RMetaExtensionContainerC& apc = iScpr->AccessPointConfig(); |
|
48 |
|
49 const CNetCfgExtProvision* provision = static_cast<const CNetCfgExtProvision*>(apc.FindExtension( |
|
50 STypeId::CreateSTypeId(CNetCfgExtProvision::EUid, CNetCfgExtProvision::ETypeId))); |
|
51 if (!provision) |
|
52 { |
|
53 return KErrArgument; |
|
54 } |
|
55 |
|
56 if (aField == KIAPId) |
|
57 { |
|
58 aValue = provision->Iap(); |
|
59 return KErrNone; |
|
60 } |
|
61 else if (aField == KIAPNetwork) |
|
62 { |
|
63 aValue = provision->NetworkId(); |
|
64 return KErrNone; |
|
65 } |
|
66 return KErrNotSupported; |
|
67 } |
|
68 |
|
69 TInt CNetCfgExtNotify::DoReadDes(const TDesC& aField, TDes8& aValue,const RMessagePtr2* aMessage) |
|
70 { |
|
71 TBuf<KCommsDbSvrMaxFieldLength> buf; |
|
72 TInt ret = DoReadDes(aField, buf, aMessage); |
|
73 aValue.Copy(buf); |
|
74 return ret; |
|
75 } |
|
76 |
|
77 TInt CNetCfgExtNotify::DoReadDes(const TDesC& aField, TDes16& aValue,const RMessagePtr2* /*aMessage*/) |
|
78 { |
|
79 const ESock::RMetaExtensionContainerC& apc = iScpr->AccessPointConfig(); |
|
80 |
|
81 const CNetCfgExtProvision* provision = static_cast<const CNetCfgExtProvision*>(apc.FindExtension(STypeId::CreateSTypeId(CNetCfgExtProvision::EUid, CNetCfgExtProvision::ETypeId))); |
|
82 if (!provision) |
|
83 { |
|
84 return KErrArgument; |
|
85 } |
|
86 |
|
87 if (aField == TPtrC(KCDTypeNameConfigDaemonName)) |
|
88 { |
|
89 aValue.Copy(provision->ConfigDaemonName()); |
|
90 return KErrNone; |
|
91 } |
|
92 if (aField == TPtrC(KCDTypeNameConfigDaemonManagerName)) |
|
93 { |
|
94 aValue.Copy(provision->ConfigDaemonManagerName()); |
|
95 return KErrNone; |
|
96 } |
|
97 |
|
98 return KErrNotSupported; |
|
99 } |
|
100 |
|
101 |
|
102 /* |
|
103 Unsupported MNifIfNotify methods |
|
104 */ |
|
105 void CNetCfgExtNotify::LinkLayerDown(TInt /*aReason*/, TAction /*aAction*/) |
|
106 { |
|
107 // Unsupported |
|
108 } |
|
109 |
|
110 void CNetCfgExtNotify::LinkLayerUp() |
|
111 { |
|
112 // Unsupported |
|
113 } |
|
114 |
|
115 void CNetCfgExtNotify::NegotiationFailed(CNifIfBase* /*aIf*/, TInt /*aReason*/) |
|
116 { |
|
117 // Unsupported |
|
118 } |
|
119 |
|
120 TInt CNetCfgExtNotify::Authenticate(TDes& /*aUsername*/, TDes& /*aPassword*/) |
|
121 { |
|
122 return KErrNotSupported; |
|
123 } |
|
124 |
|
125 void CNetCfgExtNotify::CancelAuthenticate() |
|
126 { |
|
127 // Unsupported |
|
128 } |
|
129 |
|
130 |
|
131 TInt CNetCfgExtNotify::GetExcessData(TDes8& /*aBuffer*/) |
|
132 { |
|
133 return KErrNotSupported; |
|
134 } |
|
135 |
|
136 void CNetCfgExtNotify::OpenRoute() |
|
137 { |
|
138 // Unsupported |
|
139 } |
|
140 |
|
141 void CNetCfgExtNotify::CloseRoute() |
|
142 { |
|
143 // Unsupported |
|
144 } |
|
145 |
|
146 |
|
147 void CNetCfgExtNotify::IfProgress(TSubConnectionUniqueId /*aSubConnectionUniqueId*/, TInt /*aStage*/, TInt /*aError*/) |
|
148 { |
|
149 // Unsupported |
|
150 } |
|
151 |
|
152 TInt CNetCfgExtNotify::Notification(TNifToAgentEventType /*aEvent*/, void* /*aInfo*/) |
|
153 { |
|
154 return KErrNotSupported; |
|
155 } |
|
156 |
|
157 void CNetCfgExtNotify::BinderLayerDown(CNifIfBase* /*aBinderIf*/, TInt /*aReason*/, TAction /*aAction*/) |
|
158 { |
|
159 // Unsupported |
|
160 } |
|
161 |
|
162 TInt CNetCfgExtNotify::PacketActivity(TDataTransferDirection /*aDirection*/, TUint /*aBytes*/, TBool /*aResetTimer*/) |
|
163 { |
|
164 return KErrNotSupported; |
|
165 } |
|
166 |
|
167 void CNetCfgExtNotify::NotifyDataSent(TSubConnectionUniqueId /*aSubConnectionUniqueId*/, TUint /*aUplinkVolume*/) |
|
168 { |
|
169 // Unsupported |
|
170 } |
|
171 |
|
172 void CNetCfgExtNotify::NotifyDataReceived(TSubConnectionUniqueId /*aSubConnectionUniqueId*/, TUint /*aDownlinkVolume*/) |
|
173 { |
|
174 // Unsupported |
|
175 } |
|
176 |
|
177 void CNetCfgExtNotify::NifEvent(TNetworkAdaptorEventType /*aEventType*/, TUint /*aEvent*/, const TDesC8& /*aEventData*/, TAny* /*aSource=0*/) |
|
178 { |
|
179 // Unsupported |
|
180 } |
|
181 |
|
182 |
|
183 |
|
184 TInt CNetCfgExtNotify::DoWriteInt(const TDesC& /*aField*/, TUint32 /*aValue*/,const RMessagePtr2* /*aMessage*/) |
|
185 { |
|
186 return KErrNotSupported; |
|
187 } |
|
188 |
|
189 |
|
190 TInt CNetCfgExtNotify::DoWriteDes(const TDesC& /*aField*/, const TDesC8& /*aValue*/, const RMessagePtr2* /*aMessage*/) |
|
191 { |
|
192 return KErrNotSupported; |
|
193 } |
|
194 |
|
195 TInt CNetCfgExtNotify::DoWriteDes(const TDesC& /*aField*/, const TDesC16& /*aValue*/,const RMessagePtr2* /*aMessage*/) |
|
196 { |
|
197 return KErrNotSupported; |
|
198 } |
|
199 |
|
200 TInt CNetCfgExtNotify::DoReadBool(const TDesC& /*aField*/, TBool& /*aValue*/,const RMessagePtr2* /*aMessage*/) |
|
201 { |
|
202 return KErrNotSupported; |
|
203 } |
|
204 |
|
205 TInt CNetCfgExtNotify::DoWriteBool(const TDesC& /*aField*/, TBool /*aValue*/,const RMessagePtr2* /*aMessage*/) |
|
206 { |
|
207 return KErrNotSupported; |
|
208 } |
|
209 |
|
210 |