evil_portal_app_i.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 "uart_text_input.h"
  7. #include <gui/gui.h>
  8. #include <gui/modules/text_box.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 (4)
  13. #define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
  14. #define EVIL_PORTAL_TEXT_INPUT_STORE_SIZE (512)
  15. #define UART_CH (FuriHalUartIdUSART1)
  16. struct Evil_PortalApp {
  17. Gui *gui;
  18. ViewDispatcher *view_dispatcher;
  19. SceneManager *scene_manager;
  20. char* portal_logs;
  21. char text_input_store[EVIL_PORTAL_TEXT_INPUT_STORE_SIZE + 1];
  22. FuriString *text_box_store;
  23. size_t text_box_store_strlen;
  24. TextBox *text_box;
  25. VariableItemList *var_item_list;
  26. Evil_PortalUart *uart;
  27. int selected_menu_index;
  28. int selected_option_index[NUM_MENU_ITEMS];
  29. const char *selected_tx_string;
  30. const char *command_queue[1];
  31. int command_index;
  32. bool has_command_queue;
  33. bool is_command;
  34. bool is_custom_tx_string;
  35. bool focus_console_start;
  36. bool show_stopscan_tip;
  37. bool sent_ap;
  38. bool sent_html;
  39. int BAUDRATE;
  40. int TERMINAL_MODE; // 1=AT mode, 0=other mode
  41. uint8_t *index_html;
  42. uint8_t *ap_name;
  43. };
  44. typedef enum {
  45. Evil_PortalAppViewVarItemList,
  46. Evil_PortalAppViewConsoleOutput,
  47. Evil_PortalAppViewTextInput,
  48. Evil_PortalAppViewStartPortal,
  49. } Evil_PortalAppView;