Added json broadcasting
This commit is contained in:
@ -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);
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user