flip_weather_e.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. FlipWeatherSubmenuIndexWeather, // Click to view the weather
  10. FlipWeatherSubmenuIndexGPS, // Click to view the GPS
  11. FlipWeatherSubmenuIndexAbout, // Click to view the about screen
  12. FlipWeatherSubmenuIndexSettings, // Click to view the settings screen
  13. } FlipWeatherSubmenuIndex;
  14. // Define a single view for our FlipWeather application
  15. typedef enum {
  16. FlipWeatherViewWeather, // The weather screen
  17. FlipWeatherViewGPS, // The GPS screen
  18. FlipWeatherViewSubmenu, // The main submenu
  19. FlipWeatherViewAbout, // The about screen
  20. FlipWeatherViewSettings, // The wifi settings screen
  21. FlipWeatherViewTextInputSSID, // The text input screen for SSID
  22. FlipWeatherViewTextInputPassword, // The text input screen for password
  23. } FlipWeatherView;
  24. // Each screen will have its own view
  25. typedef struct {
  26. ViewDispatcher* view_dispatcher; // Switches between our views
  27. View* view_weather; // The weather view
  28. View* view_gps; // The GPS view
  29. Submenu* submenu; // The main submenu
  30. Widget* widget; // The widget (about)
  31. VariableItemList* variable_item_list; // The variable item list (settngs)
  32. VariableItem* variable_item_ssid; // The variable item
  33. VariableItem* variable_item_password; // The variable item
  34. TextInput* uart_text_input_ssid; // The text input
  35. TextInput* uart_text_input_password; // The text input
  36. char* uart_text_input_buffer_ssid; // Buffer for the text input
  37. char* uart_text_input_temp_buffer_ssid; // Temporary buffer for the text input
  38. uint32_t uart_text_input_buffer_size_ssid; // Size of the text input buffer
  39. char* uart_text_input_buffer_password; // Buffer for the text input
  40. char* uart_text_input_temp_buffer_password; // Temporary buffer for the text input
  41. uint32_t uart_text_input_buffer_size_password; // Size of the text input buffer
  42. } FlipWeatherApp;
  43. static char city_data[48];
  44. static char region_data[48];
  45. static char country_data[48];
  46. static char lat_data[32];
  47. static char lon_data[32];
  48. static char ip_data[32];
  49. static char temperature_data[32];
  50. static char precipitation_data[32];
  51. static char rain_data[32];
  52. static char showers_data[32];
  53. static char snowfall_data[32];
  54. static char time_data[32];
  55. static char ip_address[16];
  56. #define MAX_TOKENS 64 // Adjust based on expected JSON size (50)
  57. #endif