#ifndef TCPSERVER_H
#define TCPSERVER_H

#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <QDateTime>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QJsonParseError>
#include <QVariant>

class TcpServer : public QObject
{
    Q_OBJECT
public:
    explicit TcpServer(QObject *parent = nullptr);
    void start();
    void response_msg(QString msg);

signals:
    void control_data(QString deviceId,int switchStatus);
    void tcp_log(QString log);

public slots:
    void new_incomming();
    void read_data();

private:
    QTcpServer *svr;
    QTcpSocket *so;

};

#endif // TCPSERVER_H
