|
a/libupnpp/control/service.cxx |
|
b/libupnpp/control/service.cxx |
|
... |
|
... |
92 |
|
92 |
|
93 |
int ret = UpnpSendAction(hdl, m_actionURL.c_str(), m_serviceType.c_str(),
|
93 |
int ret = UpnpSendAction(hdl, m_actionURL.c_str(), m_serviceType.c_str(),
|
94 |
0 /*devUDN*/, request, &response);
|
94 |
0 /*devUDN*/, request, &response);
|
95 |
|
95 |
|
96 |
if (ret != UPNP_E_SUCCESS) {
|
96 |
if (ret != UPNP_E_SUCCESS) {
|
97 |
LOGINF("Service::runAction: UpnpSendAction failed: " <<
|
97 |
LOGINF("Service::runAction: UpnpSendAction failed: " << ret <<
|
98 |
UpnpGetErrorMessage(ret) << endl);
|
98 |
" : " << UpnpGetErrorMessage(ret) << endl);
|
99 |
return ret;
|
99 |
return ret;
|
100 |
}
|
100 |
}
|
101 |
LOGDEB("Service::runAction: Result xml: [" << ixmlPrintDocument(response) << "]" << endl);
|
101 |
LOGDEB("Service::runAction: Result xml: [" << ixmlPrintDocument(response) << "]" << endl);
|
102 |
|
102 |
|
103 |
if (!decodeSoapBody(args.name.c_str(), response, &data)) {
|
103 |
if (!decodeSoapBody(args.name.c_str(), response, &data)) {
|
|
... |
|
... |
204 |
}
|
204 |
}
|
205 |
int timeout = 1800;
|
205 |
int timeout = 1800;
|
206 |
int ret = UpnpSubscribe(lib->getclh(), m_eventURL.c_str(),
|
206 |
int ret = UpnpSubscribe(lib->getclh(), m_eventURL.c_str(),
|
207 |
&timeout, m_SID);
|
207 |
&timeout, m_SID);
|
208 |
if (ret != UPNP_E_SUCCESS) {
|
208 |
if (ret != UPNP_E_SUCCESS) {
|
209 |
LOGERR("Service:subscribe: failed: " <<
|
209 |
LOGERR("Service:subscribe: failed: " << ret << " : " <<
|
210 |
UpnpGetErrorMessage(ret) << endl);
|
210 |
UpnpGetErrorMessage(ret) << endl);
|
211 |
return false;
|
211 |
return false;
|
212 |
}
|
212 |
}
|
213 |
//LOGDEB("Service::subscribe: sid: " << m_SID << endl);
|
213 |
//LOGDEB("Service::subscribe: sid: " << m_SID << endl);
|
214 |
return true;
|
214 |
return true;
|
|
... |
|
... |
222 |
LOGINF("Service::unSubscribe: no lib" << endl);
|
222 |
LOGINF("Service::unSubscribe: no lib" << endl);
|
223 |
return UPNP_E_OUTOF_MEMORY;
|
223 |
return UPNP_E_OUTOF_MEMORY;
|
224 |
}
|
224 |
}
|
225 |
int ret = UpnpUnSubscribe(lib->getclh(), m_SID);
|
225 |
int ret = UpnpUnSubscribe(lib->getclh(), m_SID);
|
226 |
if (ret != UPNP_E_SUCCESS) {
|
226 |
if (ret != UPNP_E_SUCCESS) {
|
227 |
LOGERR("Service:unSubscribe: failed: " <<
|
227 |
LOGERR("Service:unSubscribe: failed: " << ret << " : " <<
|
228 |
UpnpGetErrorMessage(ret) << endl);
|
228 |
UpnpGetErrorMessage(ret) << endl);
|
229 |
return false;
|
229 |
return false;
|
230 |
}
|
230 |
}
|
231 |
return true;
|
231 |
return true;
|
232 |
}
|
232 |
}
|