evil_portal_app_i.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 <xtreme/xtreme.h>
  17. #define NUM_MENU_ITEMS (6)
  18. #define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
  19. #define UART_CH (xtreme_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. Loading* loading;
  38. ViewStack* view_stack;
  39. int selected_menu_index;
  40. int selected_option_index[NUM_MENU_ITEMS];
  41. const char* selected_tx_string;
  42. bool is_command;
  43. bool is_custom_tx_string;
  44. bool focus_console_start;
  45. bool show_stopscan_tip;
  46. bool sent_reset;
  47. int BAUDRATE;
  48. char text_store[2][128 + 1];
  49. bool capture_line;
  50. FuriString* captured_line;
  51. uint8_t* index_html;
  52. uint8_t* ap_name;
  53. };
  54. typedef enum {
  55. Evil_PortalAppViewVarItemList,
  56. Evil_PortalAppViewConsoleOutput,
  57. Evil_PortalAppViewStartPortal,
  58. Evil_PortalAppViewTextInput,
  59. } Evil_PortalAppView;