-
Notifications
You must be signed in to change notification settings - Fork 47
/
subbrute_i.h
128 lines (109 loc) · 3.88 KB
/
subbrute_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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#pragma once
#include <furi.h>
#include <furi_hal.h>
#include <input/input.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/view_stack.h>
#include <gui/scene_manager.h>
#include <gui/modules/text_input.h>
#include <gui/modules/popup.h>
#include <gui/modules/widget.h>
#include <gui/modules/loading.h>
#include <gui/modules/variable_item_list.h>
#include <subghz_bruteforcer_icons.h>
#include <dialogs/dialogs.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include "subbrute.h"
#include "subbrute_device.h"
#include "subbrute_settings.h"
#include "helpers/subbrute_worker.h"
#include "views/subbrute_attack_view.h"
#include "views/subbrute_main_view.h"
#define SUB_BRUTE_FORCER_VERSION "Sub-GHz BruteForcer 3.F"
#ifdef FURI_DEBUG
//#define SUBBRUTE_FAST_TRACK false
#endif
/**
* @enum SubBruteView
* @brief An enumeration representing the different views of the SubBrute application
*
* This enumeration represents the possible views that the SubBrute application can have. Each view
* corresponds to a specific screen or UI element in the application.
*/
typedef enum {
SubBruteViewNone, /**< Not used */
SubBruteViewMain,
SubBruteViewAttack,
SubBruteViewTextInput,
SubBruteViewDialogEx, /**< Not used */
SubBruteViewPopup,
SubBruteViewWidget,
SubBruteViewStack,
SubBruteViewVarList,
} SubBruteView;
/**
* @class SubBruteState
* @brief Represents the state of a SubBrute application.
*
* This class contains the various elements and variables necessary for the functioning of a SubBrute application.
*/
struct SubBruteState {
/** GUI elements */
NotificationApp* notifications;
Gui* gui;
ViewDispatcher* view_dispatcher;
ViewStack* view_stack;
TextInput* text_input;
Popup* popup;
Widget* widget;
VariableItemList* var_list;
DialogsApp* dialogs;
char text_store[SUBBRUTE_MAX_LEN_NAME]; /**< Text store */
FuriString* file_path;
const SubGhzDevice* radio_device; /**< Radio device */
/** Views */
SubBruteMainView* view_main; /**< Main menu */
SubBruteAttackView* view_attack; /**< View for attack and setup current protocol */
SubBruteView current_view;
SceneManager* scene_manager; /**< Scene manager */
SubBruteDevice* device; /**< SubBruteDevice to get value of transmission */
SubBruteWorker* worker; /**< SubBruteWorker worker for background job */
SubBruteSettings* settings; /**< Last used settings */
};
/**
* @brief Function to show or hide a loading popup.
*
* This function is used to display or hide a loading popup in a user interface.
* The loading popup appears when an action is being performed that may take some time to complete.
*
* @param context A pointer to the context object associated with the loading popup.
* @param show A boolean value indicating whether to display or hide the loading popup.
*/
void subbrute_show_loading_popup(void* context, bool show);
/**
* @brief Callback function for text input in the sub-brute module.
*
* This function serves as a callback for handling text input in the sub-brute module.
* It should be registered as a callback function for text input events.
*
* @param context A pointer to additional context data (if any).
*
* @return None
*/
void subbrute_text_input_callback(void* context);
/**
* @brief Callback function called when a popup window is closed.
*
* This function is called when a popup window is closed. It can be used to perform
* any necessary cleanup or additional processing after the popup window is closed.
*
* @param context A void pointer to the context data associated with the popup window.
* It can be used to pass any additional information needed by the callback function.
*
* @return void
*/
void subbrute_popup_closed_callback(void* context);