|
a/libupnpp/discovery.hxx |
|
b/libupnpp/discovery.hxx |
|
... |
|
... |
16 |
*/
|
16 |
*/
|
17 |
#ifndef _UPNPPDISC_H_X_INCLUDED_
|
17 |
#ifndef _UPNPPDISC_H_X_INCLUDED_
|
18 |
#define _UPNPPDISC_H_X_INCLUDED_
|
18 |
#define _UPNPPDISC_H_X_INCLUDED_
|
19 |
|
19 |
|
20 |
#include <vector>
|
20 |
#include <vector>
|
|
|
21 |
#include <functional>
|
21 |
|
22 |
|
22 |
#include "cdirectory.hxx"
|
23 |
#include "description.hxx"
|
|
|
24 |
|
|
|
25 |
namespace UPnPClient {
|
23 |
|
26 |
|
24 |
/**
|
27 |
/**
|
25 |
* Manage UPnP discovery and maintain a directory of active devices. Singleton.
|
28 |
* Manage UPnP discovery and maintain a directory of active devices. Singleton.
|
26 |
*
|
29 |
*
|
27 |
*/
|
30 |
*/
|
|
... |
|
... |
50 |
static UPnPDeviceDirectory *getTheDir(time_t search_window = 1);
|
53 |
static UPnPDeviceDirectory *getTheDir(time_t search_window = 1);
|
51 |
|
54 |
|
52 |
/** Clean up before exit. Do call this.*/
|
55 |
/** Clean up before exit. Do call this.*/
|
53 |
static void terminate();
|
56 |
static void terminate();
|
54 |
|
57 |
|
55 |
/** Retrieve the directory services currently seen on the network */
|
58 |
typedef std::function<bool (const UPnPDeviceDesc&,
|
56 |
bool getDirServices(std::vector<ContentDirectoryService>&);
|
59 |
const UPnPServiceDesc&)> Visitor;
|
57 |
/** Retrieve specific service designated by its friendlyName */
|
60 |
|
58 |
bool getServer(const string& friendlyName, ContentDirectoryService& server);
|
61 |
/** Traverse the directory and call Visitor for each device/service pair */
|
|
|
62 |
bool traverse(Visitor);
|
59 |
|
63 |
|
60 |
/** My health */
|
64 |
/** My health */
|
61 |
bool ok() {return m_ok;}
|
65 |
bool ok() {return m_ok;}
|
62 |
/** My diagnostic if health is bad */
|
66 |
/** My diagnostic if health is bad */
|
63 |
const std::string getReason() {return m_reason;}
|
67 |
const std::string getReason() {return m_reason;}
|
|
... |
|
... |
76 |
std::string m_reason;
|
80 |
std::string m_reason;
|
77 |
int m_searchTimeout;
|
81 |
int m_searchTimeout;
|
78 |
time_t m_lastSearch;
|
82 |
time_t m_lastSearch;
|
79 |
};
|
83 |
};
|
80 |
|
84 |
|
|
|
85 |
} // namespace UPnPClient
|
81 |
|
86 |
|
82 |
#endif /* _UPNPPDISC_H_X_INCLUDED_ */
|
87 |
#endif /* _UPNPPDISC_H_X_INCLUDED_ */
|