|
a/src/conman.cxx |
|
b/src/conman.cxx |
|
... |
|
... |
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
|
17 |
|
18 |
#include "conman.hxx"
|
18 |
#include "conman.hxx"
|
19 |
|
19 |
|
20 |
#include <upnp/upnp.h> // for UPNP_E_SUCCESS, etc
|
20 |
#include <upnp/upnp.h>
|
21 |
|
21 |
|
22 |
#include <functional> // for _Bind, bind, _1, _2
|
22 |
#include <functional>
|
23 |
#include <iostream> // for endl
|
23 |
#include <iostream>
|
24 |
#include <map> // for _Rb_tree_const_iterator, etc
|
24 |
#include <string>
|
25 |
#include <string> // for string, basic_string
|
25 |
#include <utility>
|
26 |
#include <utility> // for pair
|
26 |
#include <vector>
|
27 |
#include <vector> // for vector
|
|
|
28 |
|
27 |
|
29 |
#include "libupnpp/log.hxx" // for LOGDEB
|
28 |
#include "libupnpp/log.hxx"
|
30 |
#include "libupnpp/soaphelp.hxx" // for SoapOutgoing, SoapIncoming
|
29 |
#include "libupnpp/soaphelp.hxx"
|
31 |
|
|
|
32 |
#include "upmpd.hxx" // for UpMpd
|
|
|
33 |
|
30 |
|
34 |
using namespace std;
|
31 |
using namespace std;
|
35 |
using namespace std::placeholders;
|
32 |
using namespace std::placeholders;
|
36 |
using namespace UPnPP;
|
33 |
using namespace UPnPP;
|
|
|
34 |
using namespace UPnPProvider;
|
37 |
|
35 |
|
38 |
static const string sTpCM("urn:schemas-upnp-org:service:ConnectionManager:1");
|
36 |
static const string sTpCM("urn:schemas-upnp-org:service:ConnectionManager:1");
|
39 |
static const string sIdCM("urn:upnp-org:serviceId:ConnectionManager");
|
37 |
static const string sIdCM("urn:upnp-org:serviceId:ConnectionManager");
|
40 |
|
38 |
|
41 |
UpMpdConMan::UpMpdConMan(UpMpd *dev)
|
39 |
UpMpdConMan::UpMpdConMan(UpnpDevice *dev, const string& protoinfo)
|
42 |
: UpnpService(sTpCM, sIdCM, dev)
|
40 |
: UpnpService(sTpCM, sIdCM, dev), m_protoinfo(protoinfo)
|
43 |
{
|
41 |
{
|
44 |
dev->addActionMapping(this,"GetCurrentConnectionIDs",
|
42 |
dev->addActionMapping(this,"GetCurrentConnectionIDs",
|
45 |
bind(&UpMpdConMan::getCurrentConnectionIDs,
|
43 |
bind(&UpMpdConMan::getCurrentConnectionIDs,
|
46 |
this, _1,_2));
|
44 |
this, _1,_2));
|
47 |
dev->addActionMapping(this,"GetCurrentConnectionInfo",
|
45 |
dev->addActionMapping(this,"GetCurrentConnectionInfo",
|
|
... |
|
... |
58 |
|
56 |
|
59 |
// Our data never changes, so if this is not an unconditional request,
|
57 |
// Our data never changes, so if this is not an unconditional request,
|
60 |
// we return nothing.
|
58 |
// we return nothing.
|
61 |
if (all) {
|
59 |
if (all) {
|
62 |
names.push_back("SinkProtocolInfo");
|
60 |
names.push_back("SinkProtocolInfo");
|
63 |
values.push_back(g_protocolInfo);
|
61 |
values.push_back(m_protoinfo);
|
64 |
}
|
62 |
}
|
65 |
return true;
|
63 |
return true;
|
66 |
}
|
64 |
}
|
67 |
|
65 |
|
68 |
int UpMpdConMan::getCurrentConnectionIDs(const SoapIncoming& sc, SoapOutgoing& data)
|
66 |
int UpMpdConMan::getCurrentConnectionIDs(const SoapIncoming& sc, SoapOutgoing& data)
|
|
... |
|
... |
94 |
|
92 |
|
95 |
int UpMpdConMan::getProtocolInfo(const SoapIncoming& sc, SoapOutgoing& data)
|
93 |
int UpMpdConMan::getProtocolInfo(const SoapIncoming& sc, SoapOutgoing& data)
|
96 |
{
|
94 |
{
|
97 |
LOGDEB("UpMpdConMan::getProtocolInfo" << endl);
|
95 |
LOGDEB("UpMpdConMan::getProtocolInfo" << endl);
|
98 |
data.addarg("Source", "");
|
96 |
data.addarg("Source", "");
|
99 |
data.addarg("Sink", g_protocolInfo);
|
97 |
data.addarg("Sink", m_protoinfo);
|
100 |
|
98 |
|
101 |
return UPNP_E_SUCCESS;
|
99 |
return UPNP_E_SUCCESS;
|
102 |
}
|
100 |
}
|