-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeauthAccessPointController.cpp
More file actions
53 lines (40 loc) · 1.02 KB
/
DeauthAccessPointController.cpp
File metadata and controls
53 lines (40 loc) · 1.02 KB
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
#include "DeauthAccessPointController.h"
DeauthAccessPointController::DeauthAccessPointController(U8G2 _dsp, int _wifiIndex)
{
dsp = _dsp;
wifiIndex = _wifiIndex;
isRunning = false;
menu.setDisplay(dsp);
menu.addBack();
menu.setTitle(WiFi.SSID(wifiIndex));
menu.addItem("Start Deauthing");
menu.addLoading(isRunning);
}
void DeauthAccessPointController::render()
{
menu.render();
}
void DeauthAccessPointController::buttonSelect(SimpleList<BaseController *> *controllers)
{
if( menu.getActiveIndex() == 0 ){
controllers->pop();
}
if( menu.getActiveIndex() == 1 ){
if( isRunning ){
menu.updateItem(1, "Start Deauthing");
menu.stopLoading(2);
}else{
menu.updateItem(1, "Stop Deauthing");
menu.startLoading(2);
}
isRunning = !isRunning;
}
}
void DeauthAccessPointController::buttonDown()
{
menu.selectNextItem();
}
void DeauthAccessPointController::buttonUp()
{
menu.selectPreviousItem();
}