Websocket auto serverinfo responder (#443)

* serverinfo cb

* remove webui cron

* missing header file

* tcp connection should trigger to
This commit is contained in:
brindosch
2017-06-17 23:29:04 +02:00
committed by GitHub
parent 91c7637a2b
commit d3707cb118
12 changed files with 166 additions and 38 deletions

View File

@@ -13,6 +13,7 @@
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QTimer>
// hyperion-utils includes
#include <utils/Image.h>
@@ -170,9 +171,9 @@ public:
ComponentRegister& getComponentRegister() { return _componentRegister; };
bool configModified();
bool configModified() { return _configMod; };
bool configWriteable();
bool configWriteable() { return _configWrite; };
/// gets the methode how image is maped to leds
int getLedMappingType() { return _ledMAppingType; };
@@ -308,6 +309,9 @@ signals:
void emitImage(int priority, const Image<ColorRgb> & image, const int timeout_ms);
void closing();
/// Signal which is emitted, when state of config or bonjour or priorityMuxer changed
void hyperionStateChanged();
private slots:
///
/// Updates the priority muxer with the current time and (re)writes the led color with applied
@@ -316,9 +320,12 @@ private slots:
void update();
void currentBonjourRecordsChanged(const QList<BonjourRecord> &list);
void bonjourRecordResolved(const QHostInfo &hostInfo, int port);
void bonjourRecordResolved(const QHostInfo &hostInfo, int port);
void bonjourResolve();
/// check for configWriteable and modified changes, called by _cTimer timeout()
void checkConfigState();
private:
///
@@ -335,6 +342,7 @@ private:
LedString _ledStringClone;
std::vector<ColorOrder> _ledStringColorOrder;
/// The priority muxer
PriorityMuxer _muxer;
@@ -356,7 +364,7 @@ private:
// json configuration
const QJsonObject& _qjsonConfig;
// the name of config file
/// the name of config file
QString _configFile;
/// The timer for handling priority channel timeouts
@@ -396,4 +404,15 @@ private:
BonjourServiceResolver _bonjourResolver;
BonjourRegister _hyperionSessions;
QString _bonjourCurrentServiceToResolve;
/// Interval timer to check config write and mod
QTimer _cTimer;
/// holds the prev states of configWriteable and modified
bool _prevConfigMod = false;
bool _prevConfigWrite = true;
/// holds the current states of configWriteable and modified
bool _configMod = false;
bool _configWrite = true;
};