evil_portal_app_i.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #pragma once
  2. #include "evil_portal_app.h"
  3. #include "evil_portal_custom_event.h"
  4. #include "evil_portal_uart.h"
  5. #include "scenes/evil_portal_scene.h"
  6. #include "evil_portal_icons.h"
  7. #include <gui/gui.h>
  8. #include <gui/modules/loading.h>
  9. #include <gui/modules/text_box.h>
  10. #include <gui/modules/text_input.h>
  11. #include <gui/modules/variable_item_list.h>
  12. #include <gui/scene_manager.h>
  13. #include <gui/view_dispatcher.h>
  14. #include <gui/view_stack.h>
  15. #include <dialogs/dialogs.h>
  16. #define NUM_MENU_ITEMS (6)
  17. #define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
  18. #define UART_CH (FuriHalSerialIdUsart)
  19. #define SET_HTML_CMD "sethtml"
  20. #define SET_AP_CMD "setap"
  21. #define RESET_CMD "reset"
  22. struct Evil_PortalApp {
  23. Gui* gui;
  24. ViewDispatcher* view_dispatcher;
  25. SceneManager* scene_manager;
  26. FuriString* portal_logs;
  27. FuriMutex* portal_logs_mutex;
  28. FuriString* text_box_store;
  29. size_t text_box_store_strlen;
  30. TextBox* text_box;
  31. VariableItemList* var_item_list;
  32. Evil_PortalUart* uart;
  33. TextInput* text_input;
  34. DialogsApp* dialogs;
  35. FuriString* file_path;
  36. int selected_menu_index;
  37. int selected_option_index[NUM_MENU_ITEMS];
  38. const char* selected_tx_string;
  39. bool is_command;
  40. bool is_custom_tx_string;
  41. bool focus_console_start;
  42. bool show_stopscan_tip;
  43. bool sent_reset;
  44. int BAUDRATE;
  45. char text_store[2][128 + 1];
  46. bool capture_line;
  47. FuriString* captured_line;
  48. uint8_t* index_html;
  49. uint8_t* ap_name;
  50. };
  51. typedef enum {
  52. Evil_PortalAppViewVarItemList,
  53. Evil_PortalAppViewConsoleOutput,
  54. Evil_PortalAppViewStartPortal,
  55. Evil_PortalAppViewTextInput,
  56. } Evil_PortalAppView;