|
a/libupnpp/upnpplib.hxx |
|
b/libupnpp/upnpplib.hxx |
|
... |
|
... |
95 |
void registerHandler(Upnp_EventType et, Upnp_FunPtr handler, void *cookie);
|
95 |
void registerHandler(Upnp_EventType et, Upnp_FunPtr handler, void *cookie);
|
96 |
|
96 |
|
97 |
/** Translate libupnp event type as string */
|
97 |
/** Translate libupnp event type as string */
|
98 |
static std::string evTypeAsString(Upnp_EventType);
|
98 |
static std::string evTypeAsString(Upnp_EventType);
|
99 |
|
99 |
|
100 |
int setupWebServer(const std::string& description);
|
100 |
int setupWebServer(const std::string& description, UpnpDevice_Handle *dvh);
|
101 |
|
101 |
|
102 |
UpnpClient_Handle getclh()
|
102 |
UpnpClient_Handle getclh()
|
103 |
{
|
103 |
{
|
104 |
return m_clh;
|
104 |
return m_clh;
|
105 |
}
|
|
|
106 |
UpnpDevice_Handle getdvh()
|
|
|
107 |
{
|
|
|
108 |
return m_dvh;
|
|
|
109 |
}
|
105 |
}
|
110 |
private:
|
106 |
private:
|
111 |
|
107 |
|
112 |
// A Handler object records the data from registerHandler.
|
108 |
// A Handler object records the data from registerHandler.
|
113 |
class Handler {
|
109 |
class Handler {
|
|
... |
|
... |
131 |
static int o_callback(Upnp_EventType, void *, void *);
|
127 |
static int o_callback(Upnp_EventType, void *, void *);
|
132 |
|
128 |
|
133 |
bool m_ok;
|
129 |
bool m_ok;
|
134 |
int m_init_error;
|
130 |
int m_init_error;
|
135 |
UpnpClient_Handle m_clh;
|
131 |
UpnpClient_Handle m_clh;
|
136 |
// !TBD: there should be one handle per device if we ever want to have
|
|
|
137 |
// several devices in the same process.
|
|
|
138 |
UpnpDevice_Handle m_dvh;
|
|
|
139 |
PTMutexInit m_mutex;
|
132 |
PTMutexInit m_mutex;
|
140 |
std::map<Upnp_EventType, Handler> m_handlers;
|
133 |
std::map<Upnp_EventType, Handler> m_handlers;
|
141 |
};
|
134 |
};
|
142 |
|
135 |
|
143 |
#endif /* _LIBUPNP.H_X_INCLUDED_ */
|
136 |
#endif /* _LIBUPNP.H_X_INCLUDED_ */
|