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
| #ifndef QTWIFI_H
| #define QTWIFI_H
|
| #include <QDebug>
| #include <QInputDialog>
| #include <QLabel>
| #include <QListWidget>
| #include <QProcess>
| #include <QThread>
| #include <QTimer>
|
| extern "C" {
| #include "Rk_wifi.h"
| #include "Rk_softap.h"
| }
|
| class qtWifi : public QListWidget
| {
| Q_OBJECT
|
| public:
| qtWifi(QWidget *parent = nullptr, QLabel *label = nullptr, QPushButton *btn = nullptr, bool on = false);
| ~qtWifi();
|
| static qtWifi* getInstance(QWidget *parent, QLabel *label, QPushButton *btn, bool on = false)
| {
| if (!_instance) {
| _instance = new qtWifi(parent, label, btn, on);
| }
| return _instance;
| }
|
| static qtWifi* getInstance(void)
| {
| return _instance;
| }
|
| bool isOn();
| void turnOn();
| void turnOff();
| private:
| static int wifi_callback(RK_WIFI_RUNNING_State_e state,
| RK_WIFI_INFO_Connection_s *info);
| static qtWifi* _instance;
| QLabel *text;
| QPushButton *switchBtn;
| QTimer *Timer;
| QString ssid;
|
| public slots:
| void on_btnClicked();
| void on_itemClicked(QListWidgetItem *item);
| void on_timer_timeout();
| };
|
| #endif /* QTWIFI_H */
|
|