|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __ZEROCONFCONSOLE_H__ |
|
19 #define __ZEROCONFCONSOLE_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32cons.h> |
|
23 #include <es_sock.h> |
|
24 |
|
25 |
|
26 #include <mdns/mdnsparamset.h> |
|
27 #include <pnp/pnpparameterbundle.h> |
|
28 #include <pnp/rpnpservicediscovery.h> |
|
29 #include <pnp/rpnpservicepublisher.h> |
|
30 |
|
31 #include <pnp/mpnpobserver.h> |
|
32 #include <mdns/dnsconstants.h> |
|
33 |
|
34 |
|
35 |
|
36 enum TZeroConfClientState |
|
37 { |
|
38 EStateMenu, |
|
39 EStateWaiting |
|
40 }; |
|
41 |
|
42 class CZeroconfClient : public CBase |
|
43 { |
|
44 public: |
|
45 static CZeroconfClient* NewL(MPnPObserver* iObserver); |
|
46 static CZeroconfClient* NewLC(MPnPObserver* iObserver); |
|
47 |
|
48 void ConnectL(); |
|
49 |
|
50 void GetBTName(); |
|
51 |
|
52 ~CZeroconfClient(); |
|
53 private: |
|
54 CZeroconfClient(MPnPObserver* iObserver); |
|
55 void ConstructL(); |
|
56 public: |
|
57 |
|
58 void WriteServices(); |
|
59 void WriteServiceTypes(); |
|
60 void GetService(const TDesC8& aInstanceName,TDnsType aType); |
|
61 void PublishService(); |
|
62 void SearchService(); |
|
63 |
|
64 void PublishMyService(const TDesC8& aBaseUrl,const TDesC8& aFileList,const TDesC8& aIconName);\ |
|
65 void PublishNowPlayingServiceL(TDes& aTitleBuf); |
|
66 void UpdateNowPlayingServiceL(TDes& aTitleBuf); |
|
67 void PublishCurrentStatusServiceL(const TDesC8& aStatus); |
|
68 void UpdateCurrentStatusServiceL(const TDesC8& aStatus); |
|
69 |
|
70 void UnPublishServices(); |
|
71 |
|
72 private: |
|
73 |
|
74 TZeroConfClientState iState; |
|
75 |
|
76 ////////////////////////// |
|
77 RPnPServicePublisher iServicePublish; |
|
78 RPnPServicePublisher iMusicPublish; |
|
79 RPnPServicePublisher iStatusPublish; |
|
80 RPnPServiceDiscovery iControlPoint; |
|
81 |
|
82 ////////////////////////// |
|
83 |
|
84 MPnPObserver* iMdnsObserver; |
|
85 RBuf iBTName; |
|
86 }; |
|
87 |
|
88 #endif /* __ZEROCONFCONSOLE_H__ */ |