evil_portal_app_i.h 1.8 KB

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