evil_portal_app_i.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 <gui/gui.h>
  7. #include <gui/modules/text_box.h>
  8. #include <gui/modules/variable_item_list.h>
  9. #include <gui/scene_manager.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <assets_icons.h>
  12. #include <dialogs/dialogs.h>
  13. #define NUM_MENU_ITEMS (4)
  14. #define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
  15. #define UART_CH (FuriHalUartIdUSART1)
  16. #define SET_HTML_CMD "sethtml"
  17. #define SET_AP_CMD "setap"
  18. #define RESET_CMD "reset"
  19. #define EVIL_PORTAL_INDEX_EXTENSION ".html"
  20. #define EVIL_PORTAL_BASE_FOLDER "/apps_data/evil_portal/"
  21. struct Evil_PortalApp {
  22. Gui *gui;
  23. ViewDispatcher *view_dispatcher;
  24. SceneManager *scene_manager;
  25. DialogsApp *dialogs;
  26. FuriString *portal_logs;
  27. const char *command_queue[1];
  28. int command_index;
  29. bool has_command_queue;
  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. int selected_menu_index;
  36. int selected_option_index[NUM_MENU_ITEMS];
  37. const char *selected_tx_string;
  38. bool is_command;
  39. bool is_custom_tx_string;
  40. bool focus_console_start;
  41. bool show_stopscan_tip;
  42. bool sent_ap;
  43. bool sent_html;
  44. bool sent_reset;
  45. int BAUDRATE;
  46. uint8_t *index_html;
  47. uint8_t *ap_name;
  48. };
  49. typedef enum {
  50. Evil_PortalAppViewVarItemList,
  51. Evil_PortalAppViewConsoleOutput,
  52. Evil_PortalAppViewStartPortal,
  53. } Evil_PortalAppView;