00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _BRISAMSEARCHCLIENT_H
00029 #define _BRISAMSEARCHCLIENT_H
00030
00031 #include <QUdpSocket>
00032 #include <QTimer>
00033 #include <QHttpResponseHeader>
00034
00035 #include "brisaglobal.h"
00036
00037 #define DEFAULT_SEARCH_TIME 600
00038 #define DEFAULT_SEARCH_TYPE "ssdp:all"
00039
00040 namespace BrisaUpnp {
00041
00050 class BRISA_UPNP_EXPORT BrisaMSearchClientCP: public QObject {
00051 Q_OBJECT
00052
00053 public:
00054
00059 BrisaMSearchClientCP(QObject *parent = 0, const QString &type =
00060 DEFAULT_SEARCH_TYPE, int mx = 5);
00061
00066 virtual ~BrisaMSearchClientCP();
00067
00073 void doubleDiscover();
00074
00080 bool isRunning() const;
00081
00089 void start(int interval = DEFAULT_SEARCH_TIME);
00090
00096 void stop();
00097
00098 public slots:
00105 void discover();
00106
00107 private slots:
00113 void datagramReceived();
00114
00115 signals:
00127 void msearchResponseReceived(const QString &usn, const QString &location,
00128 const QString &st, const QString &ext, const QString &server,
00129 const QString &cacheControl);
00130
00131 private:
00132 QTimer *timer;
00133 bool running;
00134 int interval;
00135 QUdpSocket *udpListener;
00136
00137 QString type;
00138 QByteArray mx;
00139
00140 QString SSDP_ADDR;
00141 int SSDP_PORT;
00142 QString S_SSDP_PORT;
00143 };
00144
00145 }
00146
00147 #endif