-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwifi.h
67 lines (52 loc) · 1.08 KB
/
wifi.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
#ifndef WIFI_H
#define WIFI_H
#include <QMainWindow>
#include <QtSerialPort/QSerialPort>
namespace Ui {
class Wifi;
}
enum Operation {
AT_CWLAP, // Get AP list
AT_CIFSR, // Get IP address
AT_CWJAP, // Connected AP info
AT_CWQAP, // Disconnect from AP
AT_CIPSERVER // TCP Server
};
enum Type {
SET_EXECUTE,
INQUIRY
};
class Wifi : public QMainWindow
{
Q_OBJECT
public:
explicit Wifi(QWidget *parent = 0);
~Wifi();
public slots:
void readPort();
private slots:
void on_input_returnPressed();
void test();
void reset();
void apList();
void getIpAddress();
void checkApConnection();
void disconnectFromAp();
void connectToAp();
void startTcpServer();
private:
void send(const QString text);
void logSend(const QString text);
void checkBuffer();
void parseApList();
void parseIpList();
void parseAp();
void pong();
Ui::Wifi *ui;
QSerialPort *port;
QString buffer;
Operation operation;
Type type;
static QMap<int, QString> encryption;
};
#endif // WIFI_H