#ifndef COM_1_H
#define COM_1_H

#include <QMainWindow>

#include "QDebug"
#include "QtSerialPort/QSerialPort"
#include "QtSerialPort/QSerialPortInfo"
#include "QMessageBox"
#include "QTimer"
#include "QByteArray"
#include "bluetooth_queue.h"
#include "bluetoothonlinedevice.h"
#include "QDateTime"
#include "QTimerEvent"
#include "QByteArray"
#include "QTextEdit"

QT_BEGIN_NAMESPACE
namespace Ui { class com_1; }
QT_END_NAMESPACE

class com_1 : public QMainWindow
{
    Q_OBJECT

public:
    com_1(QWidget *parent = nullptr);
    ~com_1();

    QSerialPort com_BT;

    QSerialPort com_VT;

    QTimer BT_port_read_timer;

    void SerOpen(int data);

    void BT_port_read();

    void VT_port_read();

    void BluetoothReceiveDataDeal(QByteArray data);

    void AtAnslysis(QByteArray str);

    QByteArray GetSendAtCommand(QString str);

    void BT_port_open_work();

    void timerEvent(QTimerEvent *event);

    void VT_port_open_work();

    QTextCharFormat fmt;

    QTimer roll_time;



private:
    Ui::com_1 *ui;

    int bluetoothinfoupdata = 0;

private slots:

    void SerRefresh();

    void on_port_open_clicked();

    void on_BuletoothOnlineList_doubleClicked(const QModelIndex &index);

    void on_port_refresh_VT_clicked();

    void on_port_open_VT_clicked();

    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void roll();
};
#endif // COM_1_H
