|
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 // @file |
|
15 // @internalComponent |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef __UPNPSERVICEDEFAULTSCPR_H |
|
20 #define __UPNPSERVICEDEFAULTSCPR_H |
|
21 |
|
22 #include <comms-infras/corescpr.h> |
|
23 #include <comms-infras/corescprstates.h> |
|
24 #include <comms-infras/corescpractivities.h> |
|
25 |
|
26 |
|
27 #include "cupnpdescriptioncomposer.h" |
|
28 #include "upnpsppublishinfo.h" |
|
29 #include "upnpservicecpr.h" |
|
30 #include "upnpscpr.h" |
|
31 |
|
32 using namespace Messages; |
|
33 |
|
34 |
|
35 class CUPnPServiceDefaultSubConnectionProvider: public CUPnPSubConnectionProvider |
|
36 { |
|
37 public: |
|
38 static CUPnPServiceDefaultSubConnectionProvider* NewL ( CSubConnectionProviderFactoryBase& aFactory ); |
|
39 ~CUPnPServiceDefaultSubConnectionProvider ( ); |
|
40 |
|
41 void SetUdpServerFlow ( const TNodeId& aCommsId ); |
|
42 void SetUdpClientFlow ( const TNodeId& aCommsId ); |
|
43 TNodeId UdpClientFlow ( ); |
|
44 TNodeId UdpServerFlow ( ); |
|
45 const TDesC8& Key ( ); |
|
46 void SetPublishInfoL ( CUPnPPublishInfoElement* aPublishInfo ); |
|
47 CUPnPPublishInfoElement* PublishInfo ( ); |
|
48 const TDesC8& RootDeviceUrn ( ); |
|
49 void SetRootDeviceUrnL ( const TDesC8& aDeviceType ); |
|
50 const TDesC8& RootDeviceUsn ( ); |
|
51 CUPnPDescriptionComposer& DeviceDescriptionComposerL ( ); |
|
52 CUPnPServiceConnectionProvider& ConnectionProvider ( ); |
|
53 TBool RootDevicePublished ( ); |
|
54 void SetRootDevicePublished ( TBool aValue ); |
|
55 TBool IsClosing ( ); |
|
56 void SetClosing ( ); |
|
57 |
|
58 private: |
|
59 CUPnPServiceDefaultSubConnectionProvider ( ESock::CSubConnectionProviderFactoryBase& aFactory, const MeshMachine::TNodeActivityMap& aActivityMap ); |
|
60 void ConstructL ( ); |
|
61 virtual void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage ); |
|
62 |
|
63 private: |
|
64 CUPnPDescriptionComposer* iDeviceDescriptionComposer; |
|
65 CUPnPPublishInfoElement* iRootDevicePublishInfo; |
|
66 RBuf8 iRootDeviceUrn; // = urn:domain-name-device:deviceType:v |
|
67 RBuf8 iRootDeviceUsn; // = upnp:rootdevice::uuid:device-UUID |
|
68 TNodeId iUdpClientFlow; |
|
69 TNodeId iUdpServerFlow; |
|
70 TBool iRootDevicePublished; |
|
71 TBool iClosing; |
|
72 }; |
|
73 |
|
74 |
|
75 inline TBool CUPnPServiceDefaultSubConnectionProvider::IsClosing ( ) |
|
76 { |
|
77 return iClosing; |
|
78 } |
|
79 |
|
80 inline void CUPnPServiceDefaultSubConnectionProvider::SetClosing ( ) |
|
81 { |
|
82 iClosing = ETrue; |
|
83 } |
|
84 |
|
85 inline TNodeId CUPnPServiceDefaultSubConnectionProvider::UdpClientFlow ( ) |
|
86 { |
|
87 return iUdpClientFlow; |
|
88 } |
|
89 |
|
90 inline void CUPnPServiceDefaultSubConnectionProvider::SetUdpClientFlow ( const TNodeId& aCommsId ) |
|
91 { |
|
92 iUdpClientFlow = aCommsId; |
|
93 } |
|
94 |
|
95 inline TNodeId CUPnPServiceDefaultSubConnectionProvider::UdpServerFlow ( ) |
|
96 { |
|
97 return iUdpServerFlow; |
|
98 } |
|
99 |
|
100 inline void CUPnPServiceDefaultSubConnectionProvider::SetUdpServerFlow ( const TNodeId& aCommsId ) |
|
101 { |
|
102 iUdpServerFlow = aCommsId; |
|
103 } |
|
104 |
|
105 inline const TDesC8& CUPnPServiceDefaultSubConnectionProvider::Key ( ) |
|
106 { |
|
107 return iRootDevicePublishInfo->Key( ); |
|
108 } |
|
109 |
|
110 inline CUPnPPublishInfoElement* CUPnPServiceDefaultSubConnectionProvider::PublishInfo ( ) |
|
111 { |
|
112 return iRootDevicePublishInfo; |
|
113 } |
|
114 |
|
115 inline const TDesC8& CUPnPServiceDefaultSubConnectionProvider::RootDeviceUrn ( ) |
|
116 { |
|
117 return iRootDeviceUrn; |
|
118 } |
|
119 |
|
120 inline void CUPnPServiceDefaultSubConnectionProvider::SetRootDeviceUrnL ( const TDesC8& aDeviceUrn ) |
|
121 { |
|
122 iRootDeviceUrn.Close ( ); |
|
123 iRootDeviceUrn.CreateL ( aDeviceUrn ); |
|
124 } |
|
125 |
|
126 inline const TDesC8& CUPnPServiceDefaultSubConnectionProvider::RootDeviceUsn ( ) |
|
127 { |
|
128 return iRootDeviceUsn; |
|
129 } |
|
130 |
|
131 inline TBool CUPnPServiceDefaultSubConnectionProvider::RootDevicePublished ( ) |
|
132 { |
|
133 return iRootDevicePublished; |
|
134 } |
|
135 |
|
136 inline void CUPnPServiceDefaultSubConnectionProvider::SetRootDevicePublished ( TBool aValue ) |
|
137 { |
|
138 iRootDevicePublished = aValue; |
|
139 } |
|
140 |
|
141 |
|
142 |
|
143 #endif //UPNPSERVICEDEFAULTSCPR_H |