Added json broadcasting

This commit is contained in:
2019-06-10 23:22:08 +02:00
parent df27b622a0
commit 3cbe947408
37 changed files with 514 additions and 487 deletions

View File

@ -11,6 +11,8 @@ class BroadCast: public QObject
private:
bool master_;
static constexpr uint8_t MODE_PREPACKET = 0;
static constexpr uint8_t MODE_PACKET = 1;
@ -22,18 +24,24 @@ private:
void write(const QByteArray& buffer);
void decode();
void decodeMaster();
private slots:
void readyRead();
public slots:
void requestJson();
signals:
void jsonRequested();
void gotJson(QJsonObject json);
public:
BroadCast(QIODevice* const iodevice = nullptr);
BroadCast(QIODevice* const iodevice = nullptr, bool master = true);
void sendJson(const QJsonObject& json);
};