evil_portal_app_i.h 1.7 KB

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