evil_portal_app_i.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #define NUM_MENU_ITEMS (4)
  12. #define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
  13. #define UART_CH (FuriHalUartIdUSART1)
  14. #define SET_HTML_CMD "sethtml"
  15. #define SET_AP_CMD "setap"
  16. #define RESET_CMD "reset"
  17. struct Evil_PortalApp {
  18. Gui *gui;
  19. ViewDispatcher *view_dispatcher;
  20. SceneManager *scene_manager;
  21. char* portal_logs;
  22. const char *command_queue[1];
  23. int command_index;
  24. bool has_command_queue;
  25. FuriString *text_box_store;
  26. size_t text_box_store_strlen;
  27. TextBox *text_box;
  28. VariableItemList *var_item_list;
  29. Evil_PortalUart *uart;
  30. int selected_menu_index;
  31. int selected_option_index[NUM_MENU_ITEMS];
  32. const char *selected_tx_string;
  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. uint8_t *index_html;
  41. uint8_t *ap_name;
  42. };
  43. typedef enum {
  44. Evil_PortalAppViewVarItemList,
  45. Evil_PortalAppViewConsoleOutput,
  46. Evil_PortalAppViewStartPortal,
  47. } Evil_PortalAppView;