flip_wifi_e.h 3.7 KB

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