-
Notifications
You must be signed in to change notification settings - Fork 6
/
evil_portal_app_i.h
75 lines (61 loc) · 1.73 KB
/
evil_portal_app_i.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
71
72
73
74
75
#pragma once
#include "evil_portal_app.h"
#include "evil_portal_custom_event.h"
#include "evil_portal_uart.h"
#include "scenes/evil_portal_scene.h"
#include "evil_portal_icons.h"
#include <gui/gui.h>
#include <gui/modules/loading.h>
#include <gui/modules/text_box.h>
#include <gui/modules/text_input.h>
#include <gui/modules/variable_item_list.h>
#include <gui/scene_manager.h>
#include <gui/view_dispatcher.h>
#include <gui/view_stack.h>
#include <dialogs/dialogs.h>
#if __has_include(<cfw/cfw.h>)
#include <cfw/cfw.h>
#define UART_CH (cfw_settings.uart_esp_channel)
#else
#define UART_CH (FuriHalSerialIdUsart)
#endif
#define NUM_MENU_ITEMS (6)
#define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
#define SET_HTML_CMD "sethtml"
#define SET_AP_CMD "setap"
#define RESET_CMD "reset"
struct Evil_PortalApp {
Gui* gui;
ViewDispatcher* view_dispatcher;
SceneManager* scene_manager;
FuriString* portal_logs;
FuriMutex* portal_logs_mutex;
FuriString* text_box_store;
size_t text_box_store_strlen;
TextBox* text_box;
VariableItemList* var_item_list;
Evil_PortalUart* uart;
TextInput* text_input;
DialogsApp* dialogs;
FuriString* file_path;
int selected_menu_index;
int selected_option_index[NUM_MENU_ITEMS];
const char* selected_tx_string;
bool is_command;
bool is_custom_tx_string;
bool focus_console_start;
bool show_stopscan_tip;
bool sent_reset;
int BAUDRATE;
char text_store[2][128 + 1];
bool capture_line;
FuriString* captured_line;
uint8_t* index_html;
uint8_t* ap_name;
};
typedef enum {
Evil_PortalAppViewVarItemList,
Evil_PortalAppViewConsoleOutput,
Evil_PortalAppViewStartPortal,
Evil_PortalAppViewTextInput,
} Evil_PortalAppView;