evil_portal_app_i.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #include <momentum/momentum.h>
  17. #define NUM_MENU_ITEMS (6)
  18. #define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
  19. #define UART_CH (momentum_settings.uart_esp_channel)
  20. #define SET_HTML_CMD "sethtml"
  21. #define SET_AP_CMD "setap"
  22. #define RESET_CMD "reset"
  23. struct Evil_PortalApp {
  24. Gui* gui;
  25. ViewDispatcher* view_dispatcher;
  26. SceneManager* scene_manager;
  27. FuriString* portal_logs;
  28. FuriMutex* portal_logs_mutex;
  29. FuriString* text_box_store;
  30. size_t text_box_store_strlen;
  31. TextBox* text_box;
  32. VariableItemList* var_item_list;
  33. Evil_PortalUart* uart;
  34. TextInput* text_input;
  35. DialogsApp* dialogs;
  36. FuriString* file_path;
  37. int selected_menu_index;
  38. int selected_option_index[NUM_MENU_ITEMS];
  39. const char* selected_tx_string;
  40. bool is_command;
  41. bool is_custom_tx_string;
  42. bool focus_console_start;
  43. bool show_stopscan_tip;
  44. bool sent_reset;
  45. int BAUDRATE;
  46. char text_store[2][128 + 1];
  47. bool capture_line;
  48. FuriString* captured_line;
  49. uint8_t* index_html;
  50. uint8_t* ap_name;
  51. };
  52. typedef enum {
  53. Evil_PortalAppViewVarItemList,
  54. Evil_PortalAppViewConsoleOutput,
  55. Evil_PortalAppViewStartPortal,
  56. Evil_PortalAppViewTextInput,
  57. } Evil_PortalAppView;