evil_portal_app_i.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. const char* command_queue[1];
  30. int command_index;
  31. bool has_command_queue;
  32. FuriString* text_box_store;
  33. size_t text_box_store_strlen;
  34. TextBox* text_box;
  35. VariableItemList* var_item_list;
  36. Evil_PortalUart* uart;
  37. TextInput* text_input;
  38. DialogsApp* dialogs;
  39. FuriString* file_path;
  40. Loading* loading;
  41. ViewStack* view_stack;
  42. int selected_menu_index;
  43. int selected_option_index[NUM_MENU_ITEMS];
  44. const char* selected_tx_string;
  45. bool is_command;
  46. bool is_custom_tx_string;
  47. bool focus_console_start;
  48. bool show_stopscan_tip;
  49. bool sent_ap;
  50. bool sent_html;
  51. bool sent_reset;
  52. int BAUDRATE;
  53. char text_store[2][128 + 1];
  54. uint8_t* index_html;
  55. uint8_t* ap_name;
  56. };
  57. typedef enum {
  58. Evil_PortalAppViewVarItemList,
  59. Evil_PortalAppViewConsoleOutput,
  60. Evil_PortalAppViewStartPortal,
  61. Evil_PortalAppViewTextInput,
  62. } Evil_PortalAppView;