-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmainwindow.h
70 lines (59 loc) · 1.51 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#define BAUDRATE 115200
#include <QMainWindow>
#include <QLineEdit>
#include <QTimer>
#include <QSerialPortInfo>
#include <QtSerialPort>
#include <QSerialPort>
#include <QMessageBox>
#include "portthread.h"
#include "threadsend.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
//QByteArray wait_for_response(int msec);
void displayError(const char a);
//void closeSerialPort();
QString getIndex();
//Check the data before sending it
bool checkData();
void lockui(bool);
~MainWindow();
private:
Ui::MainWindow *ui;
//Contain all the available COM Port
QList<QSerialPortInfo> serialPortInfoList;
QTimer m_timer;
QByteArray m_readData;
QSerialPort *serial;
PortThread *t1;
ThreadSend *t2;
QString portConnectedName;
bool sending;
signals:
void SendMessage(QString port,QByteArray ssid,QByteArray pwd, QByteArray encryption);
void SaveConf(bool b);
void CloseConnection();
void stopThreadPort(bool b);
public slots:
//Give status on the statusbar
void ChangeStatusBar();
//Control which widget is enabled
void UnlockWifiParameter();
//Send all the connection info
void sendConfig();
//Connect to the device via serial
//void TryConnect();
void noEncryption(bool b);
void write(int a);
void UpdateList(QString q);
void connectedAirbox(bool);
};
#endif // MAINWINDOW_H