flip_wifi_e.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef FLIP_WIFI_E_H
  2. #define FLIP_WIFI_E_H
  3. #include <flipper_http.h>
  4. #include <easy_flipper.h>
  5. #include <storage/storage.h>
  6. #define TAG "FlipWiFi"
  7. #define MAX_WIFI_NETWORKS 25
  8. // Define the submenu items for our FlipWiFi application
  9. typedef enum
  10. {
  11. FlipWiFiSubmenuIndexAbout,
  12. //
  13. FlipWiFiSubmenuIndexWiFiScan,
  14. FlipWiFiSubmenuIndexWiFiSaved,
  15. //
  16. FlipWiFiSubmenuIndexWiFiSavedAddSSID,
  17. //
  18. FlipWiFiSubmenuIndexWiFiScanStart = 100,
  19. FlipWiFiSubmenuIndexWiFiSavedStart = 200,
  20. } FlipWiFiSubmenuIndex;
  21. // Define a single view for our FlipWiFi application
  22. typedef enum
  23. {
  24. FlipWiFiViewWiFiScan, // The view for the wifi scan screen
  25. FlipWiFiViewWiFiSaved, // The view for the wifi scan screen
  26. FlipWiFiViewSubmenuMain, // The submenu for the main screen
  27. FlipWiFiViewSubmenuScan, // The submenu for the wifi scan screen
  28. FlipWiFiViewSubmenuSaved, // The submenu for the wifi scan screen
  29. FlipWiFiViewAbout, // The about screen
  30. FlipWiFiViewTextInputScan, // The text input screen for the wifi scan screen
  31. FlipWiFiViewTextInputSaved, // The text input screen for the wifi saved screen
  32. //
  33. FlipWiFiViewTextInputSavedAddSSID, // The text input screen for the wifi saved screen
  34. FlipWiFiViewTextInputSavedAddPassword, // The text input screen for the wifi saved screen
  35. //
  36. FlipWiFiViewPopup, // The popup screen
  37. } FlipWiFiView;
  38. // Define the WiFiPlaylist structure
  39. typedef struct
  40. {
  41. char *ssids[MAX_WIFI_NETWORKS];
  42. char *passwords[MAX_WIFI_NETWORKS];
  43. size_t count;
  44. } WiFiPlaylist;
  45. // Each screen will have its own view
  46. typedef struct
  47. {
  48. ViewDispatcher *view_dispatcher; // Switches between our views
  49. Popup *popup; // The popup for the app
  50. View *view_wifi_scan; // The view for the wifi scan screen
  51. View *view_wifi_saved; // The view for the wifi saved screen
  52. Submenu *submenu_main; // The submenu for the main screen
  53. Submenu *submenu_wifi_scan; // The submenu for the wifi scan screen
  54. Submenu *submenu_wifi_saved; // The submenu for the saved wifi screen
  55. Widget *widget_info; // The widget
  56. VariableItemList *variable_item_list_wifi; // The variable item list (settngs)
  57. VariableItem *variable_item_ssid; // The variable item
  58. UART_TextInput *uart_text_input_password_scan; // The text input for the wifi scan screen
  59. UART_TextInput *uart_text_input_password_saved; // The text input for the wifi saved screen
  60. //
  61. UART_TextInput *uart_text_input_add_ssid; // The text input for the wifi saved screen
  62. UART_TextInput *uart_text_input_add_password; // The text input for the wifi saved screen
  63. char *uart_text_input_buffer_password_scan; // Buffer for the text input
  64. char *uart_text_input_temp_buffer_password_scan; // Temporary buffer for the text input
  65. uint32_t uart_text_input_buffer_size_password_scan; // Size of the text input buffer
  66. char *uart_text_input_buffer_password_saved; // Buffer for the text input
  67. char *uart_text_input_temp_buffer_password_saved; // Temporary buffer for the text input
  68. uint32_t uart_text_input_buffer_size_password_saved; // Size of the text input buffer
  69. char *uart_text_input_buffer_add_ssid; // Buffer for the text input
  70. char *uart_text_input_temp_buffer_add_ssid; // Temporary buffer for the text input
  71. uint32_t uart_text_input_buffer_size_add_ssid; // Size of the text input buffer
  72. char *uart_text_input_buffer_add_password; // Buffer for the text input
  73. char *uart_text_input_temp_buffer_add_password; // Temporary buffer for the text input
  74. uint32_t uart_text_input_buffer_size_add_password; // Size of the text input buffer
  75. WiFiPlaylist wifi_playlist; // The playlist of wifi networks
  76. } FlipWiFiApp;
  77. #endif // FLIP_WIFI_E_H