evil_portal_app_i.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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/text_input.h>
  9. #include <gui/modules/variable_item_list.h>
  10. #include <gui/scene_manager.h>
  11. #include <gui/view_dispatcher.h>
  12. #define NUM_MENU_ITEMS (5)
  13. #define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
  14. #define UART_CH (FuriHalUartIdUSART1)
  15. #define SET_HTML_CMD "sethtml"
  16. #define SET_AP_CMD "setap"
  17. #define RESET_CMD "reset"
  18. struct Evil_PortalApp {
  19. Gui *gui;
  20. ViewDispatcher *view_dispatcher;
  21. SceneManager *scene_manager;
  22. FuriString* portal_logs;
  23. const char *command_queue[1];
  24. int command_index;
  25. bool has_command_queue;
  26. FuriString *text_box_store;
  27. size_t text_box_store_strlen;
  28. TextBox *text_box;
  29. VariableItemList *var_item_list;
  30. Evil_PortalUart *uart;
  31. TextInput* text_input;
  32. int selected_menu_index;
  33. int selected_option_index[NUM_MENU_ITEMS];
  34. const char *selected_tx_string;
  35. bool is_command;
  36. bool is_custom_tx_string;
  37. bool focus_console_start;
  38. bool show_stopscan_tip;
  39. bool sent_ap;
  40. bool sent_html;
  41. bool sent_reset;
  42. int BAUDRATE;
  43. char text_store[2][128 + 1];
  44. uint8_t *index_html;
  45. uint8_t *ap_name;
  46. };
  47. typedef enum {
  48. Evil_PortalAppViewVarItemList,
  49. Evil_PortalAppViewConsoleOutput,
  50. Evil_PortalAppViewStartPortal,
  51. Evil_PortalAppViewTextInput,
  52. } Evil_PortalAppView;