flip_weather_e.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef FLIP_WEATHER_E_H
  2. #define FLIP_WEATHER_E_H
  3. #include <flipper_http.h>
  4. #include <easy_flipper.h>
  5. #include <jsmn.h>
  6. #define TAG "FlipWeather"
  7. // Define the submenu items for our FlipWeather application
  8. typedef enum
  9. {
  10. FlipWeatherSubmenuIndexWeather, // Click to view the weather
  11. FlipWeatherSubmenuIndexGPS, // Click to view the GPS
  12. FlipWeatherSubmenuIndexAbout, // Click to view the about screen
  13. FlipWeatherSubmenuIndexSettings, // Click to view the settings screen
  14. } FlipWeatherSubmenuIndex;
  15. // Define a single view for our FlipWeather application
  16. typedef enum
  17. {
  18. FlipWeatherViewWeather, // The weather screen
  19. FlipWeatherViewGPS, // The GPS screen
  20. FlipWeatherViewSubmenu, // The main submenu
  21. FlipWeatherViewAbout, // The about screen
  22. FlipWeatherViewSettings, // The wifi settings screen
  23. FlipWeatherViewTextInputSSID, // The text input screen for SSID
  24. FlipWeatherViewTextInputPassword, // The text input screen for password
  25. } FlipWeatherView;
  26. // Each screen will have its own view
  27. typedef struct
  28. {
  29. ViewDispatcher *view_dispatcher; // Switches between our views
  30. View *view_weather; // The weather view
  31. View *view_gps; // The GPS view
  32. Submenu *submenu; // The main submenu
  33. Widget *widget; // The widget (about)
  34. VariableItemList *variable_item_list; // The variable item list (settngs)
  35. VariableItem *variable_item_ssid; // The variable item
  36. VariableItem *variable_item_password; // The variable item
  37. UART_TextInput *uart_text_input_ssid; // The text input
  38. UART_TextInput *uart_text_input_password; // The text input
  39. char *uart_text_input_buffer_ssid; // Buffer for the text input
  40. char *uart_text_input_temp_buffer_ssid; // Temporary buffer for the text input
  41. uint32_t uart_text_input_buffer_size_ssid; // Size of the text input buffer
  42. char *uart_text_input_buffer_password; // Buffer for the text input
  43. char *uart_text_input_temp_buffer_password; // Temporary buffer for the text input
  44. uint32_t uart_text_input_buffer_size_password; // Size of the text input buffer
  45. } FlipWeatherApp;
  46. #endif