|
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 #ifndef __TESTPNPPARAMSET_H__ |
|
17 #define __TESTPNPPARAMSET_H__ |
|
18 |
|
19 #include <es_sock.h> |
|
20 #include <in_sock.h> |
|
21 #include <elements/metadata.h> |
|
22 #include <comms-infras/es_parameterfamily.h> |
|
23 #include <comms-infras/es_parameterbundle.h> |
|
24 |
|
25 #include "testpnpconstants.h" |
|
26 |
|
27 /** |
|
28 TestPnP ParameterSet Family Identifiers. |
|
29 */ |
|
30 enum TTestPnPParamSetFamily |
|
31 { |
|
32 // Used by Control Point |
|
33 ETestPnPRegisterAnnouncementParamSet = 1, |
|
34 ETestPnPAbsenceAnnouncementParamSet = 2, |
|
35 ETestPnPPresenceAnnouncementParamSet = 3, |
|
36 ETestPnPDiscoverRequestParamSet = 4, |
|
37 ETestPnPDiscoverResponseParamSet = 5, |
|
38 //Do not use the 6 as it is used by family which carries implementation UID of SCPR. |
|
39 ETestPnPDescribeRequestParamSet = 7, |
|
40 ETestPnPDescribeResponseParamSet = 8, |
|
41 ETestPnPSubscribeRequestParamSet = 9, |
|
42 ETestPnPSubscribeResponseParamSet = 10, |
|
43 ETestPnPNotifyEventParamSet = 11, |
|
44 ETestPnPCancelDiscoverParamSet = 12, |
|
45 ETestPnPCancelDescribeParamSet = 13, |
|
46 ETestPnPCancelSubscribeParamSet = 14, |
|
47 ETestPnPCancelRegisterNotifyParamSet = 15, |
|
48 ETestPnPRequestParamSet = 16, |
|
49 ETestPnPResponseParamSet = 17, |
|
50 |
|
51 // Used by Service Point |
|
52 ETestPnPServiceRegisterParamSet = 18, |
|
53 ETestPnPServiceNotificationParamSet = 19, |
|
54 ETestPnPPublishResponseParamSet = 20, |
|
55 }; |
|
56 |
|
57 /** |
|
58 class TTestPnPEvent |
|
59 TestPnPEvent class defines the reason code for an event callback. |
|
60 */ |
|
61 NONSHARABLE_CLASS(TTestPnPEvent) |
|
62 { |
|
63 public: |
|
64 /** Type of TestPnP Event. */ |
|
65 enum TEventType |
|
66 { |
|
67 /** This signifies that the operation completed successfully. */ |
|
68 ESuccess, |
|
69 /** This is a 'catch-all' for communicating failures. The actual error reason is |
|
70 shown in error code. */ |
|
71 EFail, |
|
72 }; |
|
73 |
|
74 public: |
|
75 /** The event status. */ |
|
76 TInt iStatus; |
|
77 /** The error code value. */ |
|
78 TInt iErrorCode; |
|
79 }; |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 /** |
|
85 The base class for all TestPnP ParamSet classes. |
|
86 */ |
|
87 NONSHARABLE_CLASS (CTestPnPParamSetBase) : public CSubConExtensionParameterSet |
|
88 { |
|
89 public: |
|
90 inline static CTestPnPParamSetBase* NewL ( RParameterFamily& aFamily, TTestPnPParamSetFamily aFamilyType ); |
|
91 protected: |
|
92 inline CTestPnPParamSetBase (); |
|
93 }; |
|
94 |
|
95 |
|
96 // ------------------------------------------------------------------- |
|
97 |
|
98 /** |
|
99 Parameter set class containing a Uri. All TestPnP Request ParamSet classes derive from this class. |
|
100 */ |
|
101 NONSHARABLE_CLASS ( CTestPnPRequestParamSetBase ) : public CTestPnPParamSetBase |
|
102 { |
|
103 protected: |
|
104 RBuf8 iUri; |
|
105 public: |
|
106 inline void SetUriL ( const TDesC8& aUri ); |
|
107 inline const TDesC8& Uri () const; |
|
108 protected: |
|
109 inline CTestPnPRequestParamSetBase (); |
|
110 inline ~CTestPnPRequestParamSetBase (); |
|
111 protected: |
|
112 DATA_VTABLE |
|
113 }; |
|
114 |
|
115 // ---------------------------------------------------------------------- |
|
116 |
|
117 /** |
|
118 Parameter set class containing a TestPnP Event. All TestPnP Response ParamSet classes derive from this class. |
|
119 */ |
|
120 NONSHARABLE_CLASS ( CTestPnPResponseParamSetBase ) : public CTestPnPRequestParamSetBase |
|
121 { |
|
122 protected: |
|
123 TTestPnPEvent iTestPnPEvent; |
|
124 public: |
|
125 inline void SetTestPnPEvent ( const TTestPnPEvent& aEvent ); |
|
126 inline const TTestPnPEvent& TestPnPEvent () const; |
|
127 protected: |
|
128 inline CTestPnPResponseParamSetBase (); |
|
129 protected: |
|
130 DATA_VTABLE |
|
131 }; |
|
132 |
|
133 // ------------------------------------------------------------------------- |
|
134 |
|
135 /** TestPnP Control Point ParameterSet classes. */ |
|
136 |
|
137 /** |
|
138 Parameter set class for discovering services/devices. |
|
139 Calling client should set the ServiceType/DeviceType and maximum wait time. |
|
140 */ |
|
141 NONSHARABLE_CLASS(CTestPnPDiscoverRequestParamSet) : public CTestPnPRequestParamSetBase |
|
142 { |
|
143 private: |
|
144 TInt iTimeToDelayResponse; |
|
145 public : |
|
146 inline static CTestPnPDiscoverRequestParamSet* NewL( RParameterFamily& aFamily ); |
|
147 inline void SetResponseTime(TInt aResponseTime); |
|
148 inline TInt ResponseTime( ) const ; |
|
149 protected: |
|
150 DATA_VTABLE |
|
151 }; |
|
152 |
|
153 // --------------------------------------------------------------------------- |
|
154 |
|
155 /** |
|
156 Parameter set class for subscribing to remote service. Client should set the ServiceLocation and Duration |
|
157 of subscription. |
|
158 */ |
|
159 NONSHARABLE_CLASS(CTestPnPSubscribeRequestParamSet) : public CTestPnPRequestParamSetBase |
|
160 { |
|
161 protected: |
|
162 |
|
163 public: |
|
164 inline static CTestPnPSubscribeRequestParamSet* NewL( RParameterFamily& aFamily ); |
|
165 |
|
166 protected: |
|
167 DATA_VTABLE |
|
168 }; |
|
169 |
|
170 // ---------------------------------------------------------------------------- |
|
171 |
|
172 /** |
|
173 Parameter set class for registering SSDP:Alive request of a service/device. Caller should send the |
|
174 ServiceType/DeviceType to register for announcements. |
|
175 */ |
|
176 NONSHARABLE_CLASS(CTestPnPRegisterAnnouncementParamSet) : public CTestPnPRequestParamSetBase |
|
177 { |
|
178 public: |
|
179 TBool iRegister; |
|
180 inline static CTestPnPRegisterAnnouncementParamSet* NewL ( RParameterFamily& aFamily ); |
|
181 inline void SetRegisterVariable(TBool aValue); |
|
182 inline TBool RegisterVariable(); |
|
183 protected: |
|
184 DATA_VTABLE |
|
185 }; |
|
186 |
|
187 // ----------------------------------------------------------------------------- |
|
188 |
|
189 /** |
|
190 Parameter set class for describe request. Caller should set the ServiceType/DeviceType to be described. |
|
191 */ |
|
192 NONSHARABLE_CLASS(CTestPnPDescribeRequestParamSet) : public CTestPnPRequestParamSetBase |
|
193 { |
|
194 |
|
195 public: |
|
196 inline static CTestPnPDescribeRequestParamSet* NewL ( RParameterFamily& aFamily ); |
|
197 |
|
198 |
|
199 protected: |
|
200 DATA_VTABLE |
|
201 }; |
|
202 // ----------------------------------------------------------------------------- |
|
203 /** |
|
204 Parameter set class for cancel discover request. |
|
205 |
|
206 */ |
|
207 |
|
208 NONSHARABLE_CLASS(CTestPnPCancelDiscoverParamSet) : public CTestPnPRequestParamSetBase |
|
209 { |
|
210 public: |
|
211 inline static CTestPnPCancelDiscoverParamSet* NewL( RParameterFamily& aFamily ); |
|
212 |
|
213 protected: |
|
214 DATA_VTABLE |
|
215 }; |
|
216 |
|
217 // ----------------------------------------------------------------------------- |
|
218 /** |
|
219 Parameter set class for cancel describe request. |
|
220 */ |
|
221 |
|
222 NONSHARABLE_CLASS(CTestPnPCancelDescribeParamSet) : public CTestPnPRequestParamSetBase |
|
223 { |
|
224 public: |
|
225 inline static CTestPnPCancelDescribeParamSet* NewL( RParameterFamily& aFamily ); |
|
226 |
|
227 protected: |
|
228 DATA_VTABLE |
|
229 }; |
|
230 |
|
231 // ----------------------------------------------------------------------------- |
|
232 /** |
|
233 Parameter set class for cancel subscribe request. |
|
234 */ |
|
235 |
|
236 NONSHARABLE_CLASS(CTestPnPCancelSubscribeParamSet) : public CTestPnPRequestParamSetBase |
|
237 { |
|
238 public: |
|
239 inline static CTestPnPCancelSubscribeParamSet* NewL( RParameterFamily& aFamily ); |
|
240 |
|
241 protected: |
|
242 DATA_VTABLE |
|
243 }; |
|
244 |
|
245 // ----------------------------------------------------------------------------- |
|
246 /** |
|
247 Parameter set class for cancel register notify request. |
|
248 */ |
|
249 NONSHARABLE_CLASS(CTestPnPCancelRegisterNotifyParamSet) : public CTestPnPRequestParamSetBase |
|
250 { |
|
251 public: |
|
252 inline static CTestPnPCancelRegisterNotifyParamSet* NewL( RParameterFamily& aFamily ); |
|
253 |
|
254 protected: |
|
255 DATA_VTABLE |
|
256 }; |
|
257 |
|
258 // ----------------------------------------------------------------------------- |
|
259 |
|
260 /** |
|
261 Parameter set class for retrieving the responses of discovery requests. Client can extract remote device |
|
262 information such as Device Location, Unique Service Name (USN) and Max age of the advertisement in |
|
263 callback function. |
|
264 |
|
265 */ |
|
266 NONSHARABLE_CLASS(CTestPnPDiscoverResponseParamSet) : public CTestPnPResponseParamSetBase |
|
267 { |
|
268 public : |
|
269 // Internal APIs |
|
270 inline static CTestPnPDiscoverResponseParamSet* NewL( RParameterFamily& aFamily ); |
|
271 |
|
272 // D'tor |
|
273 inline ~CTestPnPDiscoverResponseParamSet (); |
|
274 protected: |
|
275 DATA_VTABLE |
|
276 }; |
|
277 |
|
278 // ------------------------------------------------------------------------------------- |
|
279 |
|
280 /** |
|
281 Parameter set class for retrieving responses of describe requests. Client can extract the device description |
|
282 in callback function. |
|
283 |
|
284 */ |
|
285 NONSHARABLE_CLASS(CTestPnPDescribeResponseParamSet) : public CTestPnPResponseParamSetBase |
|
286 { |
|
287 public: |
|
288 inline static CTestPnPDescribeResponseParamSet* NewL( RParameterFamily& aFamily ); |
|
289 inline ~CTestPnPDescribeResponseParamSet (); |
|
290 protected: |
|
291 DATA_VTABLE |
|
292 }; |
|
293 // ------------------------------------------------------------------------------------- |
|
294 |
|
295 /** |
|
296 Parameter set class for retrieving response of subscription request. Calling client can extract the |
|
297 subscription status in callback function. |
|
298 |
|
299 */ |
|
300 NONSHARABLE_CLASS(CTestPnPSubscribeResponseParamSet) : public CTestPnPResponseParamSetBase |
|
301 { |
|
302 public: |
|
303 inline static CTestPnPSubscribeResponseParamSet* NewL( RParameterFamily& aFamily ); |
|
304 protected: |
|
305 DATA_VTABLE |
|
306 }; |
|
307 // ------------------------------------------------------------------------------------- |
|
308 |
|
309 /** |
|
310 Parameter set class for retrieving the event notification. Calling client can extract the |
|
311 notification information in callback function. If notification order is not matched an error code |
|
312 is returned to the client. |
|
313 |
|
314 */ |
|
315 NONSHARABLE_CLASS(CTestPnPNotifyEventParamSet) : public CTestPnPResponseParamSetBase |
|
316 { |
|
317 public: |
|
318 inline static CTestPnPNotifyEventParamSet* NewL( RParameterFamily& aFamily ); |
|
319 inline ~CTestPnPNotifyEventParamSet (); |
|
320 protected: |
|
321 DATA_VTABLE |
|
322 }; |
|
323 // ------------------------------------------------------------------------------------- |
|
324 |
|
325 /** |
|
326 Parameter set class for retrieving the SSDP:ByeBye message. Calling client can extract the |
|
327 published information in callback function. |
|
328 |
|
329 */ |
|
330 NONSHARABLE_CLASS(CTestPnPAbsenceAnnouncementParamSet) : public CTestPnPResponseParamSetBase |
|
331 { |
|
332 public: |
|
333 inline static CTestPnPAbsenceAnnouncementParamSet* NewL( RParameterFamily& aFamily ); |
|
334 |
|
335 // D'tor |
|
336 inline ~CTestPnPAbsenceAnnouncementParamSet (); |
|
337 protected: |
|
338 DATA_VTABLE |
|
339 }; |
|
340 // ------------------------------------------------------------------------------------- |
|
341 |
|
342 /** |
|
343 Parameter set class for retrieving SSDP:Alive message. Calling client can extract the |
|
344 published information in callback function. |
|
345 |
|
346 */ |
|
347 NONSHARABLE_CLASS(CTestPnPPresenceAnnouncementParamSet) : public CTestPnPAbsenceAnnouncementParamSet |
|
348 { |
|
349 public: |
|
350 inline static CTestPnPPresenceAnnouncementParamSet* NewL( RParameterFamily& aFamily ); |
|
351 |
|
352 // D'tor |
|
353 inline ~CTestPnPPresenceAnnouncementParamSet (); |
|
354 protected: |
|
355 DATA_VTABLE |
|
356 }; |
|
357 // ------------------------------------------------------------------------------------- |
|
358 |
|
359 /** TestPnP Service Point ParameterSet classes. */ |
|
360 |
|
361 /** |
|
362 Parameter set class for registering the service and publishing the service information. Service Client |
|
363 should set the following fields : |
|
364 */ |
|
365 NONSHARABLE_CLASS( CTestPnPServiceRegisterParamSet ) : public CTestPnPRequestParamSetBase |
|
366 { |
|
367 public: |
|
368 inline ~CTestPnPServiceRegisterParamSet (); |
|
369 inline static CTestPnPServiceRegisterParamSet* NewL(RParameterFamily& aFamily); |
|
370 |
|
371 protected: |
|
372 DATA_VTABLE |
|
373 }; |
|
374 |
|
375 |
|
376 /** Parameter set class for receiving success or failure for service or device |
|
377 registration |
|
378 |
|
379 */ |
|
380 NONSHARABLE_CLASS(CTestPnPPublishResponseParamSet) : public CTestPnPResponseParamSetBase |
|
381 { |
|
382 public: |
|
383 inline static CTestPnPPublishResponseParamSet* NewL( RParameterFamily& aFamily); |
|
384 protected: |
|
385 DATA_VTABLE |
|
386 |
|
387 }; |
|
388 |
|
389 |
|
390 #include "testpnpparamset.inl" |
|
391 |
|
392 #endif // __TESTPNPPARAMSET_H__ |