|
a/src/ohproduct.cxx |
|
b/src/ohproduct.cxx |
|
... |
|
... |
28 |
#include <vector> // for vector
|
28 |
#include <vector> // for vector
|
29 |
|
29 |
|
30 |
|
30 |
|
31 |
#include "libupnpp/device/device.hxx" // for UpnpService
|
31 |
#include "libupnpp/device/device.hxx" // for UpnpService
|
32 |
#include "libupnpp/log.hxx" // for LOGDEB
|
32 |
#include "libupnpp/log.hxx" // for LOGDEB
|
33 |
#include "libupnpp/soaphelp.hxx" // for SoapData, SoapArgs
|
33 |
#include "libupnpp/soaphelp.hxx" // for SoapOutgoing, SoapIncoming
|
34 |
|
34 |
|
35 |
#include "upmpd.hxx" // for UpMpd
|
35 |
#include "upmpd.hxx" // for UpMpd
|
36 |
|
36 |
|
37 |
using namespace std;
|
37 |
using namespace std;
|
38 |
using namespace std::placeholders;
|
38 |
using namespace std::placeholders;
|
|
... |
|
... |
128 |
names.push_back("Attributes");values.push_back(csattrs);
|
128 |
names.push_back("Attributes");values.push_back(csattrs);
|
129 |
}
|
129 |
}
|
130 |
return true;
|
130 |
return true;
|
131 |
}
|
131 |
}
|
132 |
|
132 |
|
133 |
int OHProduct::manufacturer(const SoapArgs& sc, SoapData& data)
|
133 |
int OHProduct::manufacturer(const SoapIncoming& sc, SoapOutgoing& data)
|
134 |
{
|
134 |
{
|
135 |
LOGDEB("OHProduct::manufacturer" << endl);
|
135 |
LOGDEB("OHProduct::manufacturer" << endl);
|
136 |
data.addarg("Name", csmanname);
|
136 |
data.addarg("Name", csmanname);
|
137 |
data.addarg("Info", csmaninfo);
|
137 |
data.addarg("Info", csmaninfo);
|
138 |
data.addarg("Url", csmanurl);
|
138 |
data.addarg("Url", csmanurl);
|
139 |
data.addarg("ImageUri", "");
|
139 |
data.addarg("ImageUri", "");
|
140 |
return UPNP_E_SUCCESS;
|
140 |
return UPNP_E_SUCCESS;
|
141 |
}
|
141 |
}
|
142 |
|
142 |
|
143 |
int OHProduct::model(const SoapArgs& sc, SoapData& data)
|
143 |
int OHProduct::model(const SoapIncoming& sc, SoapOutgoing& data)
|
144 |
{
|
144 |
{
|
145 |
LOGDEB("OHProduct::model" << endl);
|
145 |
LOGDEB("OHProduct::model" << endl);
|
146 |
data.addarg("Name", csmodname);
|
146 |
data.addarg("Name", csmodname);
|
147 |
data.addarg("Info", csversion);
|
147 |
data.addarg("Info", csversion);
|
148 |
data.addarg("Url", csmodurl);
|
148 |
data.addarg("Url", csmodurl);
|
149 |
data.addarg("ImageUri", "");
|
149 |
data.addarg("ImageUri", "");
|
150 |
return UPNP_E_SUCCESS;
|
150 |
return UPNP_E_SUCCESS;
|
151 |
}
|
151 |
}
|
152 |
|
152 |
|
153 |
int OHProduct::product(const SoapArgs& sc, SoapData& data)
|
153 |
int OHProduct::product(const SoapIncoming& sc, SoapOutgoing& data)
|
154 |
{
|
154 |
{
|
155 |
LOGDEB("OHProduct::product" << endl);
|
155 |
LOGDEB("OHProduct::product" << endl);
|
156 |
data.addarg("Room", m_roomOrName);
|
156 |
data.addarg("Room", m_roomOrName);
|
157 |
data.addarg("Name", csprodname);
|
157 |
data.addarg("Name", csprodname);
|
158 |
data.addarg("Info", csversion);
|
158 |
data.addarg("Info", csversion);
|
159 |
data.addarg("Url", "");
|
159 |
data.addarg("Url", "");
|
160 |
data.addarg("ImageUri", "");
|
160 |
data.addarg("ImageUri", "");
|
161 |
return UPNP_E_SUCCESS;
|
161 |
return UPNP_E_SUCCESS;
|
162 |
}
|
162 |
}
|
163 |
|
163 |
|
164 |
int OHProduct::standby(const SoapArgs& sc, SoapData& data)
|
164 |
int OHProduct::standby(const SoapIncoming& sc, SoapOutgoing& data)
|
165 |
{
|
165 |
{
|
166 |
LOGDEB("OHProduct::standby" << endl);
|
166 |
LOGDEB("OHProduct::standby" << endl);
|
167 |
data.addarg("Value", "0");
|
167 |
data.addarg("Value", "0");
|
168 |
return UPNP_E_SUCCESS;
|
168 |
return UPNP_E_SUCCESS;
|
169 |
}
|
169 |
}
|
170 |
|
170 |
|
171 |
int OHProduct::setStandby(const SoapArgs& sc, SoapData& data)
|
171 |
int OHProduct::setStandby(const SoapIncoming& sc, SoapOutgoing& data)
|
172 |
{
|
172 |
{
|
173 |
LOGDEB("OHProduct::setStandby" << endl);
|
173 |
LOGDEB("OHProduct::setStandby" << endl);
|
174 |
if (!sc.getBool("Value", &m_standby)) {
|
174 |
if (!sc.getBool("Value", &m_standby)) {
|
175 |
return UPNP_E_INVALID_PARAM;
|
175 |
return UPNP_E_INVALID_PARAM;
|
176 |
}
|
176 |
}
|
177 |
m_dev->loopWakeup();
|
177 |
m_dev->loopWakeup();
|
178 |
return UPNP_E_SUCCESS;
|
178 |
return UPNP_E_SUCCESS;
|
179 |
}
|
179 |
}
|
180 |
|
180 |
|
181 |
int OHProduct::sourceCount(const SoapArgs& sc, SoapData& data)
|
181 |
int OHProduct::sourceCount(const SoapIncoming& sc, SoapOutgoing& data)
|
182 |
{
|
182 |
{
|
183 |
LOGDEB("OHProduct::sourceCount" << endl);
|
183 |
LOGDEB("OHProduct::sourceCount" << endl);
|
184 |
data.addarg("Value", SoapHelp::i2s(o_sources.size()));
|
184 |
data.addarg("Value", SoapHelp::i2s(o_sources.size()));
|
185 |
return UPNP_E_SUCCESS;
|
185 |
return UPNP_E_SUCCESS;
|
186 |
}
|
186 |
}
|
187 |
|
187 |
|
188 |
int OHProduct::sourceXML(const SoapArgs& sc, SoapData& data)
|
188 |
int OHProduct::sourceXML(const SoapIncoming& sc, SoapOutgoing& data)
|
189 |
{
|
189 |
{
|
190 |
LOGDEB("OHProduct::sourceXML" << endl);
|
190 |
LOGDEB("OHProduct::sourceXML" << endl);
|
191 |
data.addarg("Value", csxml);
|
191 |
data.addarg("Value", csxml);
|
192 |
return UPNP_E_SUCCESS;
|
192 |
return UPNP_E_SUCCESS;
|
193 |
}
|
193 |
}
|
194 |
|
194 |
|
195 |
int OHProduct::sourceIndex(const SoapArgs& sc, SoapData& data)
|
195 |
int OHProduct::sourceIndex(const SoapIncoming& sc, SoapOutgoing& data)
|
196 |
{
|
196 |
{
|
197 |
LOGDEB("OHProduct::sourceIndex" << endl);
|
197 |
LOGDEB("OHProduct::sourceIndex" << endl);
|
198 |
data.addarg("Value", SoapHelp::i2s(m_sourceIndex));
|
198 |
data.addarg("Value", SoapHelp::i2s(m_sourceIndex));
|
199 |
return UPNP_E_SUCCESS;
|
199 |
return UPNP_E_SUCCESS;
|
200 |
}
|
200 |
}
|
201 |
|
201 |
|
202 |
int OHProduct::setSourceIndex(const SoapArgs& sc, SoapData& data)
|
202 |
int OHProduct::setSourceIndex(const SoapIncoming& sc, SoapOutgoing& data)
|
203 |
{
|
203 |
{
|
204 |
LOGDEB("OHProduct::setSourceIndex" << endl);
|
204 |
LOGDEB("OHProduct::setSourceIndex" << endl);
|
205 |
int sindex;
|
205 |
int sindex;
|
206 |
if (!sc.getInt("Value", &sindex)) {
|
206 |
if (!sc.getInt("Value", &sindex)) {
|
207 |
return UPNP_E_INVALID_PARAM;
|
207 |
return UPNP_E_INVALID_PARAM;
|
|
... |
|
... |
214 |
m_sourceIndex = sindex;
|
214 |
m_sourceIndex = sindex;
|
215 |
m_dev->loopWakeup();
|
215 |
m_dev->loopWakeup();
|
216 |
return UPNP_E_SUCCESS;
|
216 |
return UPNP_E_SUCCESS;
|
217 |
}
|
217 |
}
|
218 |
|
218 |
|
219 |
int OHProduct::setSourceIndexByName(const SoapArgs& sc, SoapData& data)
|
219 |
int OHProduct::setSourceIndexByName(const SoapIncoming& sc, SoapOutgoing& data)
|
220 |
{
|
220 |
{
|
221 |
LOGDEB("OHProduct::setSourceIndexByName" << endl);
|
221 |
LOGDEB("OHProduct::setSourceIndexByName" << endl);
|
222 |
|
222 |
|
223 |
string name;
|
223 |
string name;
|
224 |
if (!sc.getString("Value", &name)) {
|
224 |
if (!sc.getString("Value", &name)) {
|
|
... |
|
... |
234 |
|
234 |
|
235 |
LOGERR("OHProduct::setSoaurceIndexByName: no such name: " << name << endl);
|
235 |
LOGERR("OHProduct::setSoaurceIndexByName: no such name: " << name << endl);
|
236 |
return UPNP_E_INVALID_PARAM;
|
236 |
return UPNP_E_INVALID_PARAM;
|
237 |
}
|
237 |
}
|
238 |
|
238 |
|
239 |
int OHProduct::source(const SoapArgs& sc, SoapData& data)
|
239 |
int OHProduct::source(const SoapIncoming& sc, SoapOutgoing& data)
|
240 |
{
|
240 |
{
|
241 |
LOGDEB("OHProduct::source" << endl);
|
241 |
LOGDEB("OHProduct::source" << endl);
|
242 |
int sindex;
|
242 |
int sindex;
|
243 |
if (!sc.getInt("Index", &sindex)) {
|
243 |
if (!sc.getInt("Index", &sindex)) {
|
244 |
return UPNP_E_INVALID_PARAM;
|
244 |
return UPNP_E_INVALID_PARAM;
|
|
... |
|
... |
253 |
data.addarg("Name", o_sources[sindex]);
|
253 |
data.addarg("Name", o_sources[sindex]);
|
254 |
data.addarg("Visible", "1");
|
254 |
data.addarg("Visible", "1");
|
255 |
return UPNP_E_SUCCESS;
|
255 |
return UPNP_E_SUCCESS;
|
256 |
}
|
256 |
}
|
257 |
|
257 |
|
258 |
int OHProduct::attributes(const SoapArgs& sc, SoapData& data)
|
258 |
int OHProduct::attributes(const SoapIncoming& sc, SoapOutgoing& data)
|
259 |
{
|
259 |
{
|
260 |
LOGDEB("OHProduct::attributes" << endl);
|
260 |
LOGDEB("OHProduct::attributes" << endl);
|
261 |
data.addarg("Value", csattrs);
|
261 |
data.addarg("Value", csattrs);
|
262 |
return UPNP_E_SUCCESS;
|
262 |
return UPNP_E_SUCCESS;
|
263 |
}
|
263 |
}
|
264 |
|
264 |
|
265 |
int OHProduct::sourceXMLChangeCount(const SoapArgs& sc, SoapData& data)
|
265 |
int OHProduct::sourceXMLChangeCount(const SoapIncoming& sc, SoapOutgoing& data)
|
266 |
{
|
266 |
{
|
267 |
LOGDEB("OHProduct::sourceXMLChangeCount" << endl);
|
267 |
LOGDEB("OHProduct::sourceXMLChangeCount" << endl);
|
268 |
data.addarg("Value", "0");
|
268 |
data.addarg("Value", "0");
|
269 |
return UPNP_E_SUCCESS;
|
269 |
return UPNP_E_SUCCESS;
|
270 |
}
|
270 |
}
|