evil_portal_app_i.h 1.8 KB

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