evil_portal_app_i.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. UART_TextInput *text_input;
  26. VariableItemList *var_item_list;
  27. Evil_PortalUart *uart;
  28. int selected_menu_index;
  29. int selected_option_index[NUM_MENU_ITEMS];
  30. const char *selected_tx_string;
  31. const char *command_queue[1];
  32. int command_index;
  33. bool has_command_queue;
  34. bool is_command;
  35. bool is_custom_tx_string;
  36. bool focus_console_start;
  37. bool show_stopscan_tip;
  38. bool sent_ap;
  39. bool sent_html;
  40. int BAUDRATE;
  41. int TERMINAL_MODE; // 1=AT mode, 0=other mode
  42. uint8_t *index_html;
  43. uint8_t *ap_name;
  44. };
  45. typedef enum {
  46. Evil_PortalAppViewVarItemList,
  47. Evil_PortalAppViewConsoleOutput,
  48. Evil_PortalAppViewTextInput,
  49. Evil_PortalAppViewStartPortal,
  50. } Evil_PortalAppView;